K30ZWMBJJ String Obfuscation
Overview
A custom string-obfuscation function found in the decompiled AutoIt script of the b017d189 sample. It protects shellcode-staging API names and file paths from static string extraction. The technique combines a permutation table with a trivial XOR key, making it recoverable with minimal effort but sufficient to defeat naive string-matching.
What It Does
- Takes a plaintext string and a hardcoded permutation lookup table.
- Permutes each character through the table.
- XORs the permuted bytes with a two-byte key (
"AA"in the observed sample). - Stores the result as a byte array in the compiled script.
- At runtime, reverses the process to recover the original API name or path.
Detection / Fingerprint
Look for AutoIt scripts containing:
- A function named
K30ZWMBJJor similar random alphanumeric identifier (e.g.,TIYHOWEDON,L300CM2V,O30MJJHT) - A long integer array initialized with values in the 48–122 ASCII range
- A short two-character XOR key (
"AA","WH", etc.) - Calls to
DllCallusing the decoded output forkernel32.dll,VirtualAlloc,VirtualProtect, etc.
Implementation Pattern Observed
Func K30ZWMBJJ($data)
Local $table[256] = [...] ; permutation lookup
Local $key = "AA"
Local $out = ""
For $i = 0 To UBound($data) - 1
$out &= Chr(BitXOR(Asc($table[$data[$i]]), Asc(StringMid($key, Mod($i, 2) + 1, 1))))
Next
Return $out
EndFunc
Reproduce on Your Own VMs
- Install AutoIt v3.3.8.1 on a Windows VM.
- Write a script that defines a permutation table and a two-byte XOR key.
- Encode a target string (e.g.,
"VirtualAlloc") through the table + XOR. - Decode at runtime and call
DllCallwith the recovered string. - Compile with
Aut2Exeto a single-file PE.
Verification: Run strings on the compiled PE — the plaintext "VirtualAlloc" should not appear. FLOSS or autoit-ripper decompilation should reveal the K30ZWMBJJ-like function and the integer array.
Defensive Countermeasures
- YARA rules targeting compiled AutoIt scripts with large integer arrays and short XOR keys.
- Static analysis pipelines that auto-decompile AutoItSC binaries and extract decoded strings.
- Behavioral detection:
DllCalltokernel32.dllwith dynamically resolved API names from AutoIt processes.
Pages Where Observed
b017d189—K30ZWMBJJwith key"AA"^[/intel/analyses/b017d1897d3c5b5c51f02fafcbe48700943ebe0921c1c881d4f7ea37fe1eefdc.html]aa4d237c— Caesar-5 obfuscationO30MJJHT, XOR key"WH"^[/intel/analyses/aa4d237c7a9b4ec7915c582ad703c886422d59ceb40ded57307d7da15ec9bfc8.html]accd2ccd— Caesar-3 obfuscationL300CM2V^[/intel/analyses/accd2ccd2be48b4303154bb87f87d0d6897441c18ca7b16b22fbaa8b68bbacbb.html]a8beee89—TIYHOWEDONjunk-token stripping^[/intel/analyses/a8beee89eb72948b3fd255c6a1f5bab0300161aa0e32ba0aaffe5653b75111d0.html]
Related Concepts
- autoit-delimiter-reverse-obfuscation — another AutoIt string-obfuscation technique
- autoit-compiled-script-dropper — concept page for AutoIt delivery patterns