# Trickbot Delivered via Highly Obfuscated JS File **[blog.trendmicro.com/trendlabs-security-intelligence/latest-trickbot-campaign-delivered-via-highly-obfuscated-js-file/](https://blog.trendmicro.com/trendlabs-security-intelligence/latest-trickbot-campaign-delivered-via-highly-obfuscated-js-file/)** August 5, 2019 We have been tracking Trickbot banking trojan activity and recently discovered a variant of the malware (detected by Trend Micro as [TrojanSpy.Win32.TRICKBOT.TIGOCDC) from distributed spam emails that contain a Microsoft Word document with enabled macro. Once the](https://www.trendmicro.com/vinfo/us/threat-encyclopedia/malware/TrojanSpy.Win32.TRICKBOT.TIGOCDC) document is clicked, it drops a heavily obfuscated JS file (JavaScript) that downloads Trickbot as its payload. This malware also checks for the number of running processes in the affected machine; if it detects that it’s in an environment with limited processes, the malware will not proceed with its routine as it assumes that it is running in a virtual environment. Aside from its information theft capabilities, it also deletes files located in removable and network drives that have particular extensions, after which the files are replaced with a copy of the malware. Based on our telemetry, this Trickbot campaign has affected the United States the most. It has also distributed spam to China, Canada, and India. [Figure 1. Infection chain](https://blog.trendmicro.com/content/dam/trendmicro/global/en/migrated/security-intelligence-migration-spreadsheet/trendlabs-security-intelligence/2019/08/fig-1-Trickbot-spam-js-infection-chain.jpg) Figure 1. Infection chain In a sample email, the spam purports to be a subscription notification involving advertising providers, even telling the user that it submitted an application for a three-year subscription and settled a sum of money with the sender. The mail then explains that several more fees will be charged to the user’s card in the coming transactions. It ends by prompting the user to see the attached document for all the settlement and subscription information. The document in question contains the malicious script. The distributed Word document presents the user with the following notification (see Figure 2) that states the content can be viewed by enabling macro content. It’s worth noting that the document hides the JS script in the document itself and not in the macro. It does this by disguising the script through the same font color as the document background. [Figure 2. Document asking users to enable macro](https://blog.trendmicro.com/content/dam/trendmicro/global/en/migrated/security-intelligence-migration-spreadsheet/trendlabs-security-intelligence/2019/08/fig-2-trickbot-spam-js-document-enable-macro.jpg) Figure 2. Document asking users to enable macro The script is obfuscated and contains different functions. In order to decrypt a function, it will use another function that will convert it to a single character. [Figure 3. Function for decryption](https://blog.trendmicro.com/content/dam/trendmicro/global/en/migrated/security-intelligence-migration-spreadsheet/trendlabs-security-intelligence/2019/08/fig-3-trickbot-spam-js-decryption-function.png) Figure 3. Function for decryption Upon successfully deobfuscating the file, we were able to analyze it and observed some interesting behaviors. Upon execution, it will display a fake Microsoft error to trick the user with an error message that pops up after enabling the macro. But actually, the JS file is already running in the background. [Figure 4. Fake Microsoft error](https://blog.trendmicro.com/content/dam/trendmicro/global/en/migrated/security-intelligence-migration-spreadsheet/trendlabs-security-intelligence/2019/08/fig-4-trickbot-spam-js-fake-ms-error.png) Figure 4. Fake Microsoft error For persistence, the malware creates a copy of itself into the Startup folder as Shell.jse. The JS file also checks for running processes — what’s particularly notable is the malware’s anti-analysis or evasion characteristic, which checks for the total number of all the running processes in the victim’s machine, which means it will not proceed with its execution if there are not enough processes running. ----- t e u g p ocesses a e u de, 00 c a acte s ( e gt o t e st g), t e a a e assu es t to be a d cato t at t s u g a virtual or sandbox environment. It will also check for the existence of processes usually used for analysis. Aside from these, the malware inspects if the environment it runs in relates to specific usernames. [Figure 5. A snippet of checked processes and usernames](https://blog.trendmicro.com/content/dam/trendmicro/global/en/migrated/security-intelligence-migration-spreadsheet/trendlabs-security-intelligence/2019/08/fig-5-trickbot-spam-checked-processes-usernames.png) Figure 5. A snippet of checked processes and usernames [Figure 6. Code error shown if anything matches the check](https://blog.trendmicro.com/content/dam/trendmicro/global/en/migrated/security-intelligence-migration-spreadsheet/trendlabs-security-intelligence/2019/08/fig-6-trickbot-spam-code-error-shown-checked.jpg) Figure 6. Code error shown if anything matches the check Here’s a list of processes and debugging tools the malware checks for in the affected system: AgentSimulator.exe B.exe BehaviorDumper BennyDB.exe ctfmon.exe DFLocker64 FrzState2k gemu - ga.exe iexplore.exe ImmunityDebugger LOGSystem.Agent.Service.exe lordPE.exe ProcessHacker procexp Procmon PROCMON Proxifier.exe tcpdump VBoxService VBoxTray.exe vmtoolsd vmware VzService.exe windanr.exe Wireshark Upon further analysis, we’ve also compiled the usernames the malware checks for based on the following strings: Emily HAPUBWS Hong Lee Johnson milozs Peter Wilson SystemIT | admin VmRemoteGuest WIN7 - TRAPS For the malware’s payload, it will connect to the URL hxxps://185[.]159[.]82[.]15/hollyhole/c644[.]php then checks for the file to be downloaded. If it is an executable file, it will save the file to %Temp% as {random}.exe and execute it afterwards. If the file is not an executable, it will then save it as {random}.cro in the same folder. The .cro file will then be decoded using certutil.exe, saved as {random}.exe in the same directory, and executed. Upon further research, we discovered that the downloaded .exe file is a variant of the Trickbot malware. [Figure 7. The file is saved, random names get generated, and .cro is decoded using certutil.exe](https://blog.trendmicro.com/content/dam/trendmicro/global/en/migrated/security-intelligence-migration-spreadsheet/trendlabs-security-intelligence/2019/08/fig-7-trickbot-spam-saved-file-random-names-cro-certutil.png) Figure 7. The file is saved, random names get generated, and .cro is decoded using certutil.exe Aside from stealing system information such as OS, CPU, and memory information; user accounts; installed programs and services; IP configuration; and network information (configuration, users, and domain settings), this Trickbot variant also gathers the following credentials and information from applications and internet browsers. **Application credentials** Filezilla ----- c oso t Out oo PuTTy Remote Desktop (RDP) VNC WinSCP **Browser credentials and information (Google Chrome, Internet Explorer, Microsoft Edge, and Mozilla Firefox)** Autofills Billing info data Browsing history Credit card data HTTP POST responses Internet cookies Usernames and passwords This malware also uses a point-of-sale (PoS) extraction module called psfin32, which identifies PoS-related terms located in the domain of interest. The [module uses LDAP queries to search for PoS information on machines with the following substrings:](https://blog.trendmicro.com/trendlabs-security-intelligence/trickbots-bigger-bag-of-tricks/) *ALOHA* *BOH* *CASH* *LANE* *MICROS* *POS* *REG* *RETAIL* *STORE* *TERM* The variant also appears to drop shadnewdll, a proxy module that intercepts and modifies web traffic on an affected device to create fraudulent [bank transactions over the network. Additionally, according to security researcher Brad Duncan, the module shares similarities with the](https://www.bleepingcomputer.com/news/security/trickbot-trojan-gets-icedid-proxy-module-to-steal-banking-info/) banking trojan IcedID, which redirects victims to fake online banking sites or attaches to a browser process to inject fake content in phishing schemes. In such cases where the malware fails to connect, it will search for files with the following extensions in the removable and network drives. These extensions are file types used by Microsoft Office and OpenDocument: .doc .xls .pdf .rtf .txt .pub .odt .ods .odp .odm .odc .odb Files with the aforementioned extensions will be saved in the %Temp% folder as ascii.txt. The said files will all then be deleted and replaced with a copy of the malware and the extension .jse (but is actually a JS file). [Figure 8. Scanning for files and replacing it with a copy of itself](https://blog.trendmicro.com/content/dam/trendmicro/global/en/migrated/security-intelligence-migration-spreadsheet/trendlabs-security-intelligence/2019/08/fig-8-trickbot-spam-scanned-files-replaced-copy-malware.png) Figure 8. Scanning for files and replacing it with a copy of itself ## Defending Against Trickbot: Trend Micro Recommendations and Solutions Information-stealing malware Trickbot has become a cybercriminal mainstay for infecting machines and compromising emails, and has been used to [reportedly steal more than 250 million accounts. This new development shows how cybercriminals can constantly tweak an existing](https://www.engadget.com/2019/07/12/trickbot-malware-trickbooster-250-million-email-accounts/) [banking trojan to add new capabilities. Users, however, can prevent these attacks by simply following best practices against spam. Aside from](https://www.trendmicro.com/vinfo/ph/security/news/cybercrime-and-digital-threats/infosec-guide-email-threats) awareness of the telltale signs of a spam email such as suspicious sender address and glaring grammatical errors, we also recommend that users refrain from opening email attachments from unverified sources. ----- Use s a d e te p ses ca a so be e t o p otect o t at uses a u t aye ed app oac aga st s s b oug t by t eats e c bot e [recommend employing endpoint application control that reduces attack exposure by ensuring only files, documents, and updates associated](https://blog.trendmicro.com/en_us/business/products/user-protection/sps/endpoint.html) [with whitelisted applications and sites can be installed, downloaded, and viewed. Endpoint solutions powered by XGen™ security such as](http://go.trendmicro.com/sem/sem/www.trendmicro.com/us/business/xgen/index.html) [Trend Micro™ Security and](https://blog.trendmicro.com/en_us/forHome/products.html) [Trend Micro Network Defense can detect related malicious files and URLs and protect users’ systems. Trend](https://blog.trendmicro.com/en_us/business/products/network.html) Micro™ Smart Protection Suites and [Trend Micro Worry-Free™ Business Security, which have](https://www.trendmicro.com/en_us/small-business/worry-free.html) [behavior monitoring capabilities, can](https://success.trendmicro.com/solution/1122593-configuring-behavior-monitoring-settings-in-apex-one) additionally protect from these types of threats by detecting malicious files such as the document and JS file involved in this campaign, as well as blocking all related malicious URLs. The [Trend Micro Deep Discovery Inspector protects customers from threats that may lead to C&C connection and data exfiltration via these](https://blog.trendmicro.com/en_us/business/products/network/advanced-threat-protection/inspector.html) DDI rules: 1645: Possible Self-Signed SSL certificate detected 2780: TRICKBOT - HTTP (Request) **Indicators of Compromise (IoCs)** **SHA-256 and URL** **Trend Micro Pattern** **Detection** 0242ebb681eb1b3dbaa751320dea56e31c5e52c8324a7de125a8144cc5270698 TrojanSpy.Win32. TRICKBOT.TIGOCDC 16429e95922c9521f7a40fa8f4c866444a060122448b243444dd2358a96a344c Trojan.W97M. JASCREX.A 666515eec773e200663fbd5fcad7109e9b97be11a83b41b8a4d73b7f5c8815ff Trojan.W97M. JASCREX.AB 41cd7fec5eaad44d2dba028164b9b9e2d1c6ea9d035679651b3b344542c40d45 Trojan.W97M. JASCREX.AD 970b135b4c47c12f97bc3d3bbdf325f391b499d03fe19ac9313bcace3a1450d2 Trojan.W97M. JASCREX.AC 8537d74885aed5cab758607e253a60433ef6410fd9b9b1c571ddabe6304bb68a TrojanSpy.JS. NEMUCOD.BONINGH 970b135b4c47c12f97bc3d3bbdf325f391b499d03fe19ac9313bcace3a1450d2 hxxps://185[.]159[.]82[.]15/hollyhole/c644[.]php **_[Check Point Research also tweeted about this campaign last July.](https://twitter.com/_CPResearch_/status/1151900514612908033)_** Spam **Trend Micro Predictive Machine** **Learning Detection** TROJ.Win32.TRX.XXPE50FFF031 Downloader.VBA.TRX.XXVBAF01FF0 Downloader.VBA.TRX.XXVBAF01FF0 Downloader.VBA.TRX.XXVBAF01FF0 We have been tracking Trickbot activity and recently discovered a variant of the malware (detected by Trend Micro as TrojanSpy.Win32.TRICKBOT.TIGOCDC) from distributed spam emails that contain a Microsoft Word document with enabled macro. By: Noel Anthony Llimos, Michael Jhon Ofiaza August 05, 2019 Read time: ( words) Content added to Folio -----