/secskills-offense:testing-ics-ot-protocolsfrom secskills-offense
Tests ICS/OT protocols (Modbus, DNP3, OPC UA, BACnet, EtherNet/IP, S7comm, MQTT) with safety-first methodology for authorized OT security assessments.
Ships in secskills-offense. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
ICS/OT protocols were designed for reliability in isolated networks, not security on connected ones. Most have no authentication, no encryption, and no integrity checking. The danger is not that they are hard to exploit — it is that exploitation can have physical consequences, which is why safety constraints govern everything you do here.
enumerating-network-servicestesting-web-applicationsengineering-detectionsOT pentesting is not IT pentesting with different ports. The rules of engagement are fundamentally different because the targets control physical processes.
Why active scanning is dangerous in OT:
Mandatory constraints:
| Protocol | Default Port | Auth by Design | Encryption | Notes |
|---|---|---|---|---|
| Modbus TCP | 502 | No | No | Most common ICS protocol; any host on the network can read/write |
| DNP3 | 20000 | Optional (SA) | No | SCADA polling; Secure Authentication is rarely deployed |
| EtherNet/IP (CIP) | 44818 | No | No | Rockwell/Allen-Bradley ecosystem |
| OPC UA | 4840 | Yes (multiple modes) | Optional (TLS) | Modern; security depends entirely on configuration |
| BACnet/IP | 47808 (UDP) | No | No | Building automation — HVAC, lighting, access control |
| S7comm | 102 | No | No | Siemens S7 PLCs; replaced by S7comm-plus with some protection |
| MQTT | 1883 / 8883 (TLS) | Optional | Optional (TLS) | IoT/ICS messaging; brokers often left open |
Start here. Passive observation carries no risk of disrupting devices and provides the asset inventory you need before touching anything.
Wireshark with ICS dissectors:
# Capture on the OT network interface (mirror/span port or tap)
tcpdump -i eth0 -w ics_capture.pcap -n
# Wireshark filters for ICS protocols
# Modbus
modbus
# DNP3
dnp3
# EtherNet/IP
enip
# OPC UA
opcua
# BACnet
bacnet
# S7comm
s7comm
# MQTT
mqtt
What to extract from passive captures:
Asset inventory from passive observation:
Build a table: IP, MAC, vendor (from OUI), protocol(s) observed, role (master/slave/HMI/historian), firmware version if visible. This becomes the basis for active enumeration scope.
Only proceed after: (1) passive recon is complete, (2) OT engineer has reviewed the asset list and approved active testing, (3) scope explicitly includes active ICS enumeration.
Safe nmap usage for ICS:
# NEVER use aggressive timing or default scripts against OT devices
# Use slow timing and specific ICS scripts only
# Modbus device discovery
nmap -Pn -sT -p 502 --script modbus-discover TARGET
# Siemens S7 device info (read-only query)
nmap -Pn -sT -p 102 --script s7-info TARGET
# BACnet device enumeration
nmap -Pn -sU -p 47808 --script bacnet-info TARGET
# EtherNet/IP enumeration
nmap -Pn -sT -p 44818 --script enip-info TARGET
# OPC UA discovery
nmap -Pn -sT -p 4840 --script opcua-endpoints TARGET
# IMPORTANT: Use -Pn (skip host discovery), -sT (full connect, not SYN scan),
# and NEVER use -A, -sV with high intensity, or broad script categories
# against OT devices.
Dedicated ICS scanning tools:
# plcscan — lightweight PLC scanner
plcscan -t TARGET
# Redpoint Nmap scripts (Digital Bond)
# These are ICS-specific and safer than generic nmap scripts
nmap --script redpoint/ -p 502,44818,47808,102,20000 TARGET
Modbus has no authentication. Any host that can reach port 502 can read sensors, write to coils, and control the PLC. This is by design — it was created in 1979 for serial links in isolated environments.
Reading coils and registers (read-only, lower risk):
# Using modbus-cli
modbus read TARGET 0 10 # Read 10 holding registers starting at address 0
modbus read -s coil TARGET 0 10 # Read 10 coils starting at address 0
# Using mbtget
mbtget -a 1 -r1 -n 10 TARGET # Read 10 holding registers, unit ID 1
mbtget -a 1 -r2 -n 10 TARGET # Read 10 input registers
# Python with pymodbus
python3 -c "
from pymodbus.client import ModbusTcpClient
client = ModbusTcpClient('TARGET')
client.connect()
result = client.read_holding_registers(0, 10, unit=1)
print(result.registers)
client.close()
"
Key Modbus function codes:
FC 01 - Read Coils (digital outputs)
FC 02 - Read Discrete Inputs (digital inputs)
FC 03 - Read Holding Registers (analog outputs / config)
FC 04 - Read Input Registers (analog inputs)
FC 05 - Write Single Coil ← WRITE — requires explicit approval
FC 06 - Write Single Register ← WRITE — requires explicit approval
FC 15 - Write Multiple Coils ← WRITE — requires explicit approval
FC 16 - Write Multiple Registers ← WRITE — requires explicit approval
FC 43 - Read Device Identification
The finding to report: If you can reach port 502 from outside the process control network, the control system has no access control. This is almost always Critical — document the network path and what registers you could read.
OPC UA is the one ICS protocol that was designed with security in mind. Whether it is actually secure depends on how it is configured.
Discovery and endpoint enumeration:
# List OPC UA endpoints and their security modes
# Using opcua-client-gui or UaExpert
# Python with opcua library
python3 -c "
from opcua import Client
client = Client('opc.tcp://TARGET:4840')
endpoints = client.connect_and_get_server_endpoints()
for ep in endpoints:
print(f'Endpoint: {ep.EndpointUrl}')
print(f' Security Mode: {ep.SecurityMode}')
print(f' Security Policy: {ep.SecurityPolicyUri}')
print(f' User Token: {[t.TokenType for t in ep.UserIdentityTokens]}')
"
Authentication modes to check:
Common OPC UA findings:
# DNP3 enumeration — identify master/outstation roles
nmap -Pn -sT -p 20000 --script dnp3-info TARGET
# Check for DNP3 Secure Authentication (rarely deployed)
# Most DNP3 implementations have no authentication at all
# BACnet device discovery
nmap -Pn -sU -p 47808 --script bacnet-info TARGET
# BACnet enumeration with BAC0
python3 -c "
import BAC0
bacnet = BAC0.lite(ip='YOUR_IP/24')
devices = bacnet.whois()
print(devices)
"
# Siemens S7 PLC information
nmap -Pn -sT -p 102 --script s7-info TARGET
# Identifies: module name, serial number, plant identification,
# firmware version, hardware version, CPU state
These appear in the majority of ICS assessments:
1. Flat networks (IT-OT convergence) The single most impactful finding. No segmentation between corporate IT and control systems means any compromised workstation can reach PLCs directly. Test by attempting to reach ICS ports from IT network segments.
2. Default credentials on HMIs and engineering workstations HMI web interfaces, VNC servers on operator stations, and engineering software often use factory defaults. Check vendor documentation for default credentials before testing.
3. Unauthenticated protocols exposed to non-process networks Modbus, S7comm, and BACnet have no authentication. If these ports are reachable from outside the process control network, any compromised host can control physical processes.
4. Unencrypted protocols carrying sensitive data Credentials, process values, and configuration data transmitted in cleartext. Demonstrate with a packet capture showing readable data.
5. Remote access gateways with weak controls VPN concentrators, jump hosts, or cellular modems providing remote access to OT networks. Check for multi-factor authentication, session logging, and access restrictions.
6. Outdated firmware with known vulnerabilities ICS devices often run firmware years behind current releases because patching requires downtime. Document versions and map to known CVEs, but do not attempt exploitation without explicit approval.
7. Historian and data diode misconfigurations Historians bridging IT and OT should be in a DMZ. Data diodes should enforce unidirectional flow. Verify with traffic analysis.
Assess against the Purdue Enterprise Reference Architecture:
Level 5 Enterprise network (corporate IT)
Level 4 Site business planning (ERP, email)
─── IT/OT DMZ ───
Level 3 Site operations (historians, OPC servers)
Level 2 Area supervisory control (HMI, engineering workstations)
Level 1 Basic control (PLCs, RTUs, controllers)
Level 0 Process (sensors, actuators, field devices)
What to verify:
When reviewing ICS security posture rather than attacking:
enumerating-network-services — standard IT network service enumerationengineering-detections — writing detection rules for ICS-specific threatsreporting-security-findings — structuring ICS findings for maximum impactWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
ics-security, ot-security, scada-testing, protocol-testing, safety-first
npx claudepluginhub trilwu/secskills --plugin secskills-offense40 skills in this plugin
/abusing-adcsEnumerate and abuse Active Directory Certificate Services with Certipy and Certify — the ESC1 through ESC16 escalation paths, vulnerable template and CA configurations, NTLM relay to web enrollment, certificate-based authentication and persistence, and the strong-mapping changes that gate several of them. Use when a domain has a certificate authority, when Certipy or BloodHound reports vulnerable templates, or when escalating from a low-privilege domain user./abusing-ci-cd-oidcExploit CI/CD pipeline misconfigurations and OIDC federation weaknesses across GitHub Actions, GitLab CI, and Jenkins -- poisoned workflows, secret exfiltration, runner compromise, overly broad OIDC trust policies, build artifact poisoning, and credential theft. Use when pentesting CI/CD infrastructure, assessing OIDC federation trust boundaries, reviewing pipeline security posture, or exploiting a path from repository access to cloud credentials./attacking-active-directoryAttack and enumerate Active Directory environments using Kerberos attacks (Kerberoasting, ASREPRoasting), credential dumping (DCSync, Mimikatz), lateral movement (PtH, PtT), and BloodHound analysis. Use when pentesting Windows domains or exploiting AD misconfigurations.2 plugins ship this exact skill · first indexed Jul 31, 2026
Other plugins' skills for the same job