This section defines the minimum Python modules and system dependencies required to support:
- OT protocol testing
- ICS traffic analysis
- Control system security challenges
- Adversary emulation in cyber ranges
- Engineering workstation simulation
All files are assumed to be transferred via USB only.
The following must be installed offline before any testing begins:
-
Python 3.x (exact version must match staging system)
-
pip
-
Virtual environment support:
- Windows:
venvvia Python installer - Ubuntu:
python3-venv - Kali:
python3-venv
- Windows:
These modules support the majority of OT security testing and protocol interaction use cases.
requests– API and device web interface interactionscapy– Packet crafting and manipulationpyshark– Live packet capture and pcap analysispymodbus– Modbus/TCP client and server simulationminimalmodbus– Modbus RTU over serialopcua– OPC UA client/server testingpython-can– CAN bus testing and ECU simulationBACpypes– BACnet/IP protocol testingcpppo– EtherNet/IP / CIP interactionpycomm3– Allen-Bradley EtherNet/IP communicationpython-nmap– Nmap automation for OT-safe scanningipython– Interactive OT testing shell
These should be downloaded on the staging system using:
pip download ipython requests pyshark scapy pycomm3 cpppo pymodbus python-nmap opcua python-can BACpypes minimalmodbus -d ~/python-offline/modulesThese support more advanced detection evasion, protocol fuzzing, and cyber range challenges.
boofuzz– Protocol fuzzing for PLC servicespydnp3– DNP3 protocol interactionpyiec104– IEC-60870-5-104 testingsnap7– Siemens S7 testings7comm– Raw Siemens S7 packet craftingmodbus-tk– Alternate Modbus stackconstruct– Binary protocol parsingbitstring– Bit-level field manipulationhexdump– Binary payload inspectionpyserial– RS-232/RS-485 serial accesscrcmod– Frame checksum generation
USB staging command (optional set):
pip download boofuzz pydnp3 pyiec104 python-snap7 modbus-tk construct bitstring hexdump pyserial crcmod -d ~/python-offline/modules-advancedThese are mandatory for Scapy, PyShark, OPC UA, and encrypted OT traffic testing.
- Npcap (WinPcap-compatible mode)
- Wireshark (for
tshark) - OpenSSL libraries
- Visual C++ Redistributable (x64)
Installation order:
- Visual C++ Redistributable
- OpenSSL
- Npcap
- Wireshark
libpcap0.8tsharkopensslbuild-essentialpython3-devpython3-venv
libpcap0.8tsharkopensslbuild-essentialpython3-devpython3-venv
Several OT testing modules require elevated execution.
-
Windows:
- PowerShell must be run as Administrator
- Npcap must be installed with raw capture support
-
Ubuntu & Kali:
- Commands must be run using
sudo - User must be in the
wiresharkgroup if live capture is required
- Commands must be run using
Each assessment system must use isolated Python environments.
- One virtual environment per project
- No system-wide pip installs
- No auto-updates
- No direct Internet access
Example (Linux):
python3 -m venv ~/ot-env
source ~/ot-env/bin/activateExample (Windows):
python -m venv C:\User\user\ot-env
C:\User\user\ot-env\Scripts\activateEvery OT test environment must use a locked dependency file.
-
Generate on the staging system:
pip freeze > requirements.txt
-
Download with:
pip download -r requirements.txt
-
Install on offline system with:
pip install --no-index --find-links=. -r requirements.txt
This ensures:
- Identical challenge environments
- No version drift
- Repeatable scoring and packet behavior
All USB transfer media must meet the following:
- Virus scanned on IT system before use
- Used only as one-way transfer into OT
- Never reused between IT and OT without reformatting
- Auto-run disabled at OS level