Detect Data Obfuscation in IBM QRadar
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/
QRadar Detection Query
/* T1001: Data Obfuscation — QRadar AQL multi-vector detection
Covers: (1) high-entropy DNS subdomain labels, (2) suspicious HTTP User-Agent strings,
(3) Base64-encoded blobs in HTTP proxy request URIs */
SELECT
DATEFORMAT(starttime, 'yyyy-MM-dd HH:mm:ss') AS event_time,
sourceip,
destinationip,
destinationport,
username,
QIDNAME(qid) AS event_name,
CATEGORYNAME(category) AS event_category,
"Query" AS dns_query_name,
"URL" AS request_url,
"User Agent" AS user_agent_string,
CASE
WHEN REGEXP_MATCH("Query", '^[A-Za-z0-9+/=_-]{30,}\.')
THEN 'HighEntropyDNSSubdomain'
WHEN NOT REGEXP_MATCH(LOWER(COALESCE("User Agent", '')), '(mozilla|chrome|safari|firefox|edge|curl|python-requests|wget|java|okhttp|axios|go-http-client)')
AND destinationport IN (80, 443, 8080, 8443)
AND "User Agent" IS NOT NULL
THEN 'SuspiciousUserAgent'
WHEN REGEXP_MATCH(COALESCE("URL", ''), '[A-Za-z0-9+/]{40,}={0,2}')
AND NOT "URL" LIKE '%accounts.google.com%'
AND NOT "URL" LIKE '%login.microsoftonline.com%'
AND NOT "URL" LIKE '%windowsupdate.com%'
AND NOT "URL" LIKE '%cdn.jsdelivr.net%'
THEN 'Base64EncodedURI'
ELSE 'MultiVector'
END AS detection_vector
FROM events
WHERE
/* Last 24 hours in milliseconds */
starttime > (DATEFORMAT(NOW(), 'epoch') - 86400000)
AND
(
/* Vector 1: DNS query with high-entropy first label (30+ Base64/hex chars) */
REGEXP_MATCH("Query", '^[A-Za-z0-9+/=_-]{30,}\.')
OR
/* Vector 2: Non-standard User-Agent on web ports — non-browser tooling */
(
destinationport IN (80, 443, 8080, 8443)
AND "User Agent" IS NOT NULL
AND NOT REGEXP_MATCH(
LOWER(COALESCE("User Agent", '')),
'(mozilla|chrome|safari|firefox|edge|curl|python-requests|wget|java|okhttp|axios|go-http-client)'
)
)
OR
/* Vector 3: Base64-encoded blob in HTTP URI path from proxy/web-filtering sources */
(
"URL" IS NOT NULL
AND REGEXP_MATCH("URL", '[A-Za-z0-9+/]{40,}={0,2}')
AND NOT "URL" LIKE '%accounts.google.com%'
AND NOT "URL" LIKE '%login.microsoftonline.com%'
AND NOT "URL" LIKE '%windowsupdate.com%'
AND NOT "URL" LIKE '%cdn.jsdelivr.net%'
AND NOT "URL" LIKE '%akamaihd.net%'
)
)
ORDER BY starttime DESC
LIMIT 500 Detects T1001 Data Obfuscation in QRadar across three vectors using normalized event fields: high-entropy DNS subdomain labels (30+ Base64/hex chars — RDAT/tunneling), non-standard HTTP User-Agent strings on web ports (non-browser tooling beaconing), and Base64-encoded blobs in HTTP request URIs from proxy and web-filtering log sources.
Data Sources
Required Tables
False Positives & Tuning
- Microsoft Azure service discovery and ARM template deployments generate long DNS subdomain labels under *.azure.com and *.windows.net that can match the 30-character entropy threshold
- Custom enterprise Java or .NET applications using HttpClient without a browser-style User-Agent header will appear as suspicious UA while performing legitimate internal API calls
- AWS S3 pre-signed URLs and Azure Blob Storage SAS tokens embed HMAC-SHA256 signatures as long Base64-encoded query parameters that match the encoded URI pattern
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.
- 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.
- 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.
- 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.
- 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.
References (11)
- https://attack.mitre.org/techniques/T1001/
- https://www.bitdefender.com/files/News/CaseStudies/study/379/Bitdefender-Whitepaper-Chinese-APT.pdf
- https://www.welivesecurity.com/2019/07/08/okrum-ke3chang-targets-diplomatic-missions/
- https://unit42.paloaltonetworks.com/rdat-oilrig/
- https://www.cisa.gov/sites/default/files/publications/MAR-10303705-1.v1.WHITE.pdf
- https://www.kaspersky.com/about/press-releases/2022_toddycat
- https://www.crowdstrike.com/blog/observations-from-the-stellarparticle-campaign/
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1001/T1001.md
- https://learn.microsoft.com/en-us/azure/sentinel/dns-solution
- https://learn.microsoft.com/en-us/defender-endpoint/advanced-hunting-devicenetworkevents-table
- https://docs.splunk.com/Documentation/StreamApp/latest/DeployStreamApp/AboutSplunkStream
Unlock Pro Content
Get the full detection package for T1001 including response playbook, investigation guide, and atomic red team tests.