Network Traffic Analysis with Zeek and Suricata for CTF Forensics
Overview
Zeek (formerly Bro) and Suricata turn raw packet captures into high‑level logs and intrusion‑detection alerts, complementing the packet‑level view you get from Wireshark. In a CTF forensic challenge you often receive a PCAP and must answer “who talked to which server, when, and what data left the network?” Zeek’s connection logs and Suricata’s rule‑matched events map directly to MITRE ATT&CK tactics such as T1046 (Network Service Discovery) and T1070 (Data Destruction).
Lab Setup
- Install Zeek and Suricata on a Kali or Ubuntu VM.
sudo apt-get install zeek suricata - Capture traffic with
tcpdumpor reuse an existing PCAP:tcpdump -i eth0 -w ctf_capture.pcap
Zeek Log Analysis
- connection.log – src/dst IP, ports, duration, bytes sent/received.
- http.log – URIs, user‑agents, response codes.
- dns.log – Queries and resolved IPs.
- files.log – Extracted files (MD5, SHA1).
Run Zeek on the PCAP: zeek -r ctf_capture.pcap. Inspect logs with cat or load them into ELK for visualization.
Suricata Rule Writing
Suricata ships with community rules; write a custom rule to detect a known malicious domain:
alert dns any any -> any any (msg:"Detect malicious DNS query"; dns.query; content:"evil‑example.com"; nocase; sid:1000001; rev:1;)
Run: suricata -r ctf_capture.pcap -c /etc/suricata/suricata.yaml -l ./logs.
Pakistan‑Focused Scenario
A CTF scenario emulates a JazzCash transaction that exfiltrates card data. Use Zeek to spot an unusual HTTP POST to an external IP at 02:00 UTC; cross‑reference Suricata alerts for the keyword “card=”. If participants discover the IOCs, they can report to the NCCIA helpline 1799 or document in a write‑up.
Do / Don’t
- Do correlate Zeek logs with Suricata alerts to avoid false positives.
- Don’t ignore encrypted traffic—Zeek’s ssl.log reveals certificate subjects that may link to a C2 server.
Takeaway
Start Zeek and Suricata in your lab today, run them on a sample PCAP, and explore the generated logs. This workflow becomes the backbone of any forensic write‑up you will submit on the portal.
