| name | detecting-modbus-command-injection-attacks |
| description | Detect command injection attacks against Modbus TCP/RTU protocol in ICS environments by monitoring for unauthorized write operations, anomalous function codes, malformed frames, and deviations from established communication baselines using ICS-aware IDS and protocol deep packet inspection. . Use when working with detecting modbus command injection attacks. |
| domain | cybersecurity |
| tags | ["ot-security","ics","modbus","command-injection","protocol-analysis","ids","scada","threat-detection"] |
| subdomain | ot-ics-security |
| version | 1.0 |
| author | oyi77 |
| license | Apache-2.0 |
| nist_csf | ["PR.IR-01","DE.CM-01","ID.AM-05","GV.OC-02"] |
Detecting Modbus Command Injection Attacks
Overview
Cybersecurity skill for detecting modbus command injection attacks. Follows industry best practices and security standards.
When to Use
Trigger phrases:
-
"detecting modbus command injection attacks"
-
"Detect command injection attacks against Modbus TCP/RTU protocol in ICS environm"
-
When deploying intrusion detection for environments using Modbus TCP (port 502) or Modbus RTU
-
When investigating suspected unauthorized modifications to PLC registers or coils
-
When building detection analytics for OT SOC monitoring Modbus-heavy environments
-
When responding to FrostyGoop-style attacks that leverage Modbus TCP for operational impact
-
When performing baseline validation after a suspected compromise of a Modbus master
Do not use for detecting attacks on non-Modbus protocols (see detecting-dnp3-protocol-anomalies for DNP3), for general IT network intrusion detection, or for Modbus device configuration (see performing-ot-vulnerability-scanning-safely).
When NOT to Use
- When you lack proper authorization for testing
- For production systems without change management
- When the task requires legal or compliance expertise beyond technical scope
Prerequisites
- Network SPAN/TAP on the segment carrying Modbus TCP traffic (typically port 502)
- Baseline of normal Modbus communication patterns (masters, slaves, function codes, register ranges, polling intervals)
- Suricata, Zeek, or commercial OT IDS deployed with Modbus protocol parsers enabled
- Understanding of Modbus function codes used in the environment (read vs write operations)
- Access to PLC programming documentation to validate expected register ranges
Workflow
import re
IOC_PATTERNS = {
"ip": r"\b(?:\d{1,3}\.){3}\d{1,3}\b",
"domain": r"\b[a-z0-9-]+\.[a-z]{2,}\b",
"hash_md5": r"\b[a-f0-9]{32}\b",
"hash_sha256": r"\b[a-f0-9]{64}\b",
}
def () -> :
{k: re.findall(v, text) k, v IOC_PATTERNS.items()}