Pupy RAT
- Type
- RAT
- Capabilities
- ExfiltrationLateral movementPost exploitationDefense evasionReconnaissanceDLL sideloading
- Delivery
- PhishingLure
- Platforms
- Windows
Pupy RAT is an open-source, cross-platform remote administration tool used maliciously as a remote access trojan. Also detected as Backdoor.Patpoopy, it incorporates Python and C components and provides remote command execution, data theft, additional module retrieval, and deployment of further malware. Attackers can use it for post-compromise operations and lateral movement. Its reflective-loading functionality supports executing portable executable payloads in memory, helping evade detection. Pupy RAT has also been associated with virtual-machine fingerprinting.
Observed Windows delivery campaigns use phishing emails containing ISO attachments with a malicious shortcut, a legitimate Microsoft-signed Windows Error Reporting executable, an attacker-controlled DLL, and a decoy spreadsheet. The shortcut launches the legitimate executable, which sideloads the malicious DLL. The loader decrypts an embedded payload using RC4, executes Pupy RAT in memory, and opens the spreadsheet to distract the victim while the RAT attempts background command-and-control communication.
Pupy RAT is a commodity tool used by multiple threat actors, including the Iranian espionage groups APT33, APT34, and APT35. Its public availability and use by different operators limit attribution based on the malware alone.
Associated threat actors
3 distinct threat actors Mallory has associated with this family across public reporting. Open in Mallory to see the full evidence chain and overlapping campaigns.
Additionally, both APT34 and APT35 have leveraged Pupy RAT in their campaigns.
Additionally, both APT34 and APT35 have leveraged Pupy RAT in their campaigns.
This blog describes how threat actors use the legitimate WerFault.exe to execute Pupy RAT on the victims’ machine.
Techniques & procedures
16 distinct techniques documented for this family, organized by ATT&CK tactic.
Initial Access
1 technique
Initial Access
The malware campaign starts with the arrival of an email with an ISO attachment.
Execution
4 techniques
Execution
The victim starts the infection chain by clicking on the shortcut file, which uses 'scriptrunner.exe' to execute WerFault.exe.
This PowerShell script, seen in Figure 5, appears to have been generated by Metasploit’s “web_delivery” module to download and execute a payload from a remote server at 45.76.128[.]71, which we speculate was used to create a meterpreter session on the system.
When the victim opens that shortcut file, it uses scriptrunner.exe LOLBin via cmd to execute WerFault.exe from the ISO.
When the victim opens that shortcut file, it uses scriptrunner.exe LOLBin via cmd to execute WerFault.exe from the ISO.
Persistence
1 technique
Persistence
The victim starts the infection chain by clicking on the shortcut file, which uses 'scriptrunner.exe' to execute WerFault.exe.
Privilege Escalation
2 techniques
Privilege Escalation
This RAT is loaded into the memory and executed while WerFault.exe was executing in the front.
The victim starts the infection chain by clicking on the shortcut file, which uses 'scriptrunner.exe' to execute WerFault.exe.
Stealth
6 techniques
Stealth
The ISO contains four files, a legitimate WerFault.exe, a malicious DLL named faultrep.dll, a shortcut file named recent inventory & our specialties.lnk and a XLS file named File.xls. The shortcut file has the same name as the ISO image.
This RAT is loaded into the memory and executed while WerFault.exe was executing in the front.
On further analysis we found the RC4 decryption function which contains the data and hard coded string as key... After decrypting the data, we confirmed that the data is a PE file with the magic bytes.
When the victim opens that shortcut file, it uses scriptrunner.exe LOLBin via cmd to execute WerFault.exe from the ISO.
"Virtual Machine Fingerprinting... used by the Pupy RAT" / "Windows Sandbox with Sensitive Configuration"
It was executed from memory and based on the analysis of ReflectiveLoader function, is capable of executing any PE file in-memory, remotely.
Discovery
1 technique
Discovery
"Virtual Machine Fingerprinting... used by the Pupy RAT" / "Windows Sandbox with Sensitive Configuration"
Lateral Movement
1 technique
Lateral Movement
The malware allows threat actors to gain full access to the infected devices, enabling them to execute commands, steal data, install further malware, or spread laterally through a network.
Command and Control
3 techniques
Command and Control
В MITRE ATT&CK скрытые каналы покрывают сразу несколько тактик: Command and Control - DNS (T1071.004 ...). ... DNS tunneling (T1071.004, Command and Control ...) эксплуатирует штатный механизм рекурсивного разрешения имён.
Pupy RAT is an open-source and publicly available malware written in Python that supports reflective DLL loading to evade detection, and additional modules are downloaded later.
In addition to its custom malware, Elfin has also used a number of commodity malware tools... Remcos... DarkComet... Quasar RAT... Pupy RAT... NanoCore... NetWeird...
Observables
5 indicators attributed across vendor reports, sandbox runs, and researcher write-ups. Values are masked here and available in full in Mallory.
Recent activity
8 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.