monitoring-scada-modbus-traffic-anomalies

Detect anomalous Modbus TCP traffic on SCADA networks using packet inspection and baselining.

954|172|Updated Mar 13, 2026
One-click install
npx skills add https://github.com/xalgord/xalgorix --skill monitoring-scada-modbus-traffic-anomalies
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: monitoring-scada-modbus-traffic-anomalies
Source: https://github.com/xalgord/xalgorix/tree/main/internal/tools/skills/data/ot-ics-security/monitoring-scada-modbus-traffic-anomalies
Command: npx skills add https://github.com/xalgord/xalgorix --skill monitoring-scada-modbus-traffic-anomalies

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pymodbus, scapy, pandas, numpy.

What problem does it solve?

Industrial control networks running Modbus TCP lack application-layer visibility, so unauthorized register writes, device enumeration, and rogue masters targeting PLCs go undetected by standard firewalls that only inspect IP and port.

Core Features & Use Cases

  • Passive Traffic Capture and Parsing: Capture Modbus TCP frames on port 502 via SPAN ports and dissect MBAP headers, function codes, and register values with Scapy, pymodbus, and Zeek.
  • Behavioral Baselining: Build 72-hour profiles of function code distribution, register access ranges, polling intervals, and authorized master IPs per device pair.
  • Anomaly Detection: Alert on unauthorized writes (FC 05/06/15/16), reconnaissance via FC 43, exception response bursts, out-of-range register values, rogue masters, and timing deviations.
  • Use Case: A water treatment plant detects an attacker using a compromised SCADA server to write a chlorine dosing setpoint of 25.0 mg/L, far above the 4.0 mg/L safe maximum, before physical damage occurs.

Quick Start

Monitor the OT network segment for Modbus traffic anomalies and alert me on any unauthorized register writes or rogue master connections.

Frequently Asked Questions about monitoring-scada-modbus-traffic-anomalies

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect unauthorized Modbus writes on a SCADA network?

Monitor write function codes 05, 06, 15, and 16 and alert when they originate from source IPs outside an authorized writers list or exceed baseline frequency. Combine this with per-register safe range checks to catch dangerous setpoint changes.

What tools can parse Modbus TCP packets in Python?

Scapy's contrib.modbus module dissects captured packets to extract function codes, register addresses, and values, while pymodbus implements full Modbus client and server logic. Zeek provides passive structured logging via its modbus.log without custom scripting.

How long should a Modbus traffic baseline be?

A minimum of 48 to 72 hours is recommended, spanning at least one full operational cycle. Shorter baselines miss shift-change writes and weekly batch jobs, producing false positives against legitimate but infrequent operations.

Why does Modbus anomaly detection miss attacks on some networks?

Common gaps include SPAN ports mirroring only one traffic direction, overly coarse function-code allow-lists that ignore FC 43 reconnaissance, and missing per-register value limits. Validate bidirectional capture and replay a known enumeration pcap to confirm alerts fire.

Can this approach be used for active testing of production PLCs?

No, this is a passive monitoring approach and should not be used for active injection or fuzzing against production SCADA systems. It also requires authorization from the asset owner and does not replace safety-instrumented systems.