T1001 Elastic Security · Elastic

Detect Data Obfuscation in Elastic Security

Adversaries may obfuscate command and control traffic to make it more difficult to detect. C2 communications are hidden—though not necessarily encrypted—in an attempt to make content more difficult to discover or decipher and to reduce conspicuousness. Observed techniques include adding junk data to protocol traffic to frustrate pattern matching (T1001.001), embedding payloads in image or media files via steganography (T1001.002), and impersonating legitimate protocols to blend with normal traffic (T1001.003). Real-world examples include Okrum hiding C2 commands in HTTP Cookie and Set-Cookie headers, RDAT encoding AES ciphertext in DNS subdomain labels, FunnyDream sending zlib-compressed obfuscated packets, StrelaStealer XOR-encrypting HTTP POST payloads, Ninja modifying HTTP headers and URL paths to masquerade as legitimate services, and TrailBlazer disguising C2 traffic as Google Notifications HTTP requests.

MITRE ATT&CK

Tactic
Command and Control
Technique
T1001 Data Obfuscation
Canonical reference
https://attack.mitre.org/techniques/T1001/

Elastic Detection Query

Elastic Security (Elastic)
eql
/* T1001: Data Obfuscation — Multi-vector C2 obfuscation detection
   Vector 1: High-entropy DNS subdomain labels (RDAT / DNS tunnel AES encoding)
   Vector 2: Non-browser process outbound HTTP beaconing
   Vector 3: Base64-encoded blob embedded in HTTP request URI path */
any where
  /* Vector 1: DNS query whose first label is 30+ chars of Base64/hex alphabet */
  (
    event.category == "network" and
    network.protocol == "dns" and
    dns.question.name != null and
    dns.question.name regex "[A-Za-z0-9+/=_-]{30,}\\." and
    not dns.question.name regex "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}"
  ) or
  /* Vector 2: Non-browser / non-system process making outbound web-port connection */
  (
    event.category == "network" and
    event.type in ("start", "connection") and
    destination.port in (80, 443, 8080, 8443) and
    network.direction == "egress" and
    process.name != null and
    not process.name in~ (
      "chrome.exe", "firefox.exe", "msedge.exe", "iexplore.exe",
      "opera.exe", "brave.exe", "slack.exe", "teams.exe",
      "outlook.exe", "onedrive.exe", "svchost.exe", "MsMpEng.exe",
      "SearchApp.exe", "zoom.exe", "dropbox.exe", "SenseCE.exe",
      "SenseIR.exe", "MsSense.exe"
    )
  ) or
  /* Vector 3: 40+ contiguous Base64-alphabet chars in HTTP URI path
     Excludes known-clean OAuth and CDN token endpoints */
  (
    event.category == "network" and
    url.path != null and
    url.path regex "[A-Za-z0-9+/]{40,}={0,2}" and
    not url.domain in (
      "accounts.google.com", "login.microsoftonline.com",
      "windowsupdate.com", "cdn.jsdelivr.net", "akamaihd.net"
    )
  )
high severity medium confidence

Detects T1001 Data Obfuscation C2 patterns using Elastic ECS network fields across three vectors: high-entropy DNS subdomain labels matching RDAT AES-in-subdomain and DNS tunneling patterns; non-browser/non-system process outbound HTTP/HTTPS connections; and Base64-encoded blobs embedded in HTTP request URI paths (characteristic of command encoding in URL path segments).

Data Sources

Elastic Agent network telemetry (endpoint.events.network)Packetbeat network captureZeek/Bro logs via Filebeat (zeek.dns, zeek.http)Auditbeat network socket events

Required Tables

logs-endpoint.events.network-*packetbeat-*logs-zeek.dns-*logs-zeek.http-*

False Positives & Tuning

  • CDN providers (Akamai, CloudFlare, Fastly) use long tokenized subdomains for edge routing that can exceed 30 characters and match the Base64/hex alphabet pattern without being malicious
  • Enterprise monitoring agents (Datadog, New Relic, Dynatrace) beacon at regular intervals from non-browser processes using custom HTTP clients, triggering the beaconing vector
  • OAuth 2.0 and JWT token flows legitimately embed long Base64-encoded state parameters and signed CDN URLs (AWS S3 pre-signed, Azure Blob SAS tokens) in HTTP request paths
Download portable Sigma rule (.yml)

Other platforms for T1001


Testing Methodology

Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1Encoded C2 Data in DNS Subdomain Queries (RDAT Pattern)

    Expected signal: Sysmon Event ID 22 (DNS Query): Three DNS queries where QueryName contains 30+ character Base64-alphabet subdomains prepended to test-canary.example.com. DNS server query logs (if forwarded to SIEM): same queries with NXDOMAIN responses. Windows DNS Client cache: ipconfig /displaydns will show the queried names.

  2. Test 2Obfuscated Cookie-Based C2 Simulation (Okrum Pattern)

    Expected signal: Sysmon Event ID 3 (Network Connection): outbound connection from powershell.exe to 127.0.0.1:8888. stream:http (if full packet capture enabled): HTTP GET request with Cookie header containing 50+ character Base64 string and a non-standard User-Agent. Sysmon Event ID 1: powershell.exe process creation with the above command line.

  3. Test 3Block-Aligned HTTP POST Payload (AES-Padded C2 Response Pattern)

    Expected signal: Sysmon Event ID 3: Four outbound connections from powershell.exe to 127.0.0.1:9090 with 3-second intervals. stream:http: POST requests to /update with content-type application/octet-stream; User-Agent 'Windows-Update-Agent/10.0' does not match standard Windows Update agent strings. Network bytes_out should reflect block-aligned sizes.

  4. Test 4Junk Data Padding in DNS TXT Record Queries (FunnyDream/Compression Pattern)

    Expected signal: Sysmon Event ID 22: DNS TXT query for a 32-char random-prefix subdomain of junk-obfuscation-test.example.com. Sysmon Event ID 3: outbound HTTP connection from powershell.exe to 127.0.0.1:7777. stream:http: POST with Content-Type application/x-compress and base64-encoded deflate-compressed body — unusual content-type for browser-originated traffic.

Unlock Pro Content

Get the full detection package for T1001 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections