Attackers can delete endpoint logs and blind an agent, but they still have to move packets across your network to command implants, move laterally and take data out. Network threat hunting uses that fact: it starts from a hypothesis about attacker behaviour and tests it against flow records, DNS logs and packet data to find activity that no alert caught. This guide covers how to frame network hypotheses, which data source answers which question and at what cost, example hunts in flow, DNS and packet data tied to MITRE ATT&CK, and how to turn a successful hunt into a lasting detection. It is for threat hunters and network security analysts who already know the basics of hunting from the Threat Hunting Guide.
Key takeaways
- Start from a testable hypothesis. "A host is beaconing to an external server at a regular interval over HTTPS" is huntable; "look for bad traffic" is not.
- Pick the cheapest data that can answer the question. Flow records cover the whole estate cheaply; Zeek metadata adds protocol detail; full packet capture answers the hardest questions but only where you can afford to keep it.
- Every network hunt depends on a baseline. Rare, long, regular or large only means something against what is normal for that segment, host role and time of day.
- Encrypted traffic is still huntable. Timing, volume, destination, TLS fingerprints such as JA4 and certificate metadata reveal a lot without decryption.
- A hunt is finished only when it is written up. Record the hypothesis, data, queries, findings and the detection or data gap it produced, or the next hunter starts from zero.
Hypothesis-driven network hunting
A network hypothesis names an attacker behaviour, where it would show up in your traffic, and what evidence would confirm or refute it. The best sources are threat intelligence on actors that target your sector, recent incidents, ATT&CK techniques with weak detection coverage and changes in your own environment (a new cloud egress path, a new remote access tool). Keep a backlog and score each idea on likely impact and data availability; the Threat Hunt Hypothesis Backlog Template gives a format.
| Hypothesis | ATT&CK technique | Primary data | What a positive looks like |
|---|---|---|---|
| An implant beacons to external infrastructure over HTTPS | T1071.001 Web Protocols; T1573 Encrypted Channel | Flow, Zeek conn and ssl logs | Regular connection intervals, consistent sizes, rare destination, unusual JA4 |
| Data is tunnelled out through DNS | T1071.004 DNS; T1572 Protocol Tunneling; T1048 Exfiltration Over Alternative Protocol | DNS resolver logs, Zeek dns.log | High volume of unique long subdomains under one parent domain, TXT or NULL heavy queries |
| Malware resolves algorithmically generated domains | T1568.002 Domain Generation Algorithms | DNS logs | Bursts of NXDOMAIN responses for random-looking names from one host |
| Data leaves to cloud storage in bulk | T1567.002 Exfiltration to Cloud Storage; T1030 Data Transfer Size Limits | Flow, proxy, Zeek conn | Outbound bytes far above the host's normal, often in evenly sized chunks or off hours |
| An unapproved remote access tool is in use | T1219 Remote Access Tools | Zeek conn, ssl and dns, flow | Long sessions to remote access service domains from hosts with no approved use |
| A compromised host is scanning internally | T1046 Network Service Discovery | Flow, Zeek conn | One source touching many hosts or ports with many failed or unanswered connections |
| C2 uses a raw or non-standard protocol | T1095 Non-Application Layer Protocol; T1571 Non-Standard Port | Flow, Zeek conn, PCAP | Traffic on unusual ports, or protocol mismatch between port and detected service |
Data sources and what each reveals
| Source | What it records | Coverage | Relative cost | Best for | Blind spots |
|---|---|---|---|---|---|
| NetFlow v9 or IPFIX | Per-flow summary: addresses, ports, protocol, bytes, packets, start and end times | Whole estate from routers, switches, firewalls and cloud flow logs | Low; long retention is affordable | Beaconing timing, volume anomalies, scanning, long connections, retrospective "who talked to this IP" | No payload or application detail; sampling can hide short flows |
| Zeek logs | Protocol metadata per connection: conn, dns, http, ssl, x509, files and more, linked by a uid | Where sensors see traffic (internet edge, data centre core, key segments) | Medium | Most hunts: protocol mismatches, TLS and certificate detail, DNS content, file transfers | Only where sensors sit; encrypted payloads stay opaque |
| DNS resolver logs | Queries and responses from internal resolvers or protective DNS | Every client using your resolvers | Low to medium | Tunnelling, DGA, newly seen domains, mapping hosts to destinations | Clients using encrypted DNS to outside resolvers bypass them |
| Full packet capture (PCAP) | Every packet, including payload | Selective: chokepoints and high-value segments | High; retention often days, not months | Confirming a finding, reconstructing sessions, extracting files and indicators | Storage-bound; encrypted payloads still need keys |
| Proxy and firewall logs | Allowed and denied connections, URLs, users where authenticated | Egress paths | Low to medium | User attribution, URL and category context | Traffic that bypasses the proxy |
IPFIX (RFC 7011, an Internet Standard) builds on NetFlow version 9, so most collectors handle both. The NetFlow and IPFIX Flow Telemetry Guide covers exporter placement and sampling, the Zeek Network Monitoring Guide covers sensor deployment, and the Arkime Full Packet Capture Guide covers indexed PCAP. Joint guidance from CISA, NSA, FBI and partner agencies in December 2024 recommended flow monitoring at key ingress and egress points as a core visibility measure, with packet capture as an option where appropriate.
Decision guidance: which source first
- Small teams: start with flow (often already available from firewalls and cloud flow logs) and resolver DNS logs. Together they support most of the hypotheses above.
- Mid-size: add Zeek at the internet edge. One sensor there gives TLS, certificate and protocol detail for all outbound traffic.
- Large or high-risk estates: add Zeek on internal segments for east-west hunts, and rolling PCAP at chokepoints with retention long enough to cover your typical time from hunt lead to investigation.
Baseline dependency
Almost every network hunt compares observed behaviour with expected behaviour: a connection is "long" for a workstation but normal for a backup server, and a domain is "rare" only if you know what the estate usually resolves. Build baselines per host role, segment and time window before you hunt, and refresh them. How to build them is covered in Network Traffic Baselining, and the counting methods hunters use against them (stacking, long-tail and frequency analysis) in the Statistical Hunting Techniques Guide. Without them, expect a flood of false positives from software updaters, monitoring agents and backup jobs.
Flow hunts
- Beaconing: group flows by source, destination and port, then look at the spread of time between connections and the consistency of bytes per connection. Low variation in both, to a destination few other hosts use, is the classic signal. Jitter added by modern implants widens the spread, so score rather than threshold. The scoring approaches are covered in the Beaconing and C2 Detection Guide and the RITA Guide.
- Long connections: sort by duration or by total connected time per source and destination pair over a day. Sessions lasting hours to destinations outside your known list of VPN, conferencing and streaming services are worth a look, especially from servers.
- Upload ratio: compare bytes out to bytes in per host (D3FEND calls this Per Host Download-Upload Ratio Analysis). Workstations and most servers download far more than they upload; a reversal points to staging or exfiltration.
- Fan-out: count distinct internal destinations and ports per source per hour. Spikes reveal scanning and lateral movement attempts, such as a workstation suddenly reaching many hosts on SMB (T1021.002 SMB/Windows Admin Shares).
- New external peers: list destinations first seen in the last day that only one or two hosts talk to.
DNS hunts
Zeek's dns.log records the query name, query type, response code, answers and their TTLs for each transaction, and resolver logs give similar fields. The DNS Logging and Detection Guide covers collection and field normalisation; these hunts build on it.
| Indicator | Why it matters | Common benign cause to rule out |
|---|---|---|
| Many unique subdomains under one parent domain from one host | Data encoded in labels is the core of DNS tunnelling | CDNs, telemetry and anti-malware lookups that encode hashes in names |
| Long query names and high character randomness | Encoded payloads and DGA names look random | Cloud service hostnames with long random identifiers |
| High share of TXT, NULL or unusual record types | Larger response capacity for tunnelled data | Email security checks (SPF, DKIM), service discovery |
| Bursts of NXDOMAIN from one host | DGA malware tries many names before one resolves | Misconfigured applications, typos in scripts |
| Very low TTLs on answers for rare domains | Fast-changing infrastructure | Load balancers and CDNs |
| Clients querying external resolvers directly or using DNS over HTTPS | Bypasses your logging and filtering | Browsers with encrypted DNS enabled by default |
Hunt by parent domain rather than full name: aggregate unique subdomain counts and total query bytes per registered domain per host. A single host sending thousands of unique labels to one rarely seen domain is a strong lead. Encrypted DNS changes what you can see; the Encrypted DNS Enterprise Guide covers keeping visibility.
Packet and protocol hunts
- Rare TLS fingerprints: JA3 and its successor JA4 fingerprint the TLS client hello. FoxIO designed JA4 to sort cipher suites and extensions, so it stays stable when browsers randomise extension order (Chrome did so from 2023). Stack JA4 values across the estate and investigate fingerprints seen on only a few hosts, or a browser-like fingerprint coming from a server process. JA4 for TLS clients is BSD 3-Clause licensed; most other JA4+ methods use the FoxIO License, which matters if you build them into a product. Zeek, Wireshark and Arkime support JA4+. See the JA3 and JA4 TLS Fingerprinting Guide.
- Certificate anomalies: from Zeek's x509 and ssl logs, look for self-signed or newly issued certificates on rare destinations, default or empty subject fields and certificates reused across unrelated IP addresses.
- Protocol on the wrong port: compare the destination port with the service Zeek detected in conn.log. HTTP or TLS on an unusual port, or an unknown service on 443, fits T1571.
- Connection state patterns: Zeek's conn_state and history fields summarise how each connection progressed. Many attempts with no reply from one source suggest scanning; completed connections with tiny, regular payloads suggest polling C2.
- Confirm with PCAP: when metadata produces a lead, pull packets for that flow to examine payload (where unencrypted), extract transferred files and capture indicators. Preserve the PCAP as evidence before it ages out.
Where identity fits
Many network leads end at a machine identity: a service account authenticating to many hosts, an API key used from a new egress address, or a workload calling an unusual cloud endpoint. Join network leads with authentication logs to attribute traffic to an account, not just an IP. The Identity Threat Hunting Guide covers the identity side.
Turning hunts into detections
Each hunt should leave something behind: a detection, a tuned baseline, a documented data gap or a confirmed "not present" result with its date. Follow these steps.
- Document the hunt: hypothesis, ATT&CK technique, data sources and time range, queries used, results, false positive causes and decision. The Threat Hunt Hypothesis and Report Template gives a structure.
- Decide whether it can be automated: high-fidelity patterns (protocol on the wrong port from servers, external resolver use) become alerts; noisier ones (beacon scores, rare JA4) become scheduled reports or risk scores for analyst review.
- Write the detection with its exclusions: encode the benign causes you found during the hunt as documented allowlists with owners and review dates.
- Test before enabling: run the rule in report-only mode for one to two weeks and measure alert volume and precision.
- Hand over: move the rule into the detection engineering lifecycle; see Threat Hunting vs Detection Engineering.
- Roll back if noisy: drop the rule back to report-only rather than deleting it, and tune.
- Record data gaps: if the hunt could not be completed because a segment had no sensor or flow sampling hid short sessions, log it as a visibility gap with an owner.
Measuring the programme
- Hunts completed per quarter, and the share that produced a detection, a data gap fix or a confirmed finding.
- ATT&CK Command and Control (TA0011) and Exfiltration (TA0010) techniques with at least one documented hunt in the past year.
- Network visibility coverage: share of internet egress points and critical segments with flow and Zeek coverage.
- Precision of hunt-derived detections after 90 days.
- Median time from hunt lead to triage decision.
Common failure patterns
- Hunting without a baseline: every backup job and updater looks like exfiltration or beaconing.
- Sampled flow treated as complete: short beacons and small transfers disappear at high sampling rates.
- Sensors only at the edge: east-west movement between internal hosts is never seen.
- Static thresholds for beaconing: jitter defeats fixed interval rules; use scoring.
- Unwritten hunts: results live in one analyst's notebook and the same hunt is repeated a year later.
Framework mapping
| Framework | Reference | How it applies |
|---|---|---|
| MITRE ATT&CK v20 | TA0011 Command and Control; TA0010 Exfiltration; techniques in the hypothesis table | Source of hypotheses and coverage tracking |
| MITRE D3FEND | D3-NTA Network Traffic Analysis; D3-DNSTA DNS Traffic Analysis; D3-PHDURA Per Host Download-Upload Ratio Analysis; D3-CAA Connection Attempt Analysis; D3-PMAD Protocol Metadata Anomaly Detection | Defensive techniques the hunts exercise |
| NIST CSF 2.0 | DE.CM-01; DE.AE-02 | Monitor networks; analyse potentially adverse events |
| NIST SP 800-53 Rev 5 | SI-4 System Monitoring; AU-6 Audit Record Review, Analysis, and Reporting | Monitoring and analysis duties hunting supports |
Practitioner checklist
- Keep a scored backlog of network hypotheses tied to ATT&CK techniques and current threat intelligence.
- Collect flow records from all egress points and cloud flow logs, and note sampling rates.
- Log internal resolver queries and responses, and detect clients that bypass them.
- Run Zeek at the internet edge at minimum, with ssl, x509 and dns logs retained alongside conn.
- Keep rolling PCAP at chokepoints long enough to cover your lead-to-investigation time.
- Build baselines per host role and segment before hunting, and refresh them.
- Include JA4 fingerprints and certificate metadata in TLS hunts.
- Write up every hunt and convert repeatable patterns into tested detections with documented exclusions.
Standards and references
- MITRE ATT&CK: Command and Control (TA0011)
- MITRE ATT&CK: Exfiltration (TA0010)
- MITRE D3FEND: Network Traffic Analysis
- Zeek Project: conn.log
- Zeek Project: dns.log
- IETF: RFC 7011, IP Flow Information Export (IPFIX) Protocol
- FoxIO: JA4+ network fingerprinting
- CISA: Enhanced Visibility and Hardening Guidance for Communications Infrastructure
Related NHI Mgmt Group resources: Threat Hunting Guide · Beaconing and C2 Detection Guide · NDR Guide · Data Exfiltration Guide