04/16/2025 | News release | Distributed by Public on 04/16/2025 23:28
Executive Summary
In December 2024, we uncovered an attack chain that employs distinct, multi-layered stages to deliver malware like Agent Tesla variants, Remcos RAT or XLoader. Attackers increasingly rely on such complex delivery mechanisms to evade detection, bypass traditional sandboxes, and ensure successful payload delivery and execution. The phishing campaign we analyzed used deceptive emails posing as an order release request to deliver a malicious attachment.
This multi-layered attack chain leverages multiple execution paths to evade detection and complicate analysis. Figure 1 below illustrates the attack chain used by this campaign.
The campaign arrives to victims as emails with attached archives. These archives contain script-based malware that ultimately infects a host with the final malware.
Our analysis demonstrates how we can track and mitigate threats that rely on multi-stage delivery mechanisms. Additionally, we highlight techniques for analyzing AutoIt-based malware and debugging shellcode to equip analysts with better threat-hunting capabilities. Despite this multi-layered approach used by the attackers, Advanced WildFire effectively detects each stage, ensuring our customers are better protected against such attacks.
Additionally, Palo Alto Networks customers are better protected from the threats discussed above through the following products:
If you think you might have been compromised or have an urgent matter, contact the Unit 42 Incident Response team.
Technical Analysis of Attack Chain
Delivery Through Fake Order Release Phishing Email
We focus this article on this particular attack chain due to its uncommon use of AutoIt compiled executables, which we observed exclusively in December 2024. This campaign has only been seen delivering the Agent Tesla variant.
The phishing emails for this particular attack chain appear to be official communications falsely claiming that a payment had been made, urging the recipient to review an attached order file. The attachment, doc00290320092.7z, contains a JavaScript encoded (.jse) file.
When executed, this .jsefile initiates the infection chain. This script acts as a downloader, retrieving and executing a PowerShell script. Figure 2 shows an example of an email with the attachment.
Malicious Archive: Disguised Order Review Script
After opening the doc00290320092.7zattachment, a potential victim would find its content, a file named doc00290320092.jse. Notice that both the ZIP filename and the JSE filename start with doc, creating the illusion that the JSE file is a legitimate document.
The JSE file is a simple downloader designed to retrieve and execute a PowerShell script from a remote server. Figure 3 shows that the script in the JSE file is not obfuscated, as this attack chain relies on a multi-layered approach rather than heavy obfuscation.
PowerShell Delivering Encoded Payload
The PowerShell script is straightforward, containing a Base64-encoded payload that it decodes, writes to the temporary directory and executes. Figure 4 shows an example of the PowerShell script.
Diverging Execution - .NET or AutoIt
Analyzing multiple PowerShell payloads from different emails revealed that the next-stage payload varies between two types of files. These droppers are either a .NET compiled executable or an AutoIt compiled executable. This suggests that the attacker employs multiple execution paths to increase resilience and evade detection. As seen in previous stages, the attacker's focus remains on a multi-layered attack chain rather than sophisticated obfuscation.
.NET Compiled Executable
The .NET file contains the next-stage payload, which is encrypted using either AES or Triple DES. Once decrypted, the payload is injected into a running RegAsm.exeprocess.
We observed similarity across multiple .NET samples from this attack chain. Figure 5 below highlights these similarities by showing two different .NET samples in dnSpy, revealing the injection into a RegAsm.exeprocess, reinforcing the multi-layered approach employed by the attacker.
The two .NET samples shown in Figure 4 load different malware families. The first sample injects a variant of AgentTelsa, possibly Snake keylogger, into a RegAsm.exeprocess. The second sample follows a similar injection technique but delivers XLoader.
AutoIt Compiled Executable
The AutoIt compiled executable introduces an additional option to the attack chain, further complicating detection and analysis. The AutoIt script within the executable contains an encrypted payload that loads the shellcode for the final malware stage. This ultimately results in the injection of a .NET file into a RegSvcsprocess, which in turn loads an Agent Tesla variant.
Figure 6 shows an example of the AutoIt script within the AutoIt compiled executable. It also contains the decrypted payload revealing shellcode designed to decrypt and inject the final malware.
AutoIt Dropper Analysis in IDA Pro
We debugged the AutoIt executable in IDA Pro to explore the debugging methods used by this AutoIt-based malware.
One of the key functions in AutoIt for tracing shellcode execution is DLLCALLADDRESS. To locate the function responsible for handling DLLCALLADDRESS, we can search for text cross-referencing the DLLCALLADDRESSstring. The only reference appears in a function that builds the lookup table.
Analyzing this function reveals that a pointer to the DLLCALLADDRESSstring is moved to the memory address 0x493684, while a function pointer is moved at 0x493684+0xCas shown below in Figure 7.
Tracing this further, a few functions down the call chain, we reach the function responsible for executing the shellcode as illustrated in Figure 8.
The dynamically resolved API calls in the shellcode indicate a straightforward execution flow. The shellcode follows a common pattern. It first loads the encrypted payload into memory, decrypts it and finally injects it into a RegSvcs process. The injected payload then reflectively loads another .NET compiled executable, which ultimately executes an Agent Tesla variant packed with .NET Reactor.
This final payload, an Agent Tesla variant, is a well-documented infostealer.
Conclusion
This analysis highlights how attackers increasingly rely on multi-layered delivery mechanisms and multiple execution paths to evade detection. By stacking simple stages instead of focusing on highly sophisticated techniques, attackers can create resilient attack chains that complicate analysis and detection. However, with its memory detection capabilities, Advanced WildFire can detect and better protect its customers.
Additionally, Palo Alto Networks customers are better protected from the threats discussed above through the following products:
If you think you may have been compromised or have an urgent matter, get in touch with the Unit 42 Incident Response team or call:
Palo Alto Networks has shared these findings with our fellow Cyber Threat Alliance (CTA) members. CTA members use this intelligence to rapidly deploy protections to their customers and to systematically disrupt malicious cyber actors. Learn more about the Cyber Threat Alliance.
Indicators of Compromise
AutoIt Infection Chain 1
AutoIt Infection Chain 2
Agent Tesla (Variant) Configuration
Additional Resources