DNS TXT Answers Containing Command Execution Keywords (IEX, Invoke-Expression, cmd.exe)

Alerts on DNS TXT answers containing IEX/Invoke-Expression or cmd.exe strings indicative of execution-oriented payloads.

FreeReviewedSigma · High · v2
Category
dns
Author
Markus Neis (SigmaHQ), DRL 1.1
Published
2018-08-08
Updated
2026-07-31

ATT&CK techniques

C2
  1. Recon

  2. Resource Dev

  3. Initial Access

  4. Execution

  5. Persistence

  6. Priv Esc

  7. Defense Evasion

  8. Cred Access

  9. Discovery

  10. Lateral Movement

  11. Collection

  12. Exfiltration

  13. Impact

What it detects

This rule flags DNS responses where the TXT record content contains likely command-execution indicators such as "IEX", "Invoke-Expression", or "cmd.exe". Attackers may embed executable commands or scripting triggers in DNS TXT answers to blend C2 traffic with normal DNS activity. It relies on DNS telemetry that includes the DNS record type and the TXT answer payload so the response can be scanned for these specific strings.

Related detections9 linkedT1071.004 — drag to rearrange
Suspicious Script Download via Curl and PowerShell by Dohdoor
DoT (DNS Over TLS) Activation - Command (via process_creation)
DoT (DNS Over TLS) Activation - PowerShell (via powershell)
Possible C2 Beacon with Fixed Authorization URI Parameter via proxy
Suspicious FinCounter DNS Tunneling Query via dns_query
Malicious SUNBURST Command and Control DNS Query to avsvmcloud Domain (via dns_query)
Suspicious Exploitation Callback to Dnslog Service (via dns_query)
Malicious Project CAV3RN DNS Configuration Recovery via cloudlanecdn.com (via dns_query)
Suspicious Entra Sign-In Interrupt With High Aggregated Risk via AiTM DNS Hijacking (via azure)
DNS TXT Answers Containing Command Execution Keywords (IEX, Invoke-Expression, cmd.exe)
Pivot detection · T1071.004 · 9 related

Changelog

v2
  1. v2
    Candidate ingested via manual entry.2026-07-31
  2. v1
    No changelog recorded for this version.2026-07-30

Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.