Malware Disguised as Document from Ukraine’s Energoatom Delivers Havoc Demon Backdoor | FortiGuard Labs

FortiGuard Labs documents a malicious spoofed document impersonating Energoatom that delivers Havoc Demon backdoor via a multi-stage macro. The operation blends anti-analysis techniques, a payload hidden in a custom XML part, and Havoc C2 communications, with indicators suggesting possible red-team-like testing in progress. #Energoatom #HavocDemon #KaynLdr #OfficeTelemetry.dll #Ukrtatnafta

Keypoints

  • The macro-enabled document is named “zatverdzhenniy_spisok_osib_na_otrim” and arrives inside an ISO image archive bearing the same filename, first seen on VirusTotal in mid-March.
  • The macro’s VBA code employs anti-analysis and obfuscation techniques (e.g., image deletion, encoded strings, and anti-debugging via OnTime scheduling).
  • The macro searches for and reads a payload from a hardcoded disk path and, if not found, extracts the payload from a custom XML node named “TwXfx” inside the document.
  • The payload is written to “C:UsersuserAppDataLocalMicrosoftOfficeOfficeTelemetry.dll” and executed via ShellExecute, leading to the Havoc Demon stage.
  • Stage 2 (KaynLdr) loads the Havoc Demon agent in memory by resolving native APIs (LdrLoadDll, ZwAllocateVirtualMemory, NtProtectVirtualMemory) and executing shellcode from memory.
  • Stage 3 (Havoc Demon) uses a C2 framework with AES-256-CTR encryption, HTTPS POST communications, and a single C2 domain (ukrtatnafta.org) configured in the sample.
  • The malware demonstrates extensive defense-evasion techniques (sleep obfuscation, API patches to disable security tools, and anti-debugging), plus signs of potential red-team artifacts.

MITRE Techniques

  • [T1059.005] Visual Basic – The macro executes and hides its code, with the VBA macro designed to run when the document is opened. Quote: “The macro begins by deleting the overlay image… [and] is set to execute when the document is opened via AutoOpen and Document_Open events.”
  • [T1027] Obfuscated/Compressed Data – The document encodes and decodes strings by subtracting 35, Base64 encoding, and other tricks to hide strings. Quote: “encoding by subtracting 35 from each character of the original string and encoding the result with Base64.”
  • [T1036] Masquerading – The payload pretends to be a legitimate Office component (OfficeTelemetry.dll) and is delivered under a Microsoft Office-like guise. Quote: “masquerade as a legitimate component of Microsoft Office.”
  • [T1106] Native API – The KaynLdr stage resolves native APIs via API hashing (LdrLoadDll, ZwAllocateVirtualMemory, NtProtectVirtualMemory) to allocate memory, load the payload, and execute in memory. Quote: “KaynLdr resolves the LdrLoadDll, ZwAllocateVirtualMemory, and NtProtectVirtualMemory Native APIs via API hashing.”
  • [T1055] Process Injection – The loader creates a new suspended injection thread to run the payload, hiding from debuggers. Quote: “the loader calls ZwCreateThreadEx to create a new suspended injection thread hidden from debuggers.”
  • [T1059.003] Windows Command Shell – The loader launches the shellcode via conhost.exe (headless), effectively using a command shell proxy to start the payload. Quote: “ShellExecute with the following command line: ‘C:WindowsSystem32conhost.exe –headless’.”
  • [T1086] PowerShell – The Havoc Demon suite lists PowerShell command execution as a capability, indicating extensibility beyond VBA. Quote: “Execute PowerShell commands” as part of major features.
  • [T1573] Encrypted Channel – Havoc Demon encrypts communications with AES-256-CTR, sharing a key/IV with the C2 on initial check-in. Quote: “…encrypted payload data… AES-256-CTR.”
  • [T1071.001] Web Protocols – Havoc Demon communicates with its C2 over HTTP/HTTPS POST requests to ukrtatnafta.org. Quote: “Demon communicates with the C2 server specified in the configuration via HTTP or HTTPS POST requests.”
  • [T1562.001] Impair Defenses – The loader patches security-related APIs (WldpQueryDynamicCodeTrust, AmsiScanBuffer, EtwEventWrite) to hinder detection. Quote: “patches security-related APIs to disable them.”
  • [T1036] Cobalt Strike Clue – The sample contains plaintext Cobalt Strike configuration field names, which could mislead analyzers. Quote: “well-known Cobalt Strike configuration field names… found in plaintext.”

Indicators of Compromise

  • [File Hash] – b773fa65bb375e6fe6d387f301f6bf33219189ea1d4a06762e965a9eba7de4e8
  • [File Hash] – 17637fac7f989549acd248ca9e5293d2b9a1a2e4bb0f7e4edf5571df35129f0c
  • [File Hash] – 9f797d705facebd1687b7765cbf65231e71821eb3c38dcc171a3fc88b9f52328
  • [File Hash] – b6cb8a7cdce0bfd3a7402d22fb0014dedb259d6c91c1538ac74097b8ca22ca5c
  • [C2 URLs] – hxxps://ukrtatnafta[.]org
  • [C2 URLs] – hxxps://ukrtatnafta[.]org/wp-content/themes/pressa/js/avias.js
  • [C2 URLs] – hxxps://ukrtatnafta[.]org/wp-content/themes/pressa/js/mobile_menu.js
  • [C2 URLs] – hxxps://ukrtatnafta[.]org/wp-content/plugins/contact-form-7/includes/js/scripts.js
  • [C2 URLs] – hxxps://ukrtatnafta[.]org/wp-content/themes/pressa/js/bootstrap.js
  • [C2 URLs] – hxxps://ukrtatnafta[.]org/wp-content/themes/pressa/js/hovermenu.js
  • [C2 URLs] – hxxps://ukrtatnafta[.]org/wp-content/themes/pressa/js/retina-1.1.0.js
  • [C2 URLs] – hxxps://ukrtatnafta[.]org/wp-content/plugins/js_composer/assets/lib/bower/isotope/dist/isotope.pkgd.min.js
  • [C2 URLs] – hxxps://ukrtatnafta[.]org/wp-content/themes/pressa/js/custom-script.js
  • [C2 URLs] – hxxps://ukrtatnafta[.]org/wp-includes/js/wp-emoji-release.min.js
  • [C2 URLs] – hxxps://ukrtatnafta[.]org/maps-api-v3/api/js/52/1/intl/uk_ALL/util.js
  • [C2 URLs] – hxxps://ukrtatnafta[.]org/wp-includes/js/wp-embed.min.js

Read more: https://www.fortinet.com/blog/threat-research/malware-disguised-as-document-ukraine-energoatom-delivers-havoc-demon-backdoor