Unveiling LummaC2 stealer’s novel Anti-Sandbox technique: Leveraging trigonometry for human behavior detection

LummaC2 v4.0 is analyzed as a dynamic information stealer that adds a novel anti-sandbox layer using mouse-cursor positions and trigonometry to delay execution until “human” behavior is detected. The article also covers its two-layer packer with control-flow flattening, XOR-encrypted strings, base64-encoded configuration, and final payload execution via loaded resources and CreateThread, highlighting techniques to hinder analysis and prevent unpacked leakage. #LummaC2 #LummaC2v4.0 #AntiSandbox #Trigonometry #GetCursorPos #VirtualProtect #ControlFlowFlattening #Packer #Mutex #Base64 #XOR

Keypoints

  • LummaC2 v4.0 introduces a novel anti-sandbox technique that waits for human mouse activity before detonating.
  • The malware uses a two-layer Packer with default Control Flow Flattening and XOR-encrypted strings to hinder analysis.
  • It decrypts and loads the final payload via a layered process that involves VirtualProtect to modify memory protections.
  • A resource-based second stage is decrypted and executed in-process using CreateThread.
  • The configuration is dynamic: Base64-encoded and XORed, with a crypter required for builds.
  • The sample includes multiple hashes for packed and unpacked variants across LummaC2 v4.0 samples.

MITRE Techniques

  • [T1497] Virtualization/Sandbox Evasion – “novel anti-sandbox technique to delay detonation of the sample until human mouse activity is detected.”
  • [T1027] Obfuscated/Compressed Files and Information – “Control Flow Flattening obfuscation implemented in default builds (even without using a packer).”
  • [T1027] Obfuscated/Compressed Files and Information – “Strings are now XOR encrypted instead of simply modified by adding junk strings in the middle.”
  • [T1140] Deobfuscate/Decode Files or Information – “decrypt the second stage with fixed hardcoded size of 6556 bytes.”
  • [T1055.012] Modify Memory Protections – “The API being resolved is ‘VirtualProtect’ used to give PAGE_EXECUTE_READWRITE protections to a fixed address that will contain the second layer.”
  • [T1055] Process Injection – “execute its Original EntryPoint via CreateThread using NTHeaders->OptionalHeader.AddressOfEntryPoint as the ThreadRoutine parameter.”
  • [T1132] Data Encoding – “The configuration is Base64 encoded and XORed with the first 32 bytes of the configuration file.”

Indicators of Compromise

  • [Hash] LummaC2 v4.0 (sample 1) – packed: b14ddf64ace0b5f0d7452be28d07355c1c6865710dbed84938e2af48ccaa46cf, unpacked: 4408ce79e355f153fa43c05c582d4e264aec435cf5575574cb85dfe888366f86
  • [Hash] LummaC2 v4.0 (sample 2) – packed: de6c4c3ddb3a3ddbcbea9124f93429bf987dcd8192e0f1b4a826505429b74560, unpacked: 976c8df8c33ec7b8c6b5944a5caca5631f1ec9d1d528b8a748fee6aae68814e3

Read more: https://outpost24.com/blog/lummac2-anti-sandbox-technique-trigonometry-human-detection/