Malware Hides Payloads in DNS TXT Records to Retrieve a Final Payload

· Original article ↗

Summary

Huntress analyzed multi-stage malware that used obfuscated PowerShell and DNS-over-HTTPS TXT records to conceal data, select external servers, and retrieve a final payload.

Key points

  • A Windows Scheduled Task launched a chain using renamed binaries and a disguised log file to extract and execute obfuscated PowerShell.
  • The PowerShell payload queried dns[.]google[.]com over HTTPS for a TXT record associated with dmarc[.]jqueryupdatejs[.]com.
  • The TXT response mimicked a DKIM signature; the malware split its Base64-like data on slashes and decoded nested Base64 strings.
  • Decoded numeric strings represented IP addresses used to select external servers for downloading the final payload.
  • The final payload installed a command-and-control stub; the researchers said server endpoints and payloads could be changed by the attacker.
  • Huntress observed another sample with variations in filenames and the same general concealment approach.

Article Details

Attack Vectors
  • A scheduled task launched a VBScript command that used cmd.exe and a renamed executable to execute obfuscated PowerShell code.
  • The PowerShell payload queried a TXT record for dmarc.jqueryupdatejs.com through Google’s DNS-over-HTTPS resolver; data embedded in the response was decoded to select an external server for the final payload.
  • The malware used names resembling active services on the target system for a renamed mshta.exe, and a lowercase one-word name for a program masking powershell.exe.
Defensive Notes
  • Inspect scheduled tasks and commands that chain VBScript, cmd.exe, renamed executables, and PowerShell.
  • Analyze suspicious files and encoded payloads through their layers; the article notes that human review and reverse engineering helped uncover the behavior.
  • Review DNS-over-HTTPS activity and TXT-record queries for suspicious domains, since the payload was delivered in TXT response data.

Indicators of compromise

TypeIndicatorContext
DOMAINjqueryupdatejs[.]comSuspicious domain whose TXT record was queried by the malware to retrieve embedded payload data.

MITRE ATT&CK