Operator On The Wire
Join
← Back to Knowledge Base
BLUE TEAM / THREAT HUNT / WINDOWS / NETWORK

DNS

This note documents detection patterns related to Suspicious DNS Activity within Windows environments.


Direct Indicators

LogEvent IDMeaningForensic ValueNotes
Sysmon22DNS queryCriticalPrimary host-level DNS telemetry.
Security5156Allowed connectionHighCorrelate DNS resolution with outbound flow.
Sysmon3Network connectionCriticalConfirms connection after DNS resolution.
Sysmon1Process creationCriticalIdentifies querying process lineage.
Security4688Process creationHighParent-child correlation.
DNS Server LogsN/AResolver-side query recordsCriticalStrong enterprise pivot source.
EDR TelemetryN/AProcess-to-DNS mappingCriticalHighest-value lineage source.

Indirect Indicators

IndicatorWhat To Look ForForensic ValueNotes
High-entropy domainRandom-looking labelsCriticalCommon DGA indicator.
Excessive subdomainsLong subdomain chainsCriticalDNS tunneling indicator.
Rare domain queried by LOLBINpowershell / certutil / rundll32CriticalStrong malicious signal.
TXT query abuseUnusual TXT retrievalHighPayload retrieval / beaconing.
NXDOMAIN burstsMany failed lookupsHighDGA or fallback logic.
Newly registered domainFresh IOCHighCampaign infrastructure clue.
Repeating interval queriesPeriodic beacon timingCriticalC2 heartbeat indicator.

Common Tools

ToolUsage
PowerShellDNS resolution and web retrieval
nslookup.exeManual lookup or script usage
certutil.exeRetrieval with domain resolution
curl.exeDNS before HTTP fetch
malware beaconsDGA / TXT / C2 resolution
custom implantDNS tunneling or staged comms

Relevant Artifacts

  • Sysmon Event ID 22
  • Sysmon Event ID 3
  • Sysmon Event ID 1
  • Security Event ID 5156
  • Security Event ID 4688
  • DNS cache (ipconfig /displaydns)
  • DNS server logs
  • Firewall logs
  • EDR DNS lineage
  • Prefetch for querying binary

MITRE ATT&CK References

  • T1071.004 DNS
  • T1568 Dynamic Resolution
  • T1048 Exfiltration Over Alternative Protocol
  • T1105 Ingress Tool Transfer

Decision Tree

  1. Which process queried DNS?

    • Image
    • Parent process
  2. Domain suspicious?

    • Entropy
    • Age
    • Reputation
  3. Query type unusual?

    • TXT
    • AAAA
    • Excessive subdomains
  4. Followed by connection?

    • Sysmon 3
    • Firewall logs
  5. Expand:

    • Beacon interval
    • Payload retrieval
    • Additional domains
  6. Scope:

    • Single host
    • Enterprise spread
    • Shared IOC

Example Detection Templates

KQL

Sysmon
| where EventID == 22
| project TimeGenerated, Computer, Image, QueryName, QueryStatus
Sysmon
| where EventID == 22
| where Image has_any ("powershell.exe","cmd.exe","rundll32.exe","certutil.exe","mshta.exe")
| project TimeGenerated, Computer, Image, QueryName

EQL

dns where process.name in ("powershell.exe","rundll32.exe","certutil.exe","mshta.exe")
sequence by host.name with maxspan=5m
  [ dns where dns.question.name != null ]
  [ network where destination.ip != null ]

Sigma

title: Suspicious DNS Query Activity
id: 91c6e3d2-suspicious-dns
status: experimental
description: Detects suspicious DNS lookups by common attacker processes
references:
  - https://attack.mitre.org/
author: Vergil
date: 2026-03-07
logsource:
  product: windows
  service: sysmon
detection:
  selection:
    EventID: 22
    Image|endswith:
      - '\powershell.exe'
      - '\rundll32.exe'
      - '\certutil.exe'
      - '\mshta.exe'
  condition: selection
fields:
  - Image
  - QueryName
falsepositives:
  - Administrative scripts
level: high
tags:
  - attack.command_and_control
  - attack.t1071.004

Mitigation & Hardening

Control AreaMitigationEffectivenessNotes
Sysmon DNS loggingEnable Event 22CriticalCore host DNS visibility
DNS server loggingRetain enterprise resolver logsCriticalBest broad visibility
Domain reputation enrichmentAdd age / threat intelHighSpeeds triage
LOLBIN monitoringAlert on DNS-active binariesHighStrong overlap with abuse
Egress correlationTie DNS to outbound flowsCriticalConfirm malicious chain