2023 Business CTF: ICS Watch Tower
Challenge Information
| Attribute | Details |
|---|---|
| Event | 2023 Business CTF |
| Category | SCADA/ICS |
| Challenge | Watch Tower |
| Difficulty | Very Easy |
Summary
ICS Watch Tower is a very easy-level forensic analysis challenge involving network traffic analysis of an industrial control system. The infrastructure monitoring system detected abnormal behavior and captured network traffic. The objective is to analyze the capture to identify what information intruders collected and altered on the network.
Challenge Information
The challenge description states:
“Our infrastructure monitoring system detected some abnormal behavior and initiated a network capture. We need to identify information the intruders collected and altered in the network.”
Challenge Objectives
- Examine the provided network capture file
- Identify suspicious or anomalous traffic patterns
- Determine what data intruders accessed
- Identify what data was modified or tampered with
- Extract evidence of the intrusion
Analysis
Network Forensics Methodology
When analyzing suspicious network captures:
- Timeline Analysis: Establish when suspicious activity occurred
- Protocol Analysis: Identify which protocols were used
- Data Flow: Track data sources and destinations
- Anomaly Detection: Identify unusual communication patterns
- Payload Analysis: Examine packet contents for sensitive data
Common ICS Intrusion Indicators
Reconnaissance Activities:
- Repeated queries to system registers
- Scanning of port 502 (Modbus)
- Port scanning for industrial protocols (DNP3, Profibus, EtherCAT)
- SNMP enumeration attempts
- Banner grabbing
Data Exfiltration:
- Large data transfers to unexpected destinations
- Unusual outbound connections
- Encrypted tunneling attempts
- DNS exfiltration
System Tampering:
- Unexpected register writes
- Coil modifications
- Configuration changes
- Device disconnections/reconnections
Solution
Step 1: Open the Network Capture
Use Wireshark to analyze the traffic:
wireshark capture.pcap &Or use command-line tools:
tshark -r capture.pcapStep 2: Examine Overall Traffic Statistics
Get a high-level view of the network activity:
# Summary statisticstshark -r capture.pcap -q -z io,phs
# Protocol hierarchytshark -r capture.pcap -q -z protocol,colinfoStep 3: Identify ICS Protocol Traffic
Filter for common industrial protocols:
# Modbustcp.port == 502
# DNP3tcp.port == 20000 || udp.port == 20000
# PROFINETeth.type == 0x8892
# Ethernet/IPtcp.port == 2222 || tcp.port == 44818Step 4: Analyze Modbus Traffic for Reconnaissance
Look for repeated read operations:
tshark -r capture.pcap -Y "modbus" -T fields \ -e ip.src -e ip.dst -e modbus.func_code -e modbus.starting_addressIdentify which registers were queried repeatedly, indicating information gathering.
Step 5: Identify Data Exfiltration
Search for unusual data transfers:
# Look for DNS tunnelingtshark -r capture.pcap -Y "dns" -T fields \ -e dns.qry.name | sort | uniq -c | sort -rn
# Look for HTTP/HTTPS with suspicious contenttshark -r capture.pcap -Y "http" -T fields \ -e http.request.uri -e http.user_agentStep 6: Detect Tampering
Look for write operations (Function Code 05, 06, 15, 16):
tshark -r capture.pcap -Y "modbus.func_code == 5 || modbus.func_code == 6 || modbus.func_code == 15 || modbus.func_code == 16"Step 7: Extract Suspicious Data
Export conversation data:
# Extract TCP conversationstshark -r capture.pcap -q -z conv,tcp
# Export specific flowstshark -r capture.pcap -Y "ip.addr == attacker_ip" -w suspicious.pcapStep 8: Analyze Payload Content
For captured data, decode the contents:
from scapy.all import *
packets = rdpcap('capture.pcap')
for packet in packets: if TCP in packet and packet[TCP].dport == 502: if Raw in packet: payload = packet[Raw].load # Try to decode as ASCII try: decoded = payload.decode('ascii', errors='ignore') print(f"Decoded: {decoded}") except: print(f"Binary: {payload.hex()}")Step 9: Timeline Reconstruction
Create a timeline of events:
from scapy.all import *
packets = rdpcap('capture.pcap')
events = []for packet in packets: if TCP in packet: events.append({ 'time': packet.time, 'src': packet[IP].src, 'dst': packet[IP].dst, 'sport': packet[TCP].sport, 'dport': packet[TCP].dport, 'flags': packet[TCP].flags })
# Sort by timeevents.sort(key=lambda x: x['time'])
# Display timelinefor event in events: print(f"{event['time']}: {event['src']}:{event['sport']} -> {event['dst']}:{event['dport']}")Step 10: Identify and Extract the Flag
Based on analysis, determine:
- What information was exfiltrated: Sensitive data from registers
- What was modified: System configurations changed by intruders
- How to prove tampering: Compare before/after states
- Extract the evidence: Compile findings into the flag format
Common Intrusion Patterns
Pattern 1: Reconnaissance Followed by Exploitation
1. Repeated reads to enumerate registers2. Identification of critical control registers3. Focused writes to specific registers4. System malfunction or unexpected behaviorPattern 2: Credential Theft
1. Search for configuration files2. Queries to credential storage registers3. Export of user authentication data4. Potential lateral movementPattern 3: Backdoor Installation
1. Upload of firmware/configuration2. Modification of boot parameters3. Installation of persistence mechanism4. Callback to command serverWireshark Tips and Tricks
# Filter for conversations between two IPsip.src == 192.168.1.1 && ip.dst == 192.168.1.100
# Find all DNS queriesdns.qry.name contains "example"
# Display only traffic with datatcp.len > 0
# Follow TCP streamRight-click packet → Follow TCP Stream
# Color code by conversationView → Coloring Rules
# Export objectsFile → Export ObjectsKey Takeaways
- Network Visibility: Industrial systems need comprehensive network monitoring
- Baseline Comparison: Compare normal vs. suspicious traffic patterns
- Protocol Understanding: Knowledge of ICS protocols aids intrusion detection
- Evidence Preservation: Capture and preserve network evidence
- Timeline Correlation: Correlate network activity with system behavior
- Threat Hunting: Proactively search for indicators of compromise
Tools and Resources
- Wireshark: Interactive packet analyzer with GUI
- tshark: Command-line Wireshark for scripting
- Scapy: Python library for packet manipulation
- zeek (Bro): Network security monitoring platform
- Suricata: Open-source threat detection engine
- tcpdump: Command-line packet capture
- Network Miner: Automated PCAP analysis