IEC 62443 Industrial Cybersecurity Testing: A Field Guide
IEC 62443 is the international standard for industrial cybersecurity. Unlike IT-focused standards (ISO 27001, NIST CSF), it was designed specifically for operational technology environments where availability and safety take precedence over confidentiality. Testing against IEC 62443 is not just a compliance checkbox — it is a systematic method for finding the specific vulnerabilities that can cause physical damage, environmental harm, or loss of life.
IEC 62443 Structure and Security Levels
The standard is organized into four series:
- 62443-1: General concepts and terminology
- 62443-2: Policies and procedures (asset owner requirements)
- 62443-3: System-level requirements (security zones, conduits)
- 62443-4: Component-level requirements (devices, software)
Security Levels (SL) are the key metric for testing scope:
| SL | Threat Actor | Capability |
|---|---|---|
| SL 1 | Unintentional/casual | Script kiddie, accidental |
| SL 2 | Intentional, simple means | Low-skill attacker with motivation |
| SL 3 | Sophisticated, moderate resources | Nation-state adjacent, IACS-specific tools |
| SL 4 | State-sponsored, extended resources | APT with unlimited resources |
Most industrial facilities target SL 2 for general production systems and SL 3 for safety-critical systems. Your testing scope must match the target SL.
Security Requirement Verification Testing
IEC 62443-3-3 defines System Security Requirements (SR) organized into seven foundational requirements (FR):
- FR 1: Identification and Authentication Control
- FR 2: Use Control
- FR 3: System Integrity
- FR 4: Data Confidentiality
- FR 5: Restricted Data Flow
- FR 6: Timely Response to Events
- FR 7: Resource Availability
For each SR, verification testing confirms the control is implemented and effective.
FR 1 Testing: Authentication Controls
# Test SR 1.1: Human user identification and authentication
# Verify: no default credentials, account lockout, password complexity
import requests
import json
COMMON_DEFAULT_CREDENTIALS = [
("admin", "admin"),
("admin", "password"),
("admin", ""),
("operator", "operator"),
("guest", "guest"),
("root", "root"),
("Administrator", ""),
]
def test_default_credentials(base_url, login_endpoint="/api/auth/login"):
"""Test for common default credentials on HMI/SCADA web interface."""
failures = []
for username, password in COMMON_DEFAULT_CREDENTIALS:
try:
resp = requests.post(
f"{base_url}{login_endpoint}",
json={"username": username, "password": password},
timeout=5,
verify=False
)
if resp.status_code == 200:
try:
data = resp.json()
if "token" in data or "session" in data or data.get("success"):
failures.append(f"Default credential accepted: {username}/{password}")
except:
if "logout" in resp.text.lower() or "dashboard" in resp.text.lower():
failures.append(f"Default credential accepted: {username}/{password}")
except requests.RequestException:
pass
return failures
def test_account_lockout(base_url, username="admin", attempts=10):
"""Verify account lockout after N failed attempts (SR 1.11)."""
locked = False
for i in range(attempts):
resp = requests.post(
f"{base_url}/api/auth/login",
json={"username": username, "password": f"wrong_pass_{i}"},
timeout=5, verify=False
)
if resp.status_code == 423: # HTTP 423 Locked
locked = True
print(f"Account locked after {i+1} attempts")
break
elif "locked" in resp.text.lower() or "too many" in resp.text.lower():
locked = True
print(f"Account locked after {i+1} attempts (from response body)")
break
if not locked:
print(f"FAIL: Account not locked after {attempts} failed attempts")
return lockedFR 5 Testing: Restricted Data Flow (Zone/Conduit Validation)
The zone and conduit model is central to IEC 62443-3-2. Each zone has a target SL, and conduits between zones must enforce communication restrictions.
#!/bin/bash
# Zone/conduit firewall rule validation script
# Run from each zone to verify only permitted traffic flows
ZONE_2_HISTORIAN="10.2.100.50"
ZONE_1_PLC="10.1.10.20"
ZONE_1_HMI="10.1.10.30"
ENTERPRISE_SERVER="10.4.0.100"
echo "=== Zone 2 → Zone 1 (restricted conduit) ==="
# Only historian replication to PLC data should pass — direct PLC management MUST be blocked
# Port 102 (S7 protocol) — should be BLOCKED from Zone 2
echo -n "S7 (102) Zone2→PLC1: "
timeout 3 bash -c "echo '' > /dev/tcp/$ZONE_1_PLC/102" 2>/dev/null && echo "OPEN (FAIL)" || echo "BLOCKED (PASS)"
# Port 502 (Modbus TCP) — should be BLOCKED from Zone 2
echo -n "Modbus (502) Zone2→PLC1: "
timeout 3 bash -c "echo '' > /dev/tcp/$ZONE_1_PLC/502" 2>/dev/null && echo "OPEN (FAIL)" || echo "BLOCKED (PASS)"
# Port 4840 (OPC-UA) HMI poll — should be ALLOWED from Zone 2
echo -n "OPC-UA (4840) Zone2→HMI: "
timeout 3 bash -c "echo '' > /dev/tcp/$ZONE_1_HMI/4840" 2>/dev/null && echo "OPEN (PASS)" || echo "BLOCKED (FAIL)"
echo ""
echo "=== Enterprise → Zone 1 (DMZ conduit) ==="
# All direct access from enterprise to Zone 1 should be BLOCKED
for port in 502 102 4840 23 22 3389 80 443; do
echo -n "Port $port Enterprise→PLC1: "
timeout 3 bash -c "echo '' > /dev/tcp/$ZONE_1_PLC/$port" 2>/dev/null && echo "OPEN (FAIL)" || echo "BLOCKED (PASS)"
donePenetration Testing for ICS
ICS penetration testing differs from IT pentesting in critical ways: you must not disrupt live processes, commands to PLCs can cause physical harm, and many ICS protocols have no authentication to exploit (making exploitation trivial but dangerous).
IACS-Specific Tools
Claroty and Dragos are commercial platforms for passive network monitoring and threat detection. For active testing, the open-source toolkit includes:
- Redpoint (NSE scripts for ICS protocols in Nmap)
- PLCscan — active scanning of PLC management interfaces
- ISF (Industrial Security Framework) — Metasploit-equivalent for ICS
- Aegis — S7 protocol fuzzer for Siemens PLCs
Safe Enumeration Without Disruption
# Passive protocol detection — no write operations
# Use only during approved maintenance windows
# Enumerate SCADA assets with Nmap ICS scripts
nmap -sV --script "s7-info,modbus-discover,dnp3-info,bacnet-info" \
-p 102,502,20000,47808 \
--script-args modbus-discover.aggressive=false \
10.1.0.0/24 \
-oX ics-scan-$(date +%Y%m%d).xml
# EtherNet/IP enumeration (Rockwell/Allen-Bradley)
nmap --script enip-info -p 44818 10.1.0.0/24
# Parse results for unauthenticated services
python3 << 'EOF'
import xml.etree.ElementTree as ET
tree = ET.parse("ics-scan-$(date +%Y%m%d).xml")
# ... extract hosts with open management ports
EOFPLC Vulnerability Testing — Read-Only Verification
from pymodbus.client import ModbusTcpClient
def test_unauthenticated_read(plc_ip, port=502):
"""
Verify: can an unauthenticated client read process data?
Modbus has no authentication — this WILL succeed on most PLCs.
Document as finding, do not attempt writes.
"""
client = ModbusTcpClient(plc_ip, port=port)
if not client.connect():
return "UNREACHABLE"
result = client.read_holding_registers(0, 10)
client.close()
if result.isError():
return "READ_FAILED (access control exists)"
values = result.registers
return f"UNAUTHENTICATED_READ_SUCCESS: registers={values[:5]}... (FINDING: no auth on Modbus)"
def test_s7_cpu_info(plc_ip, port=102):
"""
Siemens S7: CPU information readable without authentication.
Using snap7 library — read only.
"""
import snap7
client = snap7.client.Client()
try:
client.connect(plc_ip, 0, 1) # Rack 0, Slot 1
info = client.get_cpu_info()
client.disconnect()
return f"FINDING: S7 CPU info readable without auth — {info.ModuleTypeName}"
except Exception as e:
return f"Connection failed: {e}"Patch Management Testing
IEC 62443-2-3 defines patch management requirements. Testing validates the patch process, not just that patches are applied.
import subprocess
import json
from datetime import datetime, timedelta
def get_installed_patches(host, method="wmi"):
"""Query patch status of an HMI/SCADA Windows host."""
if method == "wmi":
# Via PowerShell remoting
ps_script = """
Get-HotFix | Select-Object -Property HotFixID, InstalledOn, Description |
Sort-Object InstalledOn -Descending |
ConvertTo-Json
"""
result = subprocess.run(
["powershell", "-Command",
f"Invoke-Command -ComputerName {host} -ScriptBlock {{{ps_script}}}"],
capture_output=True, text=True
)
return json.loads(result.stdout)
def test_patch_currency(host, max_age_days=90):
"""Verify no critical patches older than max_age_days are pending."""
patches = get_installed_patches(host)
cutoff = datetime.now() - timedelta(days=max_age_days)
# Query missing patches via WSUS or SCCM API
# This is environment-specific; example shows the pattern
missing = get_missing_patches(host) # Returns list of CVEs/KBs
critical_missing = [p for p in missing if p.get("severity") in ["Critical", "Important"]]
if critical_missing:
print(f"FAIL: {len(critical_missing)} critical patches missing on {host}")
for p in critical_missing[:5]:
print(f" {p['kb']} — {p['title']} (CVE: {p.get('cve', 'N/A')})")
else:
print(f"PASS: No critical patches missing on {host}")Incident Response Testing
IEC 62443-2-1 requires incident response plans. Testing them is as important as having them.
A tabletop exercise scenario for an OT environment:
SCENARIO: Ransomware on Engineering Workstation
T+0:00 Antivirus alerts on engineering workstation (EWS-01) in Zone 3
T+0:15 Security team confirms malware, begins isolation
T+0:30 Question: Can EWS-01 be isolated without disrupting SCADA comms?
Test: Remove EWS-01 from network — does historian continue?
Test: Can operators still control from HMI-01 without EWS-01?
T+1:00 Containment complete. Evidence preservation.
Test: Can memory image be captured without stopping the process?
T+2:00 Recovery: Restore EWS-01 from gold image
Test: How long does restoration take? (Measure actual time)
Test: Do SCADA configurations reload correctly?
T+3:00 Post-incident: verify no lateral movement to Zone 1/2
Test: Review firewall logs for anomalous connections during incident windowThe test outputs become metrics: MTTD (mean time to detect), MTTR (mean time to recover), blast radius (zones affected).
Key Takeaways
- Map every control to a specific IEC 62443 SR and SL before testing; testing without scope is security theater
- Zone/conduit validation via active network testing is more reliable than reviewing firewall rule spreadsheets
- ICS penetration testing must be strictly read-only unless performed in a test environment — write operations to PLCs can cause physical harm
- Patch management testing must cover both patch currency and the patch deployment process itself
- Incident response testing produces measurable metrics (MTTD, MTTR) that can be tracked over time