PISA Pakistan — Community CERT

← 🚩 CTF: Getting Started

34. ICS/OT Security & PLC Attacks for CTF

⏱ 9 min

ICS/OT Security & PLC Attacks for CTF

Introduction to ICS/OT in CTF

Industrial Control Systems (ICS) are the backbone of power grids, water treatment, and oil‑pipeline SCADA networks. Pakistani CTF organizers often embed flags inside Modbus registers or S7comm payloads to simulate a real‑world sabotage scenario.

Common ICS Protocols

  • Modbus RTU/TCP: Simple read/write registers.
  • S7comm (Siemens S7‑300/400): Encrypted session, function codes for program upload/download.
  • EtherNet/IP (CIP): Used in Allen‑Bradley PLCs.

Recon & Enumeration

  1. Identify PLCs with nmap -sU -p 502 (Modbus) or nmap -sV -p 44818 (EtherNet/IP).
  2. Use plcscan (plcscan 192.168.1.10) to fingerprint device vendor and firmware version.
  3. Run modscan (modscan -r 192.168.1.0/24) to dump register values.

Attacking PLCs

  • Write/Force Values: Use python‑modbus or snap7 to change a temperature setpoint in a simulated water‑treatment plant.
  • Program Download: For S7 devices, a crafted “STOP” function can halt a PLC, a classic “denial‑of‑service” flag trigger.
  • Tag Extraction: Read PLC tags (BOOL, INT, REAL) to discover encoded flags.

Defense & Logging (for Blue‑Team Scenarios)

  • Enable SYSLOG on PLCs and forward to ELK Stack or theHive for correlation.
  • Deploy Sigma rules for abnormal write operations (e.g., sudden change of “Valve_Open” tag).
  • Use MISP to share threat intel about known ICS malware like TRITON.

Pakistan‑Specific Context

  • National Grid SCADA: The National Transmission & Dispatch Company (NTDC) uses S7comm; a CTF challenge may mimic a rogue operator attempting to trip a 132 kV line.
  • Water‑Treatment Plants: Modbus registers control chlorine dosage; manipulating them can trigger an alarm flag.

Do / Don't

  • Do practice on virtual PLCs (e.g., LogixSim or ModbusPal) in a sandbox.
  • Don’t scan or write to real ICS equipment without explicit permission and isolation.

Takeaway

Master the plcscan → modscan → snap7 workflow to read and write PLC registers; this skill lets you solve ICS‑focused CTF challenges that hide flags inside industrial process data.

← PrevNext →