Skip to content

Modbus

Discovery

Modbus Client:

Modbus Discover Nmap Script:

nmap --script modbus-discover.nse --script-args='modbus-discover.aggressive=true' -p 502 <host>

Connect to Modbus Slave:

from pymodbus.client import ModbusTcpClient

client = ModbusTcpClient('<IP_Address_of_Target>')
client.write_coil(1, True)
result = client.read_coils(1,1)
print(result.bits[0])
client.close()

Modbus Pentesting:

Modbus Slave Simulator

Modbus Master Simulator