Network traffic is the malware talking: every beacon, download, and exfiltration leaves a pattern a defender can detect long after the hash changes. Sandbox pcaps plus Wireshark turn "it talked to something" into "it POSTs 240 bytes to /api/v2/beacon every 60 seconds with this User-Agent and this TLS fingerprint". This sub-skill covers reading those pcaps systematically and converting them into network IOCs and detections. Scope: analyze only traffic captured in your isolated lab from samples you are authorized to handle, during authorized DFIR or threat intel work. Never interact with attacker infrastructure.
Quick Workflow
- Get the pcap from the sandbox run (verify it covers the full detonation window).
- List all conversations: endpoints, protocols, byte counts, sorted by first seen.
- Resolve DNS first: every domain queried is a candidate IOC.
- Walk each HTTP session: method, URI, headers, body size, response.
- For TLS: record SNI, JA3/JA4 fingerprints, certificate details.
- Measure beacon intervals: timestamps of repeated connections.
- Extract transferred files and notable payloads from streams.
- Write network IOCs with context and draft the detection.
1. Triage with tshark
# Conversations overview
tshark -r traffic.pcap -q -z conv,ip | head -30
# DNS queries and answers
tshark -r traffic.pcap -Y dns -T fields \
-e dns.qry.name -e dns.a | sort -u
# HTTP requests
tshark -r traffic.pcap -Y http.request -T fields \
-e http.request.method -e http.host -e http.request.uri \
-e http.user_agent | sort | uniq -c | sort -rn
Example output shape:
DNS:
beacon.example-cdn[.]net -> 93.184.216.34
time.windows.com -> 52.179.45.67 (legitimate NTP-ish, ignore)
HTTP:
12 POST beacon.example-cdn[.]net /api/v2/beacon NimbusAgent/2.1
1 GET beacon.example-cdn[.]net /stage2/payload.bin NimbusAgent/2.1
Twelve identical POSTs is beaconing; the single GET is a stage download. Separate infrastructure traffic (Windows telemetry, NTP) from malware traffic before writing IOCs.
2. Beaconing analysis
# Timestamps of connections to the C2
tshark -r traffic.pcap -Y "ip.addr == 93.184.216.34 && tcp.flags.syn==1" \
-T fields -e frame.time_epoch
Example output shape:
1729699200.12
1729699260.31
1729699320.28
1729699380.35
Deltas of ~60 seconds with small jitter: classic beaconing. Record the interval, jitter range, and bytes per beacon (request and response sizes). These become IDS thresholds: "POST to this URI pattern every 60s +- 10s" detects the family even when the domain changes. Note beaconing that only starts after user interaction or a delay; that is evasion-relevant.
3. TLS fingerprinting
# JA3 hashes per TLS session
tshark -r traffic.pcap -Y tls.handshake -T fields \
-e tls.handshake.extensions_server_name -e ja3.hash | sort -u
Example output shape:
beacon.example-cdn[.]net 8a2b4c6d8e0f1a3b5c7d9e0f1a3b5c7d
A JA3/JA4 fingerprint identifies the malware's TLS client even when it talks to a fresh domain or IP. Compare against known-bad fingerprint lists, but verify: some fingerprints are shared with legitimate software (standard libraries). Pair the fingerprint with the SNI pattern or URI for a high-confidence signature.
4. Extracting payloads from streams
# Follow one TCP stream and save its data
tshark -r traffic.pcap -q -z follow,tcp,raw,3 > stream3.raw
# Or use Wireshark: right-click a packet -> Follow -> TCP Stream,
# then "Save as" the reassembled bytes
The stage2 download from the example above becomes a new sample: hash it, triage it, detonate it separately. Also extract beacon response bodies; tasking data or updated configs often hide there. If the stream is encrypted, note the key exchange (or lack of it) and move to memory analysis for the plaintext.
5. Writing network detections
# Suricata-style concept (adapt to your IDS)
# alert on the beacon URI pattern with the malware User-Agent
alert http any any -> any any (
msg:"Nimbus beacon";
http.uri; content:"/api/v2/beacon";
http.user_agent; content:"NimbusAgent/";
threshold: type both, track by_src, count 3, seconds 300;
sid:1000001;)
Network detections to produce per sample: domain and URL blocklist entries, JA3 fingerprint watch, beacon-interval anomaly description for the NDR, and the full pcap archived with the case. Include first-seen timestamps and the detonation context; a domain seen once in a lab differs from one seen beaconing for a week.
Edge cases
- DNS over HTTPS or hardcoded IPs: no DNS queries to log; the IP itself is the IOC.
- Domain fronting / CDN usage: the SNI and Host header differ, or the IP belongs to a shared CDN; blocking the IP would cause collateral damage, so detect on URI and fingerprint instead.
- Very low and slow beaconing (hours): short detonations miss it; extend runtime or note the gap.
- Traffic that only appears with simulated internet: compare full-block vs simulated-service runs to find C2 that needs DNS.
- Encrypted custom protocols over odd ports: document the port, byte patterns, and handshake; that is still a signature.
- Legitimate traffic mixed in: always baseline the clean VM's traffic first so you know what to subtract.
Escalation
If traffic shows data exfiltration (large uploads, archive files), escalate to the incident lead immediately with volume estimates; the case priority changes.
If the C2 is live and serving new payloads, hand fresh IOCs to threat intel at once; do not wait for the full writeup.
If you observe lateral movement attempts in traffic, isolate the lab segment and escalate before further detonations.
If the pcap is too large for manual review, escalate to scripted triage (tshark statistics first); do not sample blindly.
Detection and defender view
Network IOCs age fast and hit hard: a domain block stops the bleeding today. But prefer behavior-shaped detections (beacon interval plus URI pattern plus JA3) over single domains, because domains are cheap for the attacker to replace. Feed beacon profiles to the NDR team and proxy admins with the exact thresholds you measured. Keep a per-family network profile document (ports, protocols, intervals, fingerprints) that the SOC can consult during hunts; it outlives any single IOC.
Key references
- Wireshark documentation: https://www.wireshark.org/docs/
- tshark manual: https://www.wireshark.org/docs/man-pages/tshark.html
- JA3 fingerprinting method: https://github.com/salesforce/ja3
- JA4 fingerprinting: https://github.com/FoxIO-LLC/ja4
- MITRE ATT&CK: T1071 (Application Layer Protocol), T1041 (Exfiltration Over C2 Channel), T1008 (Fallback Channels)
- Suricata rule documentation: https://docs.suricata.io/en/latest/rules/
