Lesson 3 of 6 · 25 min read

Network Playbook — From IDS Alert to C2 Confirmation

Network alerts are the most data-dense: you’re swimming in connection logs, DNS queries, and TLS handshakes trying to find the signal. The network playbook gives you a systematic way through the noise.


The Network Pivot Chain

IDS alert fires

├─► Read rule + SID (what behavior triggered?)

├─► Zeek conn.log on the 5-tuple
│   (duration, bytes_sent, bytes_recv, connection state)

├─► Zeek dns.log
│   (what domain resolved to the flagged IP? reverse lookup?)

├─► Zeek ssl.log
│   (JA3/JA4 fingerprint, certificate subject, SNI vs cert mismatch?)

├─► Pivot to SOURCE HOST
│   (what process made this connection? Sysmon 3 or EDR)

└─► Frequency analysis
    (regular interval? = beacon candidate)

Reading Zeek conn.log

The conn.log is your first pivot after an IDS hit. Each row represents one TCP/UDP session.

Key fields to read:

FieldWhat it tells youHigh-signal values
durationSession length in seconds> 300s = long connection; investigate
orig_bytesBytes from source to destHigh = potential exfil
resp_bytesBytes from dest to sourceHigh relative to orig = C2 returning data
conn_stateSession stateS1 (syn only), SF (normal close), RSTO (reset by originator)
serviceProtocol detected”http”, “ssl”, blank (unrecognized protocol) — blank on 443 = suspicious

Beacon Math

When you see a pattern of short connections at regular intervals, you may have a beacon. Quantify it before concluding.

Step 1: Extract timestamps of all connections from source to destination.

# Zeek query: all connections from 10.1.5.42 to 185.220.101.5
grep "10.1.5.42" conn.log | grep "185.220.101.5" | awk '{print $1}'

Step 2: Calculate intervals between consecutive connections.

timestamps = [1723124400, 1723124460, 1723124521, 1723124579, ...]
intervals = [t2 - t1 for t1, t2 in zip(timestamps, timestamps[1:])]
# intervals = [60, 61, 58, 62, 59, ...]

Step 3: Calculate mean and standard deviation.

Mean interval: 60s. Std dev: 1.5s. Coefficient of variation (CV): 2.5%.

Interpretation: CV < 5% = highly regular = strong beacon candidate. CV 5–30% = moderate jitter = possible beacon. CV > 50% = irregular = probably not beaconing.


DNS Tunnelling Indicators

DNS tunnelling encodes data in DNS queries and responses to exfiltrate data or establish C2 through a firewall that only allows port 53.

Indicators to check in Zeek dns.log:

IndicatorDescriptionThreshold
Query lengthLong subdomains carry encoded data> 40 characters
Query entropyRandom-looking subdomainsShannon entropy > 3.5
Query volumeMany queries per minute to same domain> 10/min
Record typeNULL and TXT records rarely used legitimatelyAny NULL or many TXT
NXDOMAIN rateDGA generates many non-resolving domains> 20% of queries

TLS Analysis: JA3/JA4 and Certificate Anomalies

Certificate anomalies to check:


Zeek Log Reference— Zeek Documentation JA4+ Fingerprinting— FoxIO