autoit-overlay-script-placement
Placement of a compiled AutoIt v3 script in the file overlay (after the last PE section) rather than inside a .rsrc RT_RCDATA resource. This evades automated extraction tools such as autoit-ripper, which search exclusively for PE resource directories.
Detection / Fingerprint
- Overlay starts immediately after
.rsrcVirtualSize / SizeOfRawData boundary — no padding gap ^[/intel/analyses/e08d5bcefbe1a2672589b457ddf11c7f2bfcb9d2151b75cea5213b820e56dc95.html:31] - Script header
AU3!EA06appears at overlay offset0x00or0x10–0x20(some samples prepend a 16-byte encryption prefix) ^[/intel/analyses/e08d5bcefbe1a2672589b457ddf11c7f2bfcb9d2151b75cea5213b820e56dc95.html:35] - No RT_RCDATA resource with ID
SCRIPTpresent in.rsrcdirectory tree ^[/intel/analyses/e08d5bcefbe1a2672589b457ddf11c7f2bfcb9d2151b75cea5213b820e56dc95.html:59] - Entropy ~7.9–8.0 across the overlay — strong encryption or compressed bytecode ^[/intel/analyses/e08d5bcefbe1a2672589b457ddf11c7f2bfcb9d2151b75cea5213b820e56dc95.html:32]
autoit-ripperfails withCouldn't find any appropiate PE resource directory/Couldn't find the script resource^[/intel/analyses/e08d5bcefbe1a2672589b457ddf11c7f2bfcb9d2151b75cea5213b820e56dc95.html:35]
Implementation Patterns
- Build a standard AutoIt v3 script and compile with
Aut2Exe.exe. - Some AutoItSC versions or post-build modification place the compiled script after the last section rather than embedding it as a PE resource.
- The AutoItSC runtime locates the script by reading the PE file from disk (
GetModuleFileNameW) and seeking to the end-of-file minus script size, or by scanning for theAU3!EA06magic. - The script is decrypted at runtime by the AutoIt interpreter (standard AutoItSC behavior).
Reproduce on your own VMs
- Install AutoIt v3.3.8.1 on Windows.
- Write
payload.au3and compile withAut2Exe.exe /in payload.au3 /out dropper.exe. - Check PE structure with
rabin2 -S dropper.exeor a Python pefile script. If the compiled script is larger than the.rsrcsection, it may overflow into the overlay. - Attempt extraction with
autoit-ripper dropper.exe out/— failure confirms overlay placement. - Manual extraction: parse the PE header, compute last-section end offset, read from that offset to EOF, and verify
AU3!EA06at offset0x00or0x10.
Verification: strings -n 6 dropper.exe | grep AU3 should show AU3!EA06 near the end of output, not inside a .rsrc hex dump.
Defensive Countermeasures
- Do not rely solely on
autoit-ripperor resource-only extraction pipelines for AutoItSC samples. - Parse the PE overlay in triage: compare
file_sizevslast_section.PointerToRawData + last_section.SizeOfRawData. A non-zero delta indicates overlay data. - Hunt for
AU3!EA06anywhere in the file, not just inside.rsrc. - Monitor AutoItSC runtime execution for
GetModuleFileNameWfollowed by large file-read operations near EOF.
Pages where observed
- unclassified-autoit-compiled — entity page (eleven confirmed overlay-placed siblings)
/intel/analyses/e08d5bcefbe1a2672589b457ddf11c7f2bfcb9d2151b75cea5213b820e56dc95.html