Network Traffic Analysis for CTI: Leveraging Wireshark and Zeek
Why Packet‑Level CTI?
While log‑based IOC feeds give you what to look for, network traffic analysis tells you if the malicious activity is actually traversing your perimeter. In Pakistan, ISPs route massive volumes of OTT traffic (WhatsApp, Viber) that often hide phishing links in forwarded messages. By inspecting packet captures (PCAP) you can discover C2 callbacks, exfil, and drive‑by downloads in real time.
Capturing Traffic with tcpdump
- Identify monitoring point: Mirror a core switch port or tap the edge router feeding your DMZ.
- Start a long‑term capture:
tcpdump -i <iface> -w /data/capture_$(date +%Y%m%d%H%M).pcap -C 500 -W 10. - Rotate files every 500 MB, keeping ten files max to avoid disk pressure.
Processing PCAP with Wireshark
- Open the capture in Wireshark (or tshark for scripted analysis).
- Apply display filters for DNS queries to known malicious domains:
dns.qry.name contains "free‑gift‑pk". - Export objects (File → Export Objects → HTTP) to extract payloads that may contain malicious scripts.
- Use Lua scripts to auto‑tag packets matching a custom IOC list loaded from a CSV.
Turning Logs into Intelligence with Zeek
- Install Zeek (
sudo apt install bro) on a sensor box and point it at the same mirrored link. - Zeek produces structured logs:
http.log,dns.log,ssl.log,conn.log. - Correlate dns.log entries with the MISP IOC export:
grep -F -f misp_ioc.txt /opt/zeek/logs/dns.log | zeek-cut query answer - Build Suricata rules from discovered C2 domains:
alert dns $HOME_NET any -> $EXTERNAL_NET any (msg:"C2 Domain detected"; dns.query; content:"evil‑c2.pk"; nocase; sid:200001; rev:1;) - Feed Zeek’s notice.log into ELK for dashboards showing top Talkers, unusual ports, andgeo‑IP anomalies.
Do’s and Don’ts
- Do keep PCAP retention ≤ 7 days in accordance with PTA data‑retention guidelines.
- Do sanitize logs before sharing; remove internal IP addresses when distributing to external partners.
- Don’t capture full‑payload traffic on high‑throughput links without sampling, or you’ll drown the SOC.
- Don’t rely solely on DNS blocklists—advanced actors use DGA and fast‑flux that evade static lists.
Takeaway: By integrating Wireshark for deep packet inspection and Zeek for high‑volume log analysis, you transform raw network flows into actionable CTI that can be turned into detection rules for your SOC.
